Add one-shot scripts (plan maison, généalogie, OAuth, etc.)

This commit is contained in:
2026-08-05 12:31:35 +02:00
parent 1936ded08f
commit 4ed3756cd0
9 changed files with 2683 additions and 3 deletions
+33
View File
@@ -0,0 +1,33 @@
import re
with open('/opt/WireMCP/index.js', 'r') as f:
content = f.read()
# Replace the promisify line to include maxBuffer default
content = content.replace(
'const execAsync = promisify(exec);',
'const execAsync = promisify(exec);\nconst MAX_BUFFER = 100 * 1024 * 1024; // 100MB for large packet captures'
)
# Remove duplicate if any
lines = content.split('\n')
seen = set()
unique_lines = []
for line in lines:
if 'MAX_BUFFER' in line and line in seen:
continue
if 'MAX_BUFFER' in line:
seen.add(line)
unique_lines.append(line)
content = '\n'.join(unique_lines)
# Now wrap execAsync to pass maxBuffer by default
content = content.replace(
'const execAsync = promisify(exec);\nconst MAX_BUFFER = 100 * 1024 * 1024;',
'const _execAsync = promisify(exec);\nconst MAX_BUFFER = 100 * 1024 * 1024;\nconst execAsync = (cmd, opts = {}) => _execAsync(cmd, { maxBuffer: MAX_BUFFER, ...opts });'
)
with open('/opt/WireMCP/index.js', 'w') as f:
f.write(content)
print('OK')