Skip to content

Commit

Permalink
feat: running app as current user, not as meltcd user
Browse files Browse the repository at this point in the history
  • Loading branch information
KunalSin9h committed Dec 14, 2023
1 parent ebda715 commit 73e5cd6
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,20 @@ install_success() {
trap install_success EXIT

configure_systemd() {
if ! id meltcd >/dev/null 2>&1; then
status "Creating meltcd user..."
$SUDO useradd -r -s /bin/false -m -d /usr/share/meltcd meltcd
fi

status "Adding current user to meltcd group..."
$SUDO usermod -a -G meltcd $(whoami)
# Running meltcd application as meltcd user
# if enabled in future then add the bellow 2 linex in the meltcd.service file
# ---
# User=meltcd
# Group=meltcd
# ---
#
# if ! id meltcd >/dev/null 2>&1; then
# status "Creating meltcd user..."
# $SUDO useradd -r -s /bin/false -m -d /usr/share/meltcd meltcd
# fi

# status "Adding current user to meltcd group..."
# $SUDO usermod -a -G meltcd $(whoami)

status "Creating meltcd systemd service..."
cat <<EOF | $SUDO tee /etc/systemd/system/meltcd.service >/dev/null
Expand All @@ -121,8 +128,6 @@ After=network-online.target
[Service]
ExecStart=$BINDIR/meltcd serve
User=meltcd
Group=meltcd
Restart=always
RestartSec=3
Environment="PATH=$PATH"
Expand Down

0 comments on commit 73e5cd6

Please sign in to comment.