Skip to content

Commit

Permalink
✨ enable oauth2
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhiljha committed Apr 24, 2024
1 parent a6df597 commit b7b5ed6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
24 changes: 22 additions & 2 deletions .transpire.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@ def objects():
"kill-timeout": "1s",
"max-concurrency": 64,
},
"oauth2": {
"enabled": True,
"autocreate": True,
"introspection-url": "https://idm.ocf.berkeley.edu/realms/ocf/protocol/openid-connect/token/introspect",
"introspection-timeout": "10s",
"client-id": "ergo",
# Set via ERGO__ACCOUNTS__OAUTH2__CLIENT_SECRET
# "client-secret": ""
}
},
"channels": {
"default-modes": "+ntC",
Expand Down Expand Up @@ -318,6 +327,16 @@ def objects():
},
}

# Secrets
yield {
"apiVersion": "v1",
"kind": "Secret",
"metadata": {"name": "ircd-secrets"},
"stringData": {
"ERGO__ACCOUNTS__OAUTH2__CLIENT_SECRET": "",
},
}

ircd_labels = {"k8s.ocf.io/app": name, "k8s.ocf.io/component": "ircd"}
yield {
"apiVersion": "apps/v1",
Expand All @@ -333,13 +352,14 @@ def objects():
"containers": [
{
"name": "ergo",
"image": f"ghcr.io/ergochat/ergo:v{version}",
"image": f"ghcr.io/ergochat/ergo:{version}",
"ports": [{"containerPort": 8097}, {"containerPort": 6697}],
"volumeMounts": [
{"name": "ircd-volume", "mountPath": "/ircd/db"},
{"name": "ircd-config", "mountPath": "/ircd"},
{"name": "ircd-tls", "mountPath": "/etc/ssl"},
],
"envFrom": [{"secretRef": {"name": "ircd-secrets"}}],
},
{
"name": "gamja",
Expand All @@ -351,7 +371,7 @@ def objects():
},
{
"name": "config-reloader",
"image": f"ghcr.io/ergochat/ergo:v{version}",
"image": f"ghcr.io/ergochat/ergo:{version}",
"command": ["/bin/sh"],
"args": [
"-c",
Expand Down
4 changes: 4 additions & 0 deletions gamja/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
"server": {
"url": "wss://irc-dev.ocf.berkeley.edu:8097",
"autojoin": "#rebuild"
},
"oauth2": {
"url": "https://idm.ocf.berkeley.edu/realms/ocf",
"client_id": "ergo"
}
}
2 changes: 1 addition & 1 deletion versions.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[ergo]
version = "2.13.0"
version = "master"

0 comments on commit b7b5ed6

Please sign in to comment.