Commit Graph

8 Commits

Author SHA1 Message Date
Awiteb
4c6578ccb1 feat: Support relays and naddrs sets
This commit introduces support for 'sets', a feature that simplifies
referencing multiple relays or naddrs with a single word.

Sets are stored in the config directory under `n34` as `config.toml` in
`TOML` format. The config path follows the `$XDG_CONFIG_HOME` standard,
defaulting to `$HOME/.config` if unset.

The `n34 sets` command allows managing sets, adding, removing, updating,
or displaying them. When using the main `--relays` flag, a set name can
be provided to automatically expand its relays (an error occurs if the
set contains no relays). Similarly, any command accepting naddrs can
reference a set to extract its naddrs.

Sets can also be merged by updating a set while specifying another
set in `--repo` merges their naddrs, while `--set-relays` merges their
relays. Removal follows the same pattern.

Signed-off-by: Awiteb <a@4rs.nl>
2025-06-01 12:12:09 +00:00
Awiteb
24e8522268 chore: Move the write relays definition to the end of the commands
To make it clear, we can review exactly what was collected instead of
having it spread throughout the body of the command.

Signed-off-by: Awiteb <a@4rs.nl>
2025-05-27 19:20:42 +00:00
Awiteb
f670859b92 chore: Remove the vector parameter from add_{read,write}_relays
Signed-off-by: Awiteb <a@4rs.nl>
2025-05-27 12:35:26 +00:00
Awiteb
15d834dc0f chore: Deduplicate tags
Signed-off-by: Awiteb <a@4rs.nl>
2025-05-27 08:45:20 +00:00
Awiteb
ea862dac5f chore: Add a newline after the naddr
Signed-off-by: Awiteb <a@4rs.nl>
2025-05-27 08:29:36 +00:00
Awiteb
37cf601c01 refactor: Support more than one naddr instead of one
This commit supports multiple naddrs for sending issues to and searching
for repositories by extracting the embedded relays, and appending to the
address file instead of overwriting its previous contents. A header has
also been added to the `nostr-address` file to clarify its purpose.

This enhancement accommodates maintainers who distribute issue tracking
across multiple repositories, preventing confusion if the primary
maintainer steps down. Now, issues and patches will reference all
relevant repositories, not just one.

Note that repositories won't automatically include all maintainers'
addresses unless explicitly specified. Maintainers may manage a
repository under a project-specific public key rather than individual
keys. Addresses are only added to issues and patches when explicitly
provided via the command or written to the address file. This prevents
unintended inclusions and ensures clarity.

Suggested-by: DanConwayDev <DanConwayDev@protonmail.com>
Signed-off-by: Awiteb <a@4rs.nl>
2025-05-27 07:05:13 +00:00
Awiteb
ddea5028ee feat: Make the relays list optional
Signed-off-by: Awiteb <a@4rs.nl>
2025-05-24 12:30:40 +00:00
Awiteb
15c0eaa5dc chore: Make commands module
Signed-off-by: Awiteb <a@4rs.nl>
2025-05-23 13:15:37 +00:00