chore: improve setup script environment initialization

This commit is contained in:
ramvignesh-b
2026-05-04 22:06:29 +05:30
parent bea9b13249
commit c6dc82591d
2 changed files with 25 additions and 14 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ DB_NAME=piku_test_db
DB_USER=test
DB_PASSWORD=password123
DB_HOST=127.0.0.1
DB_PORT=5433
DB_PORT=5443
# SSL
SSL_ENABLED=true
@@ -12,7 +12,7 @@ SSL_ENABLED=true
DEBUG=True
SECRET_KEY=django-insecure-initial-key
BACKEND_DOMAIN=127.0.0.1
BACKEND_PORT=8001
BACKEND_PORT=8101
# EMAIL
EMAIL_HOST=127.0.0.1
@@ -25,4 +25,4 @@ EMAIL_API_PORT=8026
# FRONTEND
FRONTEND_PORT=5199
FRONTEND_DOMAIN=127.0.0.1
VITE_API_URL=https://127.0.0.1:8001
VITE_API_URL=https://127.0.0.1:8101
+18 -7
View File
@@ -1,6 +1,14 @@
#!/bin/bash
set -e
# Setup Env from examples
if [ ! -f ".env" ]; then
cp .env.example .env
fi
if [ ! -f ".env.e2e" ]; then
cp .env.e2e.example .env.e2e
fi
NODE_BIN=$(command -v bun || command -v npm || true)
PY_BIN=$(command -v uv || command -v pip || true)
DISTRO_BIN=$(command -v apt || command -v yum || command -v pacman || command -v zypper || true)
@@ -35,17 +43,20 @@ else
fi
# Simplify ssl generation for local - source & credits:- https://github.com/FiloSottile/mkcert
echo "[Cert] Setting up SSL..."
# pre-requisites (might be available already, just in case)
if [ $(basename "$DISTRO_BIN") = "apt" ]; then
# Note, still try to perform the setup if pkg setups fail
{
echo "[Cert] Setting up SSL..."
# pre-requisites (might be available already, just in case)
if [ $(basename "$DISTRO_BIN") = "apt" ]; then
sudo apt install -y libnss3-tools
elif [ $(basename "$DISTRO_BIN") = "yum" ]; then
elif [ $(basename "$DISTRO_BIN") = "yum" ]; then
sudo yum install -y nss-tools
elif [ $(basename "$DISTRO_BIN") = "pacman" ]; then
elif [ $(basename "$DISTRO_BIN") = "pacman" ]; then
sudo pacman -S --noconfirm nss
elif [ $(basename "$DISTRO_BIN") = "zypper" ]; then
elif [ $(basename "$DISTRO_BIN") = "zypper" ]; then
sudo zypper install -y mozilla-nss-tools
fi
fi
} || true
# Detect os and arch to get the appropriate bin. Windows: ...NO SOUP FOR YOU!
OS=$(uname -s)