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

@ -7,4 +7,4 @@ node_modules
deployment.yaml deployment.yaml
Dockerfile Dockerfile
readme.md readme.md
.git .git

View File

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

View File

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

View File

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