Files
opengenesislinkserver/tools/release/package_gen1_runtime.py
T
OpenGenesisLINK Maintenance 2ef585be75
Generation 1.1 .NET 10 ARM64 Server Runtime / ROBUST and Simulator .NET 10 ARM64 build + boot (push) Waiting to run
OpenGenesisLINK main - .NET 10 Build Gate / .NET 10 Windows x64 build (push) Waiting to run
NexVerse CI / Build NexVerse (push) Failing after 1m0s
NexVerse CI / NV dollar live database matrix (push) Failing after 16s
Generation 1 Stable and Updates source policy / release-policy (push) Successful in 17s
OpenGenesisLINK main - .NET 10 Build Gate / .NET 10 generated-project and server build (push) Successful in 1m36s
OpenGenesisLINK Generation 1 - Abgeschlossene Branches bereinigen / Abgeschlossene und nicht mehr benoetigte Branches entfernen (push) Successful in 27s
Security(gen1): WebDAV-Zugangsdaten als private hostlokale DLL kapseln
2026-12-04 19:30:07 +01:00

235 lines
11 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env python3
"""Assemble a clean binary-only Generation 1 Linux x64 release candidate.
Always checks main/EventSim shared runtime hash parity before packaging.
Never copies live INI, region files, cache, databases, secrets or logs.
"""
from __future__ import annotations
import hashlib
import os
from pathlib import Path
import re
import shutil
import zipfile
ROOT = Path("/opt/robust")
MAIN = ROOT / "bin"
EVENT = Path("/opt/eventsim/bin")
DEST = Path("/root/opengenesislink-releases")
NAME = "OpenGenesisLINK_G1_0.9.4.0_Linux-x64_20261122_RC"
STAGE = DEST / NAME
ARCHIVE = DEST / (NAME + ".zip")
def sha(path: Path) -> str:
h = hashlib.sha256()
with path.open("rb") as f:
for chunk in iter(lambda: f.read(1024 * 1024), b""):
h.update(chunk)
return h.hexdigest()
def copy(source: Path, relative: str) -> None:
if source.name.lower().startswith("ogl.webdav.private.") or source.name.lower() == "webdav.credentials":
return
if not source.is_file():
raise FileNotFoundError(source)
target = STAGE / relative
target.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(source, target)
os.chmod(target, 0o755 if source.name in {"OpenSim","Robust","OpenSim.ConsoleClient","OpenSim.Tools.Configger"} else 0o644)
def put(relative: str, value: str, executable: bool = False) -> None:
target = STAGE / relative
target.parent.mkdir(parents=True, exist_ok=True)
target.write_text(value, encoding="utf-8")
os.chmod(target, 0o755 if executable else 0o644)
def sanitize_example(text: str) -> str:
# Preserve example structure while clearing all credential-like values,
# including nested DB connection-string password parameters.
output = []
for line in text.splitlines():
if not line.lstrip().startswith(("#", ";")) and re.search(
r"(?i)^\s*(?:\w*(?:password|token|secret|privatekey|api_key|apikey|accesskey)\w*)\s*=",
line,
):
key = line.split("=", 1)[0]
line = key + '= "REPLACE_ME"'
line = re.sub(
r"(?i)(password\s*=\s*)[^;\"' ]+", r"\1REPLACE_ME", line
)
output.append(line)
result = "\n".join(output) + "\n"
if re.search(r"(?i)(sk-[a-z0-9_-]{20,}|ghp_[a-z0-9_-]{20,}|BEGIN [A-Z ]*PRIVATE KEY)", result):
raise ValueError("Template contains a sensitive credential")
return result
def main() -> None:
if STAGE.exists() or ARCHIVE.exists():
raise FileExistsError("Existing release must not be overwritten")
if os.uname().machine != "x86_64":
raise ValueError("Linux x64 package requires an x86_64 build")
shared = sorted(f.name for f in MAIN.iterdir() if f.is_file()
and f.suffix.lower() in {".dll", ".pdb", ".so"} and (EVENT / f.name).is_file())
diff = [x for x in shared if sha(MAIN/x) != sha(EVENT/x)]
if diff:
raise ValueError("Simulator and EventSim assemblies differ: " + str(len(diff)))
if len(shared) < 190:
raise ValueError("Unexpectedly few common simulator assemblies")
STAGE.mkdir(parents=True, mode=0o700)
bin_target = STAGE / "bin"
bin_target.mkdir()
selected_extensions = (".dll", ".so", ".dll.config", ".exe.config",
".deps.json", ".runtimeconfig.json",
".dll.linux", ".dll.win")
selected_names = {
"OpenSim", "Robust", "OpenSim.ConsoleClient", "OpenSim.Tools.Configger",
"ScriptSyntax.xml", "avatar-texture.dat",
"set_object_owner.xml", "enter_uuid.xml",
}
for path in sorted(MAIN.iterdir()):
if not path.is_file():
continue
if path.name in selected_names or path.name.endswith(selected_extensions):
copy(path, "bin/" + path.name)
for sub in ("assets", "openmetaverse_data", "runtimes", "lib64"):
source_dir = MAIN / sub
for path in sorted(source_dir.rglob("*")):
if path.is_file():
copy(path, "bin/" + path.relative_to(MAIN).as_posix())
for path in (MAIN / "config-include").glob("*.ini.example"):
put("bin/config-include/" + path.name,
sanitize_example(path.read_text(encoding="utf-8")))
for name in (
"OpenSim.ini.example", "Robust.HG.ini.example", "Robust.ini.example",
"Robust.HG.OGLAsset.ini.example", "OpenSim.ConsoleClient.ini.example",
"startup_commands.txt.example", "shutdown_commands.txt.example",
"http_404.html.example", "http_loginform.html.example",
):
path = MAIN / name
if path.is_file():
put("bin/" + name,
sanitize_example(path.read_text(encoding="utf-8")))
# Clean general defaults / assets. Never include the live bin/data tree,
# which stores API keys, identities, audit records and OGL security state.
for name in ("OpenSimDefaults.ini", "config-include/osslDefaultEnable.ini"):
if (MAIN / name).is_file():
put("bin/" + name,
sanitize_example((MAIN/name).read_text(encoding="utf-8")))
for name in ("LICENSE-README-IMPORTANT.txt", "avataranimations.xml"):
if (MAIN / "data" / name).is_file():
copy(MAIN / "data" / name, "bin/data/" + name)
for name in ("LICENSE", "LICENSE_POLICY.md", "NOTICE.md", "CONTRIBUTORS.txt"):
copy(ROOT/name, name)
for dirname in ("LICENSES", "ThirdPartyLicenses"):
for path in sorted((ROOT/dirname).rglob("*")):
if path.is_file():
copy(path, path.relative_to(ROOT).as_posix())
for path in sorted((ROOT/"addons/OSWebInterface/www").rglob("*")):
if path.is_file():
copy(path, path.relative_to(ROOT).as_posix())
# Assembled client template -- no production region UUID or coordinates.
put("bin/Regions/Regions.ini.example", """; Generate a unique RegionUUID for every region you create.
[Welcome]
RegionUUID = "REPLACE_WITH_UNIQUE_UUID"
Location = "1000,1000"
InternalAddress = "0.0.0.0"
InternalPort = 9000
AllowAlternatePorts = false
ExternalHostName = "SYSTEMIP"
""")
put("bin/addon-modules/.keep", "Optional addins can be placed here.\n")
put("bin/Library/.keep", "Default inventory assets if configured.\n")
put("bin/run-robust.sh", '#!/bin/sh\nset -eu\ncd "$(dirname "$0")"\nexec dotnet Robust.dll -inifile=Robust.HG.ini\n', True)
put("bin/run-simulator.sh", '#!/bin/sh\nset -eu\ncd "$(dirname "$0")"\nexec dotnet OpenSim.dll\n', True)
put("bin/EXAMPLE_Modules.ini", """; Optional OGL modules: enable only after configuring the appropriate service.
[OglUniversalTranslator]
Enabled = false
NodeId = "REPLACE_ME"
CentralUrl = "https://REPLACE_ME"
MaxCharacters = 500
; When enabling OglUniversalTranslator, disable the original [Chat] module.
[OglCrossRegionChat]
Enabled = false
NodeId = "REPLACE_ME"
ListenPort = 9971
PeerPort = 9972
; Multi-process chat requires same 256-bit OGL_CHAT_BRIDGE_KEY on both instances.
; Never expose bridge ports publicly; they bind to loopback only.
""")
put("README_RELEASE.md", """# OpenGenesisLINK Generation 1 – Stable Release 0.9.4.0
Linux x64 binary release candidate · 22 November 2026 · .NET 10
This archive is a **clean installation package**, not a clone of Stadt NexVerse
production. The main 42-region simulator and NexTopia/EventSim were verified
against the same common DLL/PDB/SO runtime assemblies. No configuration,
credentials, asset cache, region data, inventory, database or log from the live
server has been included.
## Installation
1. Install the .NET 10 runtime and required native packages on Linux x86_64.
2. Extract the ZIP. Edit configuration templates (OpenSim.ini.example,
Robust.HG.ini.example and config-include/*.ini.example) for your grid.
3. Rename or copy the templates to their operational *.ini names and enter
only your own credentials. Generate unique region UUIDs in Regions/*.ini.
4. Provision MariaDB, TLS, ports and your **valid product key** using the
official OpenGenesisLINK documentation.
5. Start ROBUST with bin/run-robust.sh and Simulator with
bin/run-simulator.sh. In production, use a process supervisor.
6. Optional central translator: configure a registered NodeId, central HTTPS
service URL, and OGL_TRANSLATOR_NODE_TOKEN loaded at process start.
Only one ChatModule must be enabled; if using OglUniversalTranslator,
disable legacy [Chat]. Translations require bilateral opt-in.
7. Optional cross-region llListen across simulator processes: configure
different loopback ports on each instance and supply the same 32-byte
random OGL_CHAT_BRIDGE_KEY as 64 hexadecimal characters. Do not
expose the relay ports externally.
The admin API DLL is included for the main simulator. Do not automatically
enable duplicate admin API servers on multiple processes.
## Privacy and licensing
No real product key, secret, account, configuration, region save, asset cache,
or user data is included. This package is **not** evidence of full EULA or
third-party licensing clearance. The included copyright/license notices
remain applicable. Review LICENSE, LICENSE_POLICY.md, LICENSES/,
ThirdPartyLicenses/, and the current OpenGenesisLINK EULA **before forwarding
this archive**. The repository still contains a legacy MPL/BSD licensing
policy requiring reconciliation with the newer closed-code distribution model.
This package is Linux x64 only. It is not a Windows or ARM64 build.
## Reproducibility
MANIFEST_SHA256.txt records the hash of every included file.
"""
)
# Every included file is tracked in the package's own checksum manifest.
items = sorted(p for p in STAGE.rglob("*") if p.is_file())
hashes = "".join(f"{sha(p)} {p.relative_to(STAGE).as_posix()}\n" for p in items)
put("MANIFEST_SHA256.txt", hashes)
# Fail closed if any unapproved path somehow got into the package.
forbidden = ("private", "credentials", "bin/assetcache/", "bin/fsassets/", "bin/meshcache/",
"scriptengines", "logs/", "regions/nexverse-", "data/nexverse-",
"data/ogl-", "data/opengenesislink-", ".pem", ".env")
filenames = [str(p.relative_to(STAGE)).replace("\\","/").lower()
for p in STAGE.rglob("*") if p.is_file()]
suspect = [n for n in filenames if any(s in n for s in forbidden)]
if suspect:
raise ValueError("A release path needs privacy review: " + str(suspect[:15]))
with zipfile.ZipFile(ARCHIVE, "w", zipfile.ZIP_DEFLATED, compresslevel=6) as z:
for p in sorted(STAGE.rglob("*")):
if p.is_file():
z.write(p, (Path(NAME)/p.relative_to(STAGE)).as_posix())
with zipfile.ZipFile(ARCHIVE) as z:
bad = z.testzip()
if bad:
raise RuntimeError("ZIP CRC failed: " + bad)
(DEST/(NAME+".zip.sha256")).write_text(f"{sha(ARCHIVE)} {ARCHIVE.name}\n")
print("PACKAGE_CREATED",ARCHIVE)
print("ZIP_BYTES",ARCHIVE.stat().st_size)
print("FILES",len(items)+1)
print("SHA256",sha(ARCHIVE))
print("COMMON_SIMULATOR_ASSEMBLIES",len(shared),"DIFFERENT",len(diff))
if __name__ == "__main__":
main()