File tree Expand file tree Collapse file tree 4 files changed +20
-27
lines changed
Expand file tree Collapse file tree 4 files changed +20
-27
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ common_param_env_vars_enabled: true
1616param_container_name : " {{ project_name }}"
1717param_usage_include_vols : true
1818param_volumes :
19- - { vol_path: "/config", vol_host_path: "/path/to/{{ project_name }}/config", desc: "Persistent config files" }
19+ - {vol_path: "/config", vol_host_path: "/path/to/{{ project_name }}/config", desc: "Persistent config files"}
2020 - {vol_path: "/data", vol_host_path: "/path/to/data", desc: "Where Wiki.js data is stored."}
2121param_usage_include_ports : true
2222param_ports :
@@ -30,6 +30,9 @@ opt_param_env_vars:
3030 - {env_var: "DB_NAME", env_value: "", desc: "DB name (postgres only)"}
3131 - {env_var: "DB_USER", env_value: "", desc: "DB username (postgres only)"}
3232 - {env_var: "DB_PASS", env_value: "", desc: "DB password (postgres only)"}
33+
34+ readonly_supported : true
35+
3336# application setup block
3437app_setup_block_enabled : true
3538app_setup_block : |
Original file line number Diff line number Diff line change @@ -21,14 +21,14 @@ port: 3000
2121# - sqlite = SQLite 3.9 or later
2222
2323db :
24- type : {{ DB_TYPE}}
24+ type : $( DB_TYPE)
2525
2626 # PostgreSQL / MySQL / MariaDB / MS SQL Server only:
27- host : {{ DB_HOST}}
28- port : {{ DB_PORT}}
29- user : {{ DB_USER}}
30- pass : {{ DB_PASS}}
31- db : {{ DB_NAME}}
27+ host : ' $( DB_HOST) '
28+ port : $( DB_PORT)
29+ user : ' $( DB_USER) '
30+ pass : ' $( DB_PASS) '
31+ db : $( DB_NAME)
3232 ssl : false
3333
3434 # Optional - PostgreSQL / MySQL / MariaDB only:
Original file line number Diff line number Diff line change 11#!/usr/bin/with-contenv bash
22# shellcheck shell=bash
33
4- mkdir -p /data
5-
6- DB_TYPE=${DB_TYPE:-sqlite}
7- DB_HOST=${DB_HOST:-mariadb}
8- DB_PORT=${DB_PORT:-3306}
9- DB_USER=${DB_USER:-root}
10- DB_PASS=${DB_PASS:-root}
11- DB_NAME=${DB_NAME:-wikijs}
4+ if [[ -z ${DB_TYPE} ]]; then
5+ printf "sqlite" > /run/s6/container_environment/DB_TYPE
6+ fi
127
138if [[ ! -f "/config/config.yml" ]]; then
149 cp /defaults/config.yml /config/config.yml
15-
16- sed -i "s|{{DB_TYPE}}|"${DB_TYPE}"|g" /config/config.yml
17- sed -i "s|{{DB_HOST}}|"${DB_HOST}"|g" /config/config.yml
18- sed -i "s|{{DB_PORT}}|"${DB_PORT}"|g" /config/config.yml
19- sed -i "s|{{DB_USER}}|"${DB_USER}"|g" /config/config.yml
20- sed -i "s|{{DB_PASS}}|"${DB_PASS}"|g" /config/config.yml
21- sed -i "s|{{DB_NAME}}|"${DB_NAME}"|g" /config/config.yml
2210fi
2311
24- ln -sf /config/config.yml /app/wiki/config.yml
25-
2612# permissions
2713lsiown -R abc:abc \
28- /app/wiki/data \
2914 /config
30- lsiown abc:abc \
31- /data
15+
16+ if grep -qe ' /data ' /proc/mounts; then
17+ lsiown abc:abc \
18+ /data
19+ fi
Original file line number Diff line number Diff line change 11#!/usr/bin/with-contenv bash
22# shellcheck shell=bash
33
4+ export CONFIG_FILE="/config/config.yml"
5+
46exec \
57 s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 3000" \
68 cd /app/wiki s6-setuidgid abc /usr/bin/node server
You can’t perform that action at this time.
0 commit comments