From 981215583876eb4e149952b029769e16ef9cc7b0 Mon Sep 17 00:00:00 2001 From: lolcat Date: Tue, 22 Aug 2023 21:40:00 -0500 Subject: [PATCH 1/3] Delete banner/birds birds birdsw_4.jpg --- banner/birds birds birdsw_4.jpg | Bin 9373 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 banner/birds birds birdsw_4.jpg diff --git a/banner/birds birds birdsw_4.jpg b/banner/birds birds birdsw_4.jpg deleted file mode 100644 index c4a52d86d965e837cb8e23135a0865e40a15e0c2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9373 zcmb8VWmFtMvnD(P3=jr)cMI+sG`PDv3@#yPa0sr!2@-U0cMt9wbdUrmxVvrMd%wH; z?a!?~r~kB6_33*0JXO_i%WoS1Oa&Qv82}In0093rz}qSy6o3Q*A%YN)5D^iPk&uwV z*kCXU3K$;)6AhafpM;nQpNNo@l98H}oSvMJh=zlfo{5>2jg^F&iJbz_$Sa9{>Oc5Bw*9|1F3JAS8G= zAo4%kLI2mlznKUi#D9jotpHHrfdDv6c+7vR4staD;-=YAUnGoe49--^I;6DhAVLX* zZl{3`limI7ZIy)gcRGn{IuQ8%JdOQ;+@&IZCn#&fwB_)3lU&u&I@XnA&zoC?yY`Y+ zC{(fZv)lKs*@E$yG}z$9*&ux@;P3x74FD1P?YZr>FH}fP!lu3W;m=1YSG-x@-Wj>s zcs`FbVf&qU|&38$p<@Ee&GhL2bXT{b2(O2|= zzCYdzG&l;r$ZqLu?xJq>%@Cm}Wo1Uz&$J>ge+HgL9*R$ciP82-T;2Sn3E7o&Ov5(h~SDL5yKaPLCBcRuD$XhPr%m4*`@%m zz{@$(*xdPt>cL1RoiK+7_FF}1RvMek@mLkl(7dTIhk~nsh-tI&nwF17mZ}l@UFqKS zD|0y`YJ?g4ebC@T!!!9L(vWrYD93n-0_y_j?fdA(pk&R;Dxpi|9weXta}l_#qb#pA z8!h^2aXCDvS(@0qMmMJOZ-A6HfYM@@j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r`+2G){cpGZ_m@Hp01)Ir zjMk}=>o3Bq2*B*ts&2un82wNouCM&Am$RavJ}&>-5G&poL!*}eQx;M3rVAtIOrwy@ zQu#be>f)tBn%-)H(%zk}jl142KIxPgO@lJb0(?975%*dOC~0Pxz^Q;rvK|aMJ_htb z?vl6tMa`AOz#12ZxXga9U&RqWxmH{v5R%1MHEU_wcWk`T!H^H`)L~ItWVPTyL{XW{ z=<3&BPB~ud?;v+LE*YK5v;20^eE{=Upg(e(^eN@~JZ`Wr=cT?c2NE1w>ZI7yyn=RL zfQu&%Ea~;o}7NNklgo4lDa_m>O^*} zZ%q+$q{+kgj_t8 z0iJgw0>ox?6JMfa}CKD{BTJY42@tIYrcezcVb^nqu3ZGr%N6ZvT^h{g*E#D=;M;N z|JKFi#_zkYukGhZEiC=%6-9MR6z-S!LMj^*%nmn!Fjy0Dj=NA5@hS!?!u>Q@{ zG3H~;8gO1P4Yxo=6Ev?J`;rDs2%$cFiAhcjVT$t6kx8Kyf%t#}kaKz7e0ns<6Y=ng1n*J Date: Wed, 23 Aug 2023 18:31:08 -0500 Subject: [PATCH 2/3] Add Dockerfile and docker entrypoint (#5) Add Dockerfile and docker entrypoint Co-authored-by: lolcat Reviewed-on: https://git.lolcat.ca/lolcat/4get/pulls/5 Co-authored-by: throwaway Co-committed-by: throwaway --- Dockerfile | 16 ++++++ README.md | 17 +++++++ apache/httpd.conf | 98 +++++++++++++++++++++++++++++++++++++ docker/docker-entrypoint.sh | 4 ++ 4 files changed, 135 insertions(+) create mode 100644 Dockerfile create mode 100644 apache/httpd.conf create mode 100755 docker/docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bff4532 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM alpine:latest +WORKDIR /var/www/html/4get + +RUN apk update && apk upgrade +RUN apk add apache2-ssl php82-fileinfo php82-openssl php82-iconv php82-common php82-dom php82-curl curl php82-pecl-apcu php82-apache2 imagemagick php82-pecl-imagick + +COPY ./apache/httpd.conf /etc/apache2/httpd.conf +COPY . . + +RUN chmod 777 /var/www/html/4get/icons + +VOLUME ["/etc/4get/certs"] +EXPOSE 80 +EXPOSE 443 + +CMD ["./docker/docker-entrypoint.sh"] diff --git a/README.md b/README.md index 6a88308..9f1282f 100644 --- a/README.md +++ b/README.md @@ -102,3 +102,20 @@ service apache2 restart You'll probably want to setup a tor address at this point, but I'm too lazy to put instructions here. Ok bye!!! + + + +## Docker Install + +``` +git clone https://git.lolcat.ca/lolcat/4get +cd 4get +docker build -t 4get . +docker run -d -p 80:80 -p 443:443 -e FOURGET_SERVER_NAME="4get.ca" -e FOURGET_SERVER_ADMIN_EMAIL="you@example.com" -v /etc/letsencrypt/live/domain.tld:/etc/4get/certs 4get +``` + +replace enviroment variables FOURGET_SERVER_NAME and FOURGET_SERVER_ADMIN_EMAIL with relevant values + +the certs directory expects files named `cert.pem`, `chain.pem`, `privkey.pem` + + diff --git a/apache/httpd.conf b/apache/httpd.conf new file mode 100644 index 0000000..8a4caa7 --- /dev/null +++ b/apache/httpd.conf @@ -0,0 +1,98 @@ +ServerTokens OS +ServerRoot /var/www +ServerSignature On +ServerName 4get.ca +ServerAdmin you@example.com + +DocumentRoot "/var/www/html/4get" + +LogLevel warn +CustomLog /dev/null common +ErrorLog /dev/null + + + SSLEngine on + SSLCertificateFile /etc/4get/certs/cert.pem + SSLCertificateKeyFile /etc/4get/certs/privkey.pem + SSLCertificateChainFile /etc/4get/certs/chain.pem + + + + RewriteEngine On + RewriteCond %{THE_REQUEST} ^\w+\ /(.*)\.php(\?.*)?\ HTTP/ + RewriteRule ^ http://%{HTTP_HOST}/%1 [R=301] + RewriteCond %{REQUEST_FILENAME}.php -f + RewriteRule .* $0.php + Options Indexes FollowSymLinks + AllowOverride None + Require all granted + + + + +LoadModule rewrite_module modules/mod_rewrite.so +LoadModule mpm_prefork_module modules/mod_mpm_prefork.so +LoadModule authn_file_module modules/mod_authn_file.so +LoadModule authn_core_module modules/mod_authn_core.so +LoadModule authz_host_module modules/mod_authz_host.so +LoadModule authz_groupfile_module modules/mod_authz_groupfile.so +LoadModule authz_user_module modules/mod_authz_user.so +LoadModule authz_core_module modules/mod_authz_core.so +LoadModule access_compat_module modules/mod_access_compat.so +LoadModule auth_basic_module modules/mod_auth_basic.so +LoadModule reqtimeout_module modules/mod_reqtimeout.so +LoadModule filter_module modules/mod_filter.so +LoadModule mime_module modules/mod_mime.so +LoadModule log_config_module modules/mod_log_config.so +LoadModule env_module modules/mod_env.so +LoadModule headers_module modules/mod_headers.so +LoadModule setenvif_module modules/mod_setenvif.so +LoadModule version_module modules/mod_version.so +LoadModule unixd_module modules/mod_unixd.so +LoadModule status_module modules/mod_status.so +LoadModule autoindex_module modules/mod_autoindex.so +LoadModule dir_module modules/mod_dir.so +LoadModule alias_module modules/mod_alias.so +LoadModule negotiation_module modules/mod_negotiation.so + + +User apache +Group apache + + + + + + AllowOverride none + Require all denied + + + + + + + DirectoryIndex index.html + + + + Require all denied + + + + + + RequestHeader unset Proxy early + + + + TypesConfig /etc/apache2/mime.types + AddType application/x-compress .Z + AddType application/x-gzip .gz .tgz + + + + MIMEMagicFile /etc/apache2/magic + + +IncludeOptional /etc/apache2/conf.d/*.conf + diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh new file mode 100755 index 0000000..469f810 --- /dev/null +++ b/docker/docker-entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh +sed -i "s/ServerName.*/ServerName ${FOURGET_SERVER_NAME}/g" /etc/apache2/httpd.conf +sed -i "s/ServerAdmin.*/ServerAdmin ${FOURGET_SERVER_ADMIN_EMAIL}/g" /etc/apache2/httpd.conf +httpd -DFOREGROUND From 232995bf0d4274f904044e6dd0dc8098757b4be3 Mon Sep 17 00:00:00 2001 From: throwaway Date: Thu, 24 Aug 2023 20:50:05 -0500 Subject: [PATCH 3/3] add set -e and use exec to replace parent process to handle docker signals (#6) use `exec` to turn httpd into parent process. This is important for docker signalling such as `docker stop ${container_id}` add `set -e` which stops the entrypoint script if any command exits with a non-zero exit code. Reviewed-on: https://git.lolcat.ca/lolcat/4get/pulls/6 Co-authored-by: throwaway Co-committed-by: throwaway --- docker/docker-entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 469f810..939e59b 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -1,4 +1,5 @@ #!/bin/sh +set -e sed -i "s/ServerName.*/ServerName ${FOURGET_SERVER_NAME}/g" /etc/apache2/httpd.conf sed -i "s/ServerAdmin.*/ServerAdmin ${FOURGET_SERVER_ADMIN_EMAIL}/g" /etc/apache2/httpd.conf -httpd -DFOREGROUND +exec httpd -DFOREGROUND