File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 11[SERVER ]
22host = " localhost"
3+ root_url = " " # optional key, used for changing the root url in automation if domain is not https://mystb.in
34port = 8181
4- session_secret = " " # Run: import secrets; print(secrets.token_urlsafe(64))
5+ session_secret = " " # Run: import secrets; print(secrets.token_urlsafe(64))
56maintenance = false
67
78[DATABASE ]
Original file line number Diff line number Diff line change 4444
4545LOGGER = logging .getLogger (__name__ )
4646SCHEMA_FILE = pathlib .Path ("schema.sql" )
47+ ROOT_URL = CONFIG ["SERVER" ].get ("root_url" , "https://mystb.in" )
4748
4849
4950class Database :
@@ -119,7 +120,7 @@ async def _post_gist_of_tokens(self) -> None:
119120
120121 for paste_id , tokens in current_tokens .items ():
121122 filename = str (datetime .datetime .now (datetime .UTC )) + "-tokens.txt"
122- json_payload ["files" ][filename ] = {"content" : f"https://mystb.in /{ paste_id } :\n { tokens } " }
123+ json_payload ["files" ][filename ] = {"content" : f"{ ROOT_URL } /{ paste_id } :\n { tokens } " }
123124
124125 success = False
125126
Original file line number Diff line number Diff line change 2525
2626class Server (TypedDict ):
2727 host : str
28+ root_url : NotRequired [str ]
2829 port : int
2930 domain : str
3031 session_secret : str
You can’t perform that action at this time.
0 commit comments