fix: Replace actions.json in the main server.py
All checks were successful
Build Docker / BuildImage (push) Successful in 1m0s
All checks were successful
Build Docker / BuildImage (push) Successful in 1m0s
This commit is contained in:
@@ -123,9 +123,3 @@ def sol_donate_post(amount):
|
||||
|
||||
transaction = create_transaction(sender, amount)
|
||||
return jsonify({"message": "Success", "transaction": transaction}), 200, SOLANA_HEADERS
|
||||
|
||||
@app.route("/actions.json")
|
||||
def sol_actions():
|
||||
return jsonify(
|
||||
{"rules": [{"pathPattern": "/donate**", "apiPath": "/api/v1/donate**"}]}
|
||||
)
|
||||
|
||||
29
server.py
29
server.py
@@ -45,7 +45,10 @@ RATE_LIMIT_WINDOW = 3600 # 1 hour in seconds
|
||||
RESTRICTED_ROUTES = ["ascii"]
|
||||
REDIRECT_ROUTES = {
|
||||
"contact": "/#contact",
|
||||
"old": "/now/old"
|
||||
"old": "/now/old",
|
||||
"/meet": "https://cloud.woodburn.au/apps/calendar/appointment/PamrmmspWJZr",
|
||||
"/meeting": "https://cloud.woodburn.au/apps/calendar/appointment/PamrmmspWJZr",
|
||||
"/appointment": "https://cloud.woodburn.au/apps/calendar/appointment/PamrmmspWJZr",
|
||||
}
|
||||
DOWNLOAD_ROUTES = {
|
||||
"pgp": "data/nathanwoodburn.asc"
|
||||
@@ -178,20 +181,15 @@ def serviceWorker():
|
||||
|
||||
|
||||
# region Misc routes
|
||||
|
||||
@app.route("/meet")
|
||||
@app.route("/meeting")
|
||||
@app.route("/appointment")
|
||||
def meetingLink():
|
||||
return redirect(
|
||||
"https://cloud.woodburn.au/apps/calendar/appointment/PamrmmspWJZr", code=302
|
||||
)
|
||||
|
||||
|
||||
@app.route("/links")
|
||||
def links():
|
||||
return render_template("link.html")
|
||||
|
||||
@app.route("/actions.json")
|
||||
def sol_actions():
|
||||
return jsonify(
|
||||
{"rules": [{"pathPattern": "/donate**", "apiPath": "/api/v1/donate**"}]}
|
||||
)
|
||||
|
||||
@app.route("/api/<path:function>")
|
||||
def api_legacy(function):
|
||||
@@ -245,7 +243,8 @@ def index():
|
||||
try:
|
||||
git = requests.get(
|
||||
"https://git.woodburn.au/api/v1/users/nathanwoodburn/activities/feeds?only-performed-by=true&limit=1",
|
||||
headers={"Authorization": os.getenv("GIT_AUTH") if os.getenv("GIT_AUTH") else os.getenv("git_token")},
|
||||
headers={"Authorization": os.getenv("GIT_AUTH") if os.getenv(
|
||||
"GIT_AUTH") else os.getenv("git_token")},
|
||||
)
|
||||
git = git.json()
|
||||
git = git[0]
|
||||
@@ -368,7 +367,7 @@ def index():
|
||||
sites=SITES,
|
||||
projects=PROJECTS,
|
||||
time=time,
|
||||
message=NC_CONFIG.get("message",""),
|
||||
message=NC_CONFIG.get("message", ""),
|
||||
),
|
||||
200,
|
||||
{"Content-Type": "text/html"},
|
||||
@@ -378,6 +377,8 @@ def index():
|
||||
return resp
|
||||
|
||||
# region Donate
|
||||
|
||||
|
||||
@app.route("/donate")
|
||||
def donate():
|
||||
if isCLI(request):
|
||||
@@ -543,6 +544,7 @@ def qrcodee(data):
|
||||
|
||||
# endregion
|
||||
|
||||
|
||||
@app.route("/supersecretpath")
|
||||
def supersecretpath():
|
||||
ascii_art = ""
|
||||
@@ -668,6 +670,7 @@ def resume_pdf():
|
||||
return send_file("data/resume.pdf")
|
||||
return error_response(request, message="Resume not found")
|
||||
|
||||
|
||||
@app.route("/tools")
|
||||
def tools():
|
||||
if isCLI(request):
|
||||
|
||||
Reference in New Issue
Block a user