feat: Add rss endpoints
All checks were successful
Build Docker / BuildImage (push) Successful in 1m42s
All checks were successful
Build Docker / BuildImage (push) Successful in 1m42s
This commit is contained in:
parent
42aff1f455
commit
637562f920
14
mail.py
14
mail.py
@ -7,6 +7,20 @@ from flask import jsonify
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
# This is used to send emails via API
|
||||||
|
# The process should be something like this
|
||||||
|
# curl --request POST \
|
||||||
|
# --url https://nathan.c.woodburn.au/api/email \
|
||||||
|
# --header 'Content-Type: application/json' \
|
||||||
|
# --data '{
|
||||||
|
# "key":"api-key",
|
||||||
|
# "to": "recipient@nathan.woodburn.au",
|
||||||
|
# "from": "sender@nathan.woodburn.au",
|
||||||
|
# "sender":"Nathan.Woodburn/",
|
||||||
|
# "subject":"Test email from api",
|
||||||
|
# "body":"G'\''day\nThis is a test email from my website api\n\nRegards,\nNathan.Woodburn/"
|
||||||
|
# }'
|
||||||
|
|
||||||
def validateSender(email):
|
def validateSender(email):
|
||||||
domains = os.getenv("EMAIL_DOMAINS").split(",")
|
domains = os.getenv("EMAIL_DOMAINS").split(",")
|
||||||
for domain in domains:
|
for domain in domains:
|
||||||
|
@ -411,11 +411,8 @@ def email():
|
|||||||
"status": 401,
|
"status": 401,
|
||||||
"error": "Unauthorized 'key' invalid"
|
"error": "Unauthorized 'key' invalid"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return sendEmail(data)
|
return sendEmail(data)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -673,6 +670,8 @@ def now_old():
|
|||||||
)
|
)
|
||||||
|
|
||||||
@app.route("/now.rss")
|
@app.route("/now.rss")
|
||||||
|
@app.route("/now.xml")
|
||||||
|
@app.route("/rss.xml")
|
||||||
def now_rss():
|
def now_rss():
|
||||||
host = "https://" + request.host
|
host = "https://" + request.host
|
||||||
if ":" in request.host:
|
if ":" in request.host:
|
||||||
|
Loading…
Reference in New Issue
Block a user