move local tools ownership to deploy repository
This commit is contained in:
@@ -15,7 +15,9 @@ Included here:
|
|||||||
- `public/` web UI
|
- `public/` web UI
|
||||||
- `plugins/` plugin catalog and capabilities
|
- `plugins/` plugin catalog and capabilities
|
||||||
- `test/` automated checks
|
- `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:
|
Not included here:
|
||||||
- production secrets
|
- production secrets
|
||||||
|
|||||||
@@ -8,8 +8,7 @@
|
|||||||
"start": "node server/index.js",
|
"start": "node server/index.js",
|
||||||
"dev": "node server/index.js",
|
"dev": "node server/index.js",
|
||||||
"prod": "node server/index.js",
|
"prod": "node server/index.js",
|
||||||
"test": "node --test",
|
"test": "node --test"
|
||||||
"migrate:json-to-sqlite": "node tools/migrate-json-to-sqlite.js"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nodemailer": "^8.0.1",
|
"nodemailer": "^8.0.1",
|
||||||
|
|||||||
@@ -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
|
|
||||||
}
|
|
||||||
@@ -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);
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user