diff --git a/README.md b/README.md index 9355c1c..cca0d5c 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,22 @@ sha256sum -c SHA256SUMS Für die Installation unter Linux x64: `sudo ./install-x64.sh`. Der Dienst verwendet Port 18080. Vor dem produktiven Einsatz SMTP und Reverse Proxy gemäß der Betriebsdokumentation konfigurieren. Der Installer erhält bestehende Anfrage- und SMTP-Konfigurationen. Generierte Binärdateien und Prüfsummen werden nicht versioniert. +## Repository-Struktur + +```text +main.go # Schlanker Programmeinstieg +internal/website/ # Anwendung, HTTP-Handler und Go-Tests + content/ # Eingebettete Wiki- und Code-Dokumentation (JSON) + static/ # CSS, JavaScript, Bilder, Videos + templates/ # HTML-Templates +scripts/ # Interne Build-/Update-Helfer +deploy/ # Aktive systemd-, SMTP- und Nginx-Beispiele + legacy/ # Historische Konfiguration, nicht neu installieren +docs/ # Entwicklungs- und Betriebsdokumentation +``` + +Die öffentlichen Build-/Installations-Einstiege bleiben `./build-x64.sh` und `./install-x64.sh`. Der Go-Code bleibt absichtlich zunächst in einem gemeinsamen internen Paket: die versionsabhängigen Inhaltsaktualisierungen greifen auf denselben Zustand zu. Dateinamen und Initialisierungsreihenfolge bleiben erhalten. + ## Dokumentation | Dokument | Inhalt | diff --git a/build-all.sh b/build-all.sh deleted file mode 100755 index 00c2b7c..0000000 --- a/build-all.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -# v33 ist bewusst nur für Linux x86_64 vorgesehen. -set -Eeuo pipefail -exec "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/build-x64.sh" "$@" diff --git a/deploy/apache-viewgit-main-domain.conf b/deploy/legacy/apache-viewgit-main-domain.conf similarity index 100% rename from deploy/apache-viewgit-main-domain.conf rename to deploy/legacy/apache-viewgit-main-domain.conf diff --git a/deploy/nginx-viewgit-main-domain.conf b/deploy/legacy/nginx-viewgit-main-domain.conf similarity index 100% rename from deploy/nginx-viewgit-main-domain.conf rename to deploy/legacy/nginx-viewgit-main-domain.conf diff --git a/deploy/opengenesis-wiki-download-stats.conf b/deploy/legacy/opengenesis-wiki-download-stats.conf similarity index 100% rename from deploy/opengenesis-wiki-download-stats.conf rename to deploy/legacy/opengenesis-wiki-download-stats.conf diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index d9e66c4..39faf18 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,15 @@ Historische Änderungsprotokolle in Versionsreihenfolge. Ältere Aussagen, Downloads und Repository-Links dokumentieren den damaligen Stand und sind keine aktuellen Betriebsanweisungen. +## Repository-Wartung – 03.12.2026 + +- Anwendungscode und Tests nach `internal/website/` verschoben, JSON-Inhalte nach `internal/website/content/`. +- Aktive Deployment-Konfiguration von historischen Beispielen getrennt. +- Interne Update- und alternative Build-Skripte nach `scripts/` verschoben. +- Website-Version bleibt v35; keine beabsichtigte Änderung an HTTP-Routen oder Seiteninhalten. + +--- + ## OpenGenesisLINK Wiki v16 – OpenSimulator-Integration **Stand der Dokumentation:** 8. Oktober 2026 diff --git a/docs/OPERATIONS.md b/docs/OPERATIONS.md index ad894ea..9da6b72 100644 --- a/docs/OPERATIONS.md +++ b/docs/OPERATIONS.md @@ -2,6 +2,8 @@ Aktueller dokumentierter Website-Stand: v35. Historische SEO-Angaben sind entsprechend gekennzeichnet. +Die aktiven Konfigurationsbeispiele liegen in `deploy/`. `deploy/legacy/` ist ausschließlich Archiv (ViewGit und Downloadzähler sind seit v34 öffentlich deaktiviert). Die früheren alternativen Einstiege `build-all.sh` und `update-amd64.sh` befinden sich nun unter `scripts/`; bevorzugt werden die unveränderten Einstiegspfade `./build-x64.sh` und `./install-x64.sh`. + ## Produktanfragen und Bereitstellung Die Website verteilt **keine Softwarepakete oder proprietären Quelltexte** mehr. Anstelle der Download-Buttons ist ein zweisprachiges Modal für Projektanfragen aktiv. Name, E-Mail, Grid-Name und Projektbeschreibung sind Pflichtfelder; Telefon, Organisation, URL, Regionen und Zeitplan optional. Das Anfrageformular speichert jeden zulässigen Datensatz zunächst mit restriktiven Dateirechten in `/var/lib/opengenesis-wiki/inquiries` und benachrichtigt anschließend **info@opengenesislink.de** per verschlüsseltem SMTP. diff --git a/install-x64.sh b/install-x64.sh index fd1c872..4c58f8b 100755 --- a/install-x64.sh +++ b/install-x64.sh @@ -2,4 +2,4 @@ # Einheitlicher Installations-Einstieg für Linux x86_64/AMD64. set -Eeuo pipefail HERE="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" -exec "$HERE/update-amd64.sh" "$@" +exec "$HERE/scripts/update-amd64.sh" "$@" diff --git a/branding_v27.go b/internal/website/branding_v27.go similarity index 99% rename from branding_v27.go rename to internal/website/branding_v27.go index df934c6..e67702f 100644 --- a/branding_v27.go +++ b/internal/website/branding_v27.go @@ -1,4 +1,4 @@ -package main +package website import ( "html/template" diff --git a/code_wiki.go b/internal/website/code_wiki.go similarity index 95% rename from code_wiki.go rename to internal/website/code_wiki.go index bc485c2..a6b5e1c 100644 --- a/code_wiki.go +++ b/internal/website/code_wiki.go @@ -1,4 +1,4 @@ -package main +package website import ( "embed" @@ -11,7 +11,7 @@ import ( // The public Code Wiki describes architecture and verified change history, // not distribution of proprietary source files or private repository views. // -//go:embed code_docs_v35.json +//go:embed content/code_docs_v35.json var codeDocsJSON embed.FS type CodeDoc struct { @@ -33,7 +33,7 @@ type CodeNavLink struct { var codeDocs []CodeDoc func init() { - bytes, err := codeDocsJSON.ReadFile("code_docs_v35.json") + bytes, err := codeDocsJSON.ReadFile("content/code_docs_v35.json") if err != nil { panic(err) } diff --git a/code_wiki_v35_test.go b/internal/website/code_wiki_v35_test.go similarity index 99% rename from code_wiki_v35_test.go rename to internal/website/code_wiki_v35_test.go index 00c2072..03b0a1d 100644 --- a/code_wiki_v35_test.go +++ b/internal/website/code_wiki_v35_test.go @@ -1,4 +1,4 @@ -package main +package website import ( "encoding/xml" diff --git a/compare_v26.go b/internal/website/compare_v26.go similarity index 99% rename from compare_v26.go rename to internal/website/compare_v26.go index 8301017..39ffea7 100644 --- a/compare_v26.go +++ b/internal/website/compare_v26.go @@ -1,4 +1,4 @@ -package main +package website import ( "fmt" diff --git a/content.go b/internal/website/content.go similarity index 99% rename from content.go rename to internal/website/content.go index 4176743..b337251 100644 --- a/content.go +++ b/internal/website/content.go @@ -1,4 +1,4 @@ -package main +package website import "html/template" diff --git a/code_docs_v35.json b/internal/website/content/code_docs_v35.json similarity index 100% rename from code_docs_v35.json rename to internal/website/content/code_docs_v35.json diff --git a/docs_v18.json b/internal/website/content/docs_v18.json similarity index 100% rename from docs_v18.json rename to internal/website/content/docs_v18.json diff --git a/wiki1011_extra.json b/internal/website/content/wiki1011_extra.json similarity index 100% rename from wiki1011_extra.json rename to internal/website/content/wiki1011_extra.json diff --git a/wiki2026.json b/internal/website/content/wiki2026.json similarity index 100% rename from wiki2026.json rename to internal/website/content/wiki2026.json diff --git a/wiki_legal_v20.json b/internal/website/content/wiki_legal_v20.json similarity index 100% rename from wiki_legal_v20.json rename to internal/website/content/wiki_legal_v20.json diff --git a/wiki_v28_articles.json b/internal/website/content/wiki_v28_articles.json similarity index 100% rename from wiki_v28_articles.json rename to internal/website/content/wiki_v28_articles.json diff --git a/wiki_v29_dotnet10.json b/internal/website/content/wiki_v29_dotnet10.json similarity index 100% rename from wiki_v29_dotnet10.json rename to internal/website/content/wiki_v29_dotnet10.json diff --git a/wiki_v30_net10.json b/internal/website/content/wiki_v30_net10.json similarity index 100% rename from wiki_v30_net10.json rename to internal/website/content/wiki_v30_net10.json diff --git a/docs_v18.go b/internal/website/docs_v18.go similarity index 94% rename from docs_v18.go rename to internal/website/docs_v18.go index 1025dee..d3b38b9 100644 --- a/docs_v18.go +++ b/internal/website/docs_v18.go @@ -1,4 +1,4 @@ -package main +package website import ( _ "embed" @@ -7,7 +7,7 @@ import ( "log" ) -//go:embed docs_v18.json +//go:embed content/docs_v18.json var installDocsJSON []byte func applyDownloadInstallDocs() { diff --git a/download_counter.go b/internal/website/download_counter.go similarity index 99% rename from download_counter.go rename to internal/website/download_counter.go index a94ae33..6b53c4d 100644 --- a/download_counter.go +++ b/internal/website/download_counter.go @@ -1,4 +1,4 @@ -package main +package website import ( "encoding/json" diff --git a/github_release_download.go b/internal/website/github_release_download.go similarity index 99% rename from github_release_download.go rename to internal/website/github_release_download.go index 0397feb..f365cb4 100644 --- a/github_release_download.go +++ b/internal/website/github_release_download.go @@ -1,4 +1,4 @@ -package main +package website import ( "encoding/json" diff --git a/github_release_download_test.go b/internal/website/github_release_download_test.go similarity index 99% rename from github_release_download_test.go rename to internal/website/github_release_download_test.go index 3067f9f..34421fa 100644 --- a/github_release_download_test.go +++ b/internal/website/github_release_download_test.go @@ -1,4 +1,4 @@ -package main +package website import ( "encoding/json" diff --git a/github_sync.go b/internal/website/github_sync.go similarity index 99% rename from github_sync.go rename to internal/website/github_sync.go index 84db053..f2fec25 100644 --- a/github_sync.go +++ b/internal/website/github_sync.go @@ -1,4 +1,4 @@ -package main +package website // GitHub-driven project status. Documentation prose is deliberately not rewritten // from unreviewed commits: only verifiable repository facts update automatically. diff --git a/github_sync_test.go b/internal/website/github_sync_test.go similarity index 99% rename from github_sync_test.go rename to internal/website/github_sync_test.go index d2f8b3c..aebac7a 100644 --- a/github_sync_test.go +++ b/internal/website/github_sync_test.go @@ -1,4 +1,4 @@ -package main +package website import ( "context" diff --git a/grid_directory.go b/internal/website/grid_directory.go similarity index 99% rename from grid_directory.go rename to internal/website/grid_directory.go index 263f8b9..106e6b1 100644 --- a/grid_directory.go +++ b/internal/website/grid_directory.go @@ -1,4 +1,4 @@ -package main +package website import ( "html/template" diff --git a/handover5.go b/internal/website/handover5.go similarity index 99% rename from handover5.go rename to internal/website/handover5.go index d0d792d..aa8dd54 100644 --- a/handover5.go +++ b/internal/website/handover5.go @@ -1,4 +1,4 @@ -package main +package website import "html/template" diff --git a/inquiries.go b/internal/website/inquiries.go similarity index 99% rename from inquiries.go rename to internal/website/inquiries.go index b7fbe1a..520c12b 100644 --- a/inquiries.go +++ b/internal/website/inquiries.go @@ -1,4 +1,4 @@ -package main +package website // Product enquiries are received by the Go service and durably stored in a // private, operator-readable inbox. The public API cannot list or retrieve them. diff --git a/inquiry_mail.go b/internal/website/inquiry_mail.go similarity index 99% rename from inquiry_mail.go rename to internal/website/inquiry_mail.go index c3be661..17a94c7 100644 --- a/inquiry_mail.go +++ b/internal/website/inquiry_mail.go @@ -1,4 +1,4 @@ -package main +package website // Each product enquiry is first stored on local disk, then sent over an // authenticated, TLS-protected SMTP connection. The durable inbox is also a diff --git a/inquiry_mail_test.go b/internal/website/inquiry_mail_test.go similarity index 99% rename from inquiry_mail_test.go rename to internal/website/inquiry_mail_test.go index d3290d3..b38df2d 100644 --- a/inquiry_mail_test.go +++ b/internal/website/inquiry_mail_test.go @@ -1,4 +1,4 @@ -package main +package website import ( "encoding/json" diff --git a/legal_v20.go b/internal/website/legal_v20.go similarity index 98% rename from legal_v20.go rename to internal/website/legal_v20.go index e07b443..d8813cb 100644 --- a/legal_v20.go +++ b/internal/website/legal_v20.go @@ -1,4 +1,4 @@ -package main +package website import ( _ "embed" @@ -8,7 +8,7 @@ import ( "strings" ) -//go:embed wiki_legal_v20.json +//go:embed content/wiki_legal_v20.json var legalV20Data []byte // applyLegalV20 runs AFTER the historical v16/v17 content rewrites and the v18 diff --git a/internal/website/main.go b/internal/website/main.go new file mode 100644 index 0000000..01d2020 --- /dev/null +++ b/internal/website/main.go @@ -0,0 +1,483 @@ +package website + +import ( + "embed" + "encoding/json" + "fmt" + "html/template" + "io/fs" + "log" + "net/http" + "os" + "sort" + "strings" + "time" +) + +const githubURL = "https://github.com/opengenesislink/opengenesislinkserver" +const githubSponsorURL = "https://github.com/sponsors/opengenesislink" +const forumURL = "https://forum.opengenesislink.de" +const viewGitURL = "https://opengenesislink.de/viewgit/" + +//go:embed templates/*.html static/*/* +var assets embed.FS + +type NavItem struct { + Title string + Icon string + Href string +} + +type NavGroup struct { + Title string + Items []NavItem +} + +type Feature struct { + Icon, Title, Text, Href, CTA string +} + +type Topic struct { + Kind, Badge, Title, Summary, Date, Href string +} + +// GridEntry is an editorial directory entry, not a real-time availability claim. +type GridEntry struct { + ID, Name, HGAddress, Platform, SummaryDE, SummaryEN, DetailsDE, DetailsEN string +} + +type Article struct { + Slug string + TitleDE string + TitleEN string + DescriptionDE string + DescriptionEN string + BodyDE template.HTML + BodyEN template.HTML + SectionDE string + SectionEN string + Updated string + Image string + ImageAltDE string + ImageAltEN string +} + +type PageData struct { + Lang string + OtherLang string + Path string + Title string + Description string + CanonicalURL string + AlternateDEURL string + AlternateENURL string + AlternateDefaultURL string + SEOImageURL string + SEOJSON template.JS + OGType string + Version string + Year int + GitHubURL string + SponsorURL string + ForumURL string + Nav []NavGroup + Features []Feature + Topics []Topic + Article *Article + Grids []GridEntry + ArticleBody template.HTML + IsHome bool + FeatureStatus []FeatureStatus + LSLStatus []LSLStatusItem + OverallProgress int + LSLProgress int + MainVersion string + DevVersion string + DevBranch string + LSLFunctionsImplemented int + LSLFunctionsPartial int + LSLFunctionsExecutable int + LSLFunctionsTotal int + LSLEventsImplemented int + LSLEventsPartial int + LSLEventsExecutable int + LSLEventsTotal int + OGLImplemented int + OGLTotal int + Sync LiveProjectData + StableDownloadReady bool + IsCode bool + CodeSlug string + CodeTitle string + CodeLead string + CodeContent template.HTML + CodeUpdated string + CodeNav []CodeNavLink + CodeRoot string +} + +// Run starts the standalone website HTTP service. +func Run() { + applyHandover5() + applyV11Extras() + applyStatus16() + applyPlainLanguage() + applyStatus2026() + applyUpdates1011() + applyDownloadInstallDocs() + applyLegalV20() + applyCurrentProjectNavigation() + applyTeamV26() + applyComparisonV26() + addLiveProjectArticle() + applyV27Branding() + applyV28Documentation() + applyV29DotNet10() + applyV30Net10() + applyV31Privacy() + applyV33Stable() + applyV34Closed() + tmpl := template.Must(template.ParseFS(assets, "templates/layout.html", "templates/home.html", "templates/article.html", "templates/codewiki.html")) + staticFS, err := fs.Sub(assets, "static") + if err != nil { + log.Fatal(err) + } + + mux := http.NewServeMux() + mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.FS(staticFS)))) + mux.Handle("/wiki-static/", http.StripPrefix("/wiki-static/", http.FileServer(http.FS(staticFS)))) + // Downloads and source browsing are deliberately unavailable even if old + // proxy rules or bookmarks continue to point to these routes. + mux.HandleFunc("/download/", closedGone) + mux.HandleFunc("/viewgit", closedGone) + mux.HandleFunc("/viewgit/", closedGone) + mux.HandleFunc("/api/downloads/stats", closedGone) + mux.HandleFunc("/api/releases/latest", closedGone) + mux.HandleFunc("/api/github-sync/status", closedGone) + mux.HandleFunc("/api/project/status", closedPublicStatusHandler) + inquiryDir := getenv("OGL_INQUIRY_DIR", "/var/lib/opengenesis-wiki/inquiries") + inbox := newInquiryInbox(inquiryDir) + mailer, err := mailerFromEnvironment() + if err != nil { + log.Fatalf("invalid inquiry SMTP configuration: %v", err) + } + inbox.mailer = mailer + if mailer == nil { + log.Printf("product enquiry SMTP not configured; enquiries will be securely stored until SMTP is configured") + } else { + go mailer.runRetryLoop(inquiryDir) + } + mux.HandleFunc("/api/inquiries", inbox.handler) + mux.HandleFunc("/robots.txt", serveRobotsTXT) + mux.HandleFunc("/sitemap.xml", serveSitemapXML) + mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + _, _ = w.Write([]byte("ok\n")) + }) + mux.HandleFunc("/api/search", searchHandler) + mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path == "/" { + http.Redirect(w, r, "/de/", http.StatusPermanentRedirect) + return + } + if r.URL.Path == "/de" || r.URL.Path == "/en" { + http.Redirect(w, r, r.URL.Path+"/", http.StatusPermanentRedirect) + return + } + parts := strings.Split(strings.Trim(r.URL.Path, "/"), "/") + if len(parts) == 0 || (parts[0] != "de" && parts[0] != "en") { + http.NotFound(w, r) + return + } + lang := parts[0] + if len(parts) == 2 && parts[1] == "code" { + if !strings.HasSuffix(r.URL.Path, "/") { + http.Redirect(w, r, r.URL.Path+"/", http.StatusPermanentRedirect) + return + } + renderCodeWiki(w, tmpl, lang, "index", r.URL.Path) + return + } + if len(parts) == 3 && parts[1] == "code" { + renderCodeWiki(w, tmpl, lang, parts[2], r.URL.Path) + return + } + if len(parts) == 1 { + renderHome(w, tmpl, lang, r.URL.Path) + return + } + if len(parts) == 3 && parts[1] == "docs" { + if destination, found := retiredArticles[parts[2]]; found { + http.Redirect(w, r, "/"+lang+"/docs/"+destination, http.StatusMovedPermanently) + return + } + renderArticle(w, tmpl, lang, parts[2], r.URL.Path) + return + } + http.NotFound(w, r) + }) + + addr := getenv("ADDR", ":18080") + log.Printf("OpenGenesisLINK Wiki listening on %s", addr) + log.Fatal(http.ListenAndServe(addr, securityHeaders(mux))) +} + +func renderHome(w http.ResponseWriter, tmpl *template.Template, lang, path string) { + data := baseData(lang, path) + data.IsHome = true + if lang == "de" { + data.Title = "OpenGenesisLINK Generation 1 (0.9.4.0) Stable | .NET 10" + data.Description = "OpenGenesisLINK Generation 1 (0.9.4.0) Stable auf .NET 10. Künftig Updates und Verbesserungen statt neuer Versionen." + data.Features = []Feature{ + {"ri-bar-chart-box-line", "Funktionsübersicht", "Funktionsumfang von Generation 1 und gesonderter Status optionaler Module.", "/de/docs/feature-matrix", "Status ansehen"}, + {"ri-terminal-box-line", "LSL-Funktionsvergleich", "Automatischer Vergleich offizieller Funktionsnamen mit dem C#-Quellcode; keine Verhaltensabnahme.", "/de/docs/lsl-status", "LSL vergleichen"}, + {"ri-global-line", "Hypergrid und Firestorm", "Virtuelle Welten besuchen und mit verbreiteten Viewern betreten.", "/de/docs/hypergrid", "Mehr erfahren"}, + {"ri-route-line", "OGL AssetService", "Optionaler Parallel-Asset-Store mit FSAssets als autoritativer Quelle; produktiver Asset-Cutover separat freizugeben.", "/de/docs/ogl-assetservice", "Entwicklungsstand"}, + {"ri-bank-card-line", "NV$ & Community", "Virtuelle Wirtschaft, Gruppen, Experiences und Grundstücke.", "/de/docs/platform-services", "Dienste ansehen"}, + {"ri-code-s-slash-line", "Dokumentation Code", "Eigenständiges technisches Wiki: Architektur, Module, Entwicklung und belegte Fehlerbehebungen.", "/de/code/", "Code-Wiki öffnen"}, + {"ri-global-line", "Grid-Verzeichnis", "Hypergrid-Adressen und Informationen zu virtuellen Welten.", "/de/docs/grid-list", "Grids ansehen"}, + } + data.Topics = []Topic{ + {"new", "Release", "OpenGenesisLINK Generation 1 (0.9.4.0)", "Stable. Weitere Änderungen erscheinen als Updates dieser Version.", "12. Nov 2026", "/de/docs/updates"}, + {"tech", "LSL", "Aktueller LSL-Quellcodevergleich", "Automatischer Vergleich aktueller LSL-Funktionsnamen; keine Laufzeit-Freigabe.", "25. Okt 2026", "/de/docs/lsl-status"}, + {"guide", "Dev", "OGL FastMap 2.0", "Asynchroner Karten-Start und gesicherte Warp3D-Mesh-Verarbeitung im aktuellen Quellcode.", "25. Okt 2026", "/de/docs/ogl-fastmap"}, + {"tech", "Security", "World-API Passwortwiederherstellung", "MariaDB-gestützte Einmaltokens und getrennte Maschinenrechte; derzeit nur für Staging.", "25. Okt 2026", "/de/docs/password-recovery"}, + {"community", "Grid", "OpenGenesisLINK Grid-Verzeichnis", "Hypergrid-Loginadressen und Grid-Details, mit Stadt NexVerse.", "04. Nov 2026", "/de/docs/grid-list"}, + {"community", "Roadmap", "Generation 1 – Updates", "Neue Funktionen, Fehlerkorrekturen und Optimierungen als Updates für 0.9.4.0.", "12. Nov 2026", "/de/docs/roadmap"}, + {"dev", "ViewGit", "Änderungen im Git-Quellcode", "Commits, Dateiversionen, Diffs und Branches aus dem Projektarchiv – auf der OpenGenesisLINK-Website.", "11. Okt 2026", viewGitURL}, + } + } else { + data.Title = "OpenGenesisLINK Generation 1 (0.9.4.0) Stable | .NET 10" + data.Description = "OpenGenesisLINK Generation 1 (0.9.4.0) Stable on .NET 10. Ongoing updates and improvements, no new version series." + data.Features = []Feature{ + {"ri-bar-chart-box-line", "Feature overview", "Generation 1 features and the separate status of optional modules.", "/en/docs/feature-matrix", "View features"}, + {"ri-terminal-box-line", "LSL function comparison", "Live comparison of official function names and C# source; not behavioral parity.", "/en/docs/lsl-status", "Compare LSL"}, + {"ri-global-line", "Hypergrid and Firestorm", "Visit other worlds using compatible viewers.", "/en/docs/hypergrid", "Learn more"}, + {"ri-route-line", "OGL AssetService", "Optional parallel asset store with authoritative FSAssets; production asset cutover needs separate approval.", "/en/docs/ogl-assetservice", "Dev status"}, + {"ri-bank-card-line", "NV$ and community", "Virtual economy, groups, Experiences and land.", "/en/docs/platform-services", "View services"}, + {"ri-code-s-slash-line", "Code documentation", "Dedicated technical wiki: architecture, modules, development and traceable fixes.", "/en/code/", "Open code wiki"}, + {"ri-global-line", "Grid directory", "Hypergrid addresses and information about virtual worlds.", "/en/docs/grid-list", "Browse grids"}, + } + data.Topics = []Topic{ + {"new", "Release", "OpenGenesisLINK v0.9.3.13", "Stable release dated 27 October 2026; Generation 1 is in development.", "27 Oct 2026", "/en/docs/updates"}, + {"tech", "LSL", "Current LSL source comparison", "Automatic current LSL function-name comparison; not runtime acceptance.", "25 Oct 2026", "/en/docs/lsl-status"}, + {"guide", "Dev", "OGL FastMap 2.0", "Deferred map generation and hardened Warp3D mesh rendering on current source branch.", "25 Oct 2026", "/en/docs/ogl-fastmap"}, + {"tech", "Security", "World API password recovery", "MariaDB-backed one-time tokens and machine scopes; staging only.", "25 Oct 2026", "/en/docs/password-recovery"}, + {"community", "Grid", "OpenGenesisLINK grid directory", "Hypergrid login addresses and grid information, including Stadt NexVerse.", "4 Nov 2026", "/en/docs/grid-list"}, + {"community", "Roadmap", "Generation 1 in development", ".NET 10 migration, World API and addons; feature-specific production acceptance.", "4 Nov 2026", "/en/docs/roadmap"}, + {"dev", "ViewGit", "Source-code change history", "Commits, file history, diffs and branches from the project archive on the OpenGenesisLINK website.", "11 Oct 2026", viewGitURL}, + } + } + if data.Sync.LSLReady { + pct := fmt.Sprintf("%.2f %%", data.Sync.LSLPercent) + data.Features[1].Title = "LSL: " + pct + " im Quellcode" + if lang == "en" { + data.Features[1].Title = "LSL: " + pct + " in source" + } + data.Features[1].Text = fmt.Sprintf("%d / %d official Second Life function names found in the C# implementation.", data.Sync.LSLMatched, data.Sync.LSLTotal) + if lang == "de" { + data.Features[1].Text = fmt.Sprintf("%d von %d Second-Life-Funktionen als Methoden im C#-Quellcode gefunden.", data.Sync.LSLMatched, data.Sync.LSLTotal) + } + data.Topics[1].Title = fmt.Sprintf("%d / %d LSL", data.Sync.LSLMatched, data.Sync.LSLTotal) + data.Topics[1].Summary = fmt.Sprintf("%.2f %% name-level coverage; full behavior is not verified.", data.Sync.LSLPercent) + if lang == "de" { + data.Topics[1].Summary = fmt.Sprintf("%.2f %% Namensabdeckung; keine bestätigte Verhaltensgleichheit.", data.Sync.LSLPercent) + } + } + // The product Stable status is an explicit Generation 1 decision, not the + // version of the latest uploaded source ZIP in the remote release archive. + data.Topics[0].Title = "OpenGenesisLINK Generation 1 (0.9.4.0) Stable" + data.Topics[0].Date = "2026-11-12" + if lang == "de" { + data.Topics[0].Summary = "Dauerhafte Stable-Basis: künftig ausschließlich Updates und Verbesserungen." + data.Topics[5].Title = "Generation 1 – Updates" + data.Topics[5].Summary = "Neue Funktionen, Sicherheitskorrekturen und Optimierungen innerhalb 0.9.4.0." + } else { + data.Topics[0].Summary = "Stable baseline: future changes are updates and improvements only." + data.Topics[5].Title = "Generation 1 updates" + data.Topics[5].Summary = "New features, security patches and optimizations within 0.9.4.0." + } + if false && data.Sync.DevelopmentReady && data.Sync.HeadSummary != "" { + data.Topics = append([]Topic{{"dev", "Code", "main: " + data.Sync.Head[:min(12, len(data.Sync.Head))], data.Sync.HeadSummary, data.Sync.DevelopmentChecked, "/" + lang + "/docs/project-live"}}, data.Topics...) + } + // Keep only editorial product information in the public homepage; private + // commit, source and release metadata is never surfaced to visitors. + filtered := data.Topics[:0] + for _, topic := range data.Topics { + if strings.Contains(topic.Href, "/viewgit") || strings.Contains(topic.Title, "main:") { + continue + } + filtered = append(filtered, topic) + } + data.Topics = filtered + applyPageSEO(&data) + if err := tmpl.ExecuteTemplate(w, "layout", data); err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + } +} + +func renderArticle(w http.ResponseWriter, tmpl *template.Template, lang, slug, path string) { + a := articleBySlug(slug) + if a == nil { + http.NotFound(w, nil) + return + } + data := baseData(lang, path) + data.Article = a + if lang == "de" { + data.Title = a.TitleDE + " – OpenGenesisLINK Wiki" + data.Description = a.DescriptionDE + data.ArticleBody = a.BodyDE + } else { + data.Title = a.TitleEN + " – OpenGenesisLINK Wiki" + data.Description = a.DescriptionEN + data.ArticleBody = a.BodyEN + } + if slug == "feature-matrix" { + data.FeatureStatus = featureStatus + data.OverallProgress = 0 + } + if slug == "grid-list" { + data.Grids = gridDirectory + } + if slug == "lsl-status" && false { + if data.Sync.LSLReady { + data.LSLProgress = int(data.Sync.LSLPercent) + data.LSLFunctionsExecutable = data.Sync.LSLMatched + data.LSLFunctionsTotal = data.Sync.LSLTotal + data.ArticleBody = liveLSLBody(lang, data.Sync) + } else { + data.ArticleBody = liveLSLBody(lang, data.Sync) + data.ArticleBody + } + } + + applyPageSEO(&data) + if err := tmpl.ExecuteTemplate(w, "layout", data); err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + } +} + +func articleBySlug(slug string) *Article { + for i := range articles { + if articles[i].Slug == slug { + return &articles[i] + } + } + return nil +} + +func baseData(lang, path string) PageData { + other := "en" + if lang == "en" { + other = "de" + } + result := PageData{ + Lang: lang, OtherLang: other, Path: path, + Version: generationOneStableVersion, + MainVersion: generationOneStableVersion, + DevVersion: "Generation 1 · Updates (main)", DevBranch: "main", + Year: time.Now().Year(), Sync: projectLiveSync.getSnapshot(), + GitHubURL: githubURL, SponsorURL: githubSponsorURL, ForumURL: forumURL, Nav: nav(lang), + } + result.StableDownloadReady = false + if lang == "de" { + result.DevVersion = "Generation 1 · Updates (main)" + } + return result +} + +// nav intentionally contains only the primary, usable documentation entry points. +// Development drafts remain available via search and direct URLs, but do not +// crowd the navigation or imply production readiness. +func nav(lang string) []NavGroup { + p := "/" + lang + "/" + d := func(slug string) string { return p + "docs/" + slug } + if lang == "de" { + return []NavGroup{ + {"", []NavItem{{"Startseite", "ri-home-5-line", p}, {"Produkt anfragen", "ri-mail-send-line", d("server-download")}}}, + {"OPEN GENESISLINK", []NavItem{{"Über OpenGenesisLINK", "ri-book-open-line", d("what-is-opengenesis")}, {"Funktionen", "ri-bar-chart-box-line", d("feature-matrix")}, {"Architektur", "ri-node-tree", d("architecture")}, {"Dokumentation Code", "ri-code-s-slash-line", p + "code/"}, {".NET 10", "ri-code-box-line", d("dotnet10")}}}, + {"GRID & BETRIEB", []NavItem{{"Hypergrid", "ri-global-line", d("hypergrid")}, {"Grid-Verzeichnis", "ri-earth-line", d("grid-list")}, {"LSL & Scripts", "ri-terminal-box-line", d("lsl-status")}, {"Inventar & Assets", "ri-archive-line", d("assets-inventory")}}}, + {"SERVICE & LIZENZ", []NavItem{{"Lizenzmodell", "ri-shield-check-line", d("license")}, {"Bereitstellung", "ri-server-line", d("installation")}, {"Updates", "ri-route-line", d("updates")}, {"Fragen & Antworten", "ri-question-line", d("faq")}}}, + {"PROJEKT", []NavItem{{"Projektteam", "ri-team-line", d("about")}, {"Kontakt", "ri-mail-line", d("contact")}, {"Datenschutz", "ri-lock-line", d("privacy")}, {"Impressum", "ri-file-text-line", d("imprint")}}}, + } + } + return []NavGroup{ + {"", []NavItem{{"Home", "ri-home-5-line", p}, {"Product enquiry", "ri-mail-send-line", d("server-download")}}}, + {"OPEN GENESISLINK", []NavItem{{"About OpenGenesisLINK", "ri-book-open-line", d("what-is-opengenesis")}, {"Features", "ri-bar-chart-box-line", d("feature-matrix")}, {"Architecture", "ri-node-tree", d("architecture")}, {"Code documentation", "ri-code-s-slash-line", p + "code/"}, {".NET 10", "ri-code-box-line", d("dotnet10")}}}, + {"GRID & OPERATIONS", []NavItem{{"Hypergrid", "ri-global-line", d("hypergrid")}, {"Grid directory", "ri-earth-line", d("grid-list")}, {"LSL & scripts", "ri-terminal-box-line", d("lsl-status")}, {"Inventory & assets", "ri-archive-line", d("assets-inventory")}}}, + {"SERVICE & LICENSING", []NavItem{{"Licensing", "ri-shield-check-line", d("license")}, {"Deployment", "ri-server-line", d("installation")}, {"Updates", "ri-route-line", d("updates")}, {"FAQ", "ri-question-line", d("faq")}}}, + {"PROJECT", []NavItem{{"Team", "ri-team-line", d("about")}, {"Contact", "ri-mail-line", d("contact")}, {"Privacy", "ri-lock-line", d("privacy")}, {"Legal notice", "ri-file-text-line", d("imprint")}}}, + } +} + +func searchHandler(w http.ResponseWriter, r *http.Request) { + q := strings.TrimSpace(strings.ToLower(r.URL.Query().Get("q"))) + lang := r.URL.Query().Get("lang") + if lang != "en" { + lang = "de" + } + var out []map[string]string + if q != "" { + for _, a := range articles { + title, desc, section := a.TitleDE, a.DescriptionDE, a.SectionDE + if lang == "en" { + title, desc, section = a.TitleEN, a.DescriptionEN, a.SectionEN + } + hay := strings.ToLower(title + " " + desc + " " + section + " " + a.Slug) + // Installation prerequisites should also be discoverable by tool name. + if extra, ok := map[string]string{ + "server-download": "produktanfrage anfrage interesse lizenz grid name kontakt project enquiry licensing closed source", + "installation": "installation bereitstellung betreibermodell dotnet lizenz deployment operator", + "build-linux": "dotnet-sdk-10.0 libgdiplus libc6-dev apt git ubuntu debian .net10 prebuild compile robust amd64 arm64", + "build-windows": "winget powershell windows server visual studio 2026 .net 10 sdk git runprebuild dotnet build", + "dotnet10": "dotnet10 net10.0 .net 10 migration sdk runtime targetframework vorbereitung umstellung", + "privacy": "datenschutz datenschutzerklärung dsgvo gdpr cookies localstorage cdn personenbezogene daten", + "imprint": "impressum marlin flemming jörg weiß viewer oberhausen gemeinschaftsprojekt anbieter", + "grid-list": "grid liste hypergrid hg login gridverzeichnis grid directory stadt nexverse hg.stadt-nexverse.de:80 opensim firestorm", + }[a.Slug]; ok { + hay += " " + extra + } + if strings.Contains(hay, q) { + out = append(out, map[string]string{"title": title, "description": desc, "url": fmt.Sprintf("/%s/docs/%s", lang, a.Slug), "section": section}) + } + } + } + if q != "" { + for _, doc := range codeDocs { + title, desc := doc.TitleDE, doc.DescDE + if lang == "en" { + title, desc = doc.TitleEN, doc.DescEN + } + if strings.Contains(strings.ToLower(title+" "+desc+" "+doc.Keywords+" "+doc.Slug), q) { + u := "/" + lang + "/code/" + if doc.Slug != "index" { + u += doc.Slug + } + out = append(out, map[string]string{"title": title, "description": desc, "url": u, "section": "Code-Dokumentation"}) + } + } + } + sort.Slice(out, func(i, j int) bool { return out[i]["title"] < out[j]["title"] }) + w.Header().Set("Content-Type", "application/json; charset=utf-8") + _ = json.NewEncoder(w).Encode(out) +} + +func securityHeaders(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("X-Content-Type-Options", "nosniff") + w.Header().Set("Referrer-Policy", "strict-origin-when-cross-origin") + w.Header().Set("Permissions-Policy", "camera=(), microphone=(), geolocation=()") + if strings.HasPrefix(r.URL.Path, "/api/") || strings.HasPrefix(r.URL.Path, "/download/") || r.URL.Path == "/healthz" { + w.Header().Set("X-Robots-Tag", "noindex, nofollow") + } + w.Header().Set("Content-Security-Policy", "default-src 'self' https:; img-src 'self' data: https:; style-src 'self' 'unsafe-inline' https:; script-src 'self' 'unsafe-inline' https:; font-src 'self' data: https:; connect-src 'self';") + next.ServeHTTP(w, r) + }) +} + +func getenv(key, fallback string) string { + if v := os.Getenv(key); v != "" { + return v + } + return fallback +} diff --git a/plain_language.go b/internal/website/plain_language.go similarity index 99% rename from plain_language.go rename to internal/website/plain_language.go index 2ff4dd4..c33dd08 100644 --- a/plain_language.go +++ b/internal/website/plain_language.go @@ -1,4 +1,4 @@ -package main +package website import ( "fmt" diff --git a/private_v34.go b/internal/website/private_v34.go similarity index 99% rename from private_v34.go rename to internal/website/private_v34.go index 6b4b9a1..a2139c2 100644 --- a/private_v34.go +++ b/internal/website/private_v34.go @@ -1,4 +1,4 @@ -package main +package website import ( "html/template" diff --git a/seo.go b/internal/website/seo.go similarity index 99% rename from seo.go rename to internal/website/seo.go index a59fc90..b265b4f 100644 --- a/seo.go +++ b/internal/website/seo.go @@ -1,4 +1,4 @@ -package main +package website import ( "encoding/json" diff --git a/seo_grid_test.go b/internal/website/seo_grid_test.go similarity index 98% rename from seo_grid_test.go rename to internal/website/seo_grid_test.go index ed5d415..e72e4e8 100644 --- a/seo_grid_test.go +++ b/internal/website/seo_grid_test.go @@ -1,4 +1,4 @@ -package main +package website import ( "net/http" diff --git a/static/css/app.css b/internal/website/static/css/app.css similarity index 100% rename from static/css/app.css rename to internal/website/static/css/app.css diff --git a/static/images/addons-scripting.jpg b/internal/website/static/images/addons-scripting.jpg similarity index 100% rename from static/images/addons-scripting.jpg rename to internal/website/static/images/addons-scripting.jpg diff --git a/static/images/atlas-overview.jpg b/internal/website/static/images/atlas-overview.jpg similarity index 100% rename from static/images/atlas-overview.jpg rename to internal/website/static/images/atlas-overview.jpg diff --git a/static/images/genesis-atlas.jpg b/internal/website/static/images/genesis-atlas.jpg similarity index 100% rename from static/images/genesis-atlas.jpg rename to internal/website/static/images/genesis-atlas.jpg diff --git a/static/images/genesislink.jpg b/internal/website/static/images/genesislink.jpg similarity index 100% rename from static/images/genesislink.jpg rename to internal/website/static/images/genesislink.jpg diff --git a/static/images/video-thumb.jpg b/internal/website/static/images/video-thumb.jpg similarity index 100% rename from static/images/video-thumb.jpg rename to internal/website/static/images/video-thumb.jpg diff --git a/static/images/viewer-home.jpg b/internal/website/static/images/viewer-home.jpg similarity index 100% rename from static/images/viewer-home.jpg rename to internal/website/static/images/viewer-home.jpg diff --git a/static/images/viewer-inworld.jpg b/internal/website/static/images/viewer-inworld.jpg similarity index 100% rename from static/images/viewer-inworld.jpg rename to internal/website/static/images/viewer-inworld.jpg diff --git a/static/images/viewer-login.jpg b/internal/website/static/images/viewer-login.jpg similarity index 100% rename from static/images/viewer-login.jpg rename to internal/website/static/images/viewer-login.jpg diff --git a/static/images/wiki-hero.jpg b/internal/website/static/images/wiki-hero.jpg similarity index 100% rename from static/images/wiki-hero.jpg rename to internal/website/static/images/wiki-hero.jpg diff --git a/static/js/app.js b/internal/website/static/js/app.js similarity index 100% rename from static/js/app.js rename to internal/website/static/js/app.js diff --git a/static/video/opengenesislink-adsense.mp4 b/internal/website/static/video/opengenesislink-adsense.mp4 similarity index 100% rename from static/video/opengenesislink-adsense.mp4 rename to internal/website/static/video/opengenesislink-adsense.mp4 diff --git a/static/viewgit/favicon.svg b/internal/website/static/viewgit/favicon.svg similarity index 100% rename from static/viewgit/favicon.svg rename to internal/website/static/viewgit/favicon.svg diff --git a/static/viewgit/styles.css b/internal/website/static/viewgit/styles.css similarity index 100% rename from static/viewgit/styles.css rename to internal/website/static/viewgit/styles.css diff --git a/status.go b/internal/website/status.go similarity index 99% rename from status.go rename to internal/website/status.go index b709987..9d7d92b 100644 --- a/status.go +++ b/internal/website/status.go @@ -1,4 +1,4 @@ -package main +package website // Status data is deliberately centralized in this file so the public progress // pages can be updated without touching templates. Percentages are editorial, diff --git a/status16.go b/internal/website/status16.go similarity index 99% rename from status16.go rename to internal/website/status16.go index 4182804..20be47b 100644 --- a/status16.go +++ b/internal/website/status16.go @@ -1,4 +1,4 @@ -package main +package website import "html/template" diff --git a/status2026.go b/internal/website/status2026.go similarity index 99% rename from status2026.go rename to internal/website/status2026.go index f69f01b..918c12d 100644 --- a/status2026.go +++ b/internal/website/status2026.go @@ -1,4 +1,4 @@ -package main +package website import ( _ "embed" @@ -7,7 +7,7 @@ import ( "log" ) -//go:embed wiki2026.json +//go:embed content/wiki2026.json var wiki2026JSON []byte type rewrite2026 struct { diff --git a/status_pages.go b/internal/website/status_pages.go similarity index 99% rename from status_pages.go rename to internal/website/status_pages.go index f5854c8..60e2e4a 100644 --- a/status_pages.go +++ b/internal/website/status_pages.go @@ -1,4 +1,4 @@ -package main +package website import "html/template" diff --git a/team_comparison_v26_test.go b/internal/website/team_comparison_v26_test.go similarity index 99% rename from team_comparison_v26_test.go rename to internal/website/team_comparison_v26_test.go index f7f57ad..a3daa4f 100644 --- a/team_comparison_v26_test.go +++ b/internal/website/team_comparison_v26_test.go @@ -1,4 +1,4 @@ -package main +package website import ( "strings" diff --git a/team_v26.go b/internal/website/team_v26.go similarity index 99% rename from team_v26.go rename to internal/website/team_v26.go index 7ea6cad..26fb871 100644 --- a/team_v26.go +++ b/internal/website/team_v26.go @@ -1,4 +1,4 @@ -package main +package website import "html/template" diff --git a/templates/article.html b/internal/website/templates/article.html similarity index 100% rename from templates/article.html rename to internal/website/templates/article.html diff --git a/templates/codewiki.html b/internal/website/templates/codewiki.html similarity index 100% rename from templates/codewiki.html rename to internal/website/templates/codewiki.html diff --git a/templates/home.html b/internal/website/templates/home.html similarity index 100% rename from templates/home.html rename to internal/website/templates/home.html diff --git a/templates/layout.html b/internal/website/templates/layout.html similarity index 100% rename from templates/layout.html rename to internal/website/templates/layout.html diff --git a/templates/viewgit.html b/internal/website/templates/viewgit.html similarity index 100% rename from templates/viewgit.html rename to internal/website/templates/viewgit.html diff --git a/update1011.go b/internal/website/update1011.go similarity index 93% rename from update1011.go rename to internal/website/update1011.go index af624e8..11dbd2c 100644 --- a/update1011.go +++ b/internal/website/update1011.go @@ -1,4 +1,4 @@ -package main +package website import ( _ "embed" @@ -7,7 +7,7 @@ import ( "log" ) -//go:embed wiki1011_extra.json +//go:embed content/wiki1011_extra.json var wiki1011ExtraJSON []byte func applyUpdates1011() { diff --git a/v11_extras.go b/internal/website/v11_extras.go similarity index 99% rename from v11_extras.go rename to internal/website/v11_extras.go index 5238d46..1828a0a 100644 --- a/v11_extras.go +++ b/internal/website/v11_extras.go @@ -1,4 +1,4 @@ -package main +package website import "html/template" diff --git a/v28_docs.go b/internal/website/v28_docs.go similarity index 98% rename from v28_docs.go rename to internal/website/v28_docs.go index 7f6a077..62ab9ed 100644 --- a/v28_docs.go +++ b/internal/website/v28_docs.go @@ -1,4 +1,4 @@ -package main +package website import ( _ "embed" @@ -8,7 +8,7 @@ import ( "strings" ) -//go:embed wiki_v28_articles.json +//go:embed content/wiki_v28_articles.json var v28WikiJSON []byte type v28Page struct { diff --git a/v28_docs_test.go b/internal/website/v28_docs_test.go similarity index 98% rename from v28_docs_test.go rename to internal/website/v28_docs_test.go index 27d25a4..b5413dd 100644 --- a/v28_docs_test.go +++ b/internal/website/v28_docs_test.go @@ -1,4 +1,4 @@ -package main +package website import ( "strings" diff --git a/v29_dotnet10.go b/internal/website/v29_dotnet10.go similarity index 98% rename from v29_dotnet10.go rename to internal/website/v29_dotnet10.go index 6fc9554..f473370 100644 --- a/v29_dotnet10.go +++ b/internal/website/v29_dotnet10.go @@ -1,4 +1,4 @@ -package main +package website import ( _ "embed" @@ -8,7 +8,7 @@ import ( "strings" ) -//go:embed wiki_v29_dotnet10.json +//go:embed content/wiki_v29_dotnet10.json var v29DotNet10JSON []byte // applyV29DotNet10 is applied last: older historical snapshots and comparison diff --git a/v29_dotnet10_test.go b/internal/website/v29_dotnet10_test.go similarity index 98% rename from v29_dotnet10_test.go rename to internal/website/v29_dotnet10_test.go index 1ef8f85..24378f1 100644 --- a/v29_dotnet10_test.go +++ b/internal/website/v29_dotnet10_test.go @@ -1,4 +1,4 @@ -package main +package website import ( "strings" diff --git a/v30_net10.go b/internal/website/v30_net10.go similarity index 98% rename from v30_net10.go rename to internal/website/v30_net10.go index 1f4db6c..eb14a7f 100644 --- a/v30_net10.go +++ b/internal/website/v30_net10.go @@ -1,4 +1,4 @@ -package main +package website import ( _ "embed" @@ -8,7 +8,7 @@ import ( "strings" ) -//go:embed wiki_v30_net10.json +//go:embed content/wiki_v30_net10.json var v30WikiNet10 []byte func applyV30Net10() { diff --git a/v30_net10_test.go b/internal/website/v30_net10_test.go similarity index 98% rename from v30_net10_test.go rename to internal/website/v30_net10_test.go index ba47469..937b939 100644 --- a/v30_net10_test.go +++ b/internal/website/v30_net10_test.go @@ -1,4 +1,4 @@ -package main +package website import ( "strings" diff --git a/v31_counter_nav_test.go b/internal/website/v31_counter_nav_test.go similarity index 99% rename from v31_counter_nav_test.go rename to internal/website/v31_counter_nav_test.go index 85532fc..9f43c92 100644 --- a/v31_counter_nav_test.go +++ b/internal/website/v31_counter_nav_test.go @@ -1,4 +1,4 @@ -package main +package website import ( "encoding/json" diff --git a/v31_privacy.go b/internal/website/v31_privacy.go similarity index 99% rename from v31_privacy.go rename to internal/website/v31_privacy.go index 5c5072f..546199d 100644 --- a/v31_privacy.go +++ b/internal/website/v31_privacy.go @@ -1,4 +1,4 @@ -package main +package website import "html/template" diff --git a/v33_1_release_artifact_test.go b/internal/website/v33_1_release_artifact_test.go similarity index 99% rename from v33_1_release_artifact_test.go rename to internal/website/v33_1_release_artifact_test.go index dbf4367..a76bbe5 100644 --- a/v33_1_release_artifact_test.go +++ b/internal/website/v33_1_release_artifact_test.go @@ -1,4 +1,4 @@ -package main +package website import ( "context" diff --git a/v33_gen1_stable.go b/internal/website/v33_gen1_stable.go similarity index 99% rename from v33_gen1_stable.go rename to internal/website/v33_gen1_stable.go index 2687a44..8ce927f 100644 --- a/v33_gen1_stable.go +++ b/internal/website/v33_gen1_stable.go @@ -1,4 +1,4 @@ -package main +package website import ( "encoding/json" diff --git a/v33_gen1_stable_test.go b/internal/website/v33_gen1_stable_test.go similarity index 99% rename from v33_gen1_stable_test.go rename to internal/website/v33_gen1_stable_test.go index 11a4f9b..35b3c56 100644 --- a/v33_gen1_stable_test.go +++ b/internal/website/v33_gen1_stable_test.go @@ -1,4 +1,4 @@ -package main +package website import ( "encoding/json" diff --git a/viewgit.go b/internal/website/viewgit.go similarity index 99% rename from viewgit.go rename to internal/website/viewgit.go index e3b5bd3..c35a867 100644 --- a/viewgit.go +++ b/internal/website/viewgit.go @@ -1,4 +1,4 @@ -package main +package website // Read-only ViewGit browser. Uses only the fixed public OpenGenesisLINK repository. // Legacy GitWeb-like query keys (?a=shortlog&p=opengenesislinkserver) are supported. diff --git a/viewgit_test.go b/internal/website/viewgit_test.go similarity index 99% rename from viewgit_test.go rename to internal/website/viewgit_test.go index be540dc..83b408a 100644 --- a/viewgit_test.go +++ b/internal/website/viewgit_test.go @@ -1,4 +1,4 @@ -package main +package website import ( "encoding/base64" diff --git a/zz_more_update.go b/internal/website/zz_more_update.go similarity index 99% rename from zz_more_update.go rename to internal/website/zz_more_update.go index aaa671f..cfaa34c 100644 --- a/zz_more_update.go +++ b/internal/website/zz_more_update.go @@ -1,4 +1,4 @@ -package main +package website import "html/template" diff --git a/zz_project_update.go b/internal/website/zz_project_update.go similarity index 99% rename from zz_project_update.go rename to internal/website/zz_project_update.go index 39e7b91..4082c49 100644 --- a/zz_project_update.go +++ b/internal/website/zz_project_update.go @@ -1,4 +1,4 @@ -package main +package website import "html/template" diff --git a/zz_sponsor_update.go b/internal/website/zz_sponsor_update.go similarity index 99% rename from zz_sponsor_update.go rename to internal/website/zz_sponsor_update.go index a768477..b3a9ad3 100644 --- a/zz_sponsor_update.go +++ b/internal/website/zz_sponsor_update.go @@ -1,4 +1,4 @@ -package main +package website import "html/template" diff --git a/main.go b/main.go index a112d6d..b3a83e9 100644 --- a/main.go +++ b/main.go @@ -1,482 +1,7 @@ package main -import ( - "embed" - "encoding/json" - "fmt" - "html/template" - "io/fs" - "log" - "net/http" - "os" - "sort" - "strings" - "time" -) - -const githubURL = "https://github.com/opengenesislink/opengenesislinkserver" -const githubSponsorURL = "https://github.com/sponsors/opengenesislink" -const forumURL = "https://forum.opengenesislink.de" -const viewGitURL = "https://opengenesislink.de/viewgit/" - -//go:embed templates/*.html static/*/* -var assets embed.FS - -type NavItem struct { - Title string - Icon string - Href string -} - -type NavGroup struct { - Title string - Items []NavItem -} - -type Feature struct { - Icon, Title, Text, Href, CTA string -} - -type Topic struct { - Kind, Badge, Title, Summary, Date, Href string -} - -// GridEntry is an editorial directory entry, not a real-time availability claim. -type GridEntry struct { - ID, Name, HGAddress, Platform, SummaryDE, SummaryEN, DetailsDE, DetailsEN string -} - -type Article struct { - Slug string - TitleDE string - TitleEN string - DescriptionDE string - DescriptionEN string - BodyDE template.HTML - BodyEN template.HTML - SectionDE string - SectionEN string - Updated string - Image string - ImageAltDE string - ImageAltEN string -} - -type PageData struct { - Lang string - OtherLang string - Path string - Title string - Description string - CanonicalURL string - AlternateDEURL string - AlternateENURL string - AlternateDefaultURL string - SEOImageURL string - SEOJSON template.JS - OGType string - Version string - Year int - GitHubURL string - SponsorURL string - ForumURL string - Nav []NavGroup - Features []Feature - Topics []Topic - Article *Article - Grids []GridEntry - ArticleBody template.HTML - IsHome bool - FeatureStatus []FeatureStatus - LSLStatus []LSLStatusItem - OverallProgress int - LSLProgress int - MainVersion string - DevVersion string - DevBranch string - LSLFunctionsImplemented int - LSLFunctionsPartial int - LSLFunctionsExecutable int - LSLFunctionsTotal int - LSLEventsImplemented int - LSLEventsPartial int - LSLEventsExecutable int - LSLEventsTotal int - OGLImplemented int - OGLTotal int - Sync LiveProjectData - StableDownloadReady bool - IsCode bool - CodeSlug string - CodeTitle string - CodeLead string - CodeContent template.HTML - CodeUpdated string - CodeNav []CodeNavLink - CodeRoot string -} +import "opengenesis-wiki/internal/website" func main() { - applyHandover5() - applyV11Extras() - applyStatus16() - applyPlainLanguage() - applyStatus2026() - applyUpdates1011() - applyDownloadInstallDocs() - applyLegalV20() - applyCurrentProjectNavigation() - applyTeamV26() - applyComparisonV26() - addLiveProjectArticle() - applyV27Branding() - applyV28Documentation() - applyV29DotNet10() - applyV30Net10() - applyV31Privacy() - applyV33Stable() - applyV34Closed() - tmpl := template.Must(template.ParseFS(assets, "templates/layout.html", "templates/home.html", "templates/article.html", "templates/codewiki.html")) - staticFS, err := fs.Sub(assets, "static") - if err != nil { - log.Fatal(err) - } - - mux := http.NewServeMux() - mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.FS(staticFS)))) - mux.Handle("/wiki-static/", http.StripPrefix("/wiki-static/", http.FileServer(http.FS(staticFS)))) - // Downloads and source browsing are deliberately unavailable even if old - // proxy rules or bookmarks continue to point to these routes. - mux.HandleFunc("/download/", closedGone) - mux.HandleFunc("/viewgit", closedGone) - mux.HandleFunc("/viewgit/", closedGone) - mux.HandleFunc("/api/downloads/stats", closedGone) - mux.HandleFunc("/api/releases/latest", closedGone) - mux.HandleFunc("/api/github-sync/status", closedGone) - mux.HandleFunc("/api/project/status", closedPublicStatusHandler) - inquiryDir := getenv("OGL_INQUIRY_DIR", "/var/lib/opengenesis-wiki/inquiries") - inbox := newInquiryInbox(inquiryDir) - mailer, err := mailerFromEnvironment() - if err != nil { - log.Fatalf("invalid inquiry SMTP configuration: %v", err) - } - inbox.mailer = mailer - if mailer == nil { - log.Printf("product enquiry SMTP not configured; enquiries will be securely stored until SMTP is configured") - } else { - go mailer.runRetryLoop(inquiryDir) - } - mux.HandleFunc("/api/inquiries", inbox.handler) - mux.HandleFunc("/robots.txt", serveRobotsTXT) - mux.HandleFunc("/sitemap.xml", serveSitemapXML) - mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusOK) - _, _ = w.Write([]byte("ok\n")) - }) - mux.HandleFunc("/api/search", searchHandler) - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - if r.URL.Path == "/" { - http.Redirect(w, r, "/de/", http.StatusPermanentRedirect) - return - } - if r.URL.Path == "/de" || r.URL.Path == "/en" { - http.Redirect(w, r, r.URL.Path+"/", http.StatusPermanentRedirect) - return - } - parts := strings.Split(strings.Trim(r.URL.Path, "/"), "/") - if len(parts) == 0 || (parts[0] != "de" && parts[0] != "en") { - http.NotFound(w, r) - return - } - lang := parts[0] - if len(parts) == 2 && parts[1] == "code" { - if !strings.HasSuffix(r.URL.Path, "/") { - http.Redirect(w, r, r.URL.Path+"/", http.StatusPermanentRedirect) - return - } - renderCodeWiki(w, tmpl, lang, "index", r.URL.Path) - return - } - if len(parts) == 3 && parts[1] == "code" { - renderCodeWiki(w, tmpl, lang, parts[2], r.URL.Path) - return - } - if len(parts) == 1 { - renderHome(w, tmpl, lang, r.URL.Path) - return - } - if len(parts) == 3 && parts[1] == "docs" { - if destination, found := retiredArticles[parts[2]]; found { - http.Redirect(w, r, "/"+lang+"/docs/"+destination, http.StatusMovedPermanently) - return - } - renderArticle(w, tmpl, lang, parts[2], r.URL.Path) - return - } - http.NotFound(w, r) - }) - - addr := getenv("ADDR", ":18080") - log.Printf("OpenGenesisLINK Wiki listening on %s", addr) - log.Fatal(http.ListenAndServe(addr, securityHeaders(mux))) -} - -func renderHome(w http.ResponseWriter, tmpl *template.Template, lang, path string) { - data := baseData(lang, path) - data.IsHome = true - if lang == "de" { - data.Title = "OpenGenesisLINK Generation 1 (0.9.4.0) Stable | .NET 10" - data.Description = "OpenGenesisLINK Generation 1 (0.9.4.0) Stable auf .NET 10. Künftig Updates und Verbesserungen statt neuer Versionen." - data.Features = []Feature{ - {"ri-bar-chart-box-line", "Funktionsübersicht", "Funktionsumfang von Generation 1 und gesonderter Status optionaler Module.", "/de/docs/feature-matrix", "Status ansehen"}, - {"ri-terminal-box-line", "LSL-Funktionsvergleich", "Automatischer Vergleich offizieller Funktionsnamen mit dem C#-Quellcode; keine Verhaltensabnahme.", "/de/docs/lsl-status", "LSL vergleichen"}, - {"ri-global-line", "Hypergrid und Firestorm", "Virtuelle Welten besuchen und mit verbreiteten Viewern betreten.", "/de/docs/hypergrid", "Mehr erfahren"}, - {"ri-route-line", "OGL AssetService", "Optionaler Parallel-Asset-Store mit FSAssets als autoritativer Quelle; produktiver Asset-Cutover separat freizugeben.", "/de/docs/ogl-assetservice", "Entwicklungsstand"}, - {"ri-bank-card-line", "NV$ & Community", "Virtuelle Wirtschaft, Gruppen, Experiences und Grundstücke.", "/de/docs/platform-services", "Dienste ansehen"}, - {"ri-code-s-slash-line", "Dokumentation Code", "Eigenständiges technisches Wiki: Architektur, Module, Entwicklung und belegte Fehlerbehebungen.", "/de/code/", "Code-Wiki öffnen"}, - {"ri-global-line", "Grid-Verzeichnis", "Hypergrid-Adressen und Informationen zu virtuellen Welten.", "/de/docs/grid-list", "Grids ansehen"}, - } - data.Topics = []Topic{ - {"new", "Release", "OpenGenesisLINK Generation 1 (0.9.4.0)", "Stable. Weitere Änderungen erscheinen als Updates dieser Version.", "12. Nov 2026", "/de/docs/updates"}, - {"tech", "LSL", "Aktueller LSL-Quellcodevergleich", "Automatischer Vergleich aktueller LSL-Funktionsnamen; keine Laufzeit-Freigabe.", "25. Okt 2026", "/de/docs/lsl-status"}, - {"guide", "Dev", "OGL FastMap 2.0", "Asynchroner Karten-Start und gesicherte Warp3D-Mesh-Verarbeitung im aktuellen Quellcode.", "25. Okt 2026", "/de/docs/ogl-fastmap"}, - {"tech", "Security", "World-API Passwortwiederherstellung", "MariaDB-gestützte Einmaltokens und getrennte Maschinenrechte; derzeit nur für Staging.", "25. Okt 2026", "/de/docs/password-recovery"}, - {"community", "Grid", "OpenGenesisLINK Grid-Verzeichnis", "Hypergrid-Loginadressen und Grid-Details, mit Stadt NexVerse.", "04. Nov 2026", "/de/docs/grid-list"}, - {"community", "Roadmap", "Generation 1 – Updates", "Neue Funktionen, Fehlerkorrekturen und Optimierungen als Updates für 0.9.4.0.", "12. Nov 2026", "/de/docs/roadmap"}, - {"dev", "ViewGit", "Änderungen im Git-Quellcode", "Commits, Dateiversionen, Diffs und Branches aus dem Projektarchiv – auf der OpenGenesisLINK-Website.", "11. Okt 2026", viewGitURL}, - } - } else { - data.Title = "OpenGenesisLINK Generation 1 (0.9.4.0) Stable | .NET 10" - data.Description = "OpenGenesisLINK Generation 1 (0.9.4.0) Stable on .NET 10. Ongoing updates and improvements, no new version series." - data.Features = []Feature{ - {"ri-bar-chart-box-line", "Feature overview", "Generation 1 features and the separate status of optional modules.", "/en/docs/feature-matrix", "View features"}, - {"ri-terminal-box-line", "LSL function comparison", "Live comparison of official function names and C# source; not behavioral parity.", "/en/docs/lsl-status", "Compare LSL"}, - {"ri-global-line", "Hypergrid and Firestorm", "Visit other worlds using compatible viewers.", "/en/docs/hypergrid", "Learn more"}, - {"ri-route-line", "OGL AssetService", "Optional parallel asset store with authoritative FSAssets; production asset cutover needs separate approval.", "/en/docs/ogl-assetservice", "Dev status"}, - {"ri-bank-card-line", "NV$ and community", "Virtual economy, groups, Experiences and land.", "/en/docs/platform-services", "View services"}, - {"ri-code-s-slash-line", "Code documentation", "Dedicated technical wiki: architecture, modules, development and traceable fixes.", "/en/code/", "Open code wiki"}, - {"ri-global-line", "Grid directory", "Hypergrid addresses and information about virtual worlds.", "/en/docs/grid-list", "Browse grids"}, - } - data.Topics = []Topic{ - {"new", "Release", "OpenGenesisLINK v0.9.3.13", "Stable release dated 27 October 2026; Generation 1 is in development.", "27 Oct 2026", "/en/docs/updates"}, - {"tech", "LSL", "Current LSL source comparison", "Automatic current LSL function-name comparison; not runtime acceptance.", "25 Oct 2026", "/en/docs/lsl-status"}, - {"guide", "Dev", "OGL FastMap 2.0", "Deferred map generation and hardened Warp3D mesh rendering on current source branch.", "25 Oct 2026", "/en/docs/ogl-fastmap"}, - {"tech", "Security", "World API password recovery", "MariaDB-backed one-time tokens and machine scopes; staging only.", "25 Oct 2026", "/en/docs/password-recovery"}, - {"community", "Grid", "OpenGenesisLINK grid directory", "Hypergrid login addresses and grid information, including Stadt NexVerse.", "4 Nov 2026", "/en/docs/grid-list"}, - {"community", "Roadmap", "Generation 1 in development", ".NET 10 migration, World API and addons; feature-specific production acceptance.", "4 Nov 2026", "/en/docs/roadmap"}, - {"dev", "ViewGit", "Source-code change history", "Commits, file history, diffs and branches from the project archive on the OpenGenesisLINK website.", "11 Oct 2026", viewGitURL}, - } - } - if data.Sync.LSLReady { - pct := fmt.Sprintf("%.2f %%", data.Sync.LSLPercent) - data.Features[1].Title = "LSL: " + pct + " im Quellcode" - if lang == "en" { - data.Features[1].Title = "LSL: " + pct + " in source" - } - data.Features[1].Text = fmt.Sprintf("%d / %d official Second Life function names found in the C# implementation.", data.Sync.LSLMatched, data.Sync.LSLTotal) - if lang == "de" { - data.Features[1].Text = fmt.Sprintf("%d von %d Second-Life-Funktionen als Methoden im C#-Quellcode gefunden.", data.Sync.LSLMatched, data.Sync.LSLTotal) - } - data.Topics[1].Title = fmt.Sprintf("%d / %d LSL", data.Sync.LSLMatched, data.Sync.LSLTotal) - data.Topics[1].Summary = fmt.Sprintf("%.2f %% name-level coverage; full behavior is not verified.", data.Sync.LSLPercent) - if lang == "de" { - data.Topics[1].Summary = fmt.Sprintf("%.2f %% Namensabdeckung; keine bestätigte Verhaltensgleichheit.", data.Sync.LSLPercent) - } - } - // The product Stable status is an explicit Generation 1 decision, not the - // version of the latest uploaded source ZIP in the remote release archive. - data.Topics[0].Title = "OpenGenesisLINK Generation 1 (0.9.4.0) Stable" - data.Topics[0].Date = "2026-11-12" - if lang == "de" { - data.Topics[0].Summary = "Dauerhafte Stable-Basis: künftig ausschließlich Updates und Verbesserungen." - data.Topics[5].Title = "Generation 1 – Updates" - data.Topics[5].Summary = "Neue Funktionen, Sicherheitskorrekturen und Optimierungen innerhalb 0.9.4.0." - } else { - data.Topics[0].Summary = "Stable baseline: future changes are updates and improvements only." - data.Topics[5].Title = "Generation 1 updates" - data.Topics[5].Summary = "New features, security patches and optimizations within 0.9.4.0." - } - if false && data.Sync.DevelopmentReady && data.Sync.HeadSummary != "" { - data.Topics = append([]Topic{{"dev", "Code", "main: " + data.Sync.Head[:min(12, len(data.Sync.Head))], data.Sync.HeadSummary, data.Sync.DevelopmentChecked, "/" + lang + "/docs/project-live"}}, data.Topics...) - } - // Keep only editorial product information in the public homepage; private - // commit, source and release metadata is never surfaced to visitors. - filtered := data.Topics[:0] - for _, topic := range data.Topics { - if strings.Contains(topic.Href, "/viewgit") || strings.Contains(topic.Title, "main:") { - continue - } - filtered = append(filtered, topic) - } - data.Topics = filtered - applyPageSEO(&data) - if err := tmpl.ExecuteTemplate(w, "layout", data); err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - } -} - -func renderArticle(w http.ResponseWriter, tmpl *template.Template, lang, slug, path string) { - a := articleBySlug(slug) - if a == nil { - http.NotFound(w, nil) - return - } - data := baseData(lang, path) - data.Article = a - if lang == "de" { - data.Title = a.TitleDE + " – OpenGenesisLINK Wiki" - data.Description = a.DescriptionDE - data.ArticleBody = a.BodyDE - } else { - data.Title = a.TitleEN + " – OpenGenesisLINK Wiki" - data.Description = a.DescriptionEN - data.ArticleBody = a.BodyEN - } - if slug == "feature-matrix" { - data.FeatureStatus = featureStatus - data.OverallProgress = 0 - } - if slug == "grid-list" { - data.Grids = gridDirectory - } - if slug == "lsl-status" && false { - if data.Sync.LSLReady { - data.LSLProgress = int(data.Sync.LSLPercent) - data.LSLFunctionsExecutable = data.Sync.LSLMatched - data.LSLFunctionsTotal = data.Sync.LSLTotal - data.ArticleBody = liveLSLBody(lang, data.Sync) - } else { - data.ArticleBody = liveLSLBody(lang, data.Sync) + data.ArticleBody - } - } - - applyPageSEO(&data) - if err := tmpl.ExecuteTemplate(w, "layout", data); err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - } -} - -func articleBySlug(slug string) *Article { - for i := range articles { - if articles[i].Slug == slug { - return &articles[i] - } - } - return nil -} - -func baseData(lang, path string) PageData { - other := "en" - if lang == "en" { - other = "de" - } - result := PageData{ - Lang: lang, OtherLang: other, Path: path, - Version: generationOneStableVersion, - MainVersion: generationOneStableVersion, - DevVersion: "Generation 1 · Updates (main)", DevBranch: "main", - Year: time.Now().Year(), Sync: projectLiveSync.getSnapshot(), - GitHubURL: githubURL, SponsorURL: githubSponsorURL, ForumURL: forumURL, Nav: nav(lang), - } - result.StableDownloadReady = false - if lang == "de" { - result.DevVersion = "Generation 1 · Updates (main)" - } - return result -} - -// nav intentionally contains only the primary, usable documentation entry points. -// Development drafts remain available via search and direct URLs, but do not -// crowd the navigation or imply production readiness. -func nav(lang string) []NavGroup { - p := "/" + lang + "/" - d := func(slug string) string { return p + "docs/" + slug } - if lang == "de" { - return []NavGroup{ - {"", []NavItem{{"Startseite", "ri-home-5-line", p}, {"Produkt anfragen", "ri-mail-send-line", d("server-download")}}}, - {"OPEN GENESISLINK", []NavItem{{"Über OpenGenesisLINK", "ri-book-open-line", d("what-is-opengenesis")}, {"Funktionen", "ri-bar-chart-box-line", d("feature-matrix")}, {"Architektur", "ri-node-tree", d("architecture")}, {"Dokumentation Code", "ri-code-s-slash-line", p + "code/"}, {".NET 10", "ri-code-box-line", d("dotnet10")}}}, - {"GRID & BETRIEB", []NavItem{{"Hypergrid", "ri-global-line", d("hypergrid")}, {"Grid-Verzeichnis", "ri-earth-line", d("grid-list")}, {"LSL & Scripts", "ri-terminal-box-line", d("lsl-status")}, {"Inventar & Assets", "ri-archive-line", d("assets-inventory")}}}, - {"SERVICE & LIZENZ", []NavItem{{"Lizenzmodell", "ri-shield-check-line", d("license")}, {"Bereitstellung", "ri-server-line", d("installation")}, {"Updates", "ri-route-line", d("updates")}, {"Fragen & Antworten", "ri-question-line", d("faq")}}}, - {"PROJEKT", []NavItem{{"Projektteam", "ri-team-line", d("about")}, {"Kontakt", "ri-mail-line", d("contact")}, {"Datenschutz", "ri-lock-line", d("privacy")}, {"Impressum", "ri-file-text-line", d("imprint")}}}, - } - } - return []NavGroup{ - {"", []NavItem{{"Home", "ri-home-5-line", p}, {"Product enquiry", "ri-mail-send-line", d("server-download")}}}, - {"OPEN GENESISLINK", []NavItem{{"About OpenGenesisLINK", "ri-book-open-line", d("what-is-opengenesis")}, {"Features", "ri-bar-chart-box-line", d("feature-matrix")}, {"Architecture", "ri-node-tree", d("architecture")}, {"Code documentation", "ri-code-s-slash-line", p + "code/"}, {".NET 10", "ri-code-box-line", d("dotnet10")}}}, - {"GRID & OPERATIONS", []NavItem{{"Hypergrid", "ri-global-line", d("hypergrid")}, {"Grid directory", "ri-earth-line", d("grid-list")}, {"LSL & scripts", "ri-terminal-box-line", d("lsl-status")}, {"Inventory & assets", "ri-archive-line", d("assets-inventory")}}}, - {"SERVICE & LICENSING", []NavItem{{"Licensing", "ri-shield-check-line", d("license")}, {"Deployment", "ri-server-line", d("installation")}, {"Updates", "ri-route-line", d("updates")}, {"FAQ", "ri-question-line", d("faq")}}}, - {"PROJECT", []NavItem{{"Team", "ri-team-line", d("about")}, {"Contact", "ri-mail-line", d("contact")}, {"Privacy", "ri-lock-line", d("privacy")}, {"Legal notice", "ri-file-text-line", d("imprint")}}}, - } -} - -func searchHandler(w http.ResponseWriter, r *http.Request) { - q := strings.TrimSpace(strings.ToLower(r.URL.Query().Get("q"))) - lang := r.URL.Query().Get("lang") - if lang != "en" { - lang = "de" - } - var out []map[string]string - if q != "" { - for _, a := range articles { - title, desc, section := a.TitleDE, a.DescriptionDE, a.SectionDE - if lang == "en" { - title, desc, section = a.TitleEN, a.DescriptionEN, a.SectionEN - } - hay := strings.ToLower(title + " " + desc + " " + section + " " + a.Slug) - // Installation prerequisites should also be discoverable by tool name. - if extra, ok := map[string]string{ - "server-download": "produktanfrage anfrage interesse lizenz grid name kontakt project enquiry licensing closed source", - "installation": "installation bereitstellung betreibermodell dotnet lizenz deployment operator", - "build-linux": "dotnet-sdk-10.0 libgdiplus libc6-dev apt git ubuntu debian .net10 prebuild compile robust amd64 arm64", - "build-windows": "winget powershell windows server visual studio 2026 .net 10 sdk git runprebuild dotnet build", - "dotnet10": "dotnet10 net10.0 .net 10 migration sdk runtime targetframework vorbereitung umstellung", - "privacy": "datenschutz datenschutzerklärung dsgvo gdpr cookies localstorage cdn personenbezogene daten", - "imprint": "impressum marlin flemming jörg weiß viewer oberhausen gemeinschaftsprojekt anbieter", - "grid-list": "grid liste hypergrid hg login gridverzeichnis grid directory stadt nexverse hg.stadt-nexverse.de:80 opensim firestorm", - }[a.Slug]; ok { - hay += " " + extra - } - if strings.Contains(hay, q) { - out = append(out, map[string]string{"title": title, "description": desc, "url": fmt.Sprintf("/%s/docs/%s", lang, a.Slug), "section": section}) - } - } - } - if q != "" { - for _, doc := range codeDocs { - title, desc := doc.TitleDE, doc.DescDE - if lang == "en" { - title, desc = doc.TitleEN, doc.DescEN - } - if strings.Contains(strings.ToLower(title+" "+desc+" "+doc.Keywords+" "+doc.Slug), q) { - u := "/" + lang + "/code/" - if doc.Slug != "index" { - u += doc.Slug - } - out = append(out, map[string]string{"title": title, "description": desc, "url": u, "section": "Code-Dokumentation"}) - } - } - } - sort.Slice(out, func(i, j int) bool { return out[i]["title"] < out[j]["title"] }) - w.Header().Set("Content-Type", "application/json; charset=utf-8") - _ = json.NewEncoder(w).Encode(out) -} - -func securityHeaders(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("X-Content-Type-Options", "nosniff") - w.Header().Set("Referrer-Policy", "strict-origin-when-cross-origin") - w.Header().Set("Permissions-Policy", "camera=(), microphone=(), geolocation=()") - if strings.HasPrefix(r.URL.Path, "/api/") || strings.HasPrefix(r.URL.Path, "/download/") || r.URL.Path == "/healthz" { - w.Header().Set("X-Robots-Tag", "noindex, nofollow") - } - w.Header().Set("Content-Security-Policy", "default-src 'self' https:; img-src 'self' data: https:; style-src 'self' 'unsafe-inline' https:; script-src 'self' 'unsafe-inline' https:; font-src 'self' data: https:; connect-src 'self';") - next.ServeHTTP(w, r) - }) -} - -func getenv(key, fallback string) string { - if v := os.Getenv(key); v != "" { - return v - } - return fallback + website.Run() } diff --git a/scripts/build-all.sh b/scripts/build-all.sh new file mode 100755 index 0000000..1fc1fa0 --- /dev/null +++ b/scripts/build-all.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# Kompatibilitäts-Einstieg: Linux x86_64. +set -Eeuo pipefail +exec "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)/build-x64.sh" "$@" diff --git a/update-amd64.sh b/scripts/update-amd64.sh similarity index 99% rename from update-amd64.sh rename to scripts/update-amd64.sh index 141f0f4..114afb2 100755 --- a/update-amd64.sh +++ b/scripts/update-amd64.sh @@ -7,7 +7,7 @@ if (( EUID != 0 )); then exit 1 fi -ROOT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +ROOT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)" SRC="${1:-$ROOT_DIR/opengenesis-wiki-linux-amd64}" SERVICE_SRC="$ROOT_DIR/deploy/opengenesis-wiki.service" TARGET_DIR="/opt/opengenesis-wiki/bin"