-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #1859 Signed-off-by: Michal Konecny <[email protected]>
- Loading branch information
Showing
13 changed files
with
187 additions
and
83 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# This is a TOML-format file. For the spec, see https://github.com/toml-lang/toml#spec | ||
|
||
# URL to the database | ||
db_url = 'postgresql://postgres:anypasswordworkslocally@postgres/anitya' | ||
|
||
# List of web administrators. The values should be the value of the "id" column | ||
# for the user in the "users" table of the database. They need to log in before | ||
# this record is created. An example value would be | ||
# "65536ed7-bdd3-4a1e-8252-10d874fd706b" | ||
# You can also find this infromation in the settings page when logged in to Anitya | ||
anitya_web_admins = [] | ||
|
||
preferred_url_scheme = "https" | ||
|
||
authlib_enabled_backends = ["Fedora"] | ||
|
||
fedora_client_id = "fedora" | ||
fedora_client_secret = "secret" | ||
fedora_server_metadata_url = "https://id.stg.fedoraproject.org/.well-known/openid-configuration" | ||
[fedora_client_kwargs] | ||
scope = "openid profile email" | ||
token_endpoint_auth_method = "client_secret_post" | ||
|
||
|
||
blacklisted_users = [] | ||
|
||
# The logging configuration, in dictConfig format. | ||
[anitya_log_config] | ||
version = 1 | ||
disable_existing_loggers = false | ||
|
||
[anitya_log_config.formatters] | ||
[anitya_log_config.formatters.simple] | ||
format = "[%(name)s %(levelname)s] %(message)s" | ||
|
||
[anitya_log_config.handlers] | ||
[anitya_log_config.handlers.console] | ||
class = "logging.StreamHandler" | ||
formatter = "simple" | ||
stream = "ext://sys.stdout" | ||
|
||
[anitya_log_config.loggers] | ||
[anitya_log_config.loggers.anitya] | ||
level = "DEBUG" | ||
propagate = false | ||
handlers = ["console"] | ||
|
||
[anitya_log_config.root] | ||
level = "INFO" | ||
handlers = ["console"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
This module contains blueprints that are only included | ||
when application is running in debug mode. | ||
""" | ||
import flask | ||
import flask_login | ||
|
||
from anitya.db import Session, User | ||
|
||
debug_blueprint = flask.Blueprint( | ||
"anitya_debug", __name__, static_folder="static", template_folder="templates" | ||
) | ||
|
||
|
||
@debug_blueprint.route("/login/debug/<name>") | ||
def login(name: str): | ||
""" | ||
Debug login for prepared users. | ||
Params: | ||
name: User to log as in. | ||
""" | ||
user = User.query.filter(User.username == name).first() | ||
|
||
# Create user if it doesn't exist yet | ||
if not user: | ||
user = User( | ||
username=name, email=(name + "@example.com"), admin=(name == "admin") | ||
) | ||
Session.add(user) | ||
Session.commit() | ||
|
||
flask_login.login_user(user) | ||
if flask.session["next_url"]: | ||
return flask.redirect(flask.session["next_url"]) | ||
return flask.redirect("/") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Improve development container |
Oops, something went wrong.