add redis creds
This commit is contained in:
parent
c0a310b5ff
commit
e8d1ba9c96
@ -4,14 +4,15 @@ module.exports = {
|
||||
gatewayUri: process.env.OIDC_GATEWAY_URI,
|
||||
clientId: process.env.OIDC_CLIENT_ID,
|
||||
clientSecret: process.env.OIDC_CLIENT_SECRET,
|
||||
redirectUris: process.env.OIDC_REDIRECT_URIS
|
||||
redirectUris: process.env.OIDC_REDIRECT_URIS,
|
||||
},
|
||||
wildDuck: {
|
||||
url: process.env.WILDDUCK_URL,
|
||||
token: process.env.WILDDUCK_TOKEN,
|
||||
domain: process.env.WILDDUCK_DOMAIN
|
||||
domain: process.env.WILDDUCK_DOMAIN,
|
||||
},
|
||||
redis: {
|
||||
url: process.env.REDIS_URL
|
||||
}
|
||||
url: process.env.REDIS_URL,
|
||||
password: process.env.REDIS_PASSWORD,
|
||||
},
|
||||
};
|
@ -99,7 +99,15 @@ spec:
|
||||
name: walias-secrets
|
||||
key: WILDDUCK_DOMAIN
|
||||
- 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:
|
||||
- secretRef:
|
||||
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';
|
||||
|
||||
const app: Application = express(feathers());
|
||||
let sessionStore;
|
||||
|
||||
// Load app configuration
|
||||
app.configure(configuration());
|
||||
@ -28,15 +29,19 @@ app.use(
|
||||
|
||||
app.use(cookieParser());
|
||||
|
||||
const sessionStore =
|
||||
getEnv() === Env.prod
|
||||
? new RedisStore({
|
||||
prefix: 'walias:',
|
||||
client: createClient({
|
||||
url: config.get('redis.url'),
|
||||
}),
|
||||
})
|
||||
: undefined;
|
||||
if (getEnv() === Env.prod) {
|
||||
const redisClient = createClient({
|
||||
url: config.get('redis.url'),
|
||||
password: config.get('redis.password'),
|
||||
});
|
||||
|
||||
sessionStore = new RedisStore({
|
||||
prefix: 'walias:',
|
||||
client: redisClient,
|
||||
});
|
||||
|
||||
redisClient.connect().catch(console.error);
|
||||
}
|
||||
|
||||
app.use(
|
||||
session({
|
||||
|
Loading…
Reference in New Issue
Block a user