forked from coop-cloud/federatedwiki
Properly enable farm mode
This commit is contained in:
parent
b1ed0e6bbc
commit
b1895299dd
|
@ -4,3 +4,7 @@ DOMAIN=federatedwiki.example.com
|
||||||
## Domain aliases
|
## Domain aliases
|
||||||
#EXTRA_DOMAINS=', `www.federatedwiki.example.com`'
|
#EXTRA_DOMAINS=', `www.federatedwiki.example.com`'
|
||||||
LETS_ENCRYPT_ENV=production
|
LETS_ENCRYPT_ENV=production
|
||||||
|
|
||||||
|
COOKIE_SECRET="asflkjqpweoriuwpeogdjgbpdofigh"
|
||||||
|
AUTHOR="Baja Colorado"
|
||||||
|
PASSWORD="Please Choose a Better Password"
|
||||||
|
|
4
abra.sh
4
abra.sh
|
@ -1 +1,3 @@
|
||||||
export INSTALL_SH_VERSION=v3
|
export INSTALL_SH_VERSION=v5
|
||||||
|
export CONFIG_JSON_VERSION=v3
|
||||||
|
export CONFIG_OWNER_JSON_VERSION=v3
|
||||||
|
|
25
compose.yml
25
compose.yml
|
@ -13,19 +13,26 @@ services:
|
||||||
configs:
|
configs:
|
||||||
- source: install_sh_conf
|
- source: install_sh_conf
|
||||||
target: /home/node/config/install.sh
|
target: /home/node/config/install.sh
|
||||||
|
- source: config_json_conf
|
||||||
|
target: /home/node/config/config.json
|
||||||
|
- source: config_owner_json_conf
|
||||||
|
target: /home/node/config/config.owner.json
|
||||||
|
environment:
|
||||||
|
- DOMAIN
|
||||||
|
- COOKIE_SECRET
|
||||||
|
- AUTHOR
|
||||||
|
- PASSWORD
|
||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: on-failure
|
condition: on-failure
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=3000"
|
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=3000"
|
||||||
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
- "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}.entrypoints=web-secure"
|
||||||
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
||||||
## Redirect from EXTRA_DOMAINS to DOMAIN
|
- "traefik.http.routers.${STACK_NAME}.tls.domains[0].main=${DOMAIN}"
|
||||||
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
|
- "traefik.http.routers.${STACK_NAME}.tls.domains[0].sans=*.${DOMAIN}"
|
||||||
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
|
|
||||||
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
|
||||||
# healthcheck:
|
# healthcheck:
|
||||||
# test: ["CMD", "curl", "-f", "http://localhost"]
|
# test: ["CMD", "curl", "-f", "http://localhost"]
|
||||||
# interval: 30s
|
# interval: 30s
|
||||||
|
@ -45,3 +52,11 @@ configs:
|
||||||
install_sh_conf:
|
install_sh_conf:
|
||||||
name: ${STACK_NAME}_install_sh_${INSTALL_SH_VERSION}
|
name: ${STACK_NAME}_install_sh_${INSTALL_SH_VERSION}
|
||||||
file: install.sh
|
file: install.sh
|
||||||
|
config_json_conf:
|
||||||
|
name: ${STACK_NAME}_config_json_${CONFIG_JSON_VERSION}
|
||||||
|
file: config.json.tmpl
|
||||||
|
template_driver: golang
|
||||||
|
config_owner_json_conf:
|
||||||
|
name: ${STACK_NAME}_config_owner_json_${CONFIG_OWNER_JSON_VERSION}
|
||||||
|
file: config.owner.json.tmpl
|
||||||
|
template_driver: golang
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"admin": "{{ env "PASSWORD" }}",
|
||||||
|
"farm": true,
|
||||||
|
"cookieSecret": "{{ env "COOKIE_SECRET" }}",
|
||||||
|
"secure_cookie": true,
|
||||||
|
"security_type": "friends",
|
||||||
|
"wikiDomains": {
|
||||||
|
"$DOMAIN": {
|
||||||
|
"id": "/home/node/.wiki/config.owner.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"name": "{{ env "AUTHOR" }}",
|
||||||
|
"friend": {
|
||||||
|
"secret": "{{ env "PASSWORD" }}"
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,4 @@
|
||||||
apk --update add gettext
|
cp -n config/config.json .wiki/config.json
|
||||||
chown -R node:node .wiki
|
cp -n config/config.owner.json .wiki/config.owner.json
|
||||||
/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
|
wiki --farm --security_type=friends
|
||||||
|
|
Loading…
Reference in New Issue