From b745013301369fff3d6f2e10702bba3549509c18 Mon Sep 17 00:00:00 2001 From: Vika Date: Sun, 30 Jul 2023 02:37:23 +0300 Subject: .envrc: add env vars for Kittybox launches directly This avoids the need for the ./dev.sh script, except when `cargo watch` is involved. --- .envrc | 6 ++++++ .vscode/settings.json | 4 ---- dev.sh | 11 +---------- 3 files changed, 7 insertions(+), 14 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.envrc b/.envrc index 9ae9b76..a567465 100644 --- a/.envrc +++ b/.envrc @@ -6,3 +6,9 @@ if has nix; then nix_direnv_watch_file ./shell.nix use flake . fi +export RUST_LOG="kittybox=trace,sqlx=trace,tower_http::trace=debug,info" +export BACKEND_URI="postgres://localhost?dbname=kittybox&host=/run/postgresql" +export JOB_QUEUE_URI="postgres://localhost?dbname=kittybox&host=/run/postgresql" +export BLOBSTORE_URI=file://./media-store +export AUTH_STORE_URI=file://./auth-store +export COOKIE_SECRET=1234567890abcdefghijklmnopqrstuvwxyz \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index c4febcd..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "rust-client.disableRustup": true, - "nixEnvSelector.suggestion": false -} diff --git a/dev.sh b/dev.sh index 979b85a..a2b2c8e 100755 --- a/dev.sh +++ b/dev.sh @@ -1,14 +1,5 @@ #!/bin/sh -if [[ -z $KITTYBOX_LOG ]]; then - export KITTYBOX_LOG="kittybox=debug,retainer::cache=warn,h2=info,rustls=info,tokio=info,tower_http::trace=debug,sqlx=trace" -fi -#export BACKEND_URI=file://./test-dir -export BACKEND_URI="postgres://localhost?dbname=kittybox&host=/run/postgresql" -export JOB_QUEUE_URI="postgres://localhost?dbname=kittybox&host=/run/postgresql" -export BLOBSTORE_URI=file://./media-store -export AUTH_STORE_URI=file://./auth-store -export COOKIE_SECRET=1234567890abcdefghijklmnopqrstuvwxyz -#export COOKIE_SECRET_FILE=/dev/null + if [[ "$1" == "watch" ]]; then shift exec systemfd --no-pid -s http::8080 -- cargo watch \ -- cgit 1.4.1