Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config.template.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[SERVER]
host = "localhost"
root_url = "" # optional key, used for changing the root url in automation if domain is not https://mystb.in
port = 8181
session_secret = "" # Run: import secrets; print(secrets.token_urlsafe(64))
session_secret = "" # Run: import secrets; print(secrets.token_urlsafe(64))
maintenance = false

[DATABASE]
Expand Down
3 changes: 2 additions & 1 deletion src/core/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

LOGGER = logging.getLogger(__name__)
SCHEMA_FILE = pathlib.Path("schema.sql")
ROOT_URL = CONFIG["SERVER"].get("root_url", "https://mystb.in")


class Database:
Expand Down Expand Up @@ -119,7 +120,7 @@ async def _post_gist_of_tokens(self) -> None:

for paste_id, tokens in current_tokens.items():
filename = str(datetime.datetime.now(datetime.UTC)) + "-tokens.txt"
json_payload["files"][filename] = {"content": f"https://mystb.in/{paste_id}:\n{tokens}"}
json_payload["files"][filename] = {"content": f"{ROOT_URL}/{paste_id}:\n{tokens}"}

success = False

Expand Down
1 change: 1 addition & 0 deletions src/types_/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

class Server(TypedDict):
host: str
root_url: NotRequired[str]
port: int
domain: str
session_secret: str
Expand Down
Loading