diff --git a/setup/start.sh b/setup/start.sh index 0e44d7ac4..9c3c9faf8 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -149,9 +149,8 @@ fi systemctl start nginx echo "==> Configuring proftpd" -# link nginx config to system config -unlink /etc/proftpd/proftpd.conf 2>/dev/null || rm -rf /etc/proftpd/proftpd.conf -ln -s "${PLATFORM_DATA_DIR}/proftpd.conf" /etc/proftpd/proftpd.conf +cp "${script_dir}/start/proftpd.conf" /etc/proftpd/proftpd.conf +systemctl restart proftpd # restart mysql to make sure it has latest config if [[ ! -f /etc/mysql/mysql.cnf ]] || ! diff -q "${script_dir}/start/mysql.cnf" /etc/mysql/mysql.cnf >/dev/null; then diff --git a/src/proftpd.ejs b/setup/start/proftpd.conf similarity index 93% rename from src/proftpd.ejs rename to setup/start/proftpd.conf index 55e3d383c..2c085ed75 100644 --- a/src/proftpd.ejs +++ b/setup/start/proftpd.conf @@ -88,16 +88,16 @@ WtmpLog off LoadModule mod_ldap.c # https://forums.proftpd.org/smf/index.php?topic=6368.0 - LDAPServer "<%= ldapUrl %>/??sub" - LDAPBindDN "<%= ldapBindUsername %>" "<%= ldapBindPassword %>" - LDAPUsers "<%= ldapUsersBaseDn %>" (username=%u) + LDAPServer "ldap://localhost:3002/??sub" + LDAPBindDN "cn=admin@cloudron,ou=proftpd,dc=cloudron" "password" + LDAPUsers "ou=proftpd,dc=cloudron" (username=%u) LDAPLog /var/log/proftpd/ldap.log SFTPEngine on - Port <%= sftpPort %> + Port 222 SFTPLog /var/log/proftpd/sftp.log # Configure both the RSA and DSA host keys, using the same host key diff --git a/src/paths.js b/src/paths.js index 0c04ac4e5..6384ddf31 100644 --- a/src/paths.js +++ b/src/paths.js @@ -25,7 +25,6 @@ exports = module.exports = { UPDATE_DIR: path.join(config.baseDir(), 'platformdata/update'), SNAPSHOT_INFO_FILE: path.join(config.baseDir(), 'platformdata/backup/snapshot-info.json'), DYNDNS_INFO_FILE: path.join(config.baseDir(), 'platformdata/dyndns-info.json'), - PROFTPD_CONFIG_FILE: path.join(config.baseDir(), 'platformdata/proftpd.conf'), // this is not part of appdata because an icon may be set before install APP_ICONS_DIR: path.join(config.baseDir(), 'boxdata/appicons'), diff --git a/src/platform.js b/src/platform.js index bc7ce1159..60ced0cb0 100644 --- a/src/platform.js +++ b/src/platform.js @@ -13,7 +13,6 @@ var addons = require('./addons.js'), assert = require('assert'), async = require('async'), debug = require('debug')('box:platform'), - ejs = require('ejs'), fs = require('fs'), graphs = require('./graphs.js'), infra = require('./infra_version.js'), @@ -28,8 +27,6 @@ var addons = require('./addons.js'), var NOOP_CALLBACK = function (error) { if (error) debug(error); }; -var PROFTPD_CONFIG_EJS = fs.readFileSync(__dirname + '/proftpd.ejs', { encoding: 'utf8' }); - function start(callback) { assert.strictEqual(typeof callback, 'function'); @@ -63,7 +60,6 @@ function start(callback) { startApps.bind(null, existingInfra), graphs.startGraphite.bind(null, existingInfra), addons.startServices.bind(null, existingInfra), - configureProftpd.bind(null, existingInfra), fs.writeFile.bind(fs, paths.INFRA_VERSION_FILE, JSON.stringify(infra, null, 4)) ], function (error) { if (error) return callback(error); @@ -167,19 +163,3 @@ function startApps(existingInfra, callback) { callback(); } } - -function configureProftpd(existingInfra, callback) { - var data = { - sftpPort: 222, - ldapUrl: 'ldap://172.18.0.1:3002', - ldapUsersBaseDn: 'ou=proftpd,dc=cloudron', - ldapBindUsername: 'cn=admin@cloudron,ou=proftpd,dc=cloudron', - ldapBindPassword: 'password' - }; - - console.log('------ configure proftpd', data, paths.PROFTPD_CONFIG_FILE); - - if (!safe.fs.writeFileSync(paths.PROFTPD_CONFIG_FILE, ejs.render(PROFTPD_CONFIG_EJS, data))) return callback(safe.error); - - callback(null); -}