[mod] Umbenennung zu "espe"
This commit is contained in:
parent
683b2b3054
commit
9c56055650
3 changed files with 68 additions and 67 deletions
|
@ -9,7 +9,7 @@ namespace _espe.api
|
||||||
{
|
{
|
||||||
const rest_subject : lib_plankton.rest.type_rest = lib_plankton.rest.make(
|
const rest_subject : lib_plankton.rest.type_rest = lib_plankton.rest.make(
|
||||||
{
|
{
|
||||||
"title": "aum",
|
"title": "espe",
|
||||||
"versioning_method": "header",
|
"versioning_method": "header",
|
||||||
"versioning_header_name": "X-Api-Version",
|
"versioning_header_name": "X-Api-Version",
|
||||||
"set_access_control_headers": true,
|
"set_access_control_headers": true,
|
||||||
|
|
131
source/main.ts
131
source/main.ts
|
@ -53,76 +53,14 @@ async function main(
|
||||||
});
|
});
|
||||||
const args : Record<string, any> = arg_handler.read(lib_plankton.args.enum_environment.cli, args_raw.join(" "));
|
const args : Record<string, any> = arg_handler.read(lib_plankton.args.enum_environment.cli, args_raw.join(" "));
|
||||||
|
|
||||||
// conf
|
|
||||||
await _espe.conf.load(args["conf_path"]);
|
|
||||||
|
|
||||||
// setup
|
|
||||||
lib_plankton.log.conf_push(
|
|
||||||
[
|
|
||||||
new lib_plankton.log.class_channel_minlevel(
|
|
||||||
new lib_plankton.log.class_channel_stdout(),
|
|
||||||
{
|
|
||||||
"none": lib_plankton.log.enum_level.error,
|
|
||||||
"error": lib_plankton.log.enum_level.error,
|
|
||||||
"warning": lib_plankton.log.enum_level.warning,
|
|
||||||
"notice": lib_plankton.log.enum_level.notice,
|
|
||||||
"info": lib_plankton.log.enum_level.info,
|
|
||||||
"debug":lib_plankton.log.enum_level.debug,
|
|
||||||
}[_espe.conf.get().verbosity]
|
|
||||||
),
|
|
||||||
]
|
|
||||||
);
|
|
||||||
await lib_plankton.session.setup(
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
"data_chest": lib_plankton.call.convey(
|
|
||||||
lib_plankton.storage.sql_table_common.chest(
|
|
||||||
{
|
|
||||||
"database_implementation": _espe.helpers.database_implementation(),
|
|
||||||
"table_name": "sessions",
|
|
||||||
"key_names": ["key"],
|
|
||||||
}
|
|
||||||
),
|
|
||||||
[
|
|
||||||
(core) => ({
|
|
||||||
"setup": (input) => core.setup(undefined),
|
|
||||||
"clear": () => core.clear(),
|
|
||||||
"write": (key, value) => core.write([key], value),
|
|
||||||
"delete": (key) => core.delete([key]),
|
|
||||||
"read": (key) => core.read([key]),
|
|
||||||
// "search": (term) => core.search(term).then(() => []),
|
|
||||||
"search": (term) => Promise.reject(new Error("not implemented")),
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
),
|
|
||||||
*/
|
|
||||||
"default_lifetime": _espe.conf.get().session_lifetime,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
_espe.service.member.listen_change(
|
|
||||||
() => {
|
|
||||||
lib_plankton.log.info(
|
|
||||||
"member_change",
|
|
||||||
{
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
_espe.service.member.listen_change(
|
|
||||||
async () => {
|
|
||||||
const authelia_export : string = await _espe.service.member.export_authelia_member_file();
|
|
||||||
process.stdout.write(authelia_export + "\n");
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// exec
|
// exec
|
||||||
if (args["help"] || (args["action"] == "help")) {
|
if (args["help"] || (args["action"] == "help")) {
|
||||||
process.stdout.write(
|
process.stdout.write(
|
||||||
arg_handler.generate_help(
|
arg_handler.generate_help(
|
||||||
{
|
{
|
||||||
"programname": "aum",
|
"programname": "espe",
|
||||||
"description": "member management for authelia",
|
"description": "Espe | Backend",
|
||||||
"executable": "aum",
|
"executable": "espe",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
+
|
+
|
||||||
|
@ -130,6 +68,25 @@ async function main(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
// conf
|
||||||
|
await _espe.conf.load(args["conf_path"]);
|
||||||
|
|
||||||
|
// setup
|
||||||
|
lib_plankton.log.conf_push(
|
||||||
|
[
|
||||||
|
new lib_plankton.log.class_channel_minlevel(
|
||||||
|
new lib_plankton.log.class_channel_stdout(),
|
||||||
|
{
|
||||||
|
"none": lib_plankton.log.enum_level.error,
|
||||||
|
"error": lib_plankton.log.enum_level.error,
|
||||||
|
"warning": lib_plankton.log.enum_level.warning,
|
||||||
|
"notice": lib_plankton.log.enum_level.notice,
|
||||||
|
"info": lib_plankton.log.enum_level.info,
|
||||||
|
"debug":lib_plankton.log.enum_level.debug,
|
||||||
|
}[_espe.conf.get().verbosity]
|
||||||
|
),
|
||||||
|
]
|
||||||
|
);
|
||||||
switch (args["action"]) {
|
switch (args["action"]) {
|
||||||
default: {
|
default: {
|
||||||
process.stderr.write(
|
process.stderr.write(
|
||||||
|
@ -162,6 +119,50 @@ async function main(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "serve": {
|
case "serve": {
|
||||||
|
await lib_plankton.session.setup(
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
"data_chest": lib_plankton.call.convey(
|
||||||
|
lib_plankton.storage.sql_table_common.chest(
|
||||||
|
{
|
||||||
|
"database_implementation": _espe.helpers.database_implementation(),
|
||||||
|
"table_name": "sessions",
|
||||||
|
"key_names": ["key"],
|
||||||
|
}
|
||||||
|
),
|
||||||
|
[
|
||||||
|
(core) => ({
|
||||||
|
"setup": (input) => core.setup(undefined),
|
||||||
|
"clear": () => core.clear(),
|
||||||
|
"write": (key, value) => core.write([key], value),
|
||||||
|
"delete": (key) => core.delete([key]),
|
||||||
|
"read": (key) => core.read([key]),
|
||||||
|
// "search": (term) => core.search(term).then(() => []),
|
||||||
|
"search": (term) => Promise.reject(new Error("not implemented")),
|
||||||
|
}),
|
||||||
|
]
|
||||||
|
),
|
||||||
|
*/
|
||||||
|
"default_lifetime": _espe.conf.get().session_lifetime,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
_espe.service.member.listen_change(
|
||||||
|
() => {
|
||||||
|
lib_plankton.log.info(
|
||||||
|
"member_change",
|
||||||
|
{
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
_espe.service.member.listen_change(
|
||||||
|
async () => {
|
||||||
|
const authelia_export : string = await _espe.service.member.export_authelia_member_file();
|
||||||
|
process.stdout.write(authelia_export + "\n");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const rest_subject : lib_plankton.rest.type_rest = _espe.api.make();
|
const rest_subject : lib_plankton.rest.type_rest = _espe.api.make();
|
||||||
const server : lib_plankton.server.type_subject = lib_plankton.server.make(
|
const server : lib_plankton.server.type_subject = lib_plankton.server.make(
|
||||||
_espe.conf.get().port,
|
_espe.conf.get().port,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
cd build
|
cd build
|
||||||
./aum $@
|
./espe $@
|
||||||
cd - > /dev/null
|
cd - > /dev/null
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue