copyparty
This commit is contained in:
parent
6b5f70b6e2
commit
120e5ac524
@ -13,7 +13,7 @@
|
|||||||
"website": "https://github.com/9001/copyparty",
|
"website": "https://github.com/9001/copyparty",
|
||||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/copyparty.webp",
|
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/copyparty.webp",
|
||||||
"config_path": "",
|
"config_path": "",
|
||||||
"description": "This script automatically adds IP address as tags to LXC containers using a Systemd service. The service also updates the tags if a LXC IP address is changed.",
|
"description": "Copyparty is a lightweight, portable HTTP file server with a browser-based interface. It supports drag-and-drop uploads, downloads, deduplication, media playback, and advanced search, making it ideal for quickly sharing and managing files.",
|
||||||
"install_methods": [
|
"install_methods": [
|
||||||
{
|
{
|
||||||
"type": "default",
|
"type": "default",
|
||||||
|
@ -64,7 +64,8 @@ function setup_user_and_dirs() {
|
|||||||
if [[ "$OS" == "Debian" ]]; then
|
if [[ "$OS" == "Debian" ]]; then
|
||||||
useradd -r -s /sbin/nologin -d "$DATA_PATH" "$SVC_USER"
|
useradd -r -s /sbin/nologin -d "$DATA_PATH" "$SVC_USER"
|
||||||
else
|
else
|
||||||
adduser -D -H -h "$DATA_PATH" -s /sbin/nologin "$SVC_USER"
|
addgroup -S "$SVC_GROUP" 2>/dev/null || true
|
||||||
|
adduser -S -D -H -G "$SVC_GROUP" -h "$DATA_PATH" -s /sbin/nologin "$SVC_USER" 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
mkdir -p "$DATA_PATH" "$LOG_PATH"
|
mkdir -p "$DATA_PATH" "$LOG_PATH"
|
||||||
@ -190,42 +191,28 @@ msg_ok "Config written"
|
|||||||
# --- Systemd/OpenRC Service ---
|
# --- Systemd/OpenRC Service ---
|
||||||
msg_info "Creating service"
|
msg_info "Creating service"
|
||||||
if [[ "$OS" == "Debian" ]]; then
|
if [[ "$OS" == "Debian" ]]; then
|
||||||
cat <<EOF >"$SERVICE_PATH_DEB"
|
cat <<'EOF' >"$SERVICE_PATH_ALP"
|
||||||
[Unit]
|
|
||||||
Description=CopyParty file server
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
User=$SVC_USER
|
|
||||||
Group=$SVC_GROUP
|
|
||||||
WorkingDirectory=$USER_DATA_PATH
|
|
||||||
Environment=PYTHONUNBUFFERED=x
|
|
||||||
LogsDirectory=copyparty
|
|
||||||
ExecStart=/usr/bin/python3 $BIN_PATH -c $CONF_PATH
|
|
||||||
Restart=always
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
EOF
|
|
||||||
systemctl daemon-reload
|
|
||||||
systemctl enable --now copyparty &>/dev/null
|
|
||||||
else
|
|
||||||
cat <<EOF >"$SERVICE_PATH_ALP"
|
|
||||||
#!/sbin/openrc-run
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
command="/usr/bin/python3"
|
name="copyparty"
|
||||||
command_args="$BIN_PATH -c $CONF_PATH"
|
description="Copyparty file server"
|
||||||
|
|
||||||
|
command="$(command -v python3)"
|
||||||
|
command_args="/usr/local/bin/copyparty-sfx.py -c /etc/copyparty.conf"
|
||||||
command_background=true
|
command_background=true
|
||||||
directory="$USER_DATA_PATH"
|
directory="/var/lib/copyparty"
|
||||||
pidfile="$USER_DATA_PATH/copyparty.pid"
|
pidfile="/run/copyparty.pid"
|
||||||
|
output_log="/var/log/copyparty/copyparty.log"
|
||||||
|
error_log="/var/log/copyparty/copyparty.err"
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
need net
|
need net
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
chmod +x "$SERVICE_PATH_ALP"
|
chmod +x "$SERVICE_PATH_ALP"
|
||||||
rc-update add copyparty default &>/dev/null
|
rc-update add copyparty default &>/dev/null
|
||||||
rc-service copyparty start &>/dev/null
|
rc-service copyparty restart &>/dev/null
|
||||||
fi
|
fi
|
||||||
msg_ok "Service created and started"
|
msg_ok "Service created and started"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user