mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4139
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2574
Author: @qiuzan2001
Created: 10/15/2026
Status: ❌ Closed
Base:
main← Head:chief-serve/config-key-0600📝 Commits (1)
48558b2setup, serve: a run config that holds an API key is readable by its owner only (0600) (#1919)📊 Changes
4 files changed (+92 additions, -6 deletions)
View changed files
📝
serve/runconfig.py(+22 -3)📝
serve/test_runconfig.py(+26 -0)📝
setup.py(+20 -3)📝
tools/test_setup_risk.py(+24 -0)📄 Description
One item of #1919: "the run config holds the API key and is written with the default umask ... Expected: mode 0600
on POSIX."
What it changes. On Linux and macOS,
strata-<model>.jsonwas created with the default umask (0644 with theusual 022), so every user of the PC could read
"api_key", the key that guards a server opened with--host 0.0.0.0. Now, when the new or the earlier config has a non-emptyapi_key, these are created 0600 from their firstbyte (through
os.open(..., 0o600)plusfchmod, so a.tmpor.bakleft from an earlier run is tightened too):setup.write_config(every config setup writes, includingrepoint_config's);write_setup_config'sstrata-<model>.json.bakof the earlier config;serve/runconfig.save) and its.bak.What it leaves alone. A config without a key (
"api_key"missing or""): the same bytes and the same modeas before. Windows: untouched. What is in the file.
docker-entrypoint.sh: itscp -fafter a re-setup keeps themode of an existing volume file, so a volume config from a key-less install stays 0644 until setup or the page
writes it again. Two consequences a user may notice: in the container (setup and the server run as root) a host user
needs sudo to read a key-holding config on the volume; and a config shared between accounts, or read by another
service user, is no longer readable by them once it holds a key. Removing the key in a save leaves that save 0600.
How it was checked.
tools/test_setup_risk.pytest_a_config_with_an_api_key_is_the_owner_s_only_1919: with umask 022, a configwith a key is 0600 (also over a 0644
.tmpleft behind), one without is 0644, andwrite_setup_config's.bakof a key-holding config is 0600 with the earlier content.
serve/test_runconfig.py: a save from the page keeps a key-holding config and its.bak0600; a config without akey (the fixture's
"api_key": "") is saved 0644 as before.upstream/mainthe two key tests fail and the no-key test passes.serve.test_runconfig,serve.test_security,tools/test_setup_risk.py,test_setup_choices.py,test_setup_menu.py,test_setup_unsloth.py,test_setup_qwen36.py,test_setup_config.py,test_setup_configs.py: OK. Python 3.14, Ubuntu (Linux 7.0); not run on macOS or Windows.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.