Files
boc/aamos-bank-import/patch-ecosystem.py
T
Bernt bae705aa97 ARCHITECTURE: NFC roadmap, edge AI, audit logging
- Add NFC ePassport roadmap (ICAO 9303, eIDAS)
- Add TensorFlow.js edge face detection (BlazeFace)
- Add structured audit logger (GDPR-compliant)
- Risk scoring support

Part of KYC Apple Native UX v1.1.0
2026-06-29 16:24:48 +00:00

44 lines
1.5 KiB
Python

import re
with open("/opt/amos/services/ecosystem.config.cjs") as f:
content = f.read()
if "aamos-bank-import" in content:
print("ALREADY_EXISTS")
else:
insert = """
// ── AAMOS Finance — Bank CSV Import ─────────────────────────────────────────
{
name: 'aamos-bank-import',
script: '/opt/amos/services/aamos-bank-import/index.mjs',
env: {
PORT: 3252,
DATABASE_URL: DB,
NODE_ENV: 'production',
SERVICE_NAME: 'aamos-bank-import',
LEDGER_URL: 'http://127.0.0.1:3250',
}
},
"""
# Insert before the closing ]
# Find the last ] followed by newline };
new_content = re.sub(r'(\n \]\n\};)', insert + r'\1', content, count=1)
if new_content == content:
# Try alternative closing pattern
new_content = content.replace("\n ]\n};", insert + "\n ]\n};", 1)
if new_content == content:
print("PATTERN_NOT_FOUND - trying line-by-line")
lines = content.split('\n')
# Find last line that is just "]" or " ]"
for i in range(len(lines)-1, -1, -1):
stripped = lines[i].strip()
if stripped == ']':
lines.insert(i, insert)
new_content = '\n'.join(lines)
break
with open("/opt/amos/services/ecosystem.config.cjs", "w") as f:
f.write(new_content)
print("INSERTED")