فهرست منبع

Remove supervisor

Johannes Zellner 9 سال پیش
والد
کامیت
9079cf4b54
4فایلهای تغییر یافته به همراه2 افزوده شده و 105 حذف شده
  1. 0 79
      ftp.js
  2. 2 4
      start.sh
  3. 0 12
      supervisor/apache2.conf
  4. 0 10
      supervisor/ftp.conf

+ 0 - 79
ftp.js

@@ -1,79 +0,0 @@
-var ftpd = require('ftpd'),
-    fs = require('fs'),
-    superagent = require('superagent'),
-    path = require('path');
-
-var simpleAuth = process.env.SIMPLE_AUTH_URL && process.env.SIMPLE_AUTH_CLIENT_ID && process.env.API_ORIGIN;
-
-function verifyUser(username, password, callback) {
-    if (!simpleAuth) {
-        if (username === 'test' && password === 'test') return callback(null);
-        else return callback(new Error('auth failed'));
-    }
-
-    var authPayload = {
-        clientId: process.env.SIMPLE_AUTH_CLIENT_ID,
-        username: username,
-        password: password
-    };
-
-    superagent.post(process.env.SIMPLE_AUTH_URL + '/api/v1/login').send(authPayload).end(function (error, result) {
-        if (error && error.status === 401) return callback(new Error('auth failed'));
-        if (error) return callback(wrapRestError(error));
-        if (result.status !== 200) return callback(new Error('auth failed'));
-
-        callback(null);
-    });
-}
-
-var server;
-var options = {
-    host: '0.0.0.0',
-    port: process.env.FTP_PORT || 7002,
-    tls: null,
-};
-
-server = new ftpd.FtpServer(options.host, {
-    getInitialCwd: function() {
-      return '/';
-    },
-    getRoot: function() {
-      return '/app/data/public';
-    },
-    pasvPortRangeStart: process.env.FTP_PORT_PASV_0 || 7003,
-    pasvPortRangeEnd: process.env.FTP_PORT_PASV_3 || 7006,
-    tlsOptions: options.tls,
-    allowUnauthorizedTls: true,
-    useWriteFile: false,
-    useReadFile: false
-});
-
-server.on('error', function(error) {
-    console.log('FTP Server error:', error);
-});
-
-server.on('client:connected', function(connection) {
-    var username = null;
-    console.log('client connected: ' + connection.remoteAddress);
-    connection.on('command:user', function(user, success, failure) {
-        if (user) {
-            username = user;
-            success();
-        } else {
-            failure();
-        }
-    });
-
-    connection.on('command:pass', function(password, success, failure) {
-        if (!password) return failure();
-
-        verifyUser(username, password, function (error) {
-            if (error) failure();
-            else success(username);
-        });
-    });
-});
-
-server.debugging = 4;
-server.listen(options.port);
-console.log('Listening on port ' + options.port);

+ 2 - 4
start.sh

@@ -19,9 +19,7 @@ sed -e "s@AuthLDAPURL .*@AuthLDAPURL ${LDAP_URL}/${LDAP_USERS_BASE_DN}?username?
 
 chown -R www-data:www-data /app/data /run
 
-echo "Cleanup apache pid"
+echo "Starting apache"
 APACHE_CONFDIR="" source /etc/apache2/envvars
 rm -f "${APACHE_PID_FILE}"
-
-echo "Starting supervisor"
-exec /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon -i lamp
+exec /usr/sbin/apache2 -DFOREGROUND

+ 0 - 12
supervisor/apache2.conf

@@ -1,12 +0,0 @@
-[program:apache2]
-autorestart=true
-autostart=true
-user=www-data
-command=/usr/bin/pidproxy /var/run/apache2/apache2.pid /bin/bash -c "source /etc/apache2/envvars && /usr/sbin/apache2 -DFOREGROUND"
-environment=APACHE_CONFDIR=""
-stdout_logfile=/dev/stdout
-stdout_logfile_maxbytes=0
-stderr_logfile=/dev/stderr
-stderr_logfile_maxbytes=0
-stopasgroup=true
-killasgroup=true

+ 0 - 10
supervisor/ftp.conf

@@ -1,10 +0,0 @@
-[program:ftp]
-directory=/app/code
-command=node ftp.js
-user=www-data
-autostart=true
-autorestart=true
-stdout_logfile=/dev/stdout
-stdout_logfile_maxbytes=0
-stderr_logfile=/dev/stderr
-stderr_logfile_maxbytes=0