aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--templates/identity/login.html4
-rw-r--r--templates/index.html1
-rw-r--r--ykps.py28
3 files changed, 3 insertions, 30 deletions
diff --git a/templates/identity/login.html b/templates/identity/login.html
index f1ecf70..79b19f6 100644
--- a/templates/identity/login.html
+++ b/templates/identity/login.html
@@ -1,5 +1,4 @@
<html lang="en">
-{#
{% if user_code or reset_password_url %}
<head>
<meta charset="UTF-8">
@@ -26,11 +25,10 @@
{% endif %}
</body>
{% else %}
-#}
<!-- This shortcut reduces the need to customize this template -->
<head>
<meta http-equiv='refresh' content='0; URL={{ auth_uri }}'>
</head>
-{# {% endif %} #}
+{% endif %}
</html>
diff --git a/templates/index.html b/templates/index.html
index c09cfae..280bbd2 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -19,7 +19,6 @@
<li><a href="/wifi">Connecting to WiFi</a></li>
<li><a href="/print">Printing</a></li>
<li><a href="//powermentor.andrewyu.org">PowerMentor for Peer Pao</a></li>
- <li><a href="/fbfp/">EXPERIMENTAL FBFP instance</a> (peer essay review system)</li>
</ul>
<h2>For Developers and Technical Users</h2>
<ul>
diff --git a/ykps.py b/ykps.py
index 02a7e40..344d980 100644
--- a/ykps.py
+++ b/ykps.py
@@ -21,17 +21,10 @@ import datetime
import zoneinfo
import flask
-import jinja2
import werkzeug
import werkzeug.middleware.proxy_fix
import identity.flask # type: ignore
-sys.path.append("/srv/ykps/fbfp/")
-
-from fbfp import make_bp as make_fbfp
-from fbfp import fbfpc_init
-from fbfp import db as fbfp_db
-
response_t: typing.TypeAlias = typing.Union[werkzeug.Response, flask.Response, str]
NOT_IMPLEMENTED = 501
@@ -80,22 +73,10 @@ app.config["SESSION_TYPE"] = "filesystem"
app.config.update(
{
- "SQLALCHEMY_DATABASE_URI": "mariadb+mariadbconnector://fbfp:%s@localhost/fbfp?unix_socket=/var/lib/mysql/mysql.sock"
- % open("/srv/ykps/mariadb.txt").read().strip("\n"),
- "FBFPC": {
- "site_title": "EXPERIMENTAL FBFP",
- "static_dir": "fbfp/static",
- "max_request_size": MAX_REQUEST_SIZE,
- "max_file_size": 3000000,
- "upload_path": "uploads",
- "require_free_space": 3 * 1024 * 1024 * 1024,
- "version_info": "https://git.sr.ht/~runxiyu/fbfp",
- },
"SECRET_KEY": open("/srv/ykps/secret-key.txt").read().strip("\n"),
"SESSION_COOKIE_HTTPONLY": True,
"SESSION_COOKIE_SECURE": True,
"SESSION_COOKIE_SAMESITE": "Lax",
- "USE_X_SENDFILE": False, # broken
}
)
@@ -173,10 +154,12 @@ def index() -> response_t:
def wifi() -> response_t:
return flask.Response(flask.render_template("wifi.html"), status=200)
+
@app.route("/print", methods=["GET"])
def print() -> response_t:
return flask.Response(flask.render_template("print.html"), status=200)
+
@app.route("/version", methods=["GET"])
def version() -> response_t:
return flask.Response(VERSION, mimetype="text/plain")
@@ -369,12 +352,5 @@ def unsub() -> response_t:
raise nope(501, "Unsubscribing is not implemented yet. Email sjdb@runxiyu.org")
-fbfpc_init(app)
-app.register_blueprint(make_fbfp(auth.login_required), url_prefix="/fbfp/")
-app.jinja_env.undefined = jinja2.StrictUndefined
-app.jinja_env.trim_blocks = True
-app.jinja_env.lstrip_blocks = True
-fbfp_db.init_app(app)
-
if __name__ == "__main__":
app.run(port=8080, debug=True)