mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
828f565290
This is going to be the v4. Expected improvements: - More reliable due to static typing. - Bump of performance. - Improvement of logging. - Authelia can be shipped as a single binary. - Will likely work on ARM architecture.
31 lines
803 B
JavaScript
Executable File
31 lines
803 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
var program = require('commander');
|
|
var spawn = require('child_process').spawn;
|
|
|
|
let config;
|
|
|
|
program
|
|
.description('Run Authelia server with a custom configuration file. This is an alternative to suites in the case the environment is already set up.')
|
|
.arguments('[config_file]', 'Configuration file to run Authelia with.')
|
|
.action((configArg) => config = configArg)
|
|
.parse(process.argv);
|
|
|
|
|
|
if (!config) {
|
|
config = 'config.yml'; // set default config file.;
|
|
}
|
|
|
|
const server = spawn(__dirname + '/../dist/authelia', ['-config', config], {
|
|
env: {
|
|
...process.env,
|
|
PUBLIC_DIR: __dirname + "/../dist/public_html"
|
|
}
|
|
});
|
|
|
|
server.stdout.pipe(process.stdout);
|
|
server.stderr.pipe(process.stderr);
|
|
|
|
server.on('exit', function(statusCode) {
|
|
process.exit(statusCode);
|
|
}); |