From 78a071ba024b70410e263e5fd2ce8786edf2dd50 Mon Sep 17 00:00:00 2001 From: drjones Date: Tue, 7 Apr 2026 21:35:52 -0700 Subject: [PATCH] Harden onion boot flow and deepen site surfaces Add persistent onion key backup and restore, improve startup resilience, and flesh out the major site verticals with richer navigation, search coverage, and operator documentation. Made-with: Cursor --- .gitignore | 41 + README.md | 283 +- app/account/hidden-services/page.tsx | 159 ++ app/api/btc/verify/route.ts | 121 + app/arb-academy/page.tsx | 46 + app/awards/page.tsx | 69 + app/barter/layout.tsx | 16 + app/barter/page.tsx | 184 ++ app/chatter/page.tsx | 142 + app/checkout/page.tsx | 60 + app/comparison/page.tsx | 245 ++ app/conspiracies/page.tsx | 34 + app/darknet-atlas/page.tsx | 192 ++ app/dashboard/page.tsx | 203 ++ app/drop-box/page.tsx | 89 + app/drops/page.tsx | 73 + app/easter-eggs/page.tsx | 40 + app/exchange/guidelines/page.tsx | 59 + app/exchange/layout.tsx | 5 + app/exchange/ledger/page.tsx | 93 + app/exchange/page.tsx | 172 ++ app/favicon.ico | Bin 0 -> 25931 bytes app/forum/handbook/page.tsx | 48 + app/forum/layout.tsx | 5 + app/forum/moderation/page.tsx | 56 + app/forum/page.tsx | 143 + app/forum/post/[id]/page.tsx | 174 ++ app/forum/reputation/page.tsx | 58 + app/forum/ring/[slug]/page.tsx | 141 + app/forum/submit/page.tsx | 105 + app/forum/t/[id]/page.tsx | 19 + app/game/page.tsx | 75 + app/globals.css | 293 ++ app/hidden-wiki/page.tsx | 273 ++ app/inner-circle/page.tsx | 89 + app/layout.tsx | 38 + app/links/page.tsx | 308 ++ app/market/analytics/page.tsx | 119 + app/market/intel/page.tsx | 97 + app/market/layout.tsx | 5 + app/market/operations/page.tsx | 102 + app/market/page.tsx | 185 ++ app/market/trust/page.tsx | 80 + app/messages/page.tsx | 33 + app/mixer/page.tsx | 173 ++ app/page.tsx | 308 ++ app/presswire/page.tsx | 93 + app/raffle/page.tsx | 93 + app/red-room/page.tsx | 69 + app/reviews/page.tsx | 228 ++ app/root-layout-client.tsx | 53 + app/sanctuary/page.tsx | 34 + app/search/page.tsx | 217 ++ app/secret-layer/page.tsx | 40 + app/security-analysis/page.tsx | 241 ++ app/sign-in/page.tsx | 108 + app/sign-up/page.tsx | 118 + app/support/page.tsx | 112 + app/syndicate/layout.tsx | 5 + app/syndicate/page.tsx | 33 + app/syndicate/routing/page.tsx | 34 + app/syndicate/topology/page.tsx | 33 + app/testimonials/page.tsx | 215 ++ app/trees/page.tsx | 82 + app/trust/page.tsx | 237 ++ app/vault/page.tsx | 144 + app/vendor/[slug]/page.tsx | 78 + app/vendor/apply/page.tsx | 209 ++ app/vendors/page.tsx | 112 + app/w/[slug]/page.tsx | 373 +++ app/wallets/page.tsx | 70 + app/webring/page.tsx | 46 + components/AccountCreation.tsx | 173 ++ components/AppProviders.tsx | 17 + components/ChatWidget.tsx | 156 + components/CheckoutFlow.tsx | 562 ++++ components/DDoSProtection.tsx | 100 + components/EncryptionDemo.tsx | 101 + components/ForumBoard.tsx | 220 ++ components/GlobalFakeSiteFooter.tsx | 20 + components/Hero.tsx | 173 ++ components/HubChatterPublicStrip.tsx | 150 + components/Navbar.tsx | 233 ++ components/OnionDisclosureBar.tsx | 100 + components/ParticleBackground.tsx | 135 + components/ProductCard.tsx | 188 ++ components/SecretLayer.tsx | 37 + components/WebringBadge.tsx | 31 + components/barter/BarterPitChrome.tsx | 94 + components/exchange/ExchangeSiteChrome.tsx | 124 + components/forum/ForumFeedToolbar.tsx | 101 + components/forum/ForumPostCard.tsx | 74 + components/forum/ForumSiteChrome.tsx | 167 ++ components/forum/ThreadVoteColumn.tsx | 64 + components/layouts/ThemedLayout.tsx | 112 + components/market/MarketSiteChrome.tsx | 190 ++ components/shop/ProductSocialBlock.tsx | 75 + components/shop/VendorShelfRow.tsx | 69 + components/site/LexiconStrip.tsx | 26 + components/syndicate/HubStrip.tsx | 21 + components/syndicate/SyndicateSiteChrome.tsx | 62 + contexts/AccountContext.tsx | 118 + contexts/CartContext.tsx | 149 + contexts/WalletContext.tsx | 196 ++ lib/barterState.ts | 118 + lib/cyberluxAccount.ts | 219 ++ lib/cyberluxEntry.ts | 18 + lib/cyberluxSearchIndex.ts | 528 ++++ lib/cyberluxZoneLexicon.ts | 153 + lib/darknetAtlas.ts | 515 ++++ lib/exchangeState.ts | 78 + lib/forumFeedFilter.ts | 12 + lib/forumRings.ts | 91 + lib/forumSort.ts | 22 + lib/forumState.ts | 345 +++ lib/merchantBtc.ts | 14 + lib/metaGame.ts | 83 + lib/nodeSkinChrome.ts | 16 + lib/onionRoutes.generated.ts | 92 + lib/placeholderOnion.ts | 3 + lib/shopCatalog.ts | 333 +++ lib/shopChatterThreads.ts | 292 ++ lib/shopFx.ts | 26 + lib/shopProductSocial.ts | 115 + lib/shopSellers.ts | 85 + lib/storeCreditStorage.ts | 38 + lib/syndicateNetwork.ts | 52 + lib/userActivityStats.ts | 34 + lib/vendorApplicationState.ts | 59 + lib/webring.ts | 40 + next.config.ts | 13 + nginx.example.conf | 34 + nginx/cyberlux-onion-servers.inc | 2689 ++++++++++++++++++ nginx/cyberlux-server-common.inc | 12 + package-lock.json | 1664 +++++++++++ package.json | 26 + postcss.config.mjs | 7 + proxy.ts | 144 + public/file.svg | 1 + public/globe.svg | 1 + public/next.svg | 1 + public/shop-assets/.gitkeep | 1 + public/vercel.svg | 1 + public/window.svg | 1 + scripts/backup-onion-keys.sh | 69 + scripts/classroom-ufw.sh | 21 + scripts/cyberlux.service | 19 + scripts/fix-next-perms.sh | 26 + scripts/generate-onion-config.cjs | 301 ++ scripts/generated/onion-labels.tsv | 43 + scripts/generated/onion-port-range.txt | 1 + scripts/generated/tor-dirs.txt | 43 + scripts/install-tor-onion.sh | 124 + scripts/onion-nodes.json | 47 + scripts/prebuild-clean-next.cjs | 68 + scripts/restore-onion-keys.sh | 50 + scripts/verify.cjs | 31 + start.sh | 248 ++ start_network.sh | 31 + tor/cyberlux-nodes.conf | 219 ++ torrc.example | 12 + tsconfig.json | 34 + 162 files changed, 21692 insertions(+), 39 deletions(-) create mode 100644 .gitignore create mode 100644 app/account/hidden-services/page.tsx create mode 100644 app/api/btc/verify/route.ts create mode 100644 app/arb-academy/page.tsx create mode 100644 app/awards/page.tsx create mode 100644 app/barter/layout.tsx create mode 100644 app/barter/page.tsx create mode 100644 app/chatter/page.tsx create mode 100644 app/checkout/page.tsx create mode 100644 app/comparison/page.tsx create mode 100644 app/conspiracies/page.tsx create mode 100644 app/darknet-atlas/page.tsx create mode 100644 app/dashboard/page.tsx create mode 100644 app/drop-box/page.tsx create mode 100644 app/drops/page.tsx create mode 100644 app/easter-eggs/page.tsx create mode 100644 app/exchange/guidelines/page.tsx create mode 100644 app/exchange/layout.tsx create mode 100644 app/exchange/ledger/page.tsx create mode 100644 app/exchange/page.tsx create mode 100644 app/favicon.ico create mode 100644 app/forum/handbook/page.tsx create mode 100644 app/forum/layout.tsx create mode 100644 app/forum/moderation/page.tsx create mode 100644 app/forum/page.tsx create mode 100644 app/forum/post/[id]/page.tsx create mode 100644 app/forum/reputation/page.tsx create mode 100644 app/forum/ring/[slug]/page.tsx create mode 100644 app/forum/submit/page.tsx create mode 100644 app/forum/t/[id]/page.tsx create mode 100644 app/game/page.tsx create mode 100644 app/globals.css create mode 100644 app/hidden-wiki/page.tsx create mode 100644 app/inner-circle/page.tsx create mode 100644 app/layout.tsx create mode 100644 app/links/page.tsx create mode 100644 app/market/analytics/page.tsx create mode 100644 app/market/intel/page.tsx create mode 100644 app/market/layout.tsx create mode 100644 app/market/operations/page.tsx create mode 100644 app/market/page.tsx create mode 100644 app/market/trust/page.tsx create mode 100644 app/messages/page.tsx create mode 100644 app/mixer/page.tsx create mode 100644 app/page.tsx create mode 100644 app/presswire/page.tsx create mode 100644 app/raffle/page.tsx create mode 100644 app/red-room/page.tsx create mode 100644 app/reviews/page.tsx create mode 100644 app/root-layout-client.tsx create mode 100644 app/sanctuary/page.tsx create mode 100644 app/search/page.tsx create mode 100644 app/secret-layer/page.tsx create mode 100644 app/security-analysis/page.tsx create mode 100644 app/sign-in/page.tsx create mode 100644 app/sign-up/page.tsx create mode 100644 app/support/page.tsx create mode 100644 app/syndicate/layout.tsx create mode 100644 app/syndicate/page.tsx create mode 100644 app/syndicate/routing/page.tsx create mode 100644 app/syndicate/topology/page.tsx create mode 100644 app/testimonials/page.tsx create mode 100644 app/trees/page.tsx create mode 100644 app/trust/page.tsx create mode 100644 app/vault/page.tsx create mode 100644 app/vendor/[slug]/page.tsx create mode 100644 app/vendor/apply/page.tsx create mode 100644 app/vendors/page.tsx create mode 100644 app/w/[slug]/page.tsx create mode 100644 app/wallets/page.tsx create mode 100644 app/webring/page.tsx create mode 100644 components/AccountCreation.tsx create mode 100644 components/AppProviders.tsx create mode 100644 components/ChatWidget.tsx create mode 100644 components/CheckoutFlow.tsx create mode 100644 components/DDoSProtection.tsx create mode 100644 components/EncryptionDemo.tsx create mode 100644 components/ForumBoard.tsx create mode 100644 components/GlobalFakeSiteFooter.tsx create mode 100644 components/Hero.tsx create mode 100644 components/HubChatterPublicStrip.tsx create mode 100644 components/Navbar.tsx create mode 100644 components/OnionDisclosureBar.tsx create mode 100644 components/ParticleBackground.tsx create mode 100644 components/ProductCard.tsx create mode 100644 components/SecretLayer.tsx create mode 100644 components/WebringBadge.tsx create mode 100644 components/barter/BarterPitChrome.tsx create mode 100644 components/exchange/ExchangeSiteChrome.tsx create mode 100644 components/forum/ForumFeedToolbar.tsx create mode 100644 components/forum/ForumPostCard.tsx create mode 100644 components/forum/ForumSiteChrome.tsx create mode 100644 components/forum/ThreadVoteColumn.tsx create mode 100644 components/layouts/ThemedLayout.tsx create mode 100644 components/market/MarketSiteChrome.tsx create mode 100644 components/shop/ProductSocialBlock.tsx create mode 100644 components/shop/VendorShelfRow.tsx create mode 100644 components/site/LexiconStrip.tsx create mode 100644 components/syndicate/HubStrip.tsx create mode 100644 components/syndicate/SyndicateSiteChrome.tsx create mode 100644 contexts/AccountContext.tsx create mode 100644 contexts/CartContext.tsx create mode 100644 contexts/WalletContext.tsx create mode 100644 lib/barterState.ts create mode 100644 lib/cyberluxAccount.ts create mode 100644 lib/cyberluxEntry.ts create mode 100644 lib/cyberluxSearchIndex.ts create mode 100644 lib/cyberluxZoneLexicon.ts create mode 100644 lib/darknetAtlas.ts create mode 100644 lib/exchangeState.ts create mode 100644 lib/forumFeedFilter.ts create mode 100644 lib/forumRings.ts create mode 100644 lib/forumSort.ts create mode 100644 lib/forumState.ts create mode 100644 lib/merchantBtc.ts create mode 100644 lib/metaGame.ts create mode 100644 lib/nodeSkinChrome.ts create mode 100644 lib/onionRoutes.generated.ts create mode 100644 lib/placeholderOnion.ts create mode 100644 lib/shopCatalog.ts create mode 100644 lib/shopChatterThreads.ts create mode 100644 lib/shopFx.ts create mode 100644 lib/shopProductSocial.ts create mode 100644 lib/shopSellers.ts create mode 100644 lib/storeCreditStorage.ts create mode 100644 lib/syndicateNetwork.ts create mode 100644 lib/userActivityStats.ts create mode 100644 lib/vendorApplicationState.ts create mode 100644 lib/webring.ts create mode 100644 next.config.ts create mode 100644 nginx.example.conf create mode 100644 nginx/cyberlux-onion-servers.inc create mode 100644 nginx/cyberlux-server-common.inc create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 postcss.config.mjs create mode 100644 proxy.ts create mode 100644 public/file.svg create mode 100644 public/globe.svg create mode 100644 public/next.svg create mode 100644 public/shop-assets/.gitkeep create mode 100644 public/vercel.svg create mode 100644 public/window.svg create mode 100644 scripts/backup-onion-keys.sh create mode 100755 scripts/classroom-ufw.sh create mode 100644 scripts/cyberlux.service create mode 100755 scripts/fix-next-perms.sh create mode 100755 scripts/generate-onion-config.cjs create mode 100644 scripts/generated/onion-labels.tsv create mode 100644 scripts/generated/onion-port-range.txt create mode 100644 scripts/generated/tor-dirs.txt create mode 100755 scripts/install-tor-onion.sh create mode 100644 scripts/onion-nodes.json create mode 100644 scripts/prebuild-clean-next.cjs create mode 100644 scripts/restore-onion-keys.sh create mode 100755 scripts/verify.cjs create mode 100755 start.sh create mode 100755 start_network.sh create mode 100644 tor/cyberlux-nodes.conf create mode 100644 torrc.example create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ef6a52 --- /dev/null +++ b/.gitignore @@ -0,0 +1,41 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/versions + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files (can opt-in for committing if needed) +.env* + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/README.md b/README.md index 28a683d..40ec067 100644 --- a/README.md +++ b/README.md @@ -1,67 +1,272 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). +# CYBERLUX -## Getting Started +> Neon storefront. Forty-three onion doors. One build. One app. No dead air. -First, run the development server: +CyberLux is a layered Next.js fiction stack built for dark-web literacy, classroom demos, mirror discipline drills, and absurdly overbuilt cyberpunk presentation. It runs one app behind Tor + nginx, then fans that app out into dedicated v3 hidden services for the hub, forum, exchange, market, crawler, syndicate, wiki layer, and every other top-level surface in `scripts/onion-nodes.json`. + +This repo is built to feel like a real underground property while still being a controlled demo environment: + +- `43` Tor v3 services +- stable loopback range `127.0.0.1:8080–8122` +- Next bound only to `127.0.0.1:3000` +- one `.onion` per major surface +- persistent hidden-service identity keyed by `HiddenServiceDir` +- self-healing backup / restore of onion key directories + +## What It Does + +CyberLux boots a single Next.js app and projects it through multiple onion entry points. + +- `hub` is the main storefront +- `forum` is Void Aggregate +- `exchange` is the classifieds stack +- `market` is the full catalog vertical +- `search` is Void Crawler +- `wiki` is the hidden-wiki layer +- `w` is the syndicate shell network +- dozens of additional dedicated onions map directly to top-level app routes + +The routing layer uses host-aware rewrites so a dedicated onion feels like its own property without forking the app into 43 separate deployments. + +## One-Command Launch + +Install system deps first on Debian/Ubuntu: ```bash -npm run dev -# or -yarn dev -# or -pnpm dev -# or -bun dev +sudo apt install tor nginx ``` -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. - -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. - -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. - -## CyberLux on Tor (classroom / demo) - -The UI uses fictional `.onion` names in places; **live addresses come from your Tor daemon** after you install the hidden services. - -**One-command launch:** install `tor` and `nginx` (`apt install tor nginx` on Debian/Ubuntu), then: +Then run: ```bash -chmod +x start.sh # once -git pull && ./start.sh +chmod +x start.sh +./start.sh ``` -The first step regenerates configs from `scripts/onion-nodes.json` (43 Tor v3 services → loopback `8080–8122`, one `.onion` per top-level area). Then it runs `git pull` if `.git` exists (failure is non-fatal), `npm install` / `npm run build`. If `.next/` is **not writable** (common after a `sudo npm run build`), the script runs **`sudo chown`** on `.next` for you. It then installs Tor + nginx via `sudo` (skip with `CYBERLUX_SKIP_TOR=1` for local-only), prints **every** `.onion` URL, and starts Next on `127.0.0.1:3000`. Use **Tor Browser** with `http://YOUR56CHAR.onion`. +What `./start.sh` does: -To add or reorder onions, edit `scripts/onion-nodes.json` and run `node scripts/generate-onion-config.cjs` (also runs automatically on `npm run build` and via `./start.sh`). +1. regenerates Tor / nginx / app route maps from `scripts/onion-nodes.json` +2. runs `git pull --ff-only` if the repo has `.git` (failure is non-fatal) +3. runs `npm install` +4. repairs `.next` ownership if a root-owned build left it unwritable +5. runs a production build +6. restores backed-up onion keys if any hidden-service directories are missing +7. installs Tor + nginx config only when it actually changed +8. waits for all onion hostname files, not just the hub +9. refreshes the onion key backup set +10. prints every live `.onion` URL +11. starts Next on `127.0.0.1:3000` -Manual steps (equivalent): `sudo bash scripts/install-tor-onion.sh`, then `npm run build && npm run start:onion`. +Use Tor Browser and open the printed URLs as: -**Start at boot (systemd):** copy `scripts/cyberlux.service`, set `User`, `Group`, and `WorkingDirectory` to your clone, `sudo install -m 0644 scripts/cyberlux.service /etc/systemd/system/`, then `sudo systemctl daemon-reload && sudo systemctl enable --now cyberlux.service`. Tor and nginx should already be enabled; this only keeps Next running after reboot. +```text +http://<56-char-v3-address>.onion +``` -**Build fails with `EACCES` on `unlink` / `build-diagnostics.json`:** Next.js writes metadata under `.next/diagnostics/build-diagnostics.json` (build stage, options — not an app bug). If those files were created as **root** (e.g. `sudo npm run build`), your user cannot overwrite them. **`npm run build` now stops in `prebuild`** with a clear error instead of a cryptic unlink message. Fix once: +## Persistent Onion Addresses + +Yes: the onion addresses are meant to persist. + +Each service uses a fixed Tor directory: + +```tor +HiddenServiceDir /var/lib/tor/ +HiddenServicePort 80 127.0.0.1: +``` + +That means the `.onion` address remains stable as long as: + +- the `torDir` names in `scripts/onion-nodes.json` do not change +- `/var/lib/tor/` is preserved +- or the backup set can restore those directories + +Addresses do **not** rotate on normal app restarts, rebuilds, or standard Tor restarts. + +## Self-Healing Onion Identity + +CyberLux now includes automatic onion key persistence tooling: + +- `scripts/backup-onion-keys.sh` +- `scripts/restore-onion-keys.sh` + +Backup location: + +```text +/var/backups/cyberlux-onion-keys/current +``` + +Behavior: + +- after boot, ready onion service directories are backed up +- on next boot, if a service dir is missing from `/var/lib/tor`, it is restored from backup +- Tor identity is preserved across ordinary host mistakes, partial deletions, or service-dir drift recovery + +This is the difference between “looks cool in a screenshot” and “survives operator error.” + +## Tor / nginx Topology + +Source of truth: + +- `scripts/onion-nodes.json` + +Generated artifacts: + +- `tor/cyberlux-nodes.conf` +- `nginx/cyberlux-onion-servers.inc` +- `lib/onionRoutes.generated.ts` +- `scripts/generated/tor-dirs.txt` +- `scripts/generated/onion-labels.tsv` +- `scripts/generated/onion-port-range.txt` + +Install path: + +- `/etc/tor/cyberlux-nodes.conf` +- `/etc/nginx/cyberlux-server-common.inc` +- `/etc/nginx/cyberlux-onion-servers.inc` +- `/etc/nginx/sites-available/cyberlux-onion` + +Runtime: + +- Next.js: `127.0.0.1:3000` +- nginx onion vhosts: `127.0.0.1:8080–8122` +- Tor exposes the public `.onion` endpoints + +## Manual Ops + +Install or refresh Tor/nginx config: + +```bash +sudo bash scripts/install-tor-onion.sh +``` + +Back up onion keys immediately: + +```bash +sudo bash scripts/backup-onion-keys.sh +``` + +Restore missing onion keys: + +```bash +sudo bash scripts/restore-onion-keys.sh +``` + +Run local-only, skipping Tor/nginx: + +```bash +CYBERLUX_SKIP_TOR=1 ./start.sh +``` + +Start app without the helper: + +```bash +npm run build +npm run start:onion +``` + +## Boot At Startup + +`scripts/cyberlux.service` is included as a systemd template for the Next process. + +Before installing it, set: + +- `User=` +- `Group=` +- `WorkingDirectory=` + +Then install: + +```bash +sudo install -m 0644 scripts/cyberlux.service /etc/systemd/system/cyberlux.service +sudo systemctl daemon-reload +sudo systemctl enable --now cyberlux.service +``` + +Notes: + +- Tor and nginx should already be installed and enabled +- the service unit keeps the Next process alive +- Tor/nginx config is still managed by the repo scripts + +## Verification + +Run the full local verification suite: + +```bash +npm run verify +``` + +That checks: + +- onion config generation +- TypeScript +- shell syntax for boot / install / backup / restore scripts +- full Next production build + +## Common Failure: `.next` Permission Hell + +If you previously ran a build with `sudo`, `.next` may be root-owned and Next will fail with `EACCES` during unlink / diagnostics writes. + +Fix once: ```bash sudo bash scripts/fix-next-perms.sh ``` -(or `sudo chown -R "$USER" .next` / `sudo rm -rf .next`), then `npm run build` or `./start.sh` again. +Then rerun: -**Verify locally:** after fixing permissions, run `npm run verify` — regenerates onion configs, runs `tsc --noEmit`, checks shell scripts, and runs a production build. +```bash +./start.sh +``` -**Security notes (for instructors):** No stack is “perfectly” secure. This setup keeps the app off the public internet: nginx and Next listen on loopback; Tor exposes onion endpoints only. Optional: `sudo bash scripts/classroom-ufw.sh` — do not publish `3000` or nginx loopback ports (`8080–8122`) to the public internet. Tor improves reachability privacy for the **service** vs raw IP hosting; it does not make unsafe application code safe or absolve lawful/ethical/use-policy obligations—use only for legitimate teaching and demos. +## Security Notes -## Learn More +CyberLux is hardened for a demo stack, not sold as magic invisibility. -To learn more about Next.js, take a look at the following resources: +- Next and nginx bind to loopback only +- Tor exposes the onion endpoints +- do **not** publish `3000` or `8080–8122` to the public internet +- optional host firewall script: `sudo bash scripts/classroom-ufw.sh` +- the app can still be insecure if the app code is insecure +- operational mistakes still matter more than branding -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. +Tor hides service reachability better than raw-IP hosting. It does not redeem bad application logic, bad operator habits, or bad judgment. -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! +## Site Map -## Deploy on Vercel +Core verticals: -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. +- `/` hub storefront +- `/market` full catalog +- `/forum` Void Aggregate +- `/exchange` classifieds +- `/barter` Ash Pit +- `/search` Void Crawler +- `/hidden-wiki` wiki layer +- `/darknet-atlas` taxonomy / atlas +- `/syndicate` shell network +- `/dashboard` personal relay +- `/account/hidden-services` mirror map -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. +There are additional dedicated onions for many top-level routes beyond those. + +## Stack + +- Next.js `16` +- React `19` +- Tailwind CSS `4` +- nginx +- Tor hidden services +- generated route / host mapping + +## Final Word + +CyberLux is supposed to boot like a machine that knows what it is: + +- same onion doors +- same identities +- no shallow mirrors +- no fake “self healing” copy without actual restore logic +- no dead routes pretending to be part of the network + +If it starts, it should start hard. diff --git a/app/account/hidden-services/page.tsx b/app/account/hidden-services/page.tsx new file mode 100644 index 0000000..ddc3bcb --- /dev/null +++ b/app/account/hidden-services/page.tsx @@ -0,0 +1,159 @@ +"use client"; + +import { FormEvent, useEffect, useState } from "react"; +import Link from "next/link"; +import { useAccount } from "@/contexts/AccountContext"; +import { exportPortableAccountJson, importPortableAccountJson } from "@/lib/cyberluxAccount"; + +export default function HiddenServicesAccountPage() { + const { user, hydrated, refreshProfile } = useAccount(); + const [importText, setImportText] = useState(""); + const [importMsg, setImportMsg] = useState<{ kind: "ok" | "err"; text: string } | null>(null); + const [copyMsg, setCopyMsg] = useState(null); + + useEffect(() => { + setImportMsg(null); + }, [importText]); + + const onCopyBundle = async () => { + setCopyMsg(null); + const json = exportPortableAccountJson(); + if (!json) return; + try { + await navigator.clipboard.writeText(json); + setCopyMsg("Copied. Paste on another onion host → Import below."); + } catch { + setCopyMsg("Could not use clipboard — select and copy manually."); + } + }; + + const onImport = (e: FormEvent) => { + e.preventDefault(); + setImportMsg(null); + const res = importPortableAccountJson(importText.trim()); + if (!res.ok) { + setImportMsg({ kind: "err", text: res.error }); + return; + } + refreshProfile(); + setImportText(""); + setImportMsg({ kind: "ok", text: "Identity loaded on this hostname. You can use dashboard, forum, exchange, and barter here." }); + }; + + if (!hydrated) { + return ( +
+ Loading… +
+ ); + } + + return ( +
+
+

hidden services

+

Account on every entry node

+

+ Each hidden-service hostname gets an isolated browser vault. Keys you mint on the forum onion do not + automatically exist on the exchange or wiki host — mirror your identity deliberately or enroll separately. +

+ +
    +
  1. + Create a handle on this host:{" "} + + Sign up + {" "} + (or{" "} + + Sign in + + ). +
  2. +
  3. + Repeat on other mirrors with the{" "} + same handle and passphrase,{" "} + or export a bundle here (signed in) and import it on the other host. +
  4. +
  5. + Use{" "} + + Dashboard + + ,{" "} + + Forum + + ,{" "} + + Exchange + + , and{" "} + + Barter + {" "} + once this hostname knows your session. +
  6. +
+ + {user ? ( +
+

Portable bundle

+

+ Signed in as @{user.username}. The bundle contains a + passphrase fingerprint — do not share it. +

+ + {copyMsg ?

{copyMsg}

: null} +
+ ) : ( +

+ + Sign in + {" "} + to copy an export bundle for another host. +

+ )} + +
+

Import bundle

+

Paste JSON from "Copy identity bundle" on the host where you exported it.

+
+