Skip to content

feat(deploy): minimal server bootstrap with optional settings overrides - #751

Open
Ferryx349 wants to merge 3 commits into
mainfrom
deploy/minimal-bootstrap
Open

feat(deploy): minimal server bootstrap with optional settings overrides#751
Ferryx349 wants to merge 3 commits into
mainfrom
deploy/minimal-bootstrap

Conversation

@Ferryx349

Copy link
Copy Markdown
Collaborator

Description

On the sandbox server, compose and copied config files don't sync automatically when the repo changes. Operators shouldn't edit files that change every release. Settings especially should not require manual YAML updates when new config keys ship.
This PR makes the bootstrap story minimal and fixes settings merge behavior so new release keys come from the image automatically.

Related Issue

Related: #744, #748, #750

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Non-functional change (docs, style, minor refactor)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.

Add bootstrap.sh, document local vs release-managed files, and merge image
defaults with optional settings.yaml overrides instead of seeding a full copy.
@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 654b197

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nostream Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Ferryx349
Ferryx349 requested a lite review from Copilot August 31, 2026 11:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coveralls

coveralls commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 71.386% (-0.02%) from 71.407% — deploy/minimal-bootstrap into main

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

There are confirmed runtime/backwards-compat and operational issues (watcher crash if config dir is missing, dropped settings.json fallback, and .nostr permissions/ownership for bind mounts) that should be addressed before merging.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

test/unit/utils/settings-paths.spec.ts:39

  • This assertion hardcodes POSIX-style separators; use a joined path to keep the test platform-independent.
    expect(getDefaultSettingsFilePath()).to.equal(`${process.cwd()}/resources/default-settings.yaml`)
  • Files reviewed: 10/10 changed files
  • Comments generated: 5
  • Review effort level: Lite

Comment on lines 301 to +307
export const loadUserSettings = (): Settings => {
ensureSettingsExists()
const raw = fs.readFileSync(getSettingsFilePath(), 'utf-8')
const settingsPath = getSettingsFilePath()

if (!fs.existsSync(settingsPath)) {
return {} as Settings
}
Comment thread src/utils/settings.ts
Comment on lines 103 to 107
public static watchSettings() {
const basePath = SettingsStatic.getSettingsFileBasePath()
const defaultsFilePath = SettingsStatic.getDefaultSettingsFilePath()
const basePath = getConfigBaseDir()
const defaultsFilePath = getDefaultSettingsFilePath()
const fileType = SettingsStatic.settingsFileType(basePath)

Comment thread test/unit/utils/settings-paths.spec.ts Outdated
Comment on lines +25 to +28
expect(getConfigBaseDir()).to.equal(`${process.cwd()}/.nostr`)
expect(getSettingsFilePath()).to.equal(`${process.cwd()}/.nostr/settings.yaml`)
expect(getSettingsBackupDir()).to.equal(`${process.cwd()}/.nostr/backups`)
expect(getSettingsAuditLogPath()).to.equal(`${process.cwd()}/.nostr/settings-audit.jsonl`)
Comment thread deploy/bootstrap.sh
Comment on lines +28 to +29
mkdir -p "$TARGET/.nostr/data" "$TARGET/.nostr/db-logs"

Comment thread deploy/README.md
Comment on lines +84 to 89
```bash
cp deploy/settings.yaml.example /opt/nostream/.nostr/settings.yaml
# edit overrides only — not a full copy of default-settings.yaml
chown 1000:1000 /opt/nostream/.nostr/settings.yaml
chmod 600 /opt/nostream/.nostr/settings.yaml
docker compose up -d
Restore settings.json fallback for backwards compatibility, ensure the
config directory exists before watchSettings() runs, fix cross-platform
path assertions, and chown .nostr for the node user in bootstrap/docs.
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.

4 participants