add redis creds
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline failed

This commit is contained in:
Sergo 2023-08-12 10:56:16 +03:00
parent c0a310b5ff
commit e8d1ba9c96
4 changed files with 30 additions and 16 deletions

View File

@ -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,
},
};

View File

@ -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

View File

@ -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({