Make predefined "owner" security optional

This commit is contained in:
3wc 2021-08-13 00:30:25 +02:00
parent b1895299dd
commit f6e7eaa6f7
6 changed files with 32 additions and 11 deletions

View File

@ -5,6 +5,9 @@ DOMAIN=federatedwiki.example.com
#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"
PASSWORD="Please Choose a Better Password"

View File

@ -1,3 +1,3 @@
export INSTALL_SH_VERSION=v5
export CONFIG_JSON_VERSION=v3
export INSTALL_SH_VERSION=v7
export CONFIG_JSON_VERSION=v6
export CONFIG_OWNER_JSON_VERSION=v3

15
compose.owner.yml Normal file
View 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

View File

@ -15,8 +15,6 @@ services:
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
@ -56,7 +54,3 @@ configs:
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

View File

@ -3,10 +3,12 @@
"farm": true,
"cookieSecret": "{{ env "COOKIE_SECRET" }}",
"secure_cookie": true,
"security_type": "friends",
"security_type": "friends"
{{ if eq (env "FEDAWIKI_IS_PRIVATE") "1" }},
"wikiDomains": {
"$DOMAIN": {
"id": "/home/node/.wiki/config.owner.json"
}
}
{{ end }}
}

View File

@ -1,4 +1,11 @@
cp -n config/config.json .wiki/config.json
cp -n config/config.owner.json .wiki/config.owner.json
#!/bin/sh
if [ ! -f .wiki/config.json ]; then
cp config/config.json .wiki/config.json
fi
if [ ! -f .wiki/config.owner.json ]; then
cp -n config/config.owner.json .wiki/config.owner.json
fi
wiki --farm --security_type=friends