2017-05-13 23:12:26 +07:00
|
|
|
#! /usr/bin/env node
|
|
|
|
|
2017-05-17 04:17:46 +07:00
|
|
|
import Server from "./lib/Server";
|
2017-06-30 00:41:05 +07:00
|
|
|
import { GlobalDependencies } from "../types/Dependencies";
|
2017-09-03 06:25:43 +07:00
|
|
|
import YAML = require("yamljs");
|
2017-05-13 23:12:26 +07:00
|
|
|
|
2017-06-30 00:41:05 +07:00
|
|
|
const configurationFilepath = process.argv[2];
|
|
|
|
if (!configurationFilepath) {
|
2017-05-13 23:12:26 +07:00
|
|
|
console.log("No config file has been provided.");
|
|
|
|
console.log("Usage: authelia <config>");
|
|
|
|
process.exit(0);
|
|
|
|
}
|
|
|
|
|
2017-07-14 05:25:11 +07:00
|
|
|
const yamlContent = YAML.load(configurationFilepath);
|
2017-05-13 23:12:26 +07:00
|
|
|
|
2017-06-30 00:41:05 +07:00
|
|
|
const deps: GlobalDependencies = {
|
2017-05-25 20:09:29 +07:00
|
|
|
u2f: require("u2f"),
|
2017-05-13 23:12:26 +07:00
|
|
|
ldapjs: require("ldapjs"),
|
|
|
|
session: require("express-session"),
|
|
|
|
winston: require("winston"),
|
|
|
|
speakeasy: require("speakeasy"),
|
2017-06-30 00:41:05 +07:00
|
|
|
nedb: require("nedb"),
|
2018-03-29 05:04:59 +07:00
|
|
|
ConnectRedis: require("connect-redis"),
|
|
|
|
Redis: require("redis")
|
2017-05-13 23:12:26 +07:00
|
|
|
};
|
|
|
|
|
2017-10-08 05:46:57 +07:00
|
|
|
const server = new Server(deps);
|
|
|
|
server.start(yamlContent, deps);
|