Skip to content

Develop - #41

Merged
gorecodes merged 11 commits into
mainfrom
develop
May 23, 2026
Merged

Develop#41
gorecodes merged 11 commits into
mainfrom
develop

Conversation

@gorecodes

Copy link
Copy Markdown
Owner

No description provided.

gorecodes and others added 11 commits May 23, 2026 18:19
…xport/import

- Add eclean-dist/pkg pretend+run flow under Maintenance > Clean tab
- Add /api/snapshot/export (StreamingResponse zip) and /api/snapshot/import (UploadFile)
- Snapshot export zips /etc/portage/, world files, and manifest; import backs up before applying
- Wire all new commands through three security whitelists (daemon, authorization, action_security)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tderr to DEVNULL

eclean triggers portage DNS resolution which spams "Unable to configure
loopback interface" to stderr. Since eclean's useful output goes to stdout,
discarding stderr is safe.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eamingResponse

Starlette 1.0.1 StreamingResponse with a sync generator sends headers but
yields no body. Replacing with a plain Response after reading the temp file
into memory fixes the 0-byte corrupt download. /etc/portage snapshots are
small enough that buffering is not a concern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-created file

Daemon runs as root; mkstemp creates files with mode 0600. Server user
cannot read the file. chmod to 0o644 after writing makes it world-readable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
FormData uploads bypass the _post() helper that normally adds the CSRF
header, causing the middleware to reject the request with 403.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nks in backup

- make.profile is a symlink to a directory: os.walk skips it, so it never
  enters the zip. Import now reads manifest.json (which already stores the
  profile path) and recreates the symlink after extractall.
- copytree used symlinks=False (default), which would follow make.profile
  into the portage tree. Pass symlinks=True to preserve it in the backup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Required by the snapshot import endpoint. FastAPI raises RuntimeError at
startup if python-multipart is not installed and any route uses File/Form.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…hot HTML

The CSP migration test bans ?. in index.html. Replace importResult?.backup
with importResult && importResult.backup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…40347, CVE-2026-42561)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gorecodes
gorecodes merged commit 7972a54 into main May 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant