diff --git a/Dockerfile b/Dockerfile index 86b0e07..036ab7a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,9 +8,17 @@ # 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 " 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/ WORKDIR /var/www -ENTRYPOINT /var/www/init +ENTRYPOINT /bin/bash init diff --git a/init b/init index e91682b..2d201c6 100755 --- a/init +++ b/init @@ -1,5 +1,5 @@ -#!/bin/bash - +#!/usr/bin/env bash +set -e # init - Initialize the container cd /var/www @@ -18,17 +18,16 @@ echo -e "$line" |crontab - [[ $interface ]] || interface=:80 sed -i "s/%interface%/$interface/" Caddyfile -shopt -s nullglob +chmod +x /usr/bin/caddy /usr/bin/mailer up= -for u in ${!upw[@]} -do up+="$u $(caddy hash-password --plaintext "${upw[$u]}")#" +shopt -s nullglob +for u in "${!upw[@]}" +do up+="\t\t$u $(caddy hash-password --plaintext "${upw["$u"]}")#" done sed "s/%userpw%/$(echo -en "$up")/" Caddyfile |tr '#' '\n' >/srv/c mv /srv/c Caddyfile -wget -O /usr/bin/mailer good4.eu/mailer -wget -O /usr/bin/caddy good4.eu/caddy2 -chmod +x /usr/bin/mailer /usr/bin/caddy - php-fpm8 -R -caddy run >caddy.log +caddy start >caddy.log + +sleep 9999d diff --git a/uploadpage/index.php b/uploadpage/index.php index d3935aa..4d43aa1 100644 --- a/uploadpage/index.php +++ b/uploadpage/index.php @@ -17,7 +17,7 @@ $headers=getallheaders(); $authuser=$headers['X-User']; if($authuser!==''){ print(' -
+

Stream Upload

User: