Skip to content

Commit

Permalink
Improved configuration API with TOML file (#519)
Browse files Browse the repository at this point in the history
* Add announce message type

* Add announcement state to peer table

* Refactor schema provider as the list of schemas is already filtered

* Remove broken test, code will change anyhow soon

* Fix test after changing message types

* Filter schema ids directly in provider

* Make distinction clearer between whitelisting and supporting schema ids

* Make clippy happy

* Generate new announcement state on first run and when provider updates

* Move Announcement struct into separate file

* Our own target set should always be valid

* Introduce a peer message type for messages outside of replication

* Update doc string

* Struct and serde for announce messages

* It's actually okay to send an empty target set

* Check if sync request message has a non empty target set

* Add a test for checking against empty target sets

* Send announcement state to all peers which are not informed yet

* Update peer status on incoming announcement

* Rename variable

* Calculate intersection between target sets of two peers

* Add entry to CHANGELOG.md

* Announcements contain the replication protocol version

* Silently ignore peers with unsupported protocol version

* Test serde for announcement messages

* Update routine which gets executed on every established new connection and scheduler beat

* Update timestamp when sending announcement to peer

* Correctly check if remote target set is valid in sync request

* Temporary fix to account for different message types

* Fix validating target sets

* Update test

* Also test receiving external announcement

* Improve panic message, fix another test

* Better CHANGELOG.md entry

* Give announce messages a type as well so serde can distinct the variants

* Update tests

* Remove data dir, rename fields, introduce schema id enum in config

* Introduce new config.toml file

* Better config field names, rename struct to WildcardOption

* New command line arguments, find config file automatically

* Fix tests

* Pandada

* Fix naming of allow lists and database url

* Rename to im_a_relay

* Make relay singular

* Add some todos

* Rename to direct_node_addresses

* Update config.toml after renaming field

* Allow wildcard strings in config.toml, fix issue with clap overriding values

* Add a doc string

* Remove unnecessary serde code for AllowList

* We already generate a path for keys

* Always show absolute path of config file, whatever comes

* Show basic config and all addresses on startup

* Correct print config when empty array

* Allow --mdns and --relay-flag args to be used without bool value

* Allow use of wildcard strings in --supported-schema-ids argument

* Rename to allow-schema-ids config

* Make sure to not print doc string in about section

* Improve texts

* Empty string should lead to empty array

* Show warnings to user for some configs

* Minor nice change

* Remove usage section for now in README.md

* Add entry to CHANGELOG.md

* Fix merge
  • Loading branch information
adzialocha authored Aug 25, 2023
1 parent 0c208d4 commit 51d37b6
Show file tree
Hide file tree
Showing 26 changed files with 1,066 additions and 472 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
target/
debug/

# Config files
config.toml
!aquadoggo_cli/config.toml

# IDE
.vscode
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Parse supported schema ids from `config.toml` [#473](https://github.com/p2panda/aquadoggo/pull/473)
- Fix relayed connections, add DCUtR Holepunching and reduce CLI args [#502](https://github.com/p2panda/aquadoggo/pull/502)
- Announce supported schema ids in network before replication [#515](https://github.com/p2panda/aquadoggo/pull/515)
- Improved configuration API with "config.toml" file, environment vars and command line arguments [#519](https://github.com/p2panda/aquadoggo/pull/519)

### Changed

Expand Down
Loading

0 comments on commit 51d37b6

Please sign in to comment.