Repository navigation
Final improvements and cleanup #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,74 @@ | ||
| # StegNet frontend website | ||
| # StegNet frontend | ||
|
|
||
| Welcome to the StegNet frontend website repo! | ||
| The public StegNet website. A statically-exported [Next.js](https://nextjs.org) | ||
| site, served by Caddy from a small Docker image and self-hosted behind Traefik. | ||
|
|
||
| ## Stack | ||
|
|
||
| - **Next.js 16** (App Router) — exported to static HTML (`output: "export"`) | ||
| - **Bun** — package manager and build runtime | ||
| - **Tailwind CSS v4** + **shadcn** (Base UI) components | ||
| - **Sentry** — client error tracking, releases, source maps | ||
| - **LogTape** — structured logging | ||
| - **Caddy** — static file server in the runtime image | ||
|
|
||
| ## Local development | ||
|
|
||
| ```bash | ||
| bun install | ||
| bun dev | ||
| ``` | ||
|
|
||
| Then open http://localhost:3000. | ||
|
|
||
| ### Environment | ||
|
|
||
| Local env lives in `.env.local` (gitignored). The site reads: | ||
|
|
||
| | Variable | Purpose | | ||
| | --- | --- | | ||
| | `NEXT_PUBLIC_SENTRY_DSN` | Sentry DSN (public) | | ||
| | `NEXT_PUBLIC_APP_VERSION` | Version shown in the footer (set at build) | | ||
| | `NEXT_PUBLIC_COMMIT_SHA` | Commit shown in the footer (set at build) | | ||
|
|
||
| Sentry `environment` is derived at runtime from the hostname (`staging.*` → | ||
| staging, `localhost` → development, otherwise production), so one build serves | ||
| every environment. | ||
|
|
||
| ## Build | ||
|
|
||
| ```bash | ||
| bun run build | ||
| ``` | ||
|
|
||
| Produces a static site in `out/`. | ||
|
|
||
| ## Docker | ||
|
|
||
| The image builds the static export and serves it with Caddy on port **8080** | ||
| (non-root). TLS is terminated upstream by Traefik. | ||
|
|
||
| ```bash | ||
| docker build \ | ||
| --build-arg VERSION=1.2.3 \ | ||
| --build-arg COMMIT_SHA="$(git rev-parse HEAD)" \ | ||
| --secret id=SENTRY_AUTH_TOKEN,env=SENTRY_AUTH_TOKEN \ | ||
| -t stegnet-frontpage . | ||
| ``` | ||
|
|
||
| ## Release & deploy | ||
|
|
||
| Deploys are driven by **git tags**. Pushing a `vX.Y.Z` tag triggers | ||
| `.github/workflows/publish-image.yml`, which: | ||
|
|
||
| 1. builds the image (version + commit baked in) and creates the Sentry release | ||
| with source maps, | ||
| 2. pushes `ghcr.io/stegnet/frontpage:<version>` and `:latest` to GHCR, | ||
| 3. records a Sentry deploy and calls the Portainer webhook to roll out. | ||
|
|
||
| ```bash | ||
| git tag v1.2.3 | ||
| git push origin v1.2.3 | ||
| ``` | ||
|
|
||
| Portainer pulls the new tag from GHCR and Caddy serves it behind Traefik. | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import Link from "next/link"; | ||
|
|
||
| export default function NotFound() { | ||
| return ( | ||
| <main className="relative flex flex-1 flex-col items-center justify-center overflow-hidden px-6 text-center"> | ||
| <div | ||
| aria-hidden | ||
| className="pointer-events-none absolute left-1/2 top-1/3 -z-10 h-[40rem] w-[40rem] -translate-x-1/2 -translate-y-1/2 rounded-full bg-gradient-to-tr from-amber-500/20 via-fuchsia-500/10 to-transparent blur-3xl" | ||
| /> | ||
|
|
||
| <p className="mb-4 text-sm font-medium tracking-widest text-muted-foreground"> | ||
| 404 | ||
| </p> | ||
|
|
||
| <h1 className="max-w-2xl text-balance text-3xl font-semibold tracking-tight sm:text-5xl"> | ||
| This page wandered off. | ||
| </h1> | ||
|
|
||
| <p className="mt-6 max-w-md text-balance text-base text-muted-foreground"> | ||
| The page you're after doesn't exist — or isn't ready yet. | ||
| </p> | ||
|
|
||
| <Link | ||
| href="/" | ||
| className="mt-8 inline-flex items-center rounded-full border border-border px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground" | ||
| > | ||
| Back home | ||
| </Link> | ||
| </main> | ||
| ); | ||
| } | ||
|
NullishUsername marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.