bank: auto-account name is goa-account-<funnypiece>-<tag>

This commit is contained in:
Hernâni Marques 2026-07-10 17:39:00 +02:00
parent 7ddb05f022
commit fa1c4efb5c
No known key found for this signature in database

View file

@ -149,15 +149,12 @@ _FUNNY_STEMS = (
def _rand_username_and_name() -> tuple[str, str]:
# Username: goa-account-<funny>-<short id> (shown to user)
# Display name: Title Case funny phrase + id
# Shown as goa-account-<funnypiece>-<tag> (e.g. goa-account-space-potato-k3m9x)
stem = secrets.choice(_FUNNY_STEMS)
alphabet = string.ascii_lowercase + string.digits
tag = "".join(secrets.choice(alphabet) for _ in range(5))
username = f"goa-account-{stem}-{tag}"
# human name: "Space Potato · k3m9x"
pretty = " ".join(w.capitalize() for w in stem.split("-"))
name = f"{pretty} · {tag}"
name = username
return username, name
@ -215,7 +212,7 @@ def create_personal_account() -> dict:
"webui": "https://bank.hacktivism.ch/webui/",
"hint": (
"This bank account was created for you automatically "
f"(funny name: {name}). "
f"({username}). "
"Copy username and password now — we do not store them for later recovery."
),
"created": time.strftime("%Y-%m-%dT%H:%MZ", time.gmtime()),