add redis creds
This commit is contained in:
parent
c0a310b5ff
commit
e8d1ba9c96
@ -7,4 +7,4 @@ node_modules
|
|||||||
deployment.yaml
|
deployment.yaml
|
||||||
Dockerfile
|
Dockerfile
|
||||||
readme.md
|
readme.md
|
||||||
.git
|
.git
|
@ -4,14 +4,15 @@ module.exports = {
|
|||||||
gatewayUri: process.env.OIDC_GATEWAY_URI,
|
gatewayUri: process.env.OIDC_GATEWAY_URI,
|
||||||
clientId: process.env.OIDC_CLIENT_ID,
|
clientId: process.env.OIDC_CLIENT_ID,
|
||||||
clientSecret: process.env.OIDC_CLIENT_SECRET,
|
clientSecret: process.env.OIDC_CLIENT_SECRET,
|
||||||
redirectUris: process.env.OIDC_REDIRECT_URIS
|
redirectUris: process.env.OIDC_REDIRECT_URIS,
|
||||||
},
|
},
|
||||||
wildDuck: {
|
wildDuck: {
|
||||||
url: process.env.WILDDUCK_URL,
|
url: process.env.WILDDUCK_URL,
|
||||||
token: process.env.WILDDUCK_TOKEN,
|
token: process.env.WILDDUCK_TOKEN,
|
||||||
domain: process.env.WILDDUCK_DOMAIN
|
domain: process.env.WILDDUCK_DOMAIN,
|
||||||
},
|
},
|
||||||
redis: {
|
redis: {
|
||||||
url: process.env.REDIS_URL
|
url: process.env.REDIS_URL,
|
||||||
}
|
password: process.env.REDIS_PASSWORD,
|
||||||
};
|
},
|
||||||
|
};
|
||||||
|
@ -99,7 +99,15 @@ spec:
|
|||||||
name: walias-secrets
|
name: walias-secrets
|
||||||
key: WILDDUCK_DOMAIN
|
key: WILDDUCK_DOMAIN
|
||||||
- name: REDIS_URL
|
- name: REDIS_URL
|
||||||
value: walias-cache
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: redis-walias-cache-owner-secrets
|
||||||
|
key: REDIS_MASTER_URI
|
||||||
|
- name: REDIS_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: redis-walias-cache-owner-secrets
|
||||||
|
key: REDIS_PASSWORD
|
||||||
envFrom:
|
envFrom:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: oidc-client-walias-owner-secrets
|
name: oidc-client-walias-owner-secrets
|
||||||
|
23
src/app.ts
23
src/app.ts
@ -16,6 +16,7 @@ import { channels } from './channels';
|
|||||||
import { Env, getEnv } from './helpers/get-env';
|
import { Env, getEnv } from './helpers/get-env';
|
||||||
|
|
||||||
const app: Application = express(feathers());
|
const app: Application = express(feathers());
|
||||||
|
let sessionStore;
|
||||||
|
|
||||||
// Load app configuration
|
// Load app configuration
|
||||||
app.configure(configuration());
|
app.configure(configuration());
|
||||||
@ -28,15 +29,19 @@ app.use(
|
|||||||
|
|
||||||
app.use(cookieParser());
|
app.use(cookieParser());
|
||||||
|
|
||||||
const sessionStore =
|
if (getEnv() === Env.prod) {
|
||||||
getEnv() === Env.prod
|
const redisClient = createClient({
|
||||||
? new RedisStore({
|
url: config.get('redis.url'),
|
||||||
prefix: 'walias:',
|
password: config.get('redis.password'),
|
||||||
client: createClient({
|
});
|
||||||
url: config.get('redis.url'),
|
|
||||||
}),
|
sessionStore = new RedisStore({
|
||||||
})
|
prefix: 'walias:',
|
||||||
: undefined;
|
client: redisClient,
|
||||||
|
});
|
||||||
|
|
||||||
|
redisClient.connect().catch(console.error);
|
||||||
|
}
|
||||||
|
|
||||||
app.use(
|
app.use(
|
||||||
session({
|
session({
|
||||||
|
Loading…
Reference in New Issue
Block a user