From ac6086bbf4f11e50c130e434fcb59217384b9580 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Sat, 17 Jul 2021 21:57:04 +0200 Subject: [PATCH] Initial import --- .env.sample | 6 ++++++ .gitignore | 1 + abra.sh | 1 + compose.yml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ install.sh | 7 +++++++ 5 files changed, 62 insertions(+) create mode 100644 .env.sample create mode 100644 .gitignore create mode 100644 abra.sh create mode 100644 compose.yml create mode 100644 install.sh diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000..35cf16f --- /dev/null +++ b/.env.sample @@ -0,0 +1,6 @@ +TYPE=federatedwiki + +DOMAIN=federatedwiki.example.com +## Domain aliases +#EXTRA_DOMAINS=', `www.federatedwiki.example.com`' +LETS_ENCRYPT_ENV=production diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..37b52cc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.envrc diff --git a/abra.sh b/abra.sh new file mode 100644 index 0000000..d2bcac2 --- /dev/null +++ b/abra.sh @@ -0,0 +1 @@ +export INSTALL_SH_VERSION=v3 diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..d1055a1 --- /dev/null +++ b/compose.yml @@ -0,0 +1,47 @@ +--- +version: "3.8" + +services: + app: + image: dobbs/farm + command: /bin/sh config/install.sh + volumes: + - "fedwiki_friends:/home/node/config" + - "fedwiki:/home/node/.wiki" + networks: + - proxy + configs: + - source: install_sh_conf + target: /home/node/config/install.sh + deploy: + restart_policy: + condition: on-failure + labels: + - "traefik.enable=true" + - "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=3000" + - "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})" + - "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure" + - "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}" + ## Redirect from EXTRA_DOMAINS to DOMAIN + #- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect" + #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true" + #- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}" + # healthcheck: + # test: ["CMD", "curl", "-f", "http://localhost"] + # interval: 30s + # timeout: 10s + # retries: 10 + # start_period: 1m + +volumes: + fedwiki: + fedwiki_friends: + +networks: + proxy: + external: true + +configs: + install_sh_conf: + name: ${STACK_NAME}_install_sh_${INSTALL_SH_VERSION} + file: install.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..67a5f5f --- /dev/null +++ b/install.sh @@ -0,0 +1,7 @@ +apk --update add gettext +chown -R node:node .wiki +/usr/bin/envsubst < config/config.json > .wiki/config.json +/usr/bin/envsubst < config/config.owner.json > .wiki/config.owner.json +chown -R node:node .wiki + +wiki --farm --security_type=friends