From 58abf04d2c50646e3ca38e03d656e5007b3b970c Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Mon, 24 Jul 2023 20:02:45 +0300 Subject: [PATCH] restructure for docker --- Makefile | 17 ------ docker-compose.yml | 18 +++++++ example.env | 7 +++ forum/Dockerfile | 36 +++++++++++++ captcha.py => forum/captcha.py | 0 {db => forum/db}/sqlite.py | 0 forum/docker-builder.sh | 7 +++ forum/docker-entrypoint.sh | 50 ++++++++++++++++++ init_sqlite.sh => forum/init_sqlite.sh | 0 main.py => forum/main.py | 0 minimd.py => forum/minimd.py | 0 password.py => forum/password.py | 0 requirements.txt => forum/requirements.txt | 0 forum/restart.sh | 27 ++++++++++ run_sqlite.sh => forum/run_sqlite.sh | 0 schema.txt => forum/schema.txt | 0 forum/static/button.png | Bin 0 -> 9651 bytes {static => forum/static}/theme.css | 0 .../templates}/admin/base.html | 0 .../templates}/admin/index.html | 0 .../templates}/admin/query.html | 0 {templates => forum/templates}/base.html | 0 {templates => forum/templates}/comment.html | 0 {templates => forum/templates}/comments.html | 0 .../templates}/confirm_delete_comment.html | 0 .../templates}/confirm_delete_thread.html | 0 .../templates}/edit_comment.html | 0 .../templates}/edit_thread.html | 0 {templates => forum/templates}/forum.html | 0 {templates => forum/templates}/help.html | 0 {templates => forum/templates}/index.html | 0 {templates => forum/templates}/login.html | 0 {templates => forum/templates}/moderator.html | 0 .../templates}/new_thread.html | 0 {templates => forum/templates}/register.html | 0 {templates => forum/templates}/thread.html | 0 {templates => forum/templates}/user_edit.html | 0 {templates => forum/templates}/user_info.html | 0 {test => forum/test}/all.sh | 0 {test => forum/test}/init_db.txt | 0 tool.py => forum/tool.py | 0 {upgrade => forum/upgrade}/sqlite/v0.1.sh | 0 upgrade_sqlite.sh => forum/upgrade_sqlite.sh | 0 forum/version.py | 3 ++ stop.sh | 4 ++ 45 files changed, 152 insertions(+), 17 deletions(-) delete mode 100644 Makefile create mode 100644 docker-compose.yml create mode 100644 example.env create mode 100644 forum/Dockerfile rename captcha.py => forum/captcha.py (100%) rename {db => forum/db}/sqlite.py (100%) create mode 100755 forum/docker-builder.sh create mode 100755 forum/docker-entrypoint.sh rename init_sqlite.sh => forum/init_sqlite.sh (100%) rename main.py => forum/main.py (100%) rename minimd.py => forum/minimd.py (100%) rename password.py => forum/password.py (100%) rename requirements.txt => forum/requirements.txt (100%) create mode 100755 forum/restart.sh rename run_sqlite.sh => forum/run_sqlite.sh (100%) rename schema.txt => forum/schema.txt (100%) create mode 100644 forum/static/button.png rename {static => forum/static}/theme.css (100%) rename {templates => forum/templates}/admin/base.html (100%) rename {templates => forum/templates}/admin/index.html (100%) rename {templates => forum/templates}/admin/query.html (100%) rename {templates => forum/templates}/base.html (100%) rename {templates => forum/templates}/comment.html (100%) rename {templates => forum/templates}/comments.html (100%) rename {templates => forum/templates}/confirm_delete_comment.html (100%) rename {templates => forum/templates}/confirm_delete_thread.html (100%) rename {templates => forum/templates}/edit_comment.html (100%) rename {templates => forum/templates}/edit_thread.html (100%) rename {templates => forum/templates}/forum.html (100%) rename {templates => forum/templates}/help.html (100%) rename {templates => forum/templates}/index.html (100%) rename {templates => forum/templates}/login.html (100%) rename {templates => forum/templates}/moderator.html (100%) rename {templates => forum/templates}/new_thread.html (100%) rename {templates => forum/templates}/register.html (100%) rename {templates => forum/templates}/thread.html (100%) rename {templates => forum/templates}/user_edit.html (100%) rename {templates => forum/templates}/user_info.html (100%) rename {test => forum/test}/all.sh (100%) rename {test => forum/test}/init_db.txt (100%) rename tool.py => forum/tool.py (100%) rename {upgrade => forum/upgrade}/sqlite/v0.1.sh (100%) rename upgrade_sqlite.sh => forum/upgrade_sqlite.sh (100%) create mode 100755 forum/version.py create mode 100755 stop.sh diff --git a/Makefile b/Makefile deleted file mode 100644 index b852cd6..0000000 --- a/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -PYTHON = python3 -FLASK = flask -SQLITE = sqlite3 - -default: venv - -test: venv - test/all.sh - -venv: - $(PYTHON) -m venv $@ - . ./venv/bin/activate && pip3 install -r requirements.txt - -forum.db: - $(SQLITE) $@ < schema.txt - -.PHONY: test diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2230332 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: "3.7" + +services: + forum: + build: + context: ./forum/ + dockerfile: ./Dockerfile + args: + UID: ${UID} + GID: ${GID} + TZ: ${TZ} + volumes: + - "./forum/:/app" + ports: + - "${EXPOSE}:5000" + environment: + ADMINU: ${ADMINU} + ADMINP: ${ADMINP} diff --git a/example.env b/example.env new file mode 100644 index 0000000..7d6239a --- /dev/null +++ b/example.env @@ -0,0 +1,7 @@ + +UID=1000 +GID=1000 +TZ=Europe/Helsinki +ADMINU=admin +ADMINP=admin +EXPOSE=5000 diff --git a/forum/Dockerfile b/forum/Dockerfile new file mode 100644 index 0000000..531f94b --- /dev/null +++ b/forum/Dockerfile @@ -0,0 +1,36 @@ +FROM ubuntu:22.04 + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update -yqq \ + && apt-get install -y --no-install-recommends \ + sqlite3 \ + tzdata \ + git \ + make \ + python3-venv \ + python3-pip \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +ARG UID +ARG GID +ARG TZ +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +RUN groupadd -g $GID user && \ + useradd -u $UID -g $GID -ms /bin/bash user && \ + mkdir -p /opt/venv && chown $UID:$GID /opt/venv +COPY ./requirements.txt /requirements.txt +COPY docker-builder.sh / +USER user + +RUN bash /docker-builder.sh +#COPY ./ /app +#USER root +#RUN chown -R $UID:$GID /app +USER user + +WORKDIR /app + +COPY docker-entrypoint.sh / +CMD bash /docker-entrypoint.sh diff --git a/captcha.py b/forum/captcha.py similarity index 100% rename from captcha.py rename to forum/captcha.py diff --git a/db/sqlite.py b/forum/db/sqlite.py similarity index 100% rename from db/sqlite.py rename to forum/db/sqlite.py diff --git a/forum/docker-builder.sh b/forum/docker-builder.sh new file mode 100755 index 0000000..dd54adc --- /dev/null +++ b/forum/docker-builder.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -eux + +python3 -m venv /opt/venv +. /opt/venv/bin/activate +pip3 install -r requirements.txt diff --git a/forum/docker-entrypoint.sh b/forum/docker-entrypoint.sh new file mode 100755 index 0000000..67e8a8a --- /dev/null +++ b/forum/docker-entrypoint.sh @@ -0,0 +1,50 @@ +#!/bin/sh +PYTHON=python3 +SQLITE=sqlite3 + +export DB="/app/forum.db" +export SERVER=gunicorn +export PID="forum.pid" +export WORKERS=4 + +if [[ $( stat -c %u /app ) -ne $( id -u ) ]]; then + echo User id and /app folder owner do not match + printf 'UID: %s\nFolder: %s\n' $( id -u ) $( stat -c %u /app ) + exit 1 +fi + +set -eu +. /opt/venv/bin/activate +if [[ -e "$DB" ]]; then + $SQLITE -header "$DB" "SELECT version,name,description,registration_enabled,login_required FROM config" + echo Database already exists +else + password=$($PYTHON tool.py password "$ADMINP") + time=$($PYTHON -c 'import time; print(time.time_ns())') + version=$($PYTHON tool.py version) + + $SQLITE "$DB" -init schema.txt "insert into config ( + version, + name, + description, + secret_key, + captcha_key, + registration_enabled, + login_required +) +values ( + '$version', + 'Forum', + '', + '$(head -c 30 /dev/urandom | base64)', + '$(head -c 30 /dev/urandom | base64)', + 0, + 1 + )" + $SQLITE "$DB" " + insert into users (name, password, role, join_time) + values (lower('$ADMINU'), '$password', 2, $time) + " +fi + +exec "$SERVER" -w $WORKERS 'main:app' --pid="$PID" -b 0.0.0.0:5000 diff --git a/init_sqlite.sh b/forum/init_sqlite.sh similarity index 100% rename from init_sqlite.sh rename to forum/init_sqlite.sh diff --git a/main.py b/forum/main.py similarity index 100% rename from main.py rename to forum/main.py diff --git a/minimd.py b/forum/minimd.py similarity index 100% rename from minimd.py rename to forum/minimd.py diff --git a/password.py b/forum/password.py similarity index 100% rename from password.py rename to forum/password.py diff --git a/requirements.txt b/forum/requirements.txt similarity index 100% rename from requirements.txt rename to forum/requirements.txt diff --git a/forum/restart.sh b/forum/restart.sh new file mode 100755 index 0000000..a1997c7 --- /dev/null +++ b/forum/restart.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +set -e +SERVER="$1" +if [ -z "$SERVER" ] +then + echo "SERVER is not set" >&2 + exit 1 +fi + +case "$SERVER" in + dev) + touch main.py + ;; + gunicorn) + if [ -z "$PID" ] + then + echo "PID is not set" >&2 + exit 1 + fi + kill -hup $(cat "$PID") + ;; + *) + echo "Unsupported $SERVER" >&2 + exit 1 + ;; +esac diff --git a/run_sqlite.sh b/forum/run_sqlite.sh similarity index 100% rename from run_sqlite.sh rename to forum/run_sqlite.sh diff --git a/schema.txt b/forum/schema.txt similarity index 100% rename from schema.txt rename to forum/schema.txt diff --git a/forum/static/button.png b/forum/static/button.png new file mode 100644 index 0000000000000000000000000000000000000000..4d49088e53206ac60385db2dc09221f4c7a735aa GIT binary patch literal 9651 zcmd6N2|SeD-}l8}tO+UEMyV*uPSzpWN>M6`Om>sTSVopGT2P9)rE(`srP3zJGTCOb z4k47X#n=a#?86u{^ITJR_rLz{{r|kreZQaQ^Sl?o>-^3+-`_dscdm1;`JQvGD~<YjKwj~ygI8s9g0oi(L-y!QITxbt|_`=a5>iib#dM-`0`Efo6DIIpC5=w!b46XXXU8( zn|NDAZ{J=p3BK&2ezxF!-E;5LwNAAXM?Y*wG?ciER@5DT*5Sg;UX8D+Aiio2%gC|y zl-U29(jE&jpChM~t)CrCir1y7n5-(lKx|Im^Fmw3aJ^%^K=z;{Xt*2>_F)0Kn*X0N4>z=0UM--IegFw47t}@+yZ~{s{WKc%bsOCD^_dKxxxcGaXxMh+|G7$ z0ex`|++yuR+1=3~l*e8ZgLB>Ns^iAY`3V6 ztnX?*(Pg>@9bZ}b($`+_R?1adi?t{Hgm?#^=?$)?oydQ^w?a&zJ3^8NepmUtI6Pqn zWouJS^Pk(b=hgi_f9+bk9;bIpNXd)QGQ-_w8f*BZ8D?qe_U;MCkCCM;$WL{}?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P$LaJ}NLkF#vMV1W_18}J2BJ-- zP0ijpbeHftUpJ3=b9Mq@_3L(WmM%=lJwP@gO|*sXigI{2w@VXd=CYOO_-0Xts&K9i zYWf$O!;|?5TN7*H3UQ@SCS1i7j#=QDEIMQbtosKN=~v4E7^-IAh<}~PPTI%#U_szc zt2F(B7;suqV@fD*!D+>-%t*iWIVjdW>&tllucUj9{U692FdnUt%jnDrHae!AeYjVFaB7{2OKKrb1XF~a)hD0Au&3c9d^umh*iAy)Bk3lL89s-=7yO@&8 zTd}{|eSJmQhaNUs2;48}b@OV#(j?G@$WxyoX=z_3rcYX@=E1M!bgC4#Em>-GgX`jj z*5YC2{*4l`3vnKEZ*MVTmn_X;j)&YffX4|N+$PJ8%O+EL2Vk=k&l#Q?gw+<((vG`z zqrXYvE3YL@`~QR0(_nPuP$PIKbGV-Q{ZMACcvJ{HlsSoitqh*Y+!+2!-400e zV0?_cLVUpB+ZpaoO@p18Z(L1IE3eL|c(P(f#WfZgg!+O>k3JUQF4Mm~@0eyx~kTZx={0rRAZfNW2I|gZT zkHZ!I6Y{%5An>xl3iqsE^)G=zUj80|em>Ud5R?Z7(9zzVP9CfRZ8ZM7 zHh=W4fv%1L#U8^1O?Ui-siQv{gGTvaLXckHY6acKcwoNyEh(KO3tB1th1K_A#2rwM z$OxY^fX-lN%Lx!G$HjslI2n1NgCawae*PH1G0gJ}(o1PC8s&iuEJ@XJ1!0?iz`T7z zy+V*d-|GAJC_TfFXD~aFfl8r=ZT8svSxA9s=^tp6M_`z*hZiO+#3$t2lef?Q?JWpc v^Ctl94K{{r>Uzq~63h|e=7a?X1fs(O0j-`*N4a0X0CrXf_rBP3>cW2kU4Gqb literal 0 HcmV?d00001 diff --git a/static/theme.css b/forum/static/theme.css similarity index 100% rename from static/theme.css rename to forum/static/theme.css diff --git a/templates/admin/base.html b/forum/templates/admin/base.html similarity index 100% rename from templates/admin/base.html rename to forum/templates/admin/base.html diff --git a/templates/admin/index.html b/forum/templates/admin/index.html similarity index 100% rename from templates/admin/index.html rename to forum/templates/admin/index.html diff --git a/templates/admin/query.html b/forum/templates/admin/query.html similarity index 100% rename from templates/admin/query.html rename to forum/templates/admin/query.html diff --git a/templates/base.html b/forum/templates/base.html similarity index 100% rename from templates/base.html rename to forum/templates/base.html diff --git a/templates/comment.html b/forum/templates/comment.html similarity index 100% rename from templates/comment.html rename to forum/templates/comment.html diff --git a/templates/comments.html b/forum/templates/comments.html similarity index 100% rename from templates/comments.html rename to forum/templates/comments.html diff --git a/templates/confirm_delete_comment.html b/forum/templates/confirm_delete_comment.html similarity index 100% rename from templates/confirm_delete_comment.html rename to forum/templates/confirm_delete_comment.html diff --git a/templates/confirm_delete_thread.html b/forum/templates/confirm_delete_thread.html similarity index 100% rename from templates/confirm_delete_thread.html rename to forum/templates/confirm_delete_thread.html diff --git a/templates/edit_comment.html b/forum/templates/edit_comment.html similarity index 100% rename from templates/edit_comment.html rename to forum/templates/edit_comment.html diff --git a/templates/edit_thread.html b/forum/templates/edit_thread.html similarity index 100% rename from templates/edit_thread.html rename to forum/templates/edit_thread.html diff --git a/templates/forum.html b/forum/templates/forum.html similarity index 100% rename from templates/forum.html rename to forum/templates/forum.html diff --git a/templates/help.html b/forum/templates/help.html similarity index 100% rename from templates/help.html rename to forum/templates/help.html diff --git a/templates/index.html b/forum/templates/index.html similarity index 100% rename from templates/index.html rename to forum/templates/index.html diff --git a/templates/login.html b/forum/templates/login.html similarity index 100% rename from templates/login.html rename to forum/templates/login.html diff --git a/templates/moderator.html b/forum/templates/moderator.html similarity index 100% rename from templates/moderator.html rename to forum/templates/moderator.html diff --git a/templates/new_thread.html b/forum/templates/new_thread.html similarity index 100% rename from templates/new_thread.html rename to forum/templates/new_thread.html diff --git a/templates/register.html b/forum/templates/register.html similarity index 100% rename from templates/register.html rename to forum/templates/register.html diff --git a/templates/thread.html b/forum/templates/thread.html similarity index 100% rename from templates/thread.html rename to forum/templates/thread.html diff --git a/templates/user_edit.html b/forum/templates/user_edit.html similarity index 100% rename from templates/user_edit.html rename to forum/templates/user_edit.html diff --git a/templates/user_info.html b/forum/templates/user_info.html similarity index 100% rename from templates/user_info.html rename to forum/templates/user_info.html diff --git a/test/all.sh b/forum/test/all.sh similarity index 100% rename from test/all.sh rename to forum/test/all.sh diff --git a/test/init_db.txt b/forum/test/init_db.txt similarity index 100% rename from test/init_db.txt rename to forum/test/init_db.txt diff --git a/tool.py b/forum/tool.py similarity index 100% rename from tool.py rename to forum/tool.py diff --git a/upgrade/sqlite/v0.1.sh b/forum/upgrade/sqlite/v0.1.sh similarity index 100% rename from upgrade/sqlite/v0.1.sh rename to forum/upgrade/sqlite/v0.1.sh diff --git a/upgrade_sqlite.sh b/forum/upgrade_sqlite.sh similarity index 100% rename from upgrade_sqlite.sh rename to forum/upgrade_sqlite.sh diff --git a/forum/version.py b/forum/version.py new file mode 100755 index 0000000..c87fc89 --- /dev/null +++ b/forum/version.py @@ -0,0 +1,3 @@ + +VERSION = "agreper-v0.1.1q1" + diff --git a/stop.sh b/stop.sh new file mode 100755 index 0000000..bdb6029 --- /dev/null +++ b/stop.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +set -e +docker-compose down forum