From a5287eb7a280db3f3348c4374c4c50df80d922d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A4=91=ED=9B=88?= Date: Sat, 14 Nov 2015 16:53:49 +0900 Subject: [PATCH] More works for VM - moved lxc path to /home/webida/lxc to /var/lib/lxc - fixed btrfs to refer right configuration properties - fixed sudoer sample to see right btrfs util in /sbin (ubuntu default) --- src/server/conf/default-conf.js | 19 ++++++++++++++----- src/server/fs/lib/linuxfs/btrfs.js | 2 +- src/system-configs/sudoers | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/server/conf/default-conf.js b/src/server/conf/default-conf.js index f71ff02..75a5628 100755 --- a/src/server/conf/default-conf.js +++ b/src/server/conf/default-conf.js @@ -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. @@ -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 idle times @@ -362,6 +363,7 @@ var conf = { */ waitTime: 5 /* 5 secs */ }, + docker: { /* * container base image name @@ -603,6 +605,12 @@ 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'); @@ -610,6 +618,7 @@ function checkConfiguration(conf) { checkFileExists(conf.logPath, 'conf.services.fs.container.lxc.rootfsPath'); } } + } if (require.main === module) { diff --git a/src/server/fs/lib/linuxfs/btrfs.js b/src/server/fs/lib/linuxfs/btrfs.js index 6376440..d671c3f 100644 --- a/src/server/fs/lib/linuxfs/btrfs.js +++ b/src/server/fs/lib/linuxfs/btrfs.js @@ -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')); } diff --git a/src/system-configs/sudoers b/src/system-configs/sudoers index 4f23b8c..650920c 100644 --- a/src/system-configs/sudoers +++ b/src/system-configs/sudoers @@ -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 \ No newline at end of file