diff options
-rw-r--r-- | build/shim/Dockerfile | 17 | ||||
-rwxr-xr-x | build/shim/shim.php (renamed from shim/shim.php) | 4 | ||||
-rw-r--r-- | docker-compose.override.yml | 32 | ||||
-rw-r--r-- | shim/README.md | 9 | ||||
m--------- | site | 0 |
5 files changed, 51 insertions, 11 deletions
diff --git a/build/shim/Dockerfile b/build/shim/Dockerfile new file mode 100644 index 0000000..986b931 --- /dev/null +++ b/build/shim/Dockerfile @@ -0,0 +1,17 @@ +FROM alpine:latest + +# install packages +RUN apk add --no-cache \ + php84 \ + php84-pdo \ + php84-pdo_sqlite \ + php84-pdo_pgsql \ + tini + +# copy scripts +COPY ./shim.php /usr/local/bin/shim.php +RUN chmod +x /usr/local/bin/shim.php + +# run +ENTRYPOINT ["/sbin/tini", "--"] +CMD ["/usr/local/bin/shim.php"] diff --git a/shim/shim.php b/build/shim/shim.php index eb84412..0c91513 100755 --- a/shim/shim.php +++ b/build/shim/shim.php @@ -1,9 +1,9 @@ -#!/usr/bin/env php +#!/usr/bin/env php84 <?php /* Copyright (c) 2024 Freya Murphy */ function wait_until_ready() { while (TRUE) { - if (file_exists("/status/ready")) { + if (file_exists("/var/run/crimson/db-ready")) { echo "database ready!\n"; break; } diff --git a/docker-compose.override.yml b/docker-compose.override.yml new file mode 100644 index 0000000..0a46e5b --- /dev/null +++ b/docker-compose.override.yml @@ -0,0 +1,32 @@ +### XSSBook --- Post posts postfully. +### Copyright © 2024 Freya Murphy <contact@freyacat.org> +### +### This file is part of XSSBook. +### +### CRIMSON is free software; you can redistribute it and/or modify it +### under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 3 of the License, or (at +### your option) any later version. +### +### CRIMSON is distributed in the hope that it will be useful, but +### WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU General Public License for more details. +### +### You should have received a copy of the GNU General Public License +### along with CRIMSON. If not, see <http://www.gnu.org/licenses/>. + +services: + # XSSBook service extensions + # - Adds websocket service + + shim: + build: ${PROJECT_ROOT}/build/shim + restart: no + env_file: DOCKER_ENV_FILES + volumes: + - ${PROJECT_ROOT} + - ${PROJECT_DATA}/crimson:/var/run/crimson + depends_on: + postgres: + condition: service_healthy diff --git a/shim/README.md b/shim/README.md deleted file mode 100644 index 80dfb3a..0000000 --- a/shim/README.md +++ /dev/null @@ -1,9 +0,0 @@ -## shim - -TODO: update beacuse this is now invalid :( - -If you are runing a xssbook v1 setup, the database is fully incompatible with xssbook v2. Luckily there is a migration that exists to port over your data. XSSBook v1 has a single sqlite database file and a custom assets directory likly called `custom`. You will know you have the right directory if there are two sub directories called `avatar` and `banner`. Place the sqlite db file (called `xssbook.db`) and the `custom` directory in the `data/shim` folder of the xssbook v2 directory. If this doesnt exist please do a full setup of v2 first. Then run `docker compose up -d shim`, and you should be all set. - -> WARNING: This will delete ALL data in the database if you specify xssbook v1 files in the data path. Make sure yo only run this once and remove the files once completed. - -> NOTE: the migration will never run if the database files are not supplied. diff --git a/site b/site -Subproject 45b58da72187a7b1ed4d75fc25bf5dd59a86a9c +Subproject d929d8de67edc8881828bddfc817acebaf5d6e8 |