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% {
basicauth / {
basicauth * {
%userpw% }
log {
output file /var/www/web.log

View File

@ -8,17 +8,12 @@
# Destroy container and image:
# 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
MAINTAINER "gitlab.com/pepa65 <pepa65@passchier.net>"
RUN apk update && apk add bash php php-fpm ffmpeg tzdata file
WORKDIR /usr/bin
COPY --from=downloader /root/caddy /usr/bin/caddy
COPY --from=downloader /root/mailer /usr/bin/mailer
COPY Caddyfile Dockerfile encode init stream vars /var/www/
RUN apk update && apk add bash php php-fpm ffmpeg tzdata file && rm -rf /lib/apk/db
ADD https://good4.eu/mailer /usr/bin/mailer
ADD https://good4.eu/caddy /usr/bin/caddy
#ADD https://caddyserver.com/api/download?os=linux&arch=amd64&idempotency=74472262832423 /usr/bin/caddy
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
tz='UTC'
# Username/password and Username/email (multiple users allowed)
# Defaults to none (no authentication required)
# Username/email/password (multiple users allowed)
# Must have at least one Username/password
declare -A umail upw
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=
shopt -s nullglob
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
sed "s/%userpw%/$(echo -en "$up")/" Caddyfile |tr '#' '\n' >/srv/c
mv /srv/c Caddyfile

View File

@ -25,7 +25,7 @@ if($authuser!==''){
<td><input class="shiftleft" type="submit" value="Logoff"></td></tr>
</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>
<td>Target:</td>

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