File tree 3 files changed +21
-1
lines changed
3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -160,3 +160,16 @@ Path inside container for user specified key file. Example: '/path/to/key'
160
160
Note: single quotes are part of the value and mandatory!
161
161
162
162
if HTTPS_PORT is set and KEY_PATH not given, a self-signed certificate and key will be generated automatically.
163
+
164
+ #### Configuration
165
+
166
+ xo-server configuration inside container is generated only once based on variables if config file is missing.
167
+
168
+ If you wish to customize the xo-server configuration file manually. Mount some directory to ` /etc/xo-server ` path inside container, eq:
169
+
170
+ ```
171
+ docker run -itd -p 80:80 -v /path/to/xo-config:/etc/xo-server ronivay/xen-orchestra
172
+ ```
173
+
174
+ Once container has started for the first time, you'll now have a configuration file at ` /path/to/xo-config/config.toml ` which you can edit.
175
+ Restarting container will apply the modified configuration.
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ services:
27
27
volumes :
28
28
- xo-data:/var/lib/xo-server
29
29
- redis-data:/var/lib/redis
30
+ # to preserve xo-server config on host dir after generated by container
31
+ # - /path/to/config:/etc/xo-server
30
32
# mount certificate files to container if HTTPS is set with cert/key paths
31
33
# - /path/to/cert.pem:/cert.pem
32
34
# - /path/to/cert.key:/cert.key
Original file line number Diff line number Diff line change @@ -10,9 +10,13 @@ function StopProcesses {
10
10
exit 0
11
11
}
12
12
13
+
14
+ if [[ ! -f /etc/xo-server/config.toml ]]; then
13
15
# generate configuration
14
16
set -a
15
17
18
+ [[ ! -d /etc/xo-server ]] && mkdir /etc/xo-server
19
+
16
20
HTTP_PORT=${HTTP_PORT:- " 80" }
17
21
CERT_PATH=${CERT_PATH:- \' ./ temp-cert.pem\' }
18
22
KEY_PATH=${KEY_PATH:- \' ./ temp-key.pem\' }
@@ -22,10 +26,11 @@ import sys
22
26
import jinja2
23
27
sys.stdout.write(
24
28
jinja2.Template(sys.stdin.read()
25
- ).render(env=os.environ))' < /xo-server.toml.j2 > /etc/xen-orchestra/packages/ xo-server/.xo-server .toml
29
+ ).render(env=os.environ))' < /xo-server.toml.j2 > /etc/xo-server/config .toml
26
30
27
31
set +a
28
32
# start services
33
+ fi
29
34
30
35
trap StopProcesses EXIT TERM
31
36
You can’t perform that action at this time.
0 commit comments