Added systemd unit
All checks were successful
Build and Publish Deb Package / build-deb (push) Successful in 2m17s
Publish Server Image / build-and-push-image (push) Successful in 4m35s

This commit is contained in:
2026-03-13 16:31:58 +00:00
parent 3ee7235b51
commit bc34b6bc41
3 changed files with 52 additions and 0 deletions

View File

@@ -23,6 +23,8 @@ extended-description = "Furumi-ng: mount remote filesystem via encrypted gRPC +
depends = "fuse3"
section = "utils"
priority = "optional"
maintainer-scripts = "debian/"
assets = [
{ source = "target/release/furumi-mount-linux", dest = "usr/bin/furumi-mount-linux", mode = "755" },
{ source = "debian/furumi-mount.service", dest = "usr/lib/systemd/user/furumi-mount.service", mode = "644" },
]

View File

@@ -0,0 +1,14 @@
[Unit]
Description=Furumi remote filesystem mount
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
EnvironmentFile=%h/.config/furumi/config
ExecStart=/usr/bin/furumi-mount-linux
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target

View File

@@ -0,0 +1,36 @@
#!/bin/bash
set -e
if [ "$1" = "configure" ]; then
if [ -n "$SUDO_USER" ] && [ "$SUDO_USER" != "root" ]; then
REAL_USER="$SUDO_USER"
REAL_HOME=$(getent passwd "$SUDO_USER" | cut -d: -f6)
CONFIG_DIR="$REAL_HOME/.config/furumi"
CONFIG_FILE="$CONFIG_DIR/config"
if [ ! -f "$CONFIG_FILE" ]; then
mkdir -p "$CONFIG_DIR"
cat > "$CONFIG_FILE" << 'EOF'
# Furumi mount configuration
# Edit the values below, then enable and start the service:
#
# systemctl --user enable --now furumi-mount.service
#
# To apply changes after editing this file:
#
# systemctl --user restart furumi-mount.service
FURUMI_SERVER=your-server:50051
FURUMI_TOKEN=your-token-here
FURUMI_MOUNT=/path/to/mountpoint
EOF
chown -R "$REAL_USER:$REAL_USER" "$CONFIG_DIR"
echo ""
echo "furumi-mount: config created at $CONFIG_FILE"
echo "furumi-mount: edit the file, then run:"
echo " systemctl --user enable --now furumi-mount.service"
echo ""
fi
fi
fi