summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-12-25 12:32:15 -0500
committerFreya Murphy <freya@freyacat.org>2024-12-25 12:32:15 -0500
commit170f39e70736baff4b7c0ffe7d91c1bdf409532b (patch)
tree400e497e102b1b2ca6fe175f2a0c2a90a060f932
parentupdate version (diff)
downloadxssbook2-170f39e70736baff4b7c0ffe7d91c1bdf409532b.tar.gz
xssbook2-170f39e70736baff4b7c0ffe7d91c1bdf409532b.tar.bz2
xssbook2-170f39e70736baff4b7c0ffe7d91c1bdf409532b.zip
make shim a container once again
-rw-r--r--build/shim/Dockerfile17
-rwxr-xr-xbuild/shim/shim.php (renamed from shim/shim.php)4
-rw-r--r--docker-compose.override.yml32
-rw-r--r--shim/README.md9
m---------site0
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