Skip to content

Commit

Permalink
refactor: application configuration (#94)
Browse files Browse the repository at this point in the history
* refactor: undo unnecessary changes

* docs: list all config values

* refactor: rename config file

* refactor: remove example files from docker image

* refactor: merge config files

* refactor: update .dockerignore to include all Dockerfiles and .env files

* WIP: migrate from config macro to config function

* refactor: configs for `log_format` and `event_store`

* refactor: remove unused macros calls

* refactor: migrate `url` config

* refactor: `secret_manager` config

* refactor: `credential_configurations` config

* refactor: rename `DidMethodOptions`, add config for `signing_algorithms_supported`

* refactor: determine default DID method

* refactor: remove comments, load env variables

* WIP: refactor `event_publishers` config

* refactor: remove `metadata`

* refactor: remove `config!` macro

* refactor: rename `config_2` to `config`

* chore: change example logo, disable `event_publisher`, respect `default_did_method`

* chore: resolve clippy issues

* refactor: remove `set_metadata_configuration`

* refactor: remove `TEST_METADATA`

* WIP

* test: fix tests

* ci: update docker-compose

* refactor: example config

* fix: replace `localhost` with container name

* refactor: clean up code

* chore: fix unused import

* chore: remove unused deployment scripts

* refactor: read `connection_string` inside postgres module

* refactor: rename env prefix to `UNICORE`

* refactor: read from `config.yaml`

* docs: update changelog

---------

Co-authored-by: Nander Stabel <[email protected]>
  • Loading branch information
daniel-mader and nanderstabel committed Jul 29, 2024
1 parent c25f9da commit a0e536d
Show file tree
Hide file tree
Showing 52 changed files with 941 additions and 823 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Dockerfile
**/Dockerfile
**/target
**/.git
**/*.env
22 changes: 9 additions & 13 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
AGENT_CONFIG_LOG_FORMAT=json
AGENT_CONFIG_EVENT_STORE=postgres
AGENT_CONFIG_URL=https://my-domain.example.org
AGENT_APPLICATION_ENABLE_CORS=false
AGENT_SECRET_MANAGER_STRONGHOLD_PATH="test.stronghold"
AGENT_SECRET_MANAGER_STRONGHOLD_PASSWORD="secure_password"
AGENT_SECRET_MANAGER_ISSUER_DID="did:key:z6Mkv5KkqNHuR6bPVT8fud3m9JaHBSEjEmiLp7HuGAwtbkk6"
AGENT_SECRET_MANAGER_ISSUER_FRAGMENT="key-0"
AGENT_SECRET_MANAGER_ISSUER_KEY_ID="9O66nzWqYYy1LmmiOudOlh2SMIaUWoTS"
AGENT_CONFIG_DID_METHOD_WEB_ENABLED=false
AGENT_STORE_DB_CONNECTION_STRING=postgresql://demo_user:demo_pass@localhost:5432/demo
AGENT_API_REST_EXTERNAL_SERVER_RESPONSE_TIMEOUT_MS=500
AGENT_CONFIG_DOMAIN_LINKAGE_ENABLED=false
UNICORE__LOG_FORMAT=text
UNICORE__EVENT_STORE__TYPE=postgres
UNICORE__EVENT_STORE__CONNECTION_STRING="postgresql://demo_user:demo_pass@cqrs-postgres-db:5432/demo"

UNICORE__SECRET_MANAGER__STRONGHOLD_PATH="agent_secret_manager/tests/res/test.stronghold"
UNICORE__SECRET_MANAGER__STRONGHOLD_PASSWORD="secure_password"
UNICORE__SECRET_MANAGER__ISSUER_KEY_ID="9O66nzWqYYy1LmmiOudOlh2SMIaUWoTS"
UNICORE__SECRET_MANAGER__ISSUER_DID="did:iota:rms:0x42ad588322e58b3c07aa39e4948d021ee17ecb5747915e9e1f35f028d7ecaf90"
UNICORE__SECRET_MANAGER__ISSUER_FRAGMENT="bQKQRzaop7CgEvqVq8UlgLGsdF-R-hnLFkKFZqW2VN0"
67 changes: 0 additions & 67 deletions .github/workflows/push.yaml

This file was deleted.

1 change: 0 additions & 1 deletion .pipeline/.gitignore

This file was deleted.

14 changes: 0 additions & 14 deletions .pipeline/README.md

This file was deleted.

47 changes: 0 additions & 47 deletions .pipeline/build.sh

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 29-07-2024
- Renamed env variable prefix from `AGENT` to `UNICORE`.
- Refactored the environment variables separators from `_` to `__` to support nested configuration values. As an example, `AGENT_LOG_FORMAT` now becomes `UNICORE__LOG_FORMAT`.
- Merged all per-module configuration files into a single `config.yaml` file.

### 24-06-2024
- Reverted the API version to V0, which means that all endpoints previously prefixed with `/v1` are now prefixed with `/v0`.
- Changed `AGENT_APPLICATION_URL` to `AGENT_CONFIG_URL`.
Expand Down
39 changes: 31 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

Build and run the **SSI Agent** in a local Docker environment following [these steps](./agent_application/docker/README.md).

## Configuration

All configuration options are documented [here](./agent_application/CONFIGURATION.md).

## Breaking changes

From time to time breaking changes can occur. Please make sure you read the [CHANGELOG](./CHANGELOG.md) before updating.
Expand Down
Loading

0 comments on commit a0e536d

Please sign in to comment.