This commit is contained in:
gitlab.com/pepa65 2022-09-08 17:14:03 +07:00
parent 66cc078c88
commit d3a1719d6c
6 changed files with 13 additions and 16 deletions

View File

@ -1,5 +1,5 @@
%interface% { %interface% {
basicauth / { basicauth * {
%userpw% } %userpw% }
log { log {
output file /var/www/web.log output file /var/www/web.log

View File

@ -8,17 +8,12 @@
# Destroy container and image: # Destroy container and image:
# docker rm stream --force && docker rmi streamupload # docker rm stream --force && docker rmi streamupload
FROM debian:buster-slim as downloader
WORKDIR /root
ADD https://good4.eu/mailer mailer
ADD https://caddyserver.com/api/download?os=linux&arch=amd64&idempotency=74472262832423 caddy
FROM alpine:latest FROM alpine:latest
MAINTAINER "gitlab.com/pepa65 <pepa65@passchier.net>" MAINTAINER "gitlab.com/pepa65 <pepa65@passchier.net>"
RUN apk update && apk add bash php php-fpm ffmpeg tzdata file RUN apk update && apk add bash php php-fpm ffmpeg tzdata file && rm -rf /lib/apk/db
WORKDIR /usr/bin ADD https://good4.eu/mailer /usr/bin/mailer
COPY --from=downloader /root/caddy /usr/bin/caddy ADD https://good4.eu/caddy /usr/bin/caddy
COPY --from=downloader /root/mailer /usr/bin/mailer #ADD https://caddyserver.com/api/download?os=linux&arch=amd64&idempotency=74472262832423 /usr/bin/caddy
COPY Caddyfile Dockerfile encode init stream vars /var/www/
WORKDIR /var/www WORKDIR /var/www
ENTRYPOINT /bin/bash init COPY Caddyfile Dockerfile encode init stream vars ./
ENTRYPOINT ./init

4
_vars
View File

@ -8,8 +8,8 @@ interface=''
# Timezone for local user # Timezone for local user
tz='UTC' tz='UTC'
# Username/password and Username/email (multiple users allowed) # Username/email/password (multiple users allowed)
# Defaults to none (no authentication required) # Must have at least one Username/password
declare -A umail upw declare -A umail upw
u='username' umail[$u]='email' upw[$u]='password' u='username' umail[$u]='email' upw[$u]='password'

4
init
View File

@ -22,7 +22,9 @@ chmod +x /usr/bin/caddy /usr/bin/mailer
up= up=
shopt -s nullglob shopt -s nullglob
for u in "${!upw[@]}" for u in "${!upw[@]}"
do up+="\t\t$u $(caddy hash-password --plaintext "${upw["$u"]}")#" do hash=${uhash[$u]}
[[ $hash ]] || hash=$(caddy hash-password --plaintext "${upw["$u"]}")
up+="\t\t$u $hash#"
done done
sed "s/%userpw%/$(echo -en "$up")/" Caddyfile |tr '#' '\n' >/srv/c sed "s/%userpw%/$(echo -en "$up")/" Caddyfile |tr '#' '\n' >/srv/c
mv /srv/c Caddyfile mv /srv/c Caddyfile

View File

@ -25,7 +25,7 @@ if($authuser!==''){
<td><input class="shiftleft" type="submit" value="Logoff"></td></tr> <td><input class="shiftleft" type="submit" value="Logoff"></td></tr>
</form>'); </form>');
} }
<form action="'.(isset($_SERVER['HTTPS']) ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].'upload.php" method="post" enctype="multipart/form-data" onsubmit="respond()">'); <form action="'.(isset($_SERVER['HTTPS']) ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].'/upload.php" method="post" enctype="multipart/form-data" onsubmit="respond()">');
?> ?>
<tr> <tr>
<td>Target:</td> <td>Target:</td>

0
uploadpage/streams/.gitkeep Normal file → Executable file
View File