about summary refs log blame commit diff
path: root/kittybox-rs/dev.sh
blob: 65d6143b8a26992cf283d20403feb73480caefb0 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
         
                                                                                                                       
                                                                              
                                         
                                         
                                                         
                              



                                                             





                                          
#!/bin/sh
export RUST_LOG="kittybox=debug,retainer::cache=warn,h2=info,rustls=info,tokio=info,tower_http::trace=debug,sqlx=trace"
#export BACKEND_URI=file://./test-dir
export BACKEND_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 \
         --ignore '.direnv' \
         --ignore '*~' \
         -x run \
         "$@"
elif [[ "$1" == "run" ]]; then
	shift 1
	exec cargo run "$@"
else
	echo "Usage: ./dev.sh [watch|run]"
	exit 1
fi