Skip to content

Commit

Permalink
Some config and dep stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
DenuxPlays committed Jan 11, 2025
1 parent 78b96d5 commit 9a83419
Show file tree
Hide file tree
Showing 6 changed files with 190 additions and 40 deletions.
5 changes: 5 additions & 0 deletions backend/.env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ TIMEOUT_REQUEST=5000
# External host
EXTERNAL_HOST=http://localhost:8080

# GoCardless integraion
GO_CARDLESS_ENABLED=false
GO_CARDLESS_SECRET_ID=
GO_CARDLESS_SECRET_KEY=

# Database
POSTGRES_HOST=127.0.0.1
POSTGRES_PORT=5432
Expand Down
202 changes: 168 additions & 34 deletions backend/Cargo.lock

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

3 changes: 1 addition & 2 deletions backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ non_ascii_idents = "forbid"
ignored = ["include_dir"]

[workspace.dependencies]
#loco-rs = { version = "0.14.0", features = ["with-db", "cache_inmem"] }
loco-rs = { git = "https://github.com/loco-rs/loco", branch = "master", features = ["with-db", "cache_inmem"] }
loco-rs = { version = "0.14.0", features = ["with-db", "cache_inmem"] }
financrr_macros = { path = "financrr_macros" }

[dependencies]
Expand Down
8 changes: 8 additions & 0 deletions backend/config/development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,11 @@ database:
dangerously_truncate: false
# Recreating schema when application loaded. This is a dangerous operation, make sure that you're using this flag only on dev environments or test mode
dangerously_recreate: false

bank_account_linking:
enabled: true
implementations:
- !GoCardless
enabled: {{get_env(name="GO_CARDLESS_ENABLED", default=false)}}
secret_id: {{get_env(name="GO_CARDLESS_SECRET_ID", default="")}}
secret_key: {{get_env(name="GO_CARDLESS_SECRET_KEY", default="")}}
8 changes: 7 additions & 1 deletion backend/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ use loco_rs::{
use migration::Migrator;
use mimalloc::MiMalloc;
use std::path::Path;
use tracing::{debug, info};
use crate::services::instance_handler::InstanceHandlerInner;

#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;
Expand Down Expand Up @@ -71,7 +73,11 @@ impl Hooks for App {

async fn before_run(ctx: &AppContext) -> Result<()> {
// Load and parse CustomConfig
let _ = CustomConfigInner::get_arc(ctx).await?;
let conf = CustomConfigInner::get_arc(ctx).await?;
debug!("Bank account linking configured: {}", conf.is_bank_account_linking_configured());

let instance_handler = InstanceHandlerInner::get_arc(ctx).await?;
info!("Instance started with id: {}", instance_handler.get_instance_id());

Ok(())
}
Expand Down
Loading

0 comments on commit 9a83419

Please sign in to comment.