diff --git a/crontab b/crontab new file mode 100644 index 0000000..dd8a1f1 --- /dev/null +++ b/crontab @@ -0,0 +1,3 @@ +# do daily/weekly/monthly maintenance +# min hour day month weekday command +*/5 * * * * /jobs/nyx-reset.sh diff --git a/default.db b/default.db new file mode 100644 index 0000000..183ca81 --- /dev/null +++ b/default.db @@ -0,0 +1,35 @@ +*3 +$3 +set +$11 +/jack/setup +$3 +yes +*3 +$3 +set +$35 +/jack/./pass/admin/admin/admin-data +$111 +{"id":"admin","password":"$s2$16384$8$1$WJK3gJ0r2HYyswGtWPOk+D3K$AsvNHWhw5kNyVw/OrgKYGGlOrLENPDmaMgEOtD1ClG0="} +*3 +$3 +set +$51 +/jack/nyx.dot.example.dot.com/board/demo/board-data +$46 +{"short":"demo","long":"demo board","meta":{}} +*3 +$3 +set +$92 +/jack/nyx.dot.example.dot.com/board/demo/thread/00000000000000000000196238209024/thread-data +$55 +{"id":196238209024,"start":196238209025,"board":"demo"} +*3 +$3 +set +$130 +/jack/nyx.dot.example.dot.com/board/demo/thread/00000000000000000000196238209024/reply/00000000000000000000196238209025/reply-data +$339 +{"id":196238209025,"text":"Username and Password for /admin/ is admin:admin - feel free to add additional administrators - please refrain from changing the password / deleting the \"admin\" administrator","image":null,"thumb":null,"thread":196238209024,"board":"demo","meta":{"adminpost":"yes","captchaprob":"1.00","spamscore":"0.000000"}} diff --git a/docker-compose.override.yml b/docker-compose.override.yml new file mode 100644 index 0000000..73ce9f5 --- /dev/null +++ b/docker-compose.override.yml @@ -0,0 +1,10 @@ +--- +services: + cron: + image: bryanpedini/dockercron:${CRON_VERSION} + restart: unless-stopped + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - ${CRON_CRONTAB}:/crontab/root + - ${CRON_JOBS}:/jobs + - ${NYX_DEMO}:/opt/nyx diff --git a/env.example b/env.example index 5993b67..6a06571 100644 --- a/env.example +++ b/env.example @@ -20,3 +20,10 @@ DIUN_EXCLUDE= # Nyx NYX_VERSION=latest NYX_DATA=./data +NYX_DEMO=/path/to/nyx-demo +# ^ where your docker-compose.override.yml resides for the demo deployment + +# Cron +CRON_VERSION=1.0-alpine3.16 +CRON_CRONTAB=./crontab +CRON_JOBS=./jobs diff --git a/jobs/nyx-reset.sh b/jobs/nyx-reset.sh new file mode 100755 index 0000000..1de9152 --- /dev/null +++ b/jobs/nyx-reset.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +cd /opt/nyx +docker compose stop nyx +cp -a default.db data/data/data.db +docker compose start nyx