~sircmpwn/dispatch.sr.ht

7aa971b1eb56ff10b37a66bb62282b493f69a4f8 — Drew DeVault 8 months ago 852f3e6 0.13.0
Updates for single-sign-on support
M config.example.ini => config.example.ini +9 -2
@@ 19,8 19,15 @@ owner-email=sir@cmpwn.com
# The source code for your fork of sr.ht
source-url=https://git.sr.ht/~sircmpwn/srht
#
# A secret key to encrypt session cookies with
secret-key=CHANGEME
# A secret key to encrypt session cookies with. Use `srht-keygen service` to
# generate this. This should be unique to each site, but shared among nodes of
# that site. For example, git.sr.ht and hg.sr.ht have different keys, but
# git1.sr.ht has the same key as git2.sr.ht.
service-key=
#
# A secret key to encrypt internal messages with. Use `srht-keygen network` to
# generate this. This should be consistent between all *.sr.ht sites and nodes.
network-key=

[mail]
#

M dispatchsrht/blueprints/html.py => dispatchsrht/blueprints/html.py +2 -2
@@ 1,9 1,9 @@
from flask import Blueprint, render_template, request, redirect, url_for, abort
from flask import session
from flask_login import current_user
from srht.config import cfg
from srht.database import db
from srht.flask import loginrequired, paginate_query
from srht.flask import paginate_query
from srht.oauth import current_user, loginrequired
from dispatchsrht.types import Task
import requests


M dispatchsrht/builds.py => dispatchsrht/builds.py +2 -1
@@ 13,7 13,8 @@ from typing import Any, Callable, Dict, Iterable, Tuple

_root = cfg("dispatch.sr.ht", "origin")
_builds_sr_ht = cfg("builds.sr.ht", "origin", default=None)
_secret_key = cfg("sr.ht", "secret-key")
_secret_key = cfg("sr.ht", "service-key",
        default=cfg("sr.ht", "secret-key", default=None))
_kdf = PBKDF2HMAC(
        algorithm=hashes.SHA256(),
        length=32,

M dispatchsrht/tasks/github/common.py => dispatchsrht/tasks/github/common.py +2 -2
@@ 8,12 8,12 @@ from dispatchsrht.app import app
from dispatchsrht.builds import decrypt_notify_payload, submit_build
from dispatchsrht.builds import first_line, encrypt_notify_url
from flask import redirect, request, url_for
from flask_login import current_user
from functools import wraps
from github import Github, GithubException
from srht.config import cfg
from srht.database import Base, db
from srht.flask import loginrequired, csrf_bypass
from srht.flask import csrf_bypass
from srht.oauth import current_user, loginrequired
from urllib.parse import urlencode

_github_client_id = cfg("dispatch.sr.ht::github",

M dispatchsrht/tasks/github/github_commit_to_build.py => dispatchsrht/tasks/github/github_commit_to_build.py +1 -1
@@ 6,12 6,12 @@ from dispatchsrht.tasks.github.common import githubloginrequired
from dispatchsrht.tasks.github.common import submit_github_build
from dispatchsrht.types import Task
from flask import Blueprint, redirect, request, render_template, url_for, abort
from flask_login import current_user
from github import Github
from jinja2 import Markup
from srht.config import cfg
from srht.database import Base, db
from srht.flask import icon, csrf_bypass
from srht.oauth import current_user
from srht.validation import Validation
from uuid import UUID, uuid4


M dispatchsrht/tasks/github/github_pr_to_build.py => dispatchsrht/tasks/github/github_pr_to_build.py +1 -1
@@ 3,12 3,12 @@ import sqlalchemy_utils as sau
from github import Github
from flask import Blueprint, redirect, request, render_template, url_for, abort
from flask import session
from flask_login import current_user
from jinja2 import Markup
from uuid import UUID, uuid4
from srht.database import Base, db
from srht.config import cfg
from srht.flask import icon, csrf_bypass
from srht.oauth import current_user
from srht.validation import Validation
from dispatchsrht.tasks import TaskDef
from dispatchsrht.tasks.github.common import GitHubAuthorization

M dispatchsrht/tasks/gitlab/common.py => dispatchsrht/tasks/gitlab/common.py +2 -2
@@ 7,11 7,11 @@ from dispatchsrht.app import app
from dispatchsrht.builds import encrypt_notify_url, first_line, submit_build
from dispatchsrht.builds import decrypt_notify_payload
from flask import abort, redirect, render_template, request, url_for
from flask_login import current_user
from functools import wraps
from srht.config import cfg, cfgb
from srht.database import Base, db
from srht.flask import csrf_bypass, loginrequired
from srht.flask import csrf_bypass
from srht.oauth import current_user, loginrequired
from urllib.parse import urlencode

_root = cfg("dispatch.sr.ht", "origin")

M dispatchsrht/tasks/gitlab/gitlab_commit_to_build.py => dispatchsrht/tasks/gitlab/gitlab_commit_to_build.py +2 -2
@@ 6,11 6,11 @@ from dispatchsrht.tasks.gitlab.common import submit_gitlab_build
from dispatchsrht.tasks import TaskDef
from dispatchsrht.types import Task
from flask import Blueprint, redirect, render_template, request, url_for
from flask_login import current_user
from jinja2 import Markup
from srht.config import cfg, cfgb, cfgkeys
from srht.database import Base, db
from srht.flask import icon, csrf_bypass, loginrequired
from srht.flask import icon, csrf_bypass
from srht.oauth import current_user, loginrequired
from srht.validation import Validation
from uuid import UUID, uuid4


M dispatchsrht/tasks/gitlab/gitlab_mr_to_build.py => dispatchsrht/tasks/gitlab/gitlab_mr_to_build.py +2 -2
@@ 6,11 6,11 @@ from dispatchsrht.tasks.gitlab.common import submit_gitlab_build
from dispatchsrht.tasks import TaskDef
from dispatchsrht.types import Task
from flask import Blueprint, redirect, render_template, request, url_for
from flask_login import current_user
from jinja2 import Markup
from srht.config import cfg, cfgb, cfgkeys
from srht.database import Base, db
from srht.flask import icon, csrf_bypass, loginrequired
from srht.flask import icon, csrf_bypass
from srht.oauth import current_user, loginrequired
from srht.validation import Validation
from uuid import UUID, uuid4