Skip to content

fix(iroh-relay): write default config if config path is set but does not exist #3245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Frando
Copy link
Member

@Frando Frando commented Mar 26, 2025

Description

In the iroh-relay binary, the helptext says that the default config will be written if --config is set but the specified file does not exist. However, we didn't actually do this. This PR changes this so that the default config is indeed written, which is useful because then this file can be adjusted as needed without having to grab everything from the config struct definition.

Breaking Changes

Notes & open questions

Change checklist

  • Sef-review.

Copy link

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3245/docs/iroh/

Last updated: 2025-03-26T10:48:10Z

Copy link

Netsim report & logs for this PR have been generated and is available at: LOGS
This report will remain available for 3 days.

Last updated for commit: 91799df

@n0bot n0bot bot added this to iroh Mar 26, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Mar 26, 2025
Copy link
Contributor

@flub flub left a comment

Choose a reason for hiding this comment

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

Please, no. We removed this on purpose.

@flub
Copy link
Contributor

flub commented Mar 26, 2025

Binaries shouldn't write their own config, it is very bad behaviour to write a file in a hidden location somewhere without telling you. This e.g. messes around with containerised deploys and setups that use read-only filesystems. It also makes things much more complicated on upgrades.

Once the relay server removed the need to save its own private key we finally removed this strange behaviour. Instead the docs should be adjusted to not say the default config is written.

The fact you need to read the config structs to to know the file format is indeed a bit unfortunate. But again something we should fix with documentation, we just also need to make sure the documentation remains correct by testing the documented config snippets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

3 participants