diff --git a/WORKING_CONTEXT.md b/WORKING_CONTEXT.md index 711c0b5..26474c1 100644 --- a/WORKING_CONTEXT.md +++ b/WORKING_CONTEXT.md @@ -15,7 +15,9 @@ Included here: - `public/` web UI - `plugins/` plugin catalog and capabilities - `test/` automated checks -- `tools/` local utility scripts + +Operational note: +- Local/ops utility scripts were moved to `Remotestation-ARCG/tools/` (deploy overlay repository). Not included here: - production secrets diff --git a/package.json b/package.json index 489b87b..534cfc7 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,7 @@ "start": "node server/index.js", "dev": "node server/index.js", "prod": "node server/index.js", - "test": "node --test", - "migrate:json-to-sqlite": "node tools/migrate-json-to-sqlite.js" + "test": "node --test" }, "dependencies": { "nodemailer": "^8.0.1", diff --git a/tools/check-windows-paths.ps1 b/tools/check-windows-paths.ps1 deleted file mode 100644 index fbf5346..0000000 --- a/tools/check-windows-paths.ps1 +++ /dev/null @@ -1,53 +0,0 @@ -$ErrorActionPreference = "Stop" - -param( - [Parameter(Mandatory = $false)] - [string]$RepoPath = "." -) - -$invalidCharPattern = '[<>:""/|?*]' -$reserved = '^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(\..*)?$' - -$repoAbs = Resolve-Path $RepoPath -Push-Location $repoAbs - -try { - $paths = git ls-tree -r --name-only HEAD - if (-not $paths) { - Write-Output "Keine Dateien im Git-Tree gefunden." - exit 0 - } - - $issues = @() - foreach ($p in $paths) { - $parts = $p -split '/' - foreach ($part in $parts) { - if ($part -match $invalidCharPattern) { - $issues += "INVALID_CHAR: $p" - break - } - if ($part -match $reserved) { - $issues += "RESERVED_NAME: $p" - break - } - if ($part.EndsWith(".") -or $part.EndsWith(" ")) { - $issues += "TRAILING_DOT_SPACE: $p" - break - } - } - if ($p.Length -gt 245) { - $issues += "POTENTIAL_LONG_PATH($($p.Length)): $p" - } - } - - if ($issues.Count -eq 0) { - Write-Output "Keine offensichtlichen Windows-Pfadprobleme im aktuellen Commit gefunden." - exit 0 - } - - $issues | Sort-Object -Unique | ForEach-Object { Write-Output $_ } - exit 2 -} -finally { - Pop-Location -} diff --git a/tools/migrate-json-to-sqlite.js b/tools/migrate-json-to-sqlite.js deleted file mode 100644 index 877be2d..0000000 --- a/tools/migrate-json-to-sqlite.js +++ /dev/null @@ -1,53 +0,0 @@ -const path = require("path"); -const fs = require("fs"); -const fsp = require("fs/promises"); - -const { createJsonStorage } = require("../server/storage/providers/json"); -const { createSqliteStorage } = require("../server/storage/providers/sqlite"); - -async function main() { - const rootDir = path.resolve(__dirname, ".."); - const dataDir = path.resolve(rootDir, process.env.DATA_DIR || "./data"); - const sqlitePath = path.resolve(rootDir, process.env.STORAGE_SQLITE_PATH || "./data/rms-storage.db"); - - await fsp.mkdir(dataDir, { recursive: true }); - - const json = createJsonStorage({ dataDir }); - await json.init(); - const sqlite = createSqliteStorage({ sqlitePath }); - await sqlite.init(); - - const files = [ - "users.json", - "station-state.json", - "auth-state.json", - "plugin-state.json" - ].map((name) => path.join(dataDir, name)); - - for (const filePath of files) { - if (!fs.existsSync(filePath)) { - continue; - } - const value = await json.readJson(filePath, null); - if (value !== null) { - await sqlite.writeJson(filePath, value); - console.log(`migrated json: ${filePath}`); - } - } - - const auditPath = path.join(dataDir, "audit.log"); - if (fs.existsSync(auditPath)) { - const content = await json.readText(auditPath, ""); - if (content) { - await sqlite.writeText(auditPath, content); - console.log(`migrated text: ${auditPath}`); - } - } - - console.log(`done -> ${sqlitePath}`); -} - -main().catch((error) => { - console.error("migration failed", error); - process.exit(1); -});