keep config.js in config/

and persist it via various docker mechanisms
pull/1/head
ansuz 6 years ago
parent 10e162e7e3
commit 744f212b26

@ -7,6 +7,7 @@ ENV STORAGE=\'./storage/file\'
ENV LOG_TO_STDOUT=true ENV LOG_TO_STDOUT=true
# Persistent storage needs # Persistent storage needs
VOLUME /cryptpad/config
VOLUME /cryptpad/datastore VOLUME /cryptpad/datastore
VOLUME /cryptpad/customize VOLUME /cryptpad/customize
VOLUME /cryptpad/blobstage VOLUME /cryptpad/blobstage

@ -4,10 +4,7 @@
mkdir -p customize mkdir -p customize
# Copying default config # Copying default config
[ ! -h customize/config.js ] && echo "Creating config.js" && cp config.example.js customize/config.js [ ! -f config/config.js ] && echo "Creating config.js" && cp config/config.example.js config/config.js
# Linking config.js
[ ! -h config.js ] && echo "Linking config.js" && ln -s customize/config.js config.js
# Thanks to http://stackoverflow.com/a/10467453 # Thanks to http://stackoverflow.com/a/10467453
sedeasy() { sedeasy() {

@ -26,3 +26,4 @@ services:
- ./data/blobstage:/cryptpad/blobstage:rw - ./data/blobstage:/cryptpad/blobstage:rw
- ./data/tasks:/cryptpad/tasks:rw - ./data/tasks:/cryptpad/tasks:rw
- ./data/block:/cryptpad/block:rw - ./data/block:/cryptpad/block:rw
- ./data/config:/cryptpad/config:rw

@ -13,10 +13,10 @@ var nThen = require("nthen");
var config; var config;
try { try {
config = require('./config'); config = require('./config/config');
} catch (e) { } catch (e) {
console.log("You can customize the configuration by copying config.example.js to config.js"); console.log("You can customize the configuration by copying config/config.example.js to config/config.js");
config = require('./config.example'); config = require('./config/config.example');
} }
var websocketPort = config.websocketPort || config.httpPort; var websocketPort = config.websocketPort || config.httpPort;
var useSecureWebsockets = config.useSecureWebsockets || false; var useSecureWebsockets = config.useSecureWebsockets || false;

Loading…
Cancel
Save