Compare commits

..
24 Commits
Author SHA1 Message Date
3wordchant 8807f46e7c chore: publish 2.2.2+1.0.29 release 2025-02-03 23:22:34 -05:00
3wordchant 19b698087e Disable healthcheck for now 2025-02-03 23:22:10 -05:00
3wordchant 58c8bba02e chore: publish 2.2.1+1.0.29 release 2025-02-03 23:21:48 -05:00
cas a304f89042 Update .drone.yml 2025-01-08 10:09:12 -08:00
3wordchant 27f81a3e81 chore: publish 2.2.0+1.0.28 release 2024-09-24 16:03:02 -04:00
3wordchant b849a3b536 Drop separate lib volume for now 2024-09-24 15:11:46 -04:00
3wordchant 2ac052366a Add support for specifying config file location 2024-09-24 15:08:10 -04:00
Bortseb 61e96089f1 chore: publish 2.1.7+1.0.28 release 2024-09-17 20:48:18 +00:00
Bortseb 6790fa45af chore: publish 2.1.6+1.0.28 release 2024-09-17 19:50:55 +00:00
3wordchant 1a1384177a chore: publish 2.1.5+1.0.27 release 2024-08-06 13:36:24 -04:00
3wordchant bec1a54581 chore: publish 2.1.4+1.0.26 release 2024-07-23 12:52:30 -04:00
3wordchant c3e117bcdf chore: publish 2.1.3+1.0.26 release 2024-07-23 12:43:06 -04:00
3wordchant 866c46f20d chore: publish 2.1.2+1.0.26 release 2024-06-11 11:27:24 -05:00
3wordchant caa49701a9 chore: publish 2.1.1+1.0.25 release 2024-05-12 14:14:45 -03:00
3wordchant a8fe024635 chore: publish 2.1.0+1.0.24 release 2024-04-05 11:48:01 -03:00
3wordchant ce991f453e Add compose.insecure.yml 2024-04-05 11:46:38 -03:00
3wordchant b302384ad0 chore: publish 2.0.4+1.0.24 release 2024-04-05 11:28:58 -03:00
3wordchant 5d55c3e70d chore: publish 2.0.3+1.0.22 release 2024-02-27 14:26:07 -03:00
3wordchant 53ab8dbf39 chore: publish 2.0.2+1.0.21 release 2023-11-22 17:15:54 +00:00
3wordchant a7bda15182 chore: publish 2.0.1+1.0.20 release 2023-10-09 11:08:21 +01:00
3wordchant d080b8c09b Fix healthcheck 2023-10-09 11:08:01 +01:00
3wordchant a93358bd68 chore: publish 2.0.0+1.0.20 release 2023-10-09 10:46:55 +01:00
3wordchant 3a0d30da6a Tidy up, add healthcheck 2023-10-08 16:57:08 +01:00
3wordchant 2da198b21b chore: publish 1.0.2+1.0.19 release 2023-10-05 22:51:28 +01:00
15 changed files with 165 additions and 55 deletions
+41
View File
@@ -0,0 +1,41 @@
---
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
+26
View File
@@ -0,0 +1,26 @@
TYPE=federatedwiki
DOMAIN=federatedwiki.example.com
## Domain aliases
#EXTRA_DOMAINS=', `www.federatedwiki.example.com`'
LETS_ENCRYPT_ENV=production
COMPOSE_FILE="compose.yml"
# Change to an absolute path to use a bind-mount, e.g. /opt/fedwiki
FEDWIKI_VOLUME="fedwiki"
# custom wiki.cafe image, for working oauth2 support
#COMPOSE_FILE="$COMPOSE_FILE:compose.wikicafe.yml"
# persistent lib volume / node_modules directory, e.g. for plugmatic
#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
# Disable SSL encryption (not recommended)
#COMPOSE_FILE="$COMPOSE_FILE:compose.insecure.yml"
CONFIG_FILE="config.json"
+1 -1
View File
@@ -1 +1 @@
.env*
/.envrc
+21 -19
View File
@@ -1,24 +1,26 @@
# Fedwiki
# Federated Wiki
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/).
Share pages circulating within a creative commons
<!-- metadata -->
* **Category**: Apps
* **Status**: 0, work-in-progress
* **Image**: [`dobbs/farm`](https://hub.docker.com/r/dobbs/farm/), 4, upstream
* **Healthcheck**: No
* **Backups**: No
* **Email**: No
* **Tests**: No
* **SSO**: No
<!-- 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 and [`abra`]
2. Deploy [`coop-cloud/traefik`]
3. `abra app new federatedwiki`
4. `abra app config YOURAPPDOMAIN` - be sure to change `DOMAIN` to something that resolves to
your Docker swarm box
5. `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
```
[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra
[`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik
+2
View File
@@ -0,0 +1,2 @@
export ENTRYPOINT_SH_VERSION=v2
export CONFIG_INITIAL_JSON_VERSION=v1
+11
View File
@@ -0,0 +1,11 @@
---
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}`)"
- "traefik.http.routers.${STACK_NAME}-non-tls.entrypoints=web"
- "caddy=https://${DOMAIN}, https://*.${DOMAIN}, https://*.*.${DOMAIN}, https://*.*.*.${DOMAIN}, http://${DOMAIN}, http://*.${DOMAIN}, http://*.*.${DOMAIN}, http://*.*.*.${DOMAIN}"
-7
View File
@@ -1,7 +0,0 @@
services:
app:
volumes:
- "lib:/home/node/lib"
volumes:
lib:
+10
View File
@@ -0,0 +1,10 @@
---
version: "3.8"
services:
app:
volumes:
- "fedwiki_lib:/home/node/lib"
volumes:
fedwiki_lib:
+6
View File
@@ -0,0 +1,6 @@
---
version: "3.8"
services:
app:
image: git.coopcloud.tech/wiki-cafe/wiki-farm:latest
+21 -23
View File
@@ -1,9 +1,12 @@
---
version: "3.8"
services:
app:
image: git.coopcloud.tech/wiki-cafe/fedwiki-oci-image:0.41.1-3
image: dobbs/farm:1.0.29
command: /bin/sh entrypoint.sh
volumes:
- "data:/home/node/.wiki"
- "${FEDWIKI_VOLUME}:/home/node/.wiki"
networks:
- proxy
configs:
@@ -15,7 +18,6 @@ services:
- cookie_secret
environment:
- DOMAIN
- DOMAINS
- COOKIE_SECRET
- AUTHOR
- ADMIN_KEY
@@ -33,27 +35,23 @@ services:
- "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/*"
- "caddy_0.reverse_proxy= @match {{upstreams 3000}}"
- ${DOMAINS}
- "caddy_1.reverse_proxy={{upstreams 3000}}"
- "caddy_1.tls.on_demand="
- "caddy=https://${DOMAIN}, https://*.${DOMAIN}, https://*.*.${DOMAIN}, https://*.*.*.${DOMAIN}"
- "caddy.reverse_proxy={{upstreams 3000}}"
- "caddy.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
- "coop-cloud.${STACK_NAME}.version=2.2.2+1.0.29"
# 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:
fedwiki:
networks:
proxy:
@@ -62,13 +60,13 @@ networks:
secrets:
cookie_secret:
external: true
name: ${STACK_NAME}_cookie_secret
name: ${STACK_NAME}_cookie_secret_${SECRET_COOKIE_SECRET_VERSION}
configs:
entrypoint_sh_conf:
name: ${STACK_NAME}_entrypoint_sh
name: ${STACK_NAME}_entrypoint_sh_${ENTRYPOINT_SH_VERSION}
file: entrypoint.sh
config_json_initial_conf:
name: ${STACK_NAME}_config_initial_json
name: ${STACK_NAME}_config_initial_json_${CONFIG_INITIAL_JSON_VERSION}
file: config.initial.json.tmpl
template_driver: golang
+2 -2
View File
@@ -1,6 +1,6 @@
{
"farm": true,
"cookieSecret": "{{ secret "cookie_secret" }}",
"security_useHttps": true,
"secure_cookie": true,
"security_type": "friends"
}
}
+5 -3
View File
@@ -1,7 +1,9 @@
#!/bin/sh
if [ ! -f .wiki/config.json ]; then
cp config/config.json .wiki/config.json
config_file="$HOME/.wiki/${CONFIG_FILE:-config.json}"
if [ ! -f "$config_file" ]; then
cp initial-config/config.json "$config_file"
fi
wiki --farm
wiki --farm --config "$config_file"
+7
View File
@@ -0,0 +1,7 @@
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
@@ -0,0 +1,11 @@
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
@@ -0,0 +1 @@
y