From cc5af850cea948e645e5bb700d69170e65ef041e Mon Sep 17 00:00:00 2001 From: august kline Date: Thu, 14 Nov 2024 17:47:45 -0500 Subject: [PATCH] Fix deploy cookie domain --- deploy.sh | 4 +++- src/server/mod.rs | 2 +- stage.sh | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/deploy.sh b/deploy.sh index 7ad6f51..6b2d43e 100755 --- a/deploy.sh +++ b/deploy.sh @@ -2,9 +2,11 @@ # this only works on macos for now, cross compilation toolchain from https://github.com/messense/homebrew-macos-cross-toolchains +set -e; + cargo update; -CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc cargo build --release --target x86_64-unknown-linux-gnu; +DOMAIN=evieippolito.com CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc cargo build --release --target x86_64-unknown-linux-gnu; scp target/x86_64-unknown-linux-gnu/release/evie kline@augustkline.com:/home/kline/; diff --git a/src/server/mod.rs b/src/server/mod.rs index 5d15506..c6565e4 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -114,7 +114,7 @@ impl BlogStateInner { async fn new() -> anyhow::Result { let username = env!("INIT_USER_NAME").to_string(); let password = env!("INIT_USER_PASSWORD").to_string(); - let domain = env!("DOMAIN").to_string(); + let domain = option_env!("DOMAIN").unwrap_or("localhost").to_string(); let db = BlogDb::new(&username, password.clone()).await?; Self::add_initial_assets(&db).await?; Self::add_initial_pages(&db).await?; diff --git a/stage.sh b/stage.sh index c2dbf69..61f52a2 100755 --- a/stage.sh +++ b/stage.sh @@ -2,9 +2,11 @@ # this only works on macos for now, cross compilation toolchain from https://github.com/messense/homebrew-macos-cross-toolchains +set -e + cargo update; -CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc cargo build --release --target x86_64-unknown-linux-gnu; +DOMAIN=evieippolito.com CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc cargo build --release --target x86_64-unknown-linux-gnu; scp target/x86_64-unknown-linux-gnu/release/evie kline@augustkline.com:/home/kline/;