mirror of
https://github.com/gomods/athens
synced 2026-02-03 11:00:32 +00:00
Remove hard coded values from SystemD Unit and installation (#1874)
Removes hardcoded values form our supplied SystemD Unit file and the installation script. Users, prior to installation, will need to ensure that their user, group, and permissions settings of where Athens stores data are correct. Co-authored-by: Manu Gupta <manugupt1@gmail.com> Co-authored-by: Matt <matt.ouille@protonmail.com>
This commit is contained in:
@@ -14,8 +14,6 @@ Nice=5
|
||||
User=www-data
|
||||
Group=www-data
|
||||
|
||||
Environment=ATHENS_DISK_STORAGE_ROOT=/var/run/athens
|
||||
|
||||
; The full path and the arguments of the command to be executed to start the process.
|
||||
ExecStart=/usr/local/bin/athens -config_file=/etc/athens/config.toml
|
||||
|
||||
|
||||
+3
-6
@@ -41,12 +41,6 @@ function doInstallConfig
|
||||
fi
|
||||
sudo mkdir -p /etc/athens
|
||||
sudo install -v -o root -g root -m 644 config.toml /etc/athens
|
||||
|
||||
# if storage is on disk, this is where the database goes (see scripts/service/athens.service)
|
||||
ATHENS_DISK_STORAGE_ROOT=/var/run/athens
|
||||
sudo mkdir -p $ATHENS_DISK_STORAGE_ROOT
|
||||
sudo chown www-data $ATHENS_DISK_STORAGE_ROOT
|
||||
sudo chgrp www-data $ATHENS_DISK_STORAGE_ROOT
|
||||
}
|
||||
|
||||
# doInstallBinary copies the Athens binary to /usr/local/bin with the necessary settings.
|
||||
@@ -69,6 +63,9 @@ function doInstallBinary
|
||||
# doInstallSystemd sets up the SystemD service unit.
|
||||
function doInstallSystemd
|
||||
{
|
||||
local rootPath=$(sed -nr 's/(RootPath) = (".*")/\2/p' /etc/athens/config.toml | xargs)
|
||||
sed -i "/ReadWritePaths/ s|=.*|=$rootPath|" scripts/service/athens.service
|
||||
|
||||
sudo install -v -o root -g root -m 644 scripts/service/athens.service /etc/systemd/system
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable athens
|
||||
|
||||
Reference in New Issue
Block a user