Compare commits
1 Commits
2.3.0+1.1.
...
plugmatic
Author | SHA1 | Date | |
---|---|---|---|
118fea84de |
41
.drone.yml
41
.drone.yml
@ -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
|
|
23
.env.sample
23
.env.sample
@ -5,22 +5,11 @@ DOMAIN=federatedwiki.example.com
|
|||||||
#EXTRA_DOMAINS=', `www.federatedwiki.example.com`'
|
#EXTRA_DOMAINS=', `www.federatedwiki.example.com`'
|
||||||
LETS_ENCRYPT_ENV=production
|
LETS_ENCRYPT_ENV=production
|
||||||
|
|
||||||
COMPOSE_FILE="compose.yml"
|
# Predefined "owner" security
|
||||||
|
#COMPOSE_FILE="compose.yml:compose.owner.yml"
|
||||||
|
|
||||||
# Change to an absolute path to use a bind-mount, e.g. /opt/fedwiki
|
COOKIE_SECRET="asflkjqpweoriuwpeogdjgbpdofigh"
|
||||||
FEDWIKI_VOLUME="fedwiki"
|
AUTHOR="Baja Colorado"
|
||||||
|
ADMIN_KEY="<paste from a .wiki/DOMAIN/status/owner.json file>"
|
||||||
|
|
||||||
# custom wiki.cafe image, for working oauth2 support
|
FEDWIKI_IS_PRIVATE=0
|
||||||
#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"
|
|
||||||
|
@ -4,8 +4,8 @@ Share pages circulating within a creative commons
|
|||||||
|
|
||||||
<!-- metadata -->
|
<!-- metadata -->
|
||||||
* **Category**: Apps
|
* **Category**: Apps
|
||||||
* **Status**: 0, work-in-progress
|
* **Status**: ❹💣
|
||||||
* **Image**: [`dobbs/farm`](https://hub.docker.com/r/dobbs/farm/), 4, upstream
|
* **Image**: [`dobbs/farm`](https://hub.docker.com/r/dobbs/farm/), ❶💚, upstream
|
||||||
* **Healthcheck**: No
|
* **Healthcheck**: No
|
||||||
* **Backups**: No
|
* **Backups**: No
|
||||||
* **Email**: No
|
* **Email**: No
|
||||||
@ -18,9 +18,9 @@ Share pages circulating within a creative commons
|
|||||||
1. Set up Docker Swarm and [`abra`]
|
1. Set up Docker Swarm and [`abra`]
|
||||||
2. Deploy [`coop-cloud/traefik`]
|
2. Deploy [`coop-cloud/traefik`]
|
||||||
3. `abra app new federatedwiki`
|
3. `abra app new federatedwiki`
|
||||||
4. `abra app config YOURAPPDOMAIN` - be sure to change `DOMAIN` to something that resolves to
|
4. `abra app YOURAPPDOMAIN config` - be sure to change `DOMAIN` to something that resolves to
|
||||||
your Docker swarm box
|
your Docker swarm box
|
||||||
5. `abra app deploy YOURAPPDOMAIN`
|
5. `abra app YOURAPPDOMAIN deploy`
|
||||||
|
|
||||||
[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra
|
[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra
|
||||||
[`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik
|
[`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik
|
||||||
|
25
abra.sh
25
abra.sh
@ -1,2 +1,23 @@
|
|||||||
export ENTRYPOINT_SH_VERSION=v2
|
export INSTALL_SH_VERSION=v8
|
||||||
export CONFIG_INITIAL_JSON_VERSION=v1
|
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
|
||||||
|
}
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
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}"
|
|
@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
version: "3.8"
|
|
||||||
|
|
||||||
services:
|
|
||||||
app:
|
|
||||||
volumes:
|
|
||||||
- "fedwiki_lib:/home/node/lib"
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
fedwiki_lib:
|
|
15
compose.owner.yml
Normal file
15
compose.owner.yml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
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
|
@ -1,6 +0,0 @@
|
|||||||
---
|
|
||||||
version: "3.8"
|
|
||||||
|
|
||||||
services:
|
|
||||||
app:
|
|
||||||
image: git.coopcloud.tech/wiki-cafe/wiki-farm:latest
|
|
58
compose.yml
58
compose.yml
@ -3,27 +3,24 @@ version: "3.8"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: dobbs/farm:1.1.1
|
image: dobbs/farm
|
||||||
command: /bin/sh entrypoint.sh
|
command: /bin/sh config/install.sh
|
||||||
volumes:
|
volumes:
|
||||||
- "${FEDWIKI_VOLUME}:/home/node/.wiki"
|
- "fedwiki_friends:/home/node/config"
|
||||||
|
- "fedwiki:/home/node/.wiki"
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
configs:
|
configs:
|
||||||
- source: entrypoint_sh_conf
|
- source: install_sh_conf
|
||||||
target: /home/node/entrypoint.sh
|
target: /home/node/config/install.sh
|
||||||
- source: config_json_initial_conf
|
- source: config_json_conf
|
||||||
target: /home/node/initial-config/config.json
|
target: /home/node/config/config.json
|
||||||
secrets:
|
|
||||||
- cookie_secret
|
|
||||||
environment:
|
environment:
|
||||||
- DOMAIN
|
- DOMAIN
|
||||||
- COOKIE_SECRET
|
- COOKIE_SECRET
|
||||||
- AUTHOR
|
- AUTHOR
|
||||||
- ADMIN_KEY
|
- ADMIN_KEY
|
||||||
deploy:
|
deploy:
|
||||||
update_config:
|
|
||||||
order: start-first
|
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
labels:
|
labels:
|
||||||
@ -34,39 +31,26 @@ services:
|
|||||||
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
- "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].main=${DOMAIN}"
|
||||||
- "traefik.http.routers.${STACK_NAME}.tls.domains[0].sans=*.${DOMAIN}"
|
- "traefik.http.routers.${STACK_NAME}.tls.domains[0].sans=*.${DOMAIN}"
|
||||||
- "traefik.http.routers.${STACK_NAME}.priority=1"
|
# healthcheck:
|
||||||
- "caddy=https://${DOMAIN}, https://*.${DOMAIN}, https://*.*.${DOMAIN}, https://*.*.*.${DOMAIN}"
|
# test: ["CMD", "curl", "-f", "http://localhost"]
|
||||||
- "caddy.reverse_proxy={{upstreams 3000}}"
|
# interval: 30s
|
||||||
- "caddy.tls.on_demand="
|
# timeout: 10s
|
||||||
- "backupbot.backup=true"
|
# retries: 10
|
||||||
- "backupbot.backup.path=/home/node/.wiki"
|
# start_period: 1m
|
||||||
- "coop-cloud.${STACK_NAME}.version=2.3.0+1.1.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:
|
volumes:
|
||||||
fedwiki:
|
fedwiki:
|
||||||
|
fedwiki_friends:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
proxy:
|
proxy:
|
||||||
external: true
|
external: true
|
||||||
|
|
||||||
secrets:
|
|
||||||
cookie_secret:
|
|
||||||
external: true
|
|
||||||
name: ${STACK_NAME}_cookie_secret_${SECRET_COOKIE_SECRET_VERSION}
|
|
||||||
|
|
||||||
configs:
|
configs:
|
||||||
entrypoint_sh_conf:
|
install_sh_conf:
|
||||||
name: ${STACK_NAME}_entrypoint_sh_${ENTRYPOINT_SH_VERSION}
|
name: ${STACK_NAME}_install_sh_${INSTALL_SH_VERSION}
|
||||||
file: entrypoint.sh
|
file: install.sh
|
||||||
config_json_initial_conf:
|
config_json_conf:
|
||||||
name: ${STACK_NAME}_config_initial_json_${CONFIG_INITIAL_JSON_VERSION}
|
name: ${STACK_NAME}_config_json_${CONFIG_JSON_VERSION}
|
||||||
file: config.initial.json.tmpl
|
file: config.json.tmpl
|
||||||
template_driver: golang
|
template_driver: golang
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"farm": true,
|
|
||||||
"cookieSecret": "{{ secret "cookie_secret" }}",
|
|
||||||
"secure_cookie": true,
|
|
||||||
"security_type": "friends"
|
|
||||||
}
|
|
14
config.json.tmpl
Normal file
14
config.json.tmpl
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"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 }}
|
||||||
|
}
|
6
config.owner.json.tmpl
Normal file
6
config.owner.json.tmpl
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"name": "{{ env "AUTHOR" }}",
|
||||||
|
"friend": {
|
||||||
|
"secret": "{{ env "PASSWORD" }}"
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
config_file="$HOME/.wiki/${CONFIG_FILE:-config.json}"
|
|
||||||
|
|
||||||
if [ ! -f "$config_file" ]; then
|
|
||||||
cp initial-config/config.json "$config_file"
|
|
||||||
fi
|
|
||||||
|
|
||||||
wiki --farm --config "$config_file"
|
|
13
install.sh
Normal file
13
install.sh
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#!/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
|
@ -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
|
|
@ -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 +0,0 @@
|
|||||||
y
|
|
@ -1 +0,0 @@
|
|||||||
decaffeinated
|
|
Reference in New Issue
Block a user