Update Environment Variables
After all domains have been configured, update each service’s .env file to reflect the new hostnames and any other required settings.
-
Connect to the DigitalOcean Droplet (if you are not already connected).
-
Run the environment setup script:
cd /home
./env_setup.sh
- Choose the service to edit when prompted:
Which service .env do you want to update?
1) Backend
2) Auth
3) App
4) Exit
-
Select your preferred editor (nano or vi), make the necessary changes
(e.g., update DOMAIN, API_URL, or any secrets)
, then save and exit. -
The script automatically:
-
Detects whether the file was modified.
-
Restarts the corresponding service (sparrow-api, sparrow-auth, or sparrow-app) only if a change was detected, and displays a confirmation like:
Restarting sparrow-api service...
[INFO] sparrow-api service restarted.
Tip:
• If you open the file but make no changes, the script will skip the restart.
• You can rerun
env_setup.sh
at any time to modify additional services or update existing values.