feat(auth): Use bind mount for providers.toml config file
Changed the way the `auth` service source its providers file to use a bindmount and use a default path if no `PROVIDER_FILE` env is set
This commit is contained in:
parent
6c050e2171
commit
fbbc6d8f39
8 changed files with 3 additions and 47 deletions
|
|
@ -50,18 +50,17 @@ services:
|
||||||
context: ./src/
|
context: ./src/
|
||||||
args:
|
args:
|
||||||
- SERVICE=auth
|
- SERVICE=auth
|
||||||
- EXTRA_FILES=auth/extra
|
container_name: app-auth
|
||||||
container_name: app-auth
|
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- app
|
- app
|
||||||
volumes:
|
volumes:
|
||||||
- sqlite-volume:/volumes/database
|
- sqlite-volume:/volumes/database
|
||||||
- static-volume:/volumes/static
|
- static-volume:/volumes/static
|
||||||
|
- ./src/auth/config:/config
|
||||||
environment:
|
environment:
|
||||||
- JWT_SECRET=KRUGKIDROVUWG2ZAMJZG653OEBTG66BANJ2W24DTEBXXMZLSEB2GQZJANRQXU6JA
|
- JWT_SECRET=KRUGKIDROVUWG2ZAMJZG653OEBTG66BANJ2W24DTEBXXMZLSEB2GQZJANRQXU6JA
|
||||||
- DATABASE_DIR=/volumes/database
|
- DATABASE_DIR=/volumes/database
|
||||||
- PROVIDER_FILE=/extra/providers.toml
|
|
||||||
logging:
|
logging:
|
||||||
driver: gelf
|
driver: gelf
|
||||||
options:
|
options:
|
||||||
|
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
<!DOCTYPE HTML>
|
|
||||||
<html>
|
|
||||||
<!--
|
|
||||||
<head>
|
|
||||||
<title>Demo Page For Login :)</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<h1>
|
|
||||||
Welcome <span id="t-username"></span>
|
|
||||||
</h1>
|
|
||||||
<input id="i-username" type="text" placeholder="Username">
|
|
||||||
</input>
|
|
||||||
<input id="i-password" type="text" placeholder="Password">
|
|
||||||
</input>
|
|
||||||
<br />
|
|
||||||
<input id="i-otp" type="text" placeholder="OTP">
|
|
||||||
</input>
|
|
||||||
<button id="b-otpSend">OTP - Send</button>
|
|
||||||
<br />
|
|
||||||
<br />
|
|
||||||
<button id="b-login">Login</button>
|
|
||||||
<button id="b-login-guest">Login as Guest</button>
|
|
||||||
<br />
|
|
||||||
<button id="b-logout">Logout</button>
|
|
||||||
<br />
|
|
||||||
<button id="b-signin">Signin</button>
|
|
||||||
<br />
|
|
||||||
<button id="b-whoami">Whoami</button>
|
|
||||||
<div>
|
|
||||||
<button id="b-otpStatus">OTP - Status</button>
|
|
||||||
<button id="b-otpEnable">OTP - Enable</button>
|
|
||||||
<button id="b-otpDisable">OTP - Disable</button>
|
|
||||||
</div>
|
|
||||||
<pre id="d-response"></pre>
|
|
||||||
<script src="./login_demo.js"> </script>
|
|
||||||
</body> -->
|
|
||||||
|
|
||||||
</html>
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
// const headers = {
|
|
||||||
// 'Accept': 'application/json',
|
|
||||||
// 'Content-Type': 'application/json',
|
|
||||||
// };
|
|
||||||
|
|
@ -69,7 +69,7 @@ export type ProviderMap = T.Static<typeof ProviderMap>;
|
||||||
|
|
||||||
export type ProviderMapFile = T.Static<typeof ProviderMapFile>;
|
export type ProviderMapFile = T.Static<typeof ProviderMapFile>;
|
||||||
async function buildProviderMap(): Promise<ProviderMap> {
|
async function buildProviderMap(): Promise<ProviderMap> {
|
||||||
const providerFile = process.env.PROVIDER_FILE;
|
const providerFile = process.env.PROVIDER_FILE ?? '/config/providers.toml';
|
||||||
if (isNullish(providerFile)) return {};
|
if (isNullish(providerFile)) return {};
|
||||||
try {
|
try {
|
||||||
await access(providerFile, fsConstants.F_OK | fsConstants.R_OK);
|
await access(providerFile, fsConstants.F_OK | fsConstants.R_OK);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue