From 7c8bbed4faf2f09d44a7bb0ed738372d13371cce Mon Sep 17 00:00:00 2001 From: "push-app-to-main[bot]" <203845782+push-app-to-main[bot]@users.noreply.github.com> Date: Tue, 30 Jun 2026 19:44:42 +1000 Subject: [PATCH] FMD Server (#15481) * Add fmd-server (ct) * Update fmd-server.sh --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: CanbiZ (MickLesk) <47820557+MickLesk@users.noreply.github.com> --- ct/fmd-server.sh | 64 +++++++++++++++++++++++++++++++++++ ct/headers/fmd-server | 6 ++++ install/fmd-server-install.sh | 48 ++++++++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 ct/fmd-server.sh create mode 100644 ct/headers/fmd-server create mode 100644 install/fmd-server-install.sh diff --git a/ct/fmd-server.sh b/ct/fmd-server.sh new file mode 100644 index 000000000..76a7bd96d --- /dev/null +++ b/ct/fmd-server.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: Slaviša Arežina (tremor021) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://gitlab.com/fmd-foss/fmd-server + +APP="FMD-Server" +var_tags="${var_tags:-FMD}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-512}" +var_disk="${var_disk:-4}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_arm64="${var_arm64:-yes}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/fmd-server ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gl_release "fmd-server" "fmd-foss/fmd-server"; then + msg_info "Stopping Service" + systemctl stop fmd-server + msg_ok "Stopped Service" + + create_backup /opt/fmd-server/config.yml /opt/fmd-server/db + + CLEAN_INSTALL=1 fetch_and_deploy_gl_release "fmd-server" "fmd-foss/fmd-server" "prebuild" "latest" "/opt/fmd-server" "fmd-server-*.zip" + + msg_info "Configuring FMD-Server" + cd /opt/fmd-server + chmod +x fmd-server-* + msg_ok "Configured FMD-Server" + + restore_backup + + msg_info "Starting Service" + systemctl start fmd-server + msg_ok "Started Service" + msg_ok "Updated successfully!" + fi + exit +} + +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}https://${IP}:8443${CL}" diff --git a/ct/headers/fmd-server b/ct/headers/fmd-server new file mode 100644 index 000000000..8732a2510 --- /dev/null +++ b/ct/headers/fmd-server @@ -0,0 +1,6 @@ + ________ _______ _____ + / ____/ |/ / __ \ / ___/___ ______ _____ _____ + / /_ / /|_/ / / / /_____\__ \/ _ \/ ___/ | / / _ \/ ___/ + / __/ / / / / /_/ /_____/__/ / __/ / | |/ / __/ / +/_/ /_/ /_/_____/ /____/\___/_/ |___/\___/_/ + diff --git a/install/fmd-server-install.sh b/install/fmd-server-install.sh new file mode 100644 index 000000000..53c9b1ec5 --- /dev/null +++ b/install/fmd-server-install.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: Slaviša Arežina (tremor021) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://gitlab.com/fmd-foss/fmd-server + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +fetch_and_deploy_gl_release "fmd-server" "fmd-foss/fmd-server" "prebuild" "latest" "/opt/fmd-server" "fmd-server-*.zip" +create_self_signed_cert + +msg_info "Configuring fmd-server" +cd /opt/fmd-server +chmod +x fmd-server-* +cp config.example.yml config.yml +edit_yaml_config config.yml "WebDir" '"/opt/fmd-server/web/dist/"' +edit_yaml_config config.yml "DatabaseDir" '"/opt/fmd-server/db/"' +edit_yaml_config config.yml "ServerCrt" '"/etc/ssl/fmd-server/fmd-server.crt"' +edit_yaml_config config.yml "ServerKey" '"/etc/ssl/fmd-server/fmd-server.key"' +msg_ok "Configured fmd-server" + +msg_info "Creating services" +cat </etc/systemd/system/fmd-server.service +[Unit] +Description=fmd-server Service +After=network.target + +[Service] +WorkingDirectory=/opt/fmd-server +ExecStart=/opt/fmd-server/fmd-server-$(arch_resolve) serve +Restart=always + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now fmd-server +msg_ok "Created services" + +motd_ssh +customize +cleanup_lxc