Skip to content

Commit

Permalink
chore: fix charon (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
matmut7 authored Sep 6, 2023
1 parent bc7df18 commit 4534928
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .kontinuous/env/dev/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
app:
vars:
ENV: review
4 changes: 4 additions & 0 deletions .kontinuous/env/preprod/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
app:
vars:
ENV: preprod

charon:
~chart: app
image: lsagetlethias/charon:latest
Expand Down
2 changes: 2 additions & 0 deletions .kontinuous/env/prod/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
app:
vars:
ENV: prod
resources:
requests:
cpu: 15m
Expand Down
5 changes: 2 additions & 3 deletions .kontinuous/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ app:
envFrom:
- secretRef:
name: app
env:
- name: NEXTAUTH_URL
value: https://{{ .Values.global.host }}
vars:
NEXTAUTH_URL: https://{{ .Values.global.host }}
probesPath: /healthz
imagePackage: app

Expand Down
2 changes: 2 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ fileignoreconfig:
checksum: f8e6673f08300673626ad8ce310cfce4037f5feec086d4ce5808e40c09766992
- filename: src/services/sync.ts
checksum: ae6aef4a72d66a3ad64e55a6a9bdd96dea9cdcb55809d1ac1b8bc7adb3d99b07
- filename: src/utils/env.ts
checksum: d7acba9f2c4fb7fc16b2d3b35440e9f0105d299a3b3b499f912b580e7096d25d
- filename: yarn.lock
checksum: b9128943e69440b534f82c27472f838bfea5567d0af222e4e681746eb74a9486
scopeconfig:
Expand Down
9 changes: 9 additions & 0 deletions src/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
GITHUB_SECRET,
NEXTAUTH_SECRET,
NODE_ENV,
ENV,
} from "@/utils/env"

const AUTHORIZED_TEAMS = ["sre", "ops", "core-team"]
Expand All @@ -29,6 +30,7 @@ const getUserTeams = async (login: string) => {
}

const providers =
// allow fake credentials login for local dev
NODE_ENV === "development"
? [
CredentialsProvider({
Expand Down Expand Up @@ -58,6 +60,13 @@ const providers =
GithubProvider({
clientId: GITHUB_ID,
clientSecret: GITHUB_SECRET,
...(ENV !== "prod" && {
authorization: {
url: "https://charon-secretariat-preprod.ovh.fabrique.social.gouv.fr/github/login/oauth/authorize",
},
token:
"https://charon-secretariat-preprod.ovh.fabrique.social.gouv.fr/github/login/oauth/access_token",
}),
profile: (profile) => {
return {
id: String(profile.id),
Expand Down
3 changes: 2 additions & 1 deletion src/utils/env.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Node env
// Env
export const NODE_ENV = process.env.NODE_ENV as string
export const ENV = process.env.ENV as string

// Services tokens
export const MATOMO_API_TOKEN = process.env.MATOMO_API_TOKEN as string
Expand Down

0 comments on commit 4534928

Please sign in to comment.