Compare commits

..
15 Commits
Author SHA1 Message Date
Christian Galo 7ba6fbabc1 Resolve merge conflict and bump app image 2026-04-18 06:12:27 +00:00
Robert Best 02ad7a1ace Bump app image and fix healthcheck quoting
Update app image to 0.39.4-2 and switch the healthcheck test to single
quotes to simplify escaping of the embedded Node.js script
2026-04-18 06:11:44 +00:00
Christian Galo 280402daf7 Update fedwiki OCI image to version 0.38.6-2 and simplify deployment command in README 2026-01-02 02:00:27 +00:00
Christian Galo 06ec22ab42 Update fedwiki OCI image to version 0.38.5-2 2025-10-24 20:26:19 +00:00
Christian Galo ce35dd4e16 Wiki Cafe OCI image 2025-10-16 07:41:15 +00:00
Christian Galo 13b27471e8 Rely on decaf image instead of custom image. 2025-05-06 16:58:56 +00:00
Christian Galo b190900922 Update README and compose files 2025-02-02 20:31:40 +00:00
Christian Galo cf0375420c Add EXTRA_DOMAINS 2023-12-05 17:52:34 +00:00
Christian Galo db6dc1d6f7 Allow specifying WIKI_VERSION 2023-12-05 17:52:10 +00:00
Christian Galo e2706d14ad Revert "remove wikicafe.yaml"
This reverts commit c35e2802c7.
2023-11-17 21:43:19 +00:00
Christian Galo c35e2802c7 remove wikicafe.yaml 2023-11-05 04:40:39 +00:00
Christian Galo a7ff392dd1 rename volumes 2023-11-03 21:41:51 +00:00
Christian Galo d059b04de0 replace var where fixed name is. Update README. 2023-10-17 04:17:26 +00:00
Christian Galo 10d66575cf update to cc commit a7bda15182 2023-10-16 23:16:59 +00:00
Christian Galo 826a25edb3 un-abra 2023-09-09 05:21:00 +00:00
20 changed files with 105 additions and 224 deletions
-41
View File
@@ -1,41 +0,0 @@
---
kind: pipeline
name: deploy to swarm-test.autonomic.zone
steps:
- name: deployment
image: git.coopcloud.tech/coop-cloud/stack-ssh-deploy:latest
settings:
host: swarm-test.autonomic.zone
stack: federatedwiki
generate_secrets: true
purge: true
deploy_key:
from_secret: drone_ssh_swarm_test
networks:
- proxy
environment:
DOMAIN: federatedwiki.swarm-test.autonomic.zone
STACK_NAME: federatedwiki
LETS_ENCRYPT_ENV: production
INSTALL_SH_VERSION: v1
CONFIG_JSON_VERSION: v1
CONFIG_OWNER_JSON_VERSION: v1
trigger:
branch:
- main
---
kind: pipeline
name: generate recipe catalogue
steps:
- name: release a new version
image: plugins/downstream
settings:
server: https://build.coopcloud.tech
token:
from_secret: drone_abra-bot_token
fork: true
repositories:
- toolshed/auto-recipes-catalogue-json
trigger:
event: tag
-34
View File
@@ -1,34 +0,0 @@
TYPE=federatedwiki
DOMAIN=federatedwiki.example.com
## Domain aliases
#EXTRA_DOMAINS=', `www.federatedwiki.example.com`'
LETS_ENCRYPT_ENV=production
COMPOSE_FILE="compose.yml"
## where the wiki data lives; change to an absolute path if you want a bindmount (e.g. /opt/fedwiki)
FEDWIKI_VOLUME="fedwiki"
## Persist the lib volume / node_modules directory. If you're not using plugmatic, you can disable this option.
COMPOSE_FILE="$COMPOSE_FILE:compose.lib.yml"
## Note(3wc): If you change this after initial deployment, you will need to
## manually copy the new value from `conf/config.initial.json`
SECRET_COOKIE_SECRET_VERSION=v1 # length=30
## Specify wiki config filename. If running multiple farms on the same machine with unique configurations, each config needs a unique filename.
## e.g. config-farm1.json, config-farm2.json, etc.
## If there exists a config file named "config.json", it will be used by all farms by default.
CONFIG_FILE="config.json"
## If using Caddy:
## Customize your Caddyfile to determine what domains are accessible and will get TLS certificates.
## You are also able to enable access over HTTP by adding domains like: http://${DOMAIN}, http://*.${DOMAIN}, http://*.*.${DOMAIN}, http://*.*.*.${DOMAIN}
CADDY="https://${DOMAIN}, https://*.${DOMAIN}, https://*.*.${DOMAIN}, https://*.*.*.${DOMAIN}"
## If using Traefik:
## By default traefik allows: https://${DOMAIN}, https://*.${DOMAIN}, https://*.*.${DOMAIN}, https://*.*.*.${DOMAIN}
## Uncomment the following line to also allow HTTP access
#COMPOSE_FILE="$COMPOSE_FILE:compose.insecure.yml"
+1 -1
View File
@@ -1 +1 @@
/.envrc
.env*
+19 -20
View File
@@ -1,25 +1,24 @@
# Federated Wiki
# Fedwiki
Share pages circulating within a creative commons.
Wiki Cafe's configuration for a Nextcloud deployment. Originally slimmed down from an `abra` [recipe](https://git.coopcloud.tech/coop-cloud/federatedwiki) by [Co-op Cloud](https://coopcloud.tech/).
See [Federated Wiki on GitHub](https://github.com/fedwiki/wiki) for more information.
<!-- metadata -->
* **Maintainer**: [@3wordchant](https://git.coopcloud.tech/3wordchant), [@Bortseb](https://git.coopcloud.tech/Bortseb), [@cgalo5758](https://git.coopcloud.tech/cgalo5758)
* **Status**: `stable`
* **Category**: Apps
* **Image**: [`wiki-cafe/fedwiki-oci-image`](https://git.coopcloud.tech/wiki-cafe/-/packages/container/fedwiki-oci-image/), 4, upstream
* **Healthcheck**: No
* **Backups**: No
* **Email**: N/A
* **Tests**: No
* **SSO**: ? (Keycloak)
<!-- endmetadata -->
## Deploying the app with Docker Swarm
## Basic usage
Set the environment variables from the .env file during the shell session.
1. Set up [Docker Swarm](https://docs.coopcloud.tech/operators/tutorial/#server-configuration) and [`abra`](https://docs.coopcloud.tech/abra/)
2. `abra app new federatedwiki -S` - Copy the secret it generates, you will need it for your wiki config file.
3. `abra app config YOURAPPDOMAIN` - be sure to change `DOMAIN` to something that resolves to
your Docker swarm box
4. `abra app deploy YOURAPPDOMAIN`
```
set -a && source .env && set +a
```
Set the secrets.
```
printf "SECRET_HERE" | docker secret create SECRET_NAME -
```
Deploy using the `-c` flag to specify one or multiple compose files.
```
docker stack deploy fedwiki --detach=true -c compose.yaml
```
-2
View File
@@ -1,2 +0,0 @@
export ENTRYPOINT_SH_VERSION=v2
export CONFIG_JSON_INITIAL_VERSION=v1
-11
View File
@@ -1,11 +0,0 @@
---
# NOTE: Do not use this in combination with the CADDY option in compose.yml
version: "3.8"
services:
app:
deploy:
labels:
- "traefik.http.services.${STACK_NAME}-non-tls.loadbalancer.server.port=3000"
- "traefik.http.routers.${STACK_NAME}-non-tls.rule=Host(`${DOMAIN}`) || HostRegexp(`{subdomain:\\w+}.${DOMAIN}`) || HostRegexp(`{subsubdomain:\\w+}.{subdomain:\\w+}.${DOMAIN}`) || HostRegexp(`{subsubsubdomain:\\w+}.{subsubdomain:\\w+}.{subdomain:\\w+}.${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}-non-tls.entrypoints=web"
+7
View File
@@ -0,0 +1,7 @@
services:
app:
volumes:
- "lib:/home/node/lib"
volumes:
lib:
-10
View File
@@ -1,10 +0,0 @@
---
version: "3.8"
services:
app:
volumes:
- "fedwiki_lib:/home/node/lib"
volumes:
fedwiki_lib:
+74
View File
@@ -0,0 +1,74 @@
services:
app:
image: git.coopcloud.tech/wiki-cafe/fedwiki-oci-image:0.39.4-2
command: /bin/sh entrypoint.sh
volumes:
- "data:/home/node/.wiki"
networks:
- proxy
configs:
- source: entrypoint_sh_conf
target: /home/node/entrypoint.sh
- source: config_json_initial_conf
target: /home/node/initial-config/config.json
secrets:
- cookie_secret
environment:
- DOMAIN
- DOMAINS
- COOKIE_SECRET
- AUTHOR
- ADMIN_KEY
deploy:
update_config:
order: start-first
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}`) || HostRegexp(`{subdomain:\\w+}.${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}.tls.domains[0].main=${DOMAIN}"
- "traefik.http.routers.${STACK_NAME}.tls.domains[0].sans=*.${DOMAIN}"
- "traefik.http.routers.${STACK_NAME}.priority=1"
- "traefik.http.routers.${STACK_NAME}_auth.rule=(Host(`${DOMAIN}`) && (PathPrefix(`/auth`) || Path(`/security/dialog.css`)))"
- "traefik.http.routers.${STACK_NAME}_auth.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}_auth.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "caddy_0=https://${DOMAIN}"
- "caddy_0.tls.on_demand="
- "caddy_0.@match.path=/auth/* /security/dialog.css"
- "caddy_0.reverse_proxy= @match {{upstreams 3000}}"
- ${DOMAINS}
- "caddy_1.reverse_proxy={{upstreams 3000}}"
- "caddy_1.tls.on_demand="
- "backupbot.backup=true"
- "backupbot.backup.path=/home/node/.wiki"
healthcheck:
test: 'node -e ''var http = require("http"); var options = { host : "localhost", port : "3000", timeout : 2000, path : "/view/welcome-visitors", headers: { "Host": "${DOMAIN}" } }; var request = http.request(options, (res) => { console.log(`STATUS: $${res.statusCode}`); if (res.statusCode == 200) { process.exit(0); } else { process.exit(1); } }); request.on("error", function(err) { console.log(''ERROR''); process.exit(1); }); request.end();'''
interval: 10s
timeout: 2s
retries: 2
start_period: 30s
volumes:
data:
networks:
proxy:
external: true
secrets:
cookie_secret:
external: true
name: ${STACK_NAME}_cookie_secret
configs:
entrypoint_sh_conf:
name: ${STACK_NAME}_entrypoint_sh
file: entrypoint.sh
config_json_initial_conf:
name: ${STACK_NAME}_config_initial_json
file: config.initial.json.tmpl
template_driver: golang
-70
View File
@@ -1,70 +0,0 @@
---
version: "3.8"
services:
app:
image: git.coopcloud.tech/wiki-cafe/fedwiki-oci-image:0.41.0-rc.2-1
command: /bin/sh entrypoint.sh
volumes:
- "${FEDWIKI_VOLUME}:/home/node/.wiki"
networks:
- proxy
configs:
- source: entrypoint_sh
target: /home/node/entrypoint.sh
- source: config_json_initial
target: /home/node/initial-config/config.json
secrets:
- cookie_secret
environment:
- DOMAIN
- COOKIE_SECRET
- AUTHOR
- ADMIN_KEY
deploy:
update_config:
order: start-first
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}`) || HostRegexp(`{subdomain:\\w+}.${DOMAIN}`) || HostRegexp(`{subsubdomain:\\w+}.{subdomain:\\w+}.${DOMAIN}`) || HostRegexp(`{subsubsubdomain:\\w+}.{subsubdomain:\\w+}.{subdomain:\\w+}.${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.${STACK_NAME}.tls.domains[0].main=${DOMAIN}"
- "traefik.http.routers.${STACK_NAME}.tls.domains[0].sans=*.${DOMAIN}"
- "traefik.http.routers.${STACK_NAME}.priority=1"
- "caddy=${CADDY}"
- "caddy.reverse_proxy={{upstreams 3000}}"
- "caddy.tls.on_demand="
- "backupbot.backup=true"
- "backupbot.backup.path=/home/node/.wiki"
- "coop-cloud.${STACK_NAME}.version=3.3.0+0.41.0-rc.0-1"
healthcheck:
test: "node -e 'var http = require(\"http\"); var options = { host : \"localhost\", port : \"3000\", timeout : 2000, path : \"/view/welcome-visitors\", headers: { \"Host\": \"${DOMAIN}\" } }; var request = http.request(options, (res) => { console.log(`STATUS: $${res.statusCode}`); if (res.statusCode == 200) { process.exit(0); } else { process.exit(1); } }); request.on(\"error\", function(err) { console.log('ERROR'); process.exit(1); }); request.end();'"
interval: 10s
timeout: 2s
retries: 2
start_period: 30s
volumes:
fedwiki:
networks:
proxy:
external: true
secrets:
cookie_secret:
external: true
name: ${STACK_NAME}_cookie_secret_${SECRET_COOKIE_SECRET_VERSION}
configs:
entrypoint_sh:
name: ${STACK_NAME}_entrypoint_sh_${ENTRYPOINT_SH_VERSION}
file: entrypoint.sh
config_json_initial:
name: ${STACK_NAME}_config_json_initial_${CONFIG_JSON_INITIAL_VERSION}
file: config.initial.json.tmpl
template_driver: golang
+1 -1
View File
@@ -3,4 +3,4 @@
"cookieSecret": "{{ secret "cookie_secret" }}",
"security_useHttps": true,
"security_type": "friends"
}
}
+3 -5
View File
@@ -1,9 +1,7 @@
#!/bin/sh
config_file="$HOME/.wiki/${CONFIG_FILE:-config.json}"
if [ ! -f "$config_file" ]; then
cp initial-config/config.json "$config_file"
if [ ! -f .wiki/config.json ]; then
cp config/config.json .wiki/config.json
fi
wiki --farm --config "$config_file"
wiki --farm
-7
View File
@@ -1,7 +0,0 @@
WARNING! 🚨
There is a new mandatory config option, FEDWIKI_VOLUME -- please copy the
default value from the recipe .env.sample to your .env file on upgrade.
If you haven't done that yet, best to bail with Ctrl+C, then add the option,
then re-run this `abra app upgrade ...` command
-11
View File
@@ -1,11 +0,0 @@
COOKIE_SECRET is now a Docker secret, and several config options have been
dropped from the recipe -- this shouldn't affect running deplyoments, as
the recipe currently just installs the generated `config.json` if there isn't
one already -- but you will likely still need to run
`abra app secret generate ...` before deploying, in preparation for moving to
ennvironment variables for config in a future release.
Additionally, there is now a healthcheck, which may require tuning, especially
on slower systems; please open a ticket on [the issue
tracker](https://git.coopcloud.tech/coop-cloud/federatedwiki/issues) if you
notice problems with the containers starting up.
-1
View File
@@ -1 +0,0 @@
y
-1
View File
@@ -1 +0,0 @@
decaffeinated
-1
View File
@@ -1 +0,0 @@
decaffeinate
-1
View File
@@ -1 +0,0 @@
decaffeinate
-1
View File
@@ -1 +0,0 @@
decaffeinated
-6
View File
@@ -1,6 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}