Compare commits

..

44 Commits

Author SHA1 Message Date
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 c35e2802c7558226a319ad6a6d9e90c9b73a23fe.
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
3wc
e90183f153 chore: publish 1.0.1+1.0.18 release 2023-08-22 19:15:13 +02:00
3wc
03cdb435dd Remove HTTP 2023-08-22 19:14:04 +02:00
3wc
33a740929d chore: publish 1.0.0+1.0.18 release 2023-08-22 18:50:50 +02:00
3wc
98ef8f18d3 Add configurable bind-mount option 2023-08-22 18:48:13 +02:00
3wc
b28d08551e chore: publish 0.2.10+1.0.18 release 2023-08-22 18:04:25 +02:00
3wc
7e15af4875 Further Caddy tweaking 2023-08-20 16:29:53 +02:00
3wc
b0a737d69e Attempt to appease caddy 2023-08-20 00:43:38 +02:00
3wc
45d76b05f6 Fix caddy label 2023-08-20 00:38:20 +02:00
3wc
6804752d3b Hard-code CADDYFILE 2023-08-20 00:21:54 +02:00
3wc
fc95658dba Add Caddy labels 2023-08-20 00:16:41 +02:00
a1cdd385b4 chore: publish 0.2.9+1.0.17 release 2023-06-21 18:18:42 -04:00
5ecc26589b chore: publish 0.2.8+1.0.17 release 2023-06-21 18:09:06 -04:00
c58712f63f chore: publish 0.2.7+1.0.17 release 2023-06-21 18:07:34 -04:00
9ba3d0bc3f chore: publish 0.2.6+1.0.17 release 2023-06-21 18:06:21 -04:00
6e8c37c2a6 chore: publish 0.2.5+1.0.17 release 2023-06-21 17:51:42 -04:00
c60645a61d chore: publish 0.2.4+1.0.17 release 2023-06-21 17:51:12 -04:00
cfee2399cf chore: publish 0.2.3+1.0.17 release 2023-06-21 17:41:58 -04:00
f19a20f880 chore: publish 0.2.2+1.0.17 release 2023-06-21 17:31:55 -04:00
3wc
0633d72d7d chore: publish 0.2.1+1.0.16 release 2023-06-20 18:22:40 +01:00
3wc
0e24c78541 chore: publish 0.2.0+1.0.13 release 2023-06-20 18:22:09 +01:00
3wc
32559a5aea Make custom wikicafe image optional, non-default 2023-06-20 18:21:43 +01:00
3wc
efebc41519 Switch to self-hosted stack-ssh-deploy image [mass update] 2023-01-21 11:49:55 -08:00
3wc
0a21e11116 Add drone configs / secrets [mass update] 2023-01-20 21:32:06 -08:00
3wc
8454597fca Add CI and catalogue generation [mass update] 2023-01-20 10:45:03 -08:00
3wc
caa7b8a02e Update abra syntax in examples (finally) [mass update] 2023-01-19 16:02:27 -08:00
3wc
3b6879415f Add optional compose file for lib persistence 2022-12-29 11:56:42 -08:00
3wc
777cb6263e Fix image path 2022-12-07 19:30:47 -08:00
3wc
23c2238460 Switch to our forked image 2022-12-07 19:21:59 -08:00
3wc
07e57c5022 Add backupbot config 2022-10-18 17:28:22 -04:00
3wc
139f829935 chore: publish 0.1.0+1.0.13 release 2022-09-27 14:36:18 -04:00
3wc
111feee4be Reduce priority of wiki routing rules 2022-09-27 14:15:44 -04:00
3wc
3191cf861f Switch back to Eric's (newer) Fedwiki image 2022-09-27 14:04:59 -04:00
3wc
4e1f67418a Goodbye, emojis! 😢
[ci skip]
2021-11-23 12:19:04 +02:00
3wc
a5c1567138 Use own docker image temporarily 2021-10-23 15:27:48 +02:00
13 changed files with 114 additions and 164 deletions

View File

@ -1,15 +0,0 @@
TYPE=federatedwiki
DOMAIN=federatedwiki.example.com
## Domain aliases
#EXTRA_DOMAINS=', `www.federatedwiki.example.com`'
LETS_ENCRYPT_ENV=production
# Predefined "owner" security
#COMPOSE_FILE="compose.yml:compose.owner.yml"
COOKIE_SECRET="asflkjqpweoriuwpeogdjgbpdofigh"
AUTHOR="Baja Colorado"
ADMIN_KEY="<paste from a .wiki/DOMAIN/status/owner.json file>"
FEDWIKI_IS_PRIVATE=0

2
.gitignore vendored
View File

@ -1 +1 @@
/.envrc .env*

View File

@ -1,26 +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/).
<!-- metadata -->
* **Category**: Apps
* **Status**: ❹💣
* **Image**: [`dobbs/farm`](https://hub.docker.com/r/dobbs/farm/), ❶💚, upstream
* **Healthcheck**: No
* **Backups**: No
* **Email**: No
* **Tests**: No
* **SSO**: No
<!-- endmetadata -->
## Basic usage ## Deploying the app with Docker Swarm
1. Set up Docker Swarm and [`abra`] Set the environment variables from the .env file during the shell session.
2. Deploy [`coop-cloud/traefik`]
3. `abra app new federatedwiki`
4. `abra app YOURAPPDOMAIN config` - be sure to change `DOMAIN` to something that resolves to
your Docker swarm box
5. `abra app YOURAPPDOMAIN deploy`
[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra ```
[`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik 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 -c compose.lib.yaml -c compose.wikicafe.yaml
```

23
abra.sh
View File

@ -1,23 +0,0 @@
export INSTALL_SH_VERSION=v8
export CONFIG_JSON_VERSION=v7
export CONFIG_OWNER_JSON_VERSION=v4
abra_backup_app() {
_abra_backup_dir "app:/home/node/.wiki"
}
abra_restore_app() {
# shellcheck disable=SC2034
{
abra__src_="-"
abra__dst_="app:/home/node/.wiki"
}
zcat "$@" | sub_app_cp
success "Restored 'app'"
}
abra_backup() {
abra_backup_app
}

7
compose.lib.yaml Normal file
View File

@ -0,0 +1,7 @@
services:
app:
volumes:
- "lib:/home/node/lib"
volumes:
lib:

View File

@ -1,15 +0,0 @@
---
version: "3.8"
services:
app:
configs:
- source: config_owner_json_conf
target: /home/node/config/config.owner.json
configs:
config_owner_json_conf:
name: ${STACK_NAME}_config_owner_json_${CONFIG_OWNER_JSON_VERSION}
file: config.owner.json.tmpl
template_driver: golang

74
compose.yaml Normal file
View File

@ -0,0 +1,74 @@
services:
app:
image: dobbs/farm:1.1.0
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

View File

@ -1,56 +0,0 @@
---
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
- source: config_json_conf
target: /home/node/config/config.json
environment:
- DOMAIN
- COOKIE_SECRET
- AUTHOR
- ADMIN_KEY
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}`) || 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}"
# 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
config_json_conf:
name: ${STACK_NAME}_config_json_${CONFIG_JSON_VERSION}
file: config.json.tmpl
template_driver: golang

6
config.initial.json.tmpl Normal file
View File

@ -0,0 +1,6 @@
{
"farm": true,
"cookieSecret": "{{ secret "cookie_secret" }}",
"secure_cookie": true,
"security_type": "friends"
}

View File

@ -1,14 +0,0 @@
{
"admin": "{{ env "ADMIN_KEY" }}",
"farm": true,
"cookieSecret": "{{ env "COOKIE_SECRET" }}",
"secure_cookie": true,
"security_type": "friends"
{{ if eq (env "FEDWIKI_IS_PRIVATE") "1" }},
"wikiDomains": {
"$DOMAIN": {
"id": "/home/node/.wiki/config.owner.json"
}
}
{{ end }}
}

View File

@ -1,6 +0,0 @@
{
"name": "{{ env "AUTHOR" }}",
"friend": {
"secret": "{{ env "PASSWORD" }}"
}
}

7
entrypoint.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/sh
if [ ! -f .wiki/config.json ]; then
cp config/config.json .wiki/config.json
fi
wiki --farm

View File

@ -1,13 +0,0 @@
#!/bin/sh
npm install wiki-plugin-plugmatic
if [ ! -f .wiki/config.json ]; then
cp config/config.json .wiki/config.json
fi
if [ ! -f .wiki/config.owner.json ]; then
cp config/config.owner.json .wiki/config.owner.json
fi
wiki --farm --security_type=friends