[add] outputs
This commit is contained in:
parent
8a33c029c7
commit
10e06afa90
2 changed files with 24 additions and 5 deletions
|
@ -142,6 +142,9 @@ namespace _espe.conf
|
|||
email_address : (null | string);
|
||||
}
|
||||
>;
|
||||
output : {
|
||||
authelia : (null | string);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
@ -311,6 +314,11 @@ namespace _espe.conf
|
|||
})) (conf_raw["settings"] ?? {})
|
||||
),
|
||||
"admins": (conf_raw["admins"] ?? []),
|
||||
"output": (
|
||||
((node_session_output) => ({
|
||||
"authelia": (node_session_output["authelia"] ?? null),
|
||||
})) (conf_raw["output"] ?? {})
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -230,12 +230,23 @@ async function main(
|
|||
);
|
||||
}
|
||||
);
|
||||
_espe.service.member.listen_change(
|
||||
async () => {
|
||||
const authelia_export : string = await _espe.service.member.export_authelia_user_file();
|
||||
process.stdout.write(authelia_export + "\n");
|
||||
// outputs
|
||||
{
|
||||
if (_espe.conf.get().output.authelia === null) {
|
||||
// do nothing
|
||||
}
|
||||
);
|
||||
else {
|
||||
_espe.service.member.listen_change(
|
||||
async () => {
|
||||
const authelia_export : string = await _espe.service.member.export_authelia_user_file();
|
||||
lib_plankton.file.write(
|
||||
_espe.conf.get().output.authelia,
|
||||
authelia_export
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const rest_subject : lib_plankton.rest.type_rest = _espe.api.make();
|
||||
const server : lib_plankton.server.type_subject = lib_plankton.server.make(
|
||||
|
|
Loading…
Add table
Reference in a new issue