Skip to content

feat(examples): configurable download URL, default to staging website on staging Cryptify#40

Merged
rubenhensen merged 1 commit into
mainfrom
chore/configurable-download-url
May 16, 2026
Merged

feat(examples): configurable download URL, default to staging website on staging Cryptify#40
rubenhensen merged 1 commit into
mainfrom
chore/configurable-download-url

Conversation

@rubenhensen
Copy link
Copy Markdown
Contributor

Summary

Files uploaded to the staging Cryptify (storage.staging.postguard.eu) are only retrievable through the staging PostGuard website at staging.postguard.eu — but both examples were printing/rendering download links pointing at postguard.eu, which 404s on staging content.

Adds a configurable base URL with a sensible default:

  • pg-dotnet: new PG_DOWNLOAD_URL env var / user-secret. Program.cs resolves it via IConfiguration and uses {downloadBaseUrl}/download?uuid=… in both flows' output.
  • pg-sveltekit: new PUBLIC_DOWNLOAD_URL env var. config.ts exports DOWNLOAD_URL; the success view in +page.svelte uses it for the /download?uuid=… link.

Default in both: https://staging.postguard.eu when *_CRYPTIFY_URL looks like a staging host (existing heuristic), else https://postguard.eu. Override either via env var / user-secret if your deployment differs.

Both READMEs and pg-sveltekit/.env.example document the new variable.

Test plan

  • pg-dotnet: dotnet run against default config — both flows print https://staging.postguard.eu/download?uuid=….
  • pg-sveltekit: run locally with default config and confirm the rendered download link points at staging.postguard.eu.
  • Set PG_DOWNLOAD_URL / PUBLIC_DOWNLOAD_URL explicitly and confirm the override takes effect.

/dobby please review

… on staging Cryptify

Files uploaded to the staging Cryptify are only retrievable through the
staging PostGuard website (staging.postguard.eu), but the examples were
displaying download links pointing at postguard.eu — which 404s on staging
content. Add a PG_DOWNLOAD_URL / PUBLIC_DOWNLOAD_URL variable with a
default that tracks the Cryptify staging heuristic, so the download URL
shown to the developer actually works against whatever Cryptify they
pointed the example at.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant