Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: running app as current user, not as meltcd user #38

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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