Skip to content

sing-box: Persist user data#7572

Merged
z-Fng merged 4 commits intoScoopInstaller:masterfrom
romeoahmed:feat/sing-box-persis
Mar 5, 2026
Merged

sing-box: Persist user data#7572
z-Fng merged 4 commits intoScoopInstaller:masterfrom
romeoahmed:feat/sing-box-persis

Conversation

@romeoahmed
Copy link
Copy Markdown
Contributor

Improved the sing-box manifest with proper persistence and robust update logic.

  • Persistence: Added config.json, cache.db, and config.d/ config/ folder to the persist field.

  • Initialization: Added a pre_install script to:

    • Ensure $persist_dir exists (fixes directory missing errors in PowerShell).
    • Initialize config.json with UTF-8 (No BOM) and LF to prevent JSON parsing errors on the first run.
    • Touch an empty cache.db file.
  • Update Logic: Optimized the checkver regex with a stable GitHub tag anchor.

  • Notes: Added guidance for TUN mode administrator requirements and multi-config directory usage.

  • Use conventional PR title: <manifest-name[@version]|chore>: <general summary of the pull request>

  • I have read the Contributing Guide

- Support persistence for config.json, cache.db, and config directories.
- Improve checkver regex and autoupdate URL for reliability.
@github-actions
Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

sing-box

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

Check the full log for details.

@z-Fng z-Fng changed the title sing-box: add persistence and pre-install initialization sing-box: Persist user data Feb 4, 2026
@z-Fng
Copy link
Copy Markdown
Member

z-Fng commented Mar 4, 2026

It looks like it doesn't work. (: I'm not a Sing-box user.

"You can run with a directory of configs using: 'sing-box run -C $persist_dir\config.d'"

PS> sing-box check
FATAL[0000] read config at config.json: open config.json: The system cannot find the file specified.

PS> sing-box run
FATAL[0000] read config at config.json: open config.json: The system cannot find the file specified.

PS> sing-box run -C D:\Scoop\persist\sing-box\config.d
FATAL[0000] unmarshal merged config: EOF

What is the reason behind having both a config and a config.d folder, while keeping the config.json file outside of them?Is it sufficient to create only the config.d folder and place the config.json file within it?

@romeoahmed
Copy link
Copy Markdown
Contributor Author

It looks like it doesn't work. (: I'm not a Sing-box user.

"You can run with a directory of configs using: 'sing-box run -C $persist_dir\config.d'"

PS> sing-box check
FATAL[0000] read config at config.json: open config.json: The system cannot find the file specified.

PS> sing-box run
FATAL[0000] read config at config.json: open config.json: The system cannot find the file specified.

PS> sing-box run -C D:\Scoop\persist\sing-box\config.d
FATAL[0000] unmarshal merged config: EOF

What is the reason behind having both a config and a config.d folder, while keeping the config.json file outside of them?Is it sufficient to create only the config.d folder and place the config.json file within it?

These are just three common configuration methods for sing-box, and all three are retained here for compatibility. The error occurs because there are no configuration files in config.d/, while the outer config.json is an empty file to prevent sing-box from running directly without errors.

@z-Fng
Copy link
Copy Markdown
Member

z-Fng commented Mar 5, 2026

/verify

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 5, 2026

All changes look good.

Wait for review from human collaborators.

sing-box

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate

Check the full log for details.

Copy link
Copy Markdown
Member

@z-Fng z-Fng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

@z-Fng z-Fng merged commit 6dd87a7 into ScoopInstaller:master Mar 5, 2026
3 checks passed
@romeoahmed romeoahmed deleted the feat/sing-box-persis branch April 4, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants