fix: load Sense package environment file (#46)
This commit is contained in:
@@ -1,45 +1,5 @@
|
||||
@echo off
|
||||
setlocal
|
||||
cd /d "%~dp0"
|
||||
|
||||
set "SENSE_UI_STATIC_DIR=%~dp0ui"
|
||||
|
||||
if /I "%~1"=="demo" goto :demo
|
||||
|
||||
set "SENSE_DATABASE_MODE=postgres"
|
||||
if "%SENSE_DATABASE_URL%"=="" goto :missing_database_url
|
||||
if "%SENSE_IDENTITY_SIGNING_KEY%"=="" goto :missing_identity_key
|
||||
if "%SENSE_BOOTSTRAP_TOKEN%"=="" goto :missing_bootstrap_token
|
||||
if "%SENSE_CREDENTIAL_KEY%"=="" goto :missing_credential_key
|
||||
|
||||
echo Starting Sense in production mode at %SENSE_HTTP_ADDRESS%...
|
||||
"%~dp0sense-server.exe"
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0start-sense.ps1" %*
|
||||
exit /b %ERRORLEVEL%
|
||||
|
||||
:demo
|
||||
set "SENSE_DATABASE_MODE=memory"
|
||||
if "%SENSE_HTTP_ADDRESS%"=="" set "SENSE_HTTP_ADDRESS=127.0.0.1:18080"
|
||||
echo Starting Sense in temporary demo mode at http://%SENSE_HTTP_ADDRESS% ...
|
||||
echo Demo data is discarded when the process stops. Do not use this mode in production.
|
||||
"%~dp0sense-server.exe"
|
||||
exit /b %ERRORLEVEL%
|
||||
|
||||
:missing_database_url
|
||||
echo [ERROR] SENSE_DATABASE_URL is required in production mode.
|
||||
goto :configuration_help
|
||||
|
||||
:missing_identity_key
|
||||
echo [ERROR] SENSE_IDENTITY_SIGNING_KEY is required in production mode.
|
||||
goto :configuration_help
|
||||
|
||||
:missing_bootstrap_token
|
||||
echo [ERROR] SENSE_BOOTSTRAP_TOKEN is required in production mode.
|
||||
goto :configuration_help
|
||||
|
||||
:missing_credential_key
|
||||
echo [ERROR] SENSE_CREDENTIAL_KEY is required in production mode.
|
||||
|
||||
:configuration_help
|
||||
echo Set the required environment variables outside this directory.
|
||||
echo See README-WINDOWS.md and config\sense.env.example.
|
||||
exit /b 1
|
||||
|
||||
Reference in New Issue
Block a user