diff --git a/conf/Rocketchat.service b/conf/Rocketchat.service index 81d20d4..9a60036 100644 --- a/conf/Rocketchat.service +++ b/conf/Rocketchat.service @@ -1,19 +1,19 @@ [Unit] -Description=Rocket.Chat +Description=Rocket.Chat After=network.target [Service] -Type=simple -WorkingDirectory=/var/www/rocketchat -User=www-data +Type=simple +WorkingDirectory=/var/www/rocketchat +User=www-data Group=www-data -ExecStart=/usr/local/bin/node main.js -Restart=always -SyslogIdentifier=Rocket.Chat -Environment="BIND_IP=127.0.0.1" -Environment="ROOT_URL=https://CHANGEMETOROOTURL" -Environment="PORT=3000" +ExecStart=/usr/local/bin/node main.js +Restart=always +SyslogIdentifier=Rocket.Chat +Environment="BIND_IP=127.0.0.1" +Environment="ROOT_URL=https://#ROOTURL##LOCATION#" +Environment="PORT=3000" Environment="MONGO_URL=mongodb://localhost:27017/rocketchat" [Install] -WantedBy=multi-user.target +WantedBy=multi-user.target diff --git a/scripts/install b/scripts/install index ff2973c..357a5bc 100644 --- a/scripts/install +++ b/scripts/install @@ -61,7 +61,8 @@ ynh_app_setting_set $app final_path $final_path sudo mkdir -p $final_path # Copy and set systemd configuration -sed -i "s@CHANGEMETOROOTURL@$domain/@g" ../conf/Rocketchat.service +sed -i "s@#ROOTURL#@$domain/@g" ../conf/Rocketchat.service +sed -i "s@#LOCATION#@/${path}@g" ../conf/Rocketchat.service sudo cp ../conf/Rocketchat.service /etc/systemd/system/ sudo systemctl daemon-reload