Add Discourse calendar key generator
/ build (push) Successful in 42s Details

This commit is contained in:
kosma 2026-03-04 15:45:54 +01:00
parent d8f5a7f77c
commit 6b0689038f
3 changed files with 23 additions and 2 deletions

View File

@ -0,0 +1,20 @@
on:
push:
branches:
- main
jobs:
build:
runs-on: docker
container:
image: ubuntu:24.04
steps:
- name: Install dependencies
run: apt-get update -q && apt-get install -qy git nodejs buildah
- uses: actions/checkout@v4
- name: Build and push Docker image
run: |
buildah build -t kalendasz:latest
buildah push --creds ${{ gitea.actor }}:${{ secrets.PUSH_PACKAGES_KEY }} kalendasz:latest "docker://git.hswro.org/kosma/kalendasz:latest"

1
.gitignore vendored
View File

@ -1 +1,2 @@
config.yaml
/venv/

4
app.py
View File

@ -2,6 +2,7 @@ import argparse
import base64
import json
import secrets
from urllib.parse import urlencode
import yaml
from cryptography.hazmat.primitives import serialization
@ -46,8 +47,7 @@ def authorize():
"nonce": nonce,
"public_key": public_key,
}
query = "&".join(f"{k}={v}" for k, v in params.items())
return redirect(f"{config['forum_url']}/user-api-key/new?{query}")
return redirect(f"{config['forum_url']}/user-api-key/new?{urlencode(params)}")
@app.route("/callback")