OpenHausIO / backend

HTTP API for the OpenHaus SmartHome/IoT solution
https://docs.open-haus.io
6 stars 2 forks source link

Move dependency "dotenv" from dev dependency to dependency #445

Closed mStirner closed 4 months ago

mStirner commented 5 months ago

Move the dotenv depedency. Use a .env as configuration file in the app directory. For cli start like node index.js & as service with systemd:

[Unit]
Description=OpenHaus SmartHome/IoT backend
Documentation=https://open-haus.io
After=network.target
[Service]
WorkingDirectory=/opt/OpenHaus/backend
EnvironmentFile=/opt/OpenHaus/backend/.env
#Environment=DATABASE_HOST=127.0.0.1
#Environment=DATABASE_PORT=27017
#Environment=NODE_ENV=development
#Environment=LOG_LEVEL=info
#Environment=VAULT_MASTER_PASSWORD=Pa$$w0rd
#Environment=USERS_JWT_SECRET=Pa$$w0rd
#Environment=UUID=c77a762d-c886-4d63-b4c5-e402adcfa7be
#Environment=API_AUTH_ENABLED=false
#Environment=MQTT_BROKER_VERSION=4
#Environment=HTTP_SOCKET=/tmp/open-haus.sock
Type=simple
ExecStart=/usr/bin/node index.js
Restart=on-failure
[Install]
WantedBy=multi-user.target
DATABASE_HOST=127.0.0.1
DATABASE_PORT=27017
NODE_ENV=development
LOG_LEVEL=info
VAULT_MASTER_PASSWORD=Pa$$w0rd
USERS_JWT_SECRET=Pa$$w0rd
UUID=c77a762d-c886-4d63-b4c5-e402adcfa7be
API_AUTH_ENABLED=false
MQTT_BROKER_VERSION=4
HTTP_SOCKET=/tmp/open-haus.sock
mStirner commented 5 months ago

Its already in the "dependency" section in package.json