diff --git a/ct/alpine-syncthing.sh b/ct/alpine-syncthing.sh new file mode 100644 index 000000000..3d41f5dba --- /dev/null +++ b/ct/alpine-syncthing.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://syncthing.net/ + +APP="Alpine-Syncthing" +var_tags="${var_tags:-alpine;networking}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-256}" +var_disk="${var_disk:-1}" +var_os="${var_os:-alpine}" +var_version="${var_version:-3.22}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + msg_info "Updating Alpine Packages" + $STD apk -U upgrade + msg_ok "Updated Alpine Packages" + + msg_info "Updating Syncthing" + $STD apk upgrade syncthing + msg_ok "Updated Syncthing" + + msg_info "Restarting Syncthing" + $STD rc-service syncthing restart + msg_ok "Restarted Syncthing" + + exit 1 +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8384${CL}" diff --git a/frontend/public/json/syncthing.json b/frontend/public/json/syncthing.json index b6a195b99..4cc6cae25 100644 --- a/frontend/public/json/syncthing.json +++ b/frontend/public/json/syncthing.json @@ -12,7 +12,7 @@ "documentation": null, "website": "https://syncthing.net/", "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/syncthing.webp", - "config_path": "/root/.local/state/syncthing/config.xml", + "config_path": "/root/.local/state/syncthing/config.xml - Alpine: /var/lib/syncthing/.local/state/syncthing/config.xml", "description": "Syncthing is an open-source file syncing tool that allows users to keep their files in sync across multiple devices by using peer-to-peer synchronization. It doesn't rely on any central server, so all data transfers are directly between devices.", "install_methods": [ { @@ -25,8 +25,19 @@ "os": "debian", "version": "12" } - } - ], + }, + { + "type": "alpine", + "script": "ct/alpine-syncthing.sh", + "resources": { + "cpu": 1, + "ram": 256, + "hdd": 1, + "os": "alpine", + "version": "3.22" + } + } + ], "default_credentials": { "username": null, "password": null diff --git a/install/alpine-syncthing-install.sh b/install/alpine-syncthing-install.sh new file mode 100644 index 000000000..0e21a31f1 --- /dev/null +++ b/install/alpine-syncthing-install.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://syncthing.net/ + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Setup Syncthing" +$STD apk add --no-cache syncthing +sed -i "{s/127.0.0.1:8384/0.0.0.0:8384/g}" /var/lib/syncthing/.local/state/syncthing/config.xml +msg_ok "Setup Syncthing" + +msg_info "Enabling Syncthing Service" +$STD rc-update add syncthing default +msg_ok "Enabled Syncthing Service" + +msg_info "Starting Syncthing" +$STD rc-service syncthing start +msg_ok "Started Syncthing" + +motd_ssh +customize