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