From 79327d2efa272f0dcb73a481ad27a031d5672f1e Mon Sep 17 00:00:00 2001 From: Tobias Reisinger Date: Mon, 4 Mar 2024 16:09:03 +0100 Subject: [PATCH] Remove the _local directory again --- .env | 2 +- .gitignore | 1 - Makefile | 6 +++--- config/emgauwa-controller.pkl | 2 +- config/emgauwa-core.pkl | 2 +- emgauwa-controller/src/settings.rs | 2 +- emgauwa-core/build.rs | 2 +- emgauwa-core/src/settings.rs | 2 +- emgauwa-lib/build.rs | 2 +- emgauwa-lib/src/settings.rs | 4 ---- 10 files changed, 10 insertions(+), 15 deletions(-) diff --git a/.env b/.env index 78b6033..2f5ee4c 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -DATABASE_URL="sqlite://_local/emgauwa-dev.sqlite" +DATABASE_URL="sqlite://emgauwa-dev.sqlite" diff --git a/.gitignore b/.gitignore index be8fe54..dd13990 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ /tests/testing_bak/ /tests/testing_latest/ -/_local/ emgauwa-*.sqlite emgauwa-*.sqlite-* emgauwa-*.json diff --git a/Makefile b/Makefile index 09287c7..5284844 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,9 @@ sqlx: build-rpi: cross build --target arm-unknown-linux-gnueabihf -_local/emgauwa-%.json: config/emgauwa-%.pkl config/lib/%.pkl config/lib/common.pkl +emgauwa-%.json: config/emgauwa-%.pkl config/lib/%.pkl config/lib/common.pkl pkl eval -f json -o $@ $< configs: - $(MAKE) _local/emgauwa-core.json - $(MAKE) _local/emgauwa-controller.json + $(MAKE) emgauwa-core.json + $(MAKE) emgauwa-controller.json diff --git a/config/emgauwa-controller.pkl b/config/emgauwa-controller.pkl index e38f6d4..ff265a5 100644 --- a/config/emgauwa-controller.pkl +++ b/config/emgauwa-controller.pkl @@ -5,7 +5,7 @@ server { port = 4419 } -database = "sqlite://_local/emgauwa-controller.sqlite" +database = "sqlite://emgauwa-controller.sqlite" permissions { user = "emgauwa" diff --git a/config/emgauwa-core.pkl b/config/emgauwa-core.pkl index e9f467d..aed5358 100644 --- a/config/emgauwa-core.pkl +++ b/config/emgauwa-core.pkl @@ -5,7 +5,7 @@ server { port = 4419 } -database = "sqlite://_local/emgauwa-core.sqlite" +database = "sqlite://emgauwa-core.sqlite" permissions { user = "emgauwa" diff --git a/emgauwa-controller/src/settings.rs b/emgauwa-controller/src/settings.rs index 8e0da84..7330c38 100644 --- a/emgauwa-controller/src/settings.rs +++ b/emgauwa-controller/src/settings.rs @@ -32,7 +32,7 @@ impl Default for Settings { fn default() -> Self { Settings { server: settings::Server::default(), - database: String::from("sqlite://_local/emgauwa-controller.sqlite"), + database: String::from("sqlite://emgauwa-controller.sqlite"), permissions: settings::Permissions::default(), logging: settings::Logging::default(), diff --git a/emgauwa-core/build.rs b/emgauwa-core/build.rs index 9611aff..41015be 100644 --- a/emgauwa-core/build.rs +++ b/emgauwa-core/build.rs @@ -1,3 +1,3 @@ fn main() { - println!("cargo:rustc-env=DATABASE_URL=sqlite://_local/emgauwa-core.sqlite") + println!("cargo:rustc-env=DATABASE_URL=sqlite://emgauwa-core.sqlite") } diff --git a/emgauwa-core/src/settings.rs b/emgauwa-core/src/settings.rs index 5277efa..c2e7bc4 100644 --- a/emgauwa-core/src/settings.rs +++ b/emgauwa-core/src/settings.rs @@ -18,7 +18,7 @@ impl Default for Settings { fn default() -> Self { Settings { server: settings::Server::default(), - database: String::from("sqlite://_local/emgauwa-core.sqlite"), + database: String::from("sqlite://emgauwa-core.sqlite"), permissions: settings::Permissions::default(), logging: settings::Logging::default(), diff --git a/emgauwa-lib/build.rs b/emgauwa-lib/build.rs index 493491e..65d8d11 100644 --- a/emgauwa-lib/build.rs +++ b/emgauwa-lib/build.rs @@ -1,4 +1,4 @@ fn main() { println!("cargo:rerun-if-changed=migrations"); - println!("cargo:rustc-env=DATABASE_URL=sqlite://_local/emgauwa-dev.sqlite"); + println!("cargo:rustc-env=DATABASE_URL=sqlite://emgauwa-dev.sqlite"); } diff --git a/emgauwa-lib/src/settings.rs b/emgauwa-lib/src/settings.rs index 1e83244..4d56f6f 100644 --- a/emgauwa-lib/src/settings.rs +++ b/emgauwa-lib/src/settings.rs @@ -58,13 +58,9 @@ pub fn load(config_name: &str, env_prefix: &str) -> Result where for<'de> T: serde::Deserialize<'de>, { - // TODO: Add switch to only include local config if in development mode - let dev_file = - config::File::with_name(&format!("./_local/emgauwa-{}", config_name)).required(false); let local_file = config::File::with_name(&format!("./emgauwa-{}", config_name)).required(false); config::Config::builder() - .add_source(dev_file) .add_source(local_file) .add_source( config::Environment::with_prefix(&format!("EMGAUWA_{}", env_prefix))