feat(identity): register accounts and resend verification mail

This commit is contained in:
shira committed 2026-10-06 23:59:51 +03:00
1 parent 5e202ac972
commit 4436f626a3
55 files changed
+3227 -88

No files matched your search

+1
View File
@@ -150,6 +150,7 @@ EMAIL_FROM=no-reply@example.com
EMAIL_TIMEOUT=10s
APP_PUBLIC_URL=http://localhost:8080
PASSWORD_HASH_CONCURRENCY=1
IDENTITY_KEY_SECRET=$(random_secret)
POSTGRES_EXPORTER_USER=
POSTGRES_EXPORTER_PASSWORD=
EOF
+15 -2
View File
@@ -50,6 +50,9 @@ EVIDENCE_SCHEMA = "lincodex.release-evidence/v1"
RELEASE_REGISTRY = "lincodex.invalid"
# Project name used only to render Compose files; nothing is started under it.
RENDER_PROJECT = "lincodex-release"
# Compose requires IDENTITY_KEY_SECRET and .env.example has none; this value only
# lets a render or build go through and is never deployed.
RENDER_ONLY_IDENTITY_KEY = "render-only-identity-key-secret-not-for-deployment"
CHECKS = ("smoke", "e2e")
CHECK_SCOPE = {
"smoke": (
@@ -538,7 +541,12 @@ class Docker:
args += ["-f", str(root / name)]
args += ["config", "--format", "json"]
env = docker_env(
{"APP_PROJECT": RENDER_PROJECT, "APP_NETWORK": f"{RENDER_PROJECT}_default", "LINCODEX_RELEASE_TAG": tag}
{
"APP_PROJECT": RENDER_PROJECT,
"APP_NETWORK": f"{RENDER_PROJECT}_default",
"LINCODEX_RELEASE_TAG": tag,
"IDENTITY_KEY_SECRET": RENDER_ONLY_IDENTITY_KEY,
}
)
return json.loads(run(args, cwd=root, env=env))
@@ -590,7 +598,12 @@ class Docker:
args += ["--build-arg", f"{name}={value}"]
args.append(service)
env = docker_env(
{"APP_PROJECT": RENDER_PROJECT, "APP_NETWORK": f"{RENDER_PROJECT}_default", "LINCODEX_RELEASE_TAG": tag}
{
"APP_PROJECT": RENDER_PROJECT,
"APP_NETWORK": f"{RENDER_PROJECT}_default",
"LINCODEX_RELEASE_TAG": tag,
"IDENTITY_KEY_SECRET": RENDER_ONLY_IDENTITY_KEY,
}
)
print(f"Building {service} for release {tag}", flush=True)
if subprocess.run(args, cwd=root, env=env, check=False).returncode != 0:
+3 -1
View File
@@ -26,13 +26,15 @@ port=18080
network="${project}_default"
storage_network="${project}_storage"
started=0
# .env.example has no usable IDENTITY_KEY_SECRET; the throwaway stack draws its own.
identity_key_secret=$(od -An -N24 -tx1 /dev/urandom | tr -d ' \n')
# The smoke stack sends no mail: it uses EMAIL_PROVIDER=disabled from
# .env.example and points mail links at its own loopback port.
compose() {
APP_PROJECT="$project" APP_NETWORK="$app_network" APP_STORAGE_NETWORK="$storage_network" APP_HTTP_PORT="$port" \
APP_SUBNET=172.29.81.0/24 APP_FRONTEND_IP=172.29.81.10 \
APP_PUBLIC_URL="http://localhost:$port" LINCODEX_RELEASE_TAG="$release_tag" docker compose \
APP_PUBLIC_URL="http://localhost:$port" LINCODEX_RELEASE_TAG="$release_tag" IDENTITY_KEY_SECRET="$identity_key_secret" docker compose \
--env-file "$env_file" \
-p "$project" \
"${compose_files[@]}" \
+4 -1
View File
@@ -63,7 +63,10 @@ def size_bytes(value):
def render_compose(file_names, project, extra_env=None, profiles=()):
if isinstance(file_names, str):
file_names = [file_names]
environment = dict(os.environ, APP_PROJECT=project, APP_NETWORK=f"{project}_default")
# The example file has no usable IDENTITY_KEY_SECRET, which Compose requires.
environment = dict(
os.environ, APP_PROJECT=project, APP_NETWORK=f"{project}_default", IDENTITY_KEY_SECRET="render-only-identity-key-secret"
)
for name in ("APP_HTTP_BIND", "APP_HTTP_PORT", "ML_BIND_ADDRESS", "APP_SUBNET", "APP_FRONTEND_IP", "TRUSTED_PROXY_CIDRS"):
environment.pop(name, None)
environment.update(extra_env or {})