Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions src/server/conf/default-conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,11 @@ var conf = {
linuxfs: 'default',

container: {
type: 'lxc', // support type: ['none', 'lxc', 'lxcd', 'docker']
type: 'lxc', // support type: ['none', 'lxc', 'docker'], do not use lxcd (deprecated)
userid: 'webida',
namePrefix: 'webida-',
lxc: {
confPath: process.env.WEBIDA_CONTAINER_CONFIG_PATH || WEBIDA_HOME + '/lxc/webida/config',
rootfsPath: process.env.WEBIDA_CONTAINER_ROOTFS_PATH || WEBIDA_HOME + '/lxc/webida/rootfs',
confPath: process.env.WEBIDA_CONTAINER_CONFIG_PATH || '/var/lib/lxc/webida/config',
// Evey container has it's own IP.
// If you are running webida in VM or your host is using 10.x.y.z IP,
// 0) Assign valid base, gw, ip range value.
Expand All @@ -347,9 +346,11 @@ var conf = {
gw: '10.0.0.1' /* gateway */
}
},

// deprecated. do not enable this type if you don't know what's next to enable this one.
lxcd: {
confPath: process.env.WEBIDA_CONTAINER_CONFIG_PATH || WEBIDA_HOME + '/lxc/webida/config',
rootfsPath: process.env.WEBIDA_CONTAINER_ROOTFS_PATH || WEBIDA_HOME + '/lxc/webida/rootfs',
confPath: process.env.WEBIDA_CONTAINER_CONFIG_PATH || '/var/lib/lxc/webida/config',
rootfsPath: process.env.WEBIDA_CONTAINER_ROOTFS_PATH ||'/var/lib/lxc/webida/rootfs',
/*
* lxc container expire time
* - stop lxc container after <expire> idle times
Expand All @@ -362,6 +363,7 @@ var conf = {
*/
waitTime: 5 /* 5 secs */
},

docker: {
/*
* container base image name
Expand Down Expand Up @@ -603,13 +605,20 @@ function checkConfiguration(conf) {

checkDirExists(conf.logPath, 'conf.logPath');

if (conf.signup.allowSignup) {
if(conf.signup.emailHost === 'your.smtp.server') {
console.warn('conf.signup.emailHost is not configured. New users will not receive an activation mail.');
}
}

// TODO : add more configuration properties
if (conf.services.fs.container.type === 'lxc') {
checkFileExists(conf.logPath, 'conf.services.fs.container.lxc.confPath');
if (conf.services.fs.container.lxc.rootfsPath) {
checkFileExists(conf.logPath, 'conf.services.fs.container.lxc.rootfsPath');
}
}

}

if (require.main === module) {
Expand Down
2 changes: 1 addition & 1 deletion src/server/fs/lib/linuxfs/btrfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function createFS(fsid, callback) {
cmdProc.on('exit', function (code, signal) {
logger.info('EXIT', fsid, cmdProc.pid, code, signal);
if (code === 0) {
setQuotaLimit(fsid, config.fsPolicy.fsQuotaInBytes, callback);
setQuotaLimit(fsid, config.services.fs.fsPolicy.fsQuotaInBytes, callback);
} else {
callback(new Error('EXIT with error'));
}
Expand Down
2 changes: 1 addition & 1 deletion src/system-configs/sudoers
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Allow webida to handle webida service
# add this file to /etc/sudoers.d

webida ALL = (root) NOPASSWD: /usr/bin/lxc-execute, /usr/local/bin/btrfs, /usr/sbin/xfs_quota, /usr/bin/rsync, /bin/kill
webida ALL = (root) NOPASSWD: /usr/bin/lxc-execute, /sbin/btrfs, /usr/sbin/xfs_quota, /usr/bin/rsync, /bin/kill