From d3fe8eb01002c387ff4a103277cb4f1e442ec572 Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Sun, 19 Jul 2026 19:10:04 +0300 Subject: [PATCH] =?UTF-8?q?fix(db-*,epf-build):=20=D0=BC=D0=B0=D1=81=D0=BA?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D1=82=D1=8C=20=D1=83=D1=87=D1=91?= =?UTF-8?q?=D1=82=D0=BD=D1=8B=D0=B5=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D0=B5?= =?UTF-8?q?=20=D0=B2=20=D1=81=D1=82=D1=80=D0=BE=D0=BA=D0=B5=20Running?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Навыки печатали полную командную строку платформы, включая /P<пароль> (1cv8) и --password= (ibcmd), в диагностику. Добавлен per-token маскер (/N, /P, --user=, --password= → ***); привязка к началу токена не трогает пути. Оба порта, обе ветки движка, все 9 навыков с параметрами подключения. Co-Authored-By: Claude Opus 4.8 --- .../skills/db-dump-cf/scripts/db-dump-cf.ps1 | 12 +++++++++--- .../skills/db-dump-cf/scripts/db-dump-cf.py | 16 +++++++++++++--- .../skills/db-dump-dt/scripts/db-dump-dt.ps1 | 12 +++++++++--- .../skills/db-dump-dt/scripts/db-dump-dt.py | 16 +++++++++++++--- .../skills/db-dump-xml/scripts/db-dump-xml.ps1 | 12 +++++++++--- .../skills/db-dump-xml/scripts/db-dump-xml.py | 16 +++++++++++++--- .../skills/db-load-cf/scripts/db-load-cf.ps1 | 12 +++++++++--- .../skills/db-load-cf/scripts/db-load-cf.py | 16 +++++++++++++--- .../skills/db-load-dt/scripts/db-load-dt.ps1 | 12 +++++++++--- .../skills/db-load-dt/scripts/db-load-dt.py | 16 +++++++++++++--- .../skills/db-load-git/scripts/db-load-git.ps1 | 14 ++++++++++---- .../skills/db-load-git/scripts/db-load-git.py | 18 ++++++++++++++---- .../skills/db-load-xml/scripts/db-load-xml.ps1 | 14 ++++++++++---- .../skills/db-load-xml/scripts/db-load-xml.py | 18 ++++++++++++++---- .claude/skills/db-update/scripts/db-update.ps1 | 12 +++++++++--- .claude/skills/db-update/scripts/db-update.py | 16 +++++++++++++--- .claude/skills/epf-build/scripts/epf-build.ps1 | 12 +++++++++--- .claude/skills/epf-build/scripts/epf-build.py | 16 +++++++++++++--- 18 files changed, 202 insertions(+), 58 deletions(-) diff --git a/.claude/skills/db-dump-cf/scripts/db-dump-cf.ps1 b/.claude/skills/db-dump-cf/scripts/db-dump-cf.ps1 index b8453505..95f4c62f 100644 --- a/.claude/skills/db-dump-cf/scripts/db-dump-cf.ps1 +++ b/.claude/skills/db-dump-cf/scripts/db-dump-cf.ps1 @@ -1,4 +1,4 @@ -# db-dump-cf v1.7 — Dump 1C configuration to CF file +# db-dump-cf v1.8 — Dump 1C configuration to CF file # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # NB: *nix-раскладку платформы (/opt/1cv8//1cv8, без .exe) знает только .py-порт — PS на *nix не исполняется. <# @@ -76,6 +76,12 @@ param( $OutputEncoding = [System.Text.Encoding]::UTF8 [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 +function Format-SafeArgs { + # Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display. + param([string[]]$A) + ($A | ForEach-Object { $_ -replace '^(/[NP]).+', '$1***' -replace '^(--(user|password)=).+', '$1***' }) -join ' ' +} + # --- Resolve V8Path --- function Find-ProjectV8Path { $dir = (Get-Location).Path @@ -190,7 +196,7 @@ try { if ($UserName) { $arguments += "--user=$UserName" } if ($Password) { $arguments += "--password=$Password" } $arguments += "--data=$tempDir" - Write-Host "Running: ibcmd $($arguments -join ' ')" + Write-Host "Running: ibcmd $(Format-SafeArgs $arguments)" $__ib = Invoke-IbcmdProcess $V8Path $arguments $output = $__ib.Output $exitCode = $__ib.ExitCode @@ -235,7 +241,7 @@ try { $arguments += "/DisableStartupDialogs" # --- Execute --- - Write-Host "Running: 1cv8.exe $($arguments -join ' ')" + Write-Host "Running: 1cv8.exe $(Format-SafeArgs $arguments)" $process = Start-Process -FilePath $V8Path -ArgumentList $arguments -NoNewWindow -Wait -PassThru $exitCode = $process.ExitCode diff --git a/.claude/skills/db-dump-cf/scripts/db-dump-cf.py b/.claude/skills/db-dump-cf/scripts/db-dump-cf.py index 299467e3..93cb2b75 100644 --- a/.claude/skills/db-dump-cf/scripts/db-dump-cf.py +++ b/.claude/skills/db-dump-cf/scripts/db-dump-cf.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# db-dump-cf v1.7 — Dump 1C configuration to CF file +# db-dump-cf v1.8 — Dump 1C configuration to CF file # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse @@ -105,6 +105,16 @@ def output_nonempty(path): return os.path.isfile(path) and os.path.getsize(path) > 0 +def _mask(args): + """Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display.""" + out = [] + for a in args: + a = re.sub(r"^(/[NP]).+", r"\1***", a) + a = re.sub(r"^(--(?:user|password)=).+", r"\1***", a) + out.append(a) + return out + + def main(): sys.stdout.reconfigure(encoding="utf-8") sys.stderr.reconfigure(encoding="utf-8") @@ -156,7 +166,7 @@ def main(): if args.Password: arguments.append(f"--password={args.Password}") arguments.append(f"--data={ib_data}") - print(f"Running: ibcmd {' '.join(arguments)}") + print(f"Running: ibcmd {' '.join(_mask(arguments))}") result = run_ibcmd([v8path] + arguments, bool(args.UserName)) exit_code = result.returncode out_missing = exit_code == 0 and not output_nonempty(args.OutputFile) @@ -206,7 +216,7 @@ def main(): arguments.append("/DisableStartupDialogs") # --- Execute --- - print(f"Running: 1cv8.exe {' '.join(arguments)}") + print(f"Running: 1cv8.exe {' '.join(_mask(arguments))}") result = subprocess.run( [v8path] + arguments, capture_output=True, diff --git a/.claude/skills/db-dump-dt/scripts/db-dump-dt.ps1 b/.claude/skills/db-dump-dt/scripts/db-dump-dt.ps1 index 76130588..5a44e8d4 100644 --- a/.claude/skills/db-dump-dt/scripts/db-dump-dt.ps1 +++ b/.claude/skills/db-dump-dt/scripts/db-dump-dt.ps1 @@ -1,4 +1,4 @@ -# db-dump-dt v1.6 — Dump 1C information base to DT file +# db-dump-dt v1.7 — Dump 1C information base to DT file # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # NB: *nix-раскладку платформы (/opt/1cv8//1cv8, без .exe) знает только .py-порт — PS на *nix не исполняется. <# @@ -60,6 +60,12 @@ param( $OutputEncoding = [System.Text.Encoding]::UTF8 [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 +function Format-SafeArgs { + # Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display. + param([string[]]$A) + ($A | ForEach-Object { $_ -replace '^(/[NP]).+', '$1***' -replace '^(--(user|password)=).+', '$1***' }) -join ' ' +} + # --- Resolve V8Path --- function Find-ProjectV8Path { $dir = (Get-Location).Path @@ -170,7 +176,7 @@ try { $arguments += "$OutputFile" $arguments += "--data=$tempDir" - Write-Host "Running: ibcmd $($arguments -join ' ')" + Write-Host "Running: ibcmd $(Format-SafeArgs $arguments)" $__ib = Invoke-IbcmdProcess $V8Path $arguments $output = $__ib.Output $exitCode = $__ib.ExitCode @@ -208,7 +214,7 @@ try { $arguments += "/DisableStartupDialogs" # --- Execute --- - Write-Host "Running: 1cv8.exe $($arguments -join ' ')" + Write-Host "Running: 1cv8.exe $(Format-SafeArgs $arguments)" $process = Start-Process -FilePath $V8Path -ArgumentList $arguments -NoNewWindow -Wait -PassThru $exitCode = $process.ExitCode diff --git a/.claude/skills/db-dump-dt/scripts/db-dump-dt.py b/.claude/skills/db-dump-dt/scripts/db-dump-dt.py index 1cb1c9ca..d2bcce17 100644 --- a/.claude/skills/db-dump-dt/scripts/db-dump-dt.py +++ b/.claude/skills/db-dump-dt/scripts/db-dump-dt.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# db-dump-dt v1.6 — Dump 1C information base to DT file +# db-dump-dt v1.7 — Dump 1C information base to DT file # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse @@ -105,6 +105,16 @@ def output_nonempty(path): return os.path.isfile(path) and os.path.getsize(path) > 0 +def _mask(args): + """Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display.""" + out = [] + for a in args: + a = re.sub(r"^(/[NP]).+", r"\1***", a) + a = re.sub(r"^(--(?:user|password)=).+", r"\1***", a) + out.append(a) + return out + + def main(): sys.stdout.reconfigure(encoding="utf-8") sys.stderr.reconfigure(encoding="utf-8") @@ -149,7 +159,7 @@ def main(): ib_data = tempfile.mkdtemp(prefix="ibcmd_data_") atexit.register(shutil.rmtree, ib_data, ignore_errors=True) arguments.append(f"--data={ib_data}") - print(f"Running: ibcmd {' '.join(arguments)}") + print(f"Running: ibcmd {' '.join(_mask(arguments))}") result = run_ibcmd([v8path] + arguments, bool(args.UserName)) exit_code = result.returncode out_missing = exit_code == 0 and not output_nonempty(args.OutputFile) @@ -193,7 +203,7 @@ def main(): arguments.append("/DisableStartupDialogs") # --- Execute --- - print(f"Running: 1cv8.exe {' '.join(arguments)}") + print(f"Running: 1cv8.exe {' '.join(_mask(arguments))}") result = subprocess.run( [v8path] + arguments, capture_output=True, diff --git a/.claude/skills/db-dump-xml/scripts/db-dump-xml.ps1 b/.claude/skills/db-dump-xml/scripts/db-dump-xml.ps1 index 8508f2b9..cd469f01 100644 --- a/.claude/skills/db-dump-xml/scripts/db-dump-xml.ps1 +++ b/.claude/skills/db-dump-xml/scripts/db-dump-xml.ps1 @@ -1,4 +1,4 @@ -# db-dump-xml v1.9 — Dump 1C configuration to XML files +# db-dump-xml v1.10 — Dump 1C configuration to XML files # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # NB: *nix-раскладку платформы (/opt/1cv8//1cv8, без .exe) знает только .py-порт — PS на *nix не исполняется. <# @@ -99,6 +99,12 @@ param( $OutputEncoding = [System.Text.Encoding]::UTF8 [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 +function Format-SafeArgs { + # Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display. + param([string[]]$A) + ($A | ForEach-Object { $_ -replace '^(/[NP]).+', '$1***' -replace '^(--(user|password)=).+', '$1***' }) -join ' ' +} + # --- Resolve V8Path --- function Find-ProjectV8Path { $dir = (Get-Location).Path @@ -231,7 +237,7 @@ try { if ($UserName) { $arguments += "--user=$UserName" } if ($Password) { $arguments += "--password=$Password" } $arguments += "--data=$tempDir" - Write-Host "Running: ibcmd $($arguments -join ' ')" + Write-Host "Running: ibcmd $(Format-SafeArgs $arguments)" $__ib = Invoke-IbcmdProcess $V8Path $arguments $output = $__ib.Output $exitCode = $__ib.ExitCode @@ -304,7 +310,7 @@ try { $arguments += "/DisableStartupDialogs" # --- Execute --- - Write-Host "Running: 1cv8.exe $($arguments -join ' ')" + Write-Host "Running: 1cv8.exe $(Format-SafeArgs $arguments)" $process = Start-Process -FilePath $V8Path -ArgumentList $arguments -NoNewWindow -Wait -PassThru $exitCode = $process.ExitCode diff --git a/.claude/skills/db-dump-xml/scripts/db-dump-xml.py b/.claude/skills/db-dump-xml/scripts/db-dump-xml.py index a474b5c7..076898c5 100644 --- a/.claude/skills/db-dump-xml/scripts/db-dump-xml.py +++ b/.claude/skills/db-dump-xml/scripts/db-dump-xml.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# db-dump-xml v1.9 — Dump 1C configuration to XML files +# db-dump-xml v1.10 — Dump 1C configuration to XML files # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse @@ -105,6 +105,16 @@ def dir_nonempty(path): return os.path.isdir(path) and any(os.scandir(path)) +def _mask(args): + """Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display.""" + out = [] + for a in args: + a = re.sub(r"^(/[NP]).+", r"\1***", a) + a = re.sub(r"^(--(?:user|password)=).+", r"\1***", a) + out.append(a) + return out + + def main(): sys.stdout.reconfigure(encoding="utf-8") sys.stderr.reconfigure(encoding="utf-8") @@ -187,7 +197,7 @@ def main(): if args.Password: arguments.append(f"--password={args.Password}") arguments.append(f"--data={ib_data}") - print(f"Running: ibcmd {' '.join(arguments)}") + print(f"Running: ibcmd {' '.join(_mask(arguments))}") result = run_ibcmd([v8path] + arguments, bool(args.UserName)) exit_code = result.returncode out_missing = exit_code == 0 and not dir_nonempty(args.ConfigDir) @@ -260,7 +270,7 @@ def main(): arguments.append("/DisableStartupDialogs") # --- Execute --- - print(f"Running: 1cv8.exe {' '.join(arguments)}") + print(f"Running: 1cv8.exe {' '.join(_mask(arguments))}") result = subprocess.run( [v8path] + arguments, capture_output=True, diff --git a/.claude/skills/db-load-cf/scripts/db-load-cf.ps1 b/.claude/skills/db-load-cf/scripts/db-load-cf.ps1 index 6d0b629c..4137d91e 100644 --- a/.claude/skills/db-load-cf/scripts/db-load-cf.ps1 +++ b/.claude/skills/db-load-cf/scripts/db-load-cf.ps1 @@ -1,4 +1,4 @@ -# db-load-cf v1.7 — Load 1C configuration from CF file +# db-load-cf v1.8 — Load 1C configuration from CF file # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # NB: *nix-раскладку платформы (/opt/1cv8//1cv8, без .exe) знает только .py-порт — PS на *nix не исполняется. <# @@ -76,6 +76,12 @@ param( $OutputEncoding = [System.Text.Encoding]::UTF8 [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 +function Format-SafeArgs { + # Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display. + param([string[]]$A) + ($A | ForEach-Object { $_ -replace '^(/[NP]).+', '$1***' -replace '^(--(user|password)=).+', '$1***' }) -join ' ' +} + function Get-ExitAnnotation { # Annotate an abnormal process exit code so a crash isn't reported as a bare number. # A batch DESIGNER that crashes (e.g. missing license) may leave the infobase locked or @@ -200,7 +206,7 @@ try { if ($UserName) { $arguments += "--user=$UserName" } if ($Password) { $arguments += "--password=$Password" } $arguments += "--data=$tempDir" - Write-Host "Running: ibcmd $($arguments -join ' ')" + Write-Host "Running: ibcmd $(Format-SafeArgs $arguments)" $__ib = Invoke-IbcmdProcess $V8Path $arguments $output = $__ib.Output $exitCode = $__ib.ExitCode @@ -241,7 +247,7 @@ try { $arguments += "/DisableStartupDialogs" # --- Execute --- - Write-Host "Running: 1cv8.exe $($arguments -join ' ')" + Write-Host "Running: 1cv8.exe $(Format-SafeArgs $arguments)" $process = Start-Process -FilePath $V8Path -ArgumentList $arguments -NoNewWindow -Wait -PassThru $exitCode = $process.ExitCode diff --git a/.claude/skills/db-load-cf/scripts/db-load-cf.py b/.claude/skills/db-load-cf/scripts/db-load-cf.py index 2fb9ee9d..3e97df77 100644 --- a/.claude/skills/db-load-cf/scripts/db-load-cf.py +++ b/.claude/skills/db-load-cf/scripts/db-load-cf.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# db-load-cf v1.7 — Load 1C configuration from CF file +# db-load-cf v1.8 — Load 1C configuration from CF file # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse @@ -124,6 +124,16 @@ def describe_exit(code): return "" +def _mask(args): + """Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display.""" + out = [] + for a in args: + a = re.sub(r"^(/[NP]).+", r"\1***", a) + a = re.sub(r"^(--(?:user|password)=).+", r"\1***", a) + out.append(a) + return out + + def main(): sys.stdout.reconfigure(encoding="utf-8") sys.stderr.reconfigure(encoding="utf-8") @@ -175,7 +185,7 @@ def main(): if args.Password: arguments.append(f"--password={args.Password}") arguments.append(f"--data={ib_data}") - print(f"Running: ibcmd {' '.join(arguments)}") + print(f"Running: ibcmd {' '.join(_mask(arguments))}") result = run_ibcmd([v8path] + arguments, bool(args.UserName)) if result.returncode == 0: print(f"Configuration loaded successfully from: {args.InputFile}") @@ -219,7 +229,7 @@ def main(): arguments.append("/DisableStartupDialogs") # --- Execute --- - print(f"Running: 1cv8.exe {' '.join(arguments)}") + print(f"Running: 1cv8.exe {' '.join(_mask(arguments))}") result = subprocess.run( [v8path] + arguments, capture_output=True, diff --git a/.claude/skills/db-load-dt/scripts/db-load-dt.ps1 b/.claude/skills/db-load-dt/scripts/db-load-dt.ps1 index 58cde48d..87e66457 100644 --- a/.claude/skills/db-load-dt/scripts/db-load-dt.ps1 +++ b/.claude/skills/db-load-dt/scripts/db-load-dt.ps1 @@ -1,4 +1,4 @@ -# db-load-dt v1.6 — Load 1C information base from DT file +# db-load-dt v1.7 — Load 1C information base from DT file # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # NB: *nix-раскладку платформы (/opt/1cv8//1cv8, без .exe) знает только .py-порт — PS на *nix не исполняется. <# @@ -73,6 +73,12 @@ param( $OutputEncoding = [System.Text.Encoding]::UTF8 [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 +function Format-SafeArgs { + # Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display. + param([string[]]$A) + ($A | ForEach-Object { $_ -replace '^(/[NP]).+', '$1***' -replace '^(--(user|password)=).+', '$1***' }) -join ' ' +} + function Get-ExitAnnotation { # Annotate an abnormal process exit code so a crash isn't reported as a bare number. # A batch DESIGNER that crashes (e.g. missing license) may leave the infobase locked or @@ -194,7 +200,7 @@ try { $arguments += "$InputFile" $arguments += "--data=$tempDir" - Write-Host "Running: ibcmd $($arguments -join ' ')" + Write-Host "Running: ibcmd $(Format-SafeArgs $arguments)" $__ib = Invoke-IbcmdProcess $V8Path $arguments $output = $__ib.Output $exitCode = $__ib.ExitCode @@ -230,7 +236,7 @@ try { $arguments += "/DisableStartupDialogs" # --- Execute --- - Write-Host "Running: 1cv8.exe $($arguments -join ' ')" + Write-Host "Running: 1cv8.exe $(Format-SafeArgs $arguments)" $process = Start-Process -FilePath $V8Path -ArgumentList $arguments -NoNewWindow -Wait -PassThru $exitCode = $process.ExitCode diff --git a/.claude/skills/db-load-dt/scripts/db-load-dt.py b/.claude/skills/db-load-dt/scripts/db-load-dt.py index 9fb0f01c..5f3495ad 100644 --- a/.claude/skills/db-load-dt/scripts/db-load-dt.py +++ b/.claude/skills/db-load-dt/scripts/db-load-dt.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# db-load-dt v1.6 — Load 1C information base from DT file +# db-load-dt v1.7 — Load 1C information base from DT file # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse @@ -124,6 +124,16 @@ def describe_exit(code): return "" +def _mask(args): + """Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display.""" + out = [] + for a in args: + a = re.sub(r"^(/[NP]).+", r"\1***", a) + a = re.sub(r"^(--(?:user|password)=).+", r"\1***", a) + out.append(a) + return out + + def main(): sys.stdout.reconfigure(encoding="utf-8") sys.stderr.reconfigure(encoding="utf-8") @@ -172,7 +182,7 @@ def main(): ib_data = tempfile.mkdtemp(prefix="ibcmd_data_") atexit.register(shutil.rmtree, ib_data, ignore_errors=True) arguments.append(f"--data={ib_data}") - print(f"Running: ibcmd {' '.join(arguments)}") + print(f"Running: ibcmd {' '.join(_mask(arguments))}") result = run_ibcmd([v8path] + arguments, bool(args.UserName)) if result.returncode == 0: print(f"Information base restored successfully from: {args.InputFile}") @@ -214,7 +224,7 @@ def main(): arguments.append("/DisableStartupDialogs") # --- Execute --- - print(f"Running: 1cv8.exe {' '.join(arguments)}") + print(f"Running: 1cv8.exe {' '.join(_mask(arguments))}") result = subprocess.run( [v8path] + arguments, capture_output=True, diff --git a/.claude/skills/db-load-git/scripts/db-load-git.ps1 b/.claude/skills/db-load-git/scripts/db-load-git.ps1 index efdaca25..52584431 100644 --- a/.claude/skills/db-load-git/scripts/db-load-git.ps1 +++ b/.claude/skills/db-load-git/scripts/db-load-git.ps1 @@ -1,4 +1,4 @@ -# db-load-git v1.12 — Load Git changes into 1C database +# db-load-git v1.13 — Load Git changes into 1C database # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # NB: *nix-раскладку платформы (/opt/1cv8//1cv8, без .exe) знает только .py-порт — PS на *nix не исполняется. <# @@ -108,6 +108,12 @@ param( $OutputEncoding = [System.Text.Encoding]::UTF8 [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 +function Format-SafeArgs { + # Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display. + param([string[]]$A) + ($A | ForEach-Object { $_ -replace '^(/[NP]).+', '$1***' -replace '^(--(user|password)=).+', '$1***' }) -join ' ' +} + function Get-ExitAnnotation { # Annotate an abnormal process exit code so a crash isn't reported as a bare number. # A batch DESIGNER that crashes (e.g. missing license) may leave the infobase locked or @@ -389,7 +395,7 @@ try { if ($UserName) { $arguments += "--user=$UserName" } if ($Password) { $arguments += "--password=$Password" } $arguments += "--data=$tempDir" - Write-Host "Running: ibcmd $($arguments -join ' ')" + Write-Host "Running: ibcmd $(Format-SafeArgs $arguments)" $__ib = Invoke-IbcmdProcess $V8Path $arguments $output = $__ib.Output $exitCode = $__ib.ExitCode @@ -405,7 +411,7 @@ try { if ($UserName) { $applyArgs += "--user=$UserName" } if ($Password) { $applyArgs += "--password=$Password" } $applyArgs += "--data=$tempDir" - Write-Host "Running: ibcmd $($applyArgs -join ' ')" + Write-Host "Running: ibcmd $(Format-SafeArgs $applyArgs)" $__ib = Invoke-IbcmdProcess $V8Path $applyArgs $applyOut = $__ib.Output $exitCode = $__ib.ExitCode @@ -463,7 +469,7 @@ try { # --- Execute --- Write-Host "" Write-Host "Executing partial configuration load..." - Write-Host "Running: 1cv8.exe $($arguments -join ' ')" + Write-Host "Running: 1cv8.exe $(Format-SafeArgs $arguments)" $process = Start-Process -FilePath $V8Path -ArgumentList $arguments -NoNewWindow -Wait -PassThru $exitCode = $process.ExitCode diff --git a/.claude/skills/db-load-git/scripts/db-load-git.py b/.claude/skills/db-load-git/scripts/db-load-git.py index 36d9be43..498e9eb4 100644 --- a/.claude/skills/db-load-git/scripts/db-load-git.py +++ b/.claude/skills/db-load-git/scripts/db-load-git.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# db-load-git v1.12 — Load Git changes into 1C database +# db-load-git v1.13 — Load Git changes into 1C database # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse @@ -146,6 +146,16 @@ def describe_exit(code): return "" +def _mask(args): + """Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display.""" + out = [] + for a in args: + a = re.sub(r"^(/[NP]).+", r"\1***", a) + a = re.sub(r"^(--(?:user|password)=).+", r"\1***", a) + out.append(a) + return out + + def main(): sys.stdout.reconfigure(encoding="utf-8") sys.stderr.reconfigure(encoding="utf-8") @@ -332,7 +342,7 @@ def main(): if args.Password: arguments.append(f"--password={args.Password}") arguments.append(f"--data={ib_data}") - print(f"Running: ibcmd {' '.join(arguments)}") + print(f"Running: ibcmd {' '.join(_mask(arguments))}") result = run_ibcmd([v8path] + arguments, bool(args.UserName)) if result.returncode != 0: print(f"Error loading changes (code: {result.returncode}){describe_exit(result.returncode)}", file=sys.stderr) @@ -352,7 +362,7 @@ def main(): if args.Password: apply_args.append(f"--password={args.Password}") apply_args.append(f"--data={ib_data}") - print(f"Running: ibcmd {' '.join(apply_args)}") + print(f"Running: ibcmd {' '.join(_mask(apply_args))}") ar = run_ibcmd([v8path] + apply_args, bool(args.UserName)) exit_code = ar.returncode if exit_code == 0: @@ -407,7 +417,7 @@ def main(): # --- Execute --- print("") print("Executing partial configuration load...") - print(f"Running: 1cv8.exe {' '.join(arguments)}") + print(f"Running: 1cv8.exe {' '.join(_mask(arguments))}") result = subprocess.run( [v8path] + arguments, diff --git a/.claude/skills/db-load-xml/scripts/db-load-xml.ps1 b/.claude/skills/db-load-xml/scripts/db-load-xml.ps1 index ebf16b94..e03b8980 100644 --- a/.claude/skills/db-load-xml/scripts/db-load-xml.ps1 +++ b/.claude/skills/db-load-xml/scripts/db-load-xml.ps1 @@ -1,4 +1,4 @@ -# db-load-xml v1.13 — Load 1C configuration from XML files +# db-load-xml v1.14 — Load 1C configuration from XML files # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # NB: *nix-раскладку платформы (/opt/1cv8//1cv8, без .exe) знает только .py-порт — PS на *nix не исполняется. <# @@ -108,6 +108,12 @@ param( $OutputEncoding = [System.Text.Encoding]::UTF8 [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 +function Format-SafeArgs { + # Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display. + param([string[]]$A) + ($A | ForEach-Object { $_ -replace '^(/[NP]).+', '$1***' -replace '^(--(user|password)=).+', '$1***' }) -join ' ' +} + function Get-ExitAnnotation { # Annotate an abnormal process exit code so a crash isn't reported as a bare number. # A batch DESIGNER that crashes (e.g. missing license) may leave the infobase locked or @@ -261,7 +267,7 @@ try { if ($UserName) { $arguments += "--user=$UserName" } if ($Password) { $arguments += "--password=$Password" } $arguments += "--data=$tempDir" - Write-Host "Running: ibcmd $($arguments -join ' ')" + Write-Host "Running: ibcmd $(Format-SafeArgs $arguments)" $__ib = Invoke-IbcmdProcess $V8Path $arguments $output = $__ib.Output $exitCode = $__ib.ExitCode @@ -278,7 +284,7 @@ try { if ($UserName) { $applyArgs += "--user=$UserName" } if ($Password) { $applyArgs += "--password=$Password" } $applyArgs += "--data=$tempDir" - Write-Host "Running: ibcmd $($applyArgs -join ' ')" + Write-Host "Running: ibcmd $(Format-SafeArgs $applyArgs)" $__ib = Invoke-IbcmdProcess $V8Path $applyArgs $applyOut = $__ib.Output $exitCode = $__ib.ExitCode @@ -368,7 +374,7 @@ try { $arguments += "/DisableStartupDialogs" # --- Execute --- - Write-Host "Running: 1cv8.exe $($arguments -join ' ')" + Write-Host "Running: 1cv8.exe $(Format-SafeArgs $arguments)" $process = Start-Process -FilePath $V8Path -ArgumentList $arguments -NoNewWindow -Wait -PassThru $exitCode = $process.ExitCode diff --git a/.claude/skills/db-load-xml/scripts/db-load-xml.py b/.claude/skills/db-load-xml/scripts/db-load-xml.py index e5c84977..f9617942 100644 --- a/.claude/skills/db-load-xml/scripts/db-load-xml.py +++ b/.claude/skills/db-load-xml/scripts/db-load-xml.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# db-load-xml v1.13 — Load 1C configuration from XML files +# db-load-xml v1.14 — Load 1C configuration from XML files # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse @@ -124,6 +124,16 @@ def describe_exit(code): return "" +def _mask(args): + """Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display.""" + out = [] + for a in args: + a = re.sub(r"^(/[NP]).+", r"\1***", a) + a = re.sub(r"^(--(?:user|password)=).+", r"\1***", a) + out.append(a) + return out + + def main(): sys.stdout.reconfigure(encoding="utf-8") sys.stderr.reconfigure(encoding="utf-8") @@ -224,7 +234,7 @@ def main(): if args.Password: arguments.append(f"--password={args.Password}") arguments.append(f"--data={ib_data}") - print(f"Running: ibcmd {' '.join(arguments)}") + print(f"Running: ibcmd {' '.join(_mask(arguments))}") result = run_ibcmd([v8path] + arguments, bool(args.UserName)) if result.returncode != 0: print(f"Error loading configuration from files (code: {result.returncode}){describe_exit(result.returncode)}", file=sys.stderr) @@ -244,7 +254,7 @@ def main(): if args.Password: apply_args.append(f"--password={args.Password}") apply_args.append(f"--data={ib_data}") - print(f"Running: ibcmd {' '.join(apply_args)}") + print(f"Running: ibcmd {' '.join(_mask(apply_args))}") ar = run_ibcmd([v8path] + apply_args, bool(args.UserName)) exit_code = ar.returncode if exit_code == 0: @@ -333,7 +343,7 @@ def main(): arguments.append("/DisableStartupDialogs") # --- Execute --- - print(f"Running: 1cv8.exe {' '.join(arguments)}") + print(f"Running: 1cv8.exe {' '.join(_mask(arguments))}") result = subprocess.run( [v8path] + arguments, capture_output=True, diff --git a/.claude/skills/db-update/scripts/db-update.ps1 b/.claude/skills/db-update/scripts/db-update.ps1 index 99ab137a..8aba9378 100644 --- a/.claude/skills/db-update/scripts/db-update.ps1 +++ b/.claude/skills/db-update/scripts/db-update.ps1 @@ -1,4 +1,4 @@ -# db-update v1.7 — Update 1C database configuration +# db-update v1.8 — Update 1C database configuration # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # NB: *nix-раскладку платформы (/opt/1cv8//1cv8, без .exe) знает только .py-порт — PS на *nix не исполняется. <# @@ -89,6 +89,12 @@ param( $OutputEncoding = [System.Text.Encoding]::UTF8 [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 +function Format-SafeArgs { + # Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display. + param([string[]]$A) + ($A | ForEach-Object { $_ -replace '^(/[NP]).+', '$1***' -replace '^(--(user|password)=).+', '$1***' }) -join ' ' +} + function Get-ExitAnnotation { # Annotate an abnormal process exit code so a crash isn't reported as a bare number. # A batch DESIGNER that crashes (e.g. missing license) may leave the infobase locked or @@ -208,7 +214,7 @@ try { if ($UserName) { $arguments += "--user=$UserName" } if ($Password) { $arguments += "--password=$Password" } $arguments += "--data=$tempDir" - Write-Host "Running: ibcmd $($arguments -join ' ')" + Write-Host "Running: ibcmd $(Format-SafeArgs $arguments)" $__ib = Invoke-IbcmdProcess $V8Path $arguments $output = $__ib.Output $exitCode = $__ib.ExitCode @@ -260,7 +266,7 @@ try { $arguments += "/DisableStartupDialogs" # --- Execute --- - Write-Host "Running: 1cv8.exe $($arguments -join ' ')" + Write-Host "Running: 1cv8.exe $(Format-SafeArgs $arguments)" $process = Start-Process -FilePath $V8Path -ArgumentList $arguments -NoNewWindow -Wait -PassThru $exitCode = $process.ExitCode diff --git a/.claude/skills/db-update/scripts/db-update.py b/.claude/skills/db-update/scripts/db-update.py index 96f2368e..bb744985 100644 --- a/.claude/skills/db-update/scripts/db-update.py +++ b/.claude/skills/db-update/scripts/db-update.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# db-update v1.7 — Update 1C database configuration +# db-update v1.8 — Update 1C database configuration # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse @@ -124,6 +124,16 @@ def describe_exit(code): return "" +def _mask(args): + """Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display.""" + out = [] + for a in args: + a = re.sub(r"^(/[NP]).+", r"\1***", a) + a = re.sub(r"^(--(?:user|password)=).+", r"\1***", a) + out.append(a) + return out + + def main(): sys.stdout.reconfigure(encoding="utf-8") sys.stderr.reconfigure(encoding="utf-8") @@ -176,7 +186,7 @@ def main(): if args.Password: arguments.append(f"--password={args.Password}") arguments.append(f"--data={ib_data}") - print(f"Running: ibcmd {' '.join(arguments)}") + print(f"Running: ibcmd {' '.join(_mask(arguments))}") result = run_ibcmd([v8path] + arguments, bool(args.UserName)) if result.returncode == 0: print("Database configuration updated successfully") @@ -228,7 +238,7 @@ def main(): arguments.append("/DisableStartupDialogs") # --- Execute --- - print(f"Running: 1cv8.exe {' '.join(arguments)}") + print(f"Running: 1cv8.exe {' '.join(_mask(arguments))}") result = subprocess.run( [v8path] + arguments, capture_output=True, diff --git a/.claude/skills/epf-build/scripts/epf-build.ps1 b/.claude/skills/epf-build/scripts/epf-build.ps1 index 8ebfd675..e1603080 100644 --- a/.claude/skills/epf-build/scripts/epf-build.ps1 +++ b/.claude/skills/epf-build/scripts/epf-build.ps1 @@ -1,4 +1,4 @@ -# epf-build v1.7 — Build external data processor or report (EPF/ERF) from XML sources +# epf-build v1.8 — Build external data processor or report (EPF/ERF) from XML sources # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # NB: *nix-раскладку платформы (/opt/1cv8//1cv8, без .exe) знает только .py-порт — PS на *nix не исполняется. <# @@ -70,6 +70,12 @@ param( $OutputEncoding = [System.Text.Encoding]::UTF8 [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 +function Format-SafeArgs { + # Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display. + param([string[]]$A) + ($A | ForEach-Object { $_ -replace '^(/[NP]).+', '$1***' -replace '^(--(user|password)=).+', '$1***' }) -join ' ' +} + # --- Resolve V8Path --- function Find-ProjectV8Path { $dir = (Get-Location).Path @@ -195,7 +201,7 @@ try { if ($UserName) { $arguments += "--user=$UserName" } if ($Password) { $arguments += "--password=$Password" } $arguments += "--data=$tempDir" - Write-Host "Running: ibcmd $($arguments -join ' ')" + Write-Host "Running: ibcmd $(Format-SafeArgs $arguments)" $__ib = Invoke-IbcmdProcess $V8Path $arguments $output = $__ib.Output $exitCode = $__ib.ExitCode @@ -233,7 +239,7 @@ try { $arguments += "/DisableStartupDialogs" # --- Execute --- - Write-Host "Running: 1cv8.exe $($arguments -join ' ')" + Write-Host "Running: 1cv8.exe $(Format-SafeArgs $arguments)" $process = Start-Process -FilePath $V8Path -ArgumentList $arguments -NoNewWindow -Wait -PassThru $exitCode = $process.ExitCode diff --git a/.claude/skills/epf-build/scripts/epf-build.py b/.claude/skills/epf-build/scripts/epf-build.py index b124fc5a..314afdad 100644 --- a/.claude/skills/epf-build/scripts/epf-build.py +++ b/.claude/skills/epf-build/scripts/epf-build.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# epf-build v1.7 — Build external data processor or report (EPF/ERF) from XML sources +# epf-build v1.8 — Build external data processor or report (EPF/ERF) from XML sources # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse @@ -105,6 +105,16 @@ def output_nonempty(path): return os.path.isfile(path) and os.path.getsize(path) > 0 +def _mask(args): + """Mask credential tokens (/N, /P for 1cv8; --user=, --password= for ibcmd) for display.""" + out = [] + for a in args: + a = re.sub(r"^(/[NP]).+", r"\1***", a) + a = re.sub(r"^(--(?:user|password)=).+", r"\1***", a) + out.append(a) + return out + + def main(): sys.stdout.reconfigure(encoding="utf-8") sys.stderr.reconfigure(encoding="utf-8") @@ -172,7 +182,7 @@ def main(): if args.Password: arguments.append(f"--password={args.Password}") arguments.append(f"--data={ib_data}") - print(f"Running: ibcmd {' '.join(arguments)}") + print(f"Running: ibcmd {' '.join(_mask(arguments))}") result = run_ibcmd([v8path] + arguments, warn_no_user=False) exit_code = result.returncode out_missing = exit_code == 0 and not output_nonempty(args.OutputFile) @@ -211,7 +221,7 @@ def main(): arguments.append("/DisableStartupDialogs") # --- Execute --- - print(f"Running: 1cv8.exe {' '.join(arguments)}") + print(f"Running: 1cv8.exe {' '.join(_mask(arguments))}") result = subprocess.run( [v8path] + arguments, capture_output=True,