From 535589c3dd36f8ae99955d30f6be5d2efd6b870b Mon Sep 17 00:00:00 2001 From: "push-app-to-main[bot]" <203845782+push-app-to-main[bot]@users.noreply.github.com> Date: Wed, 15 Oct 2025 22:12:38 +0200 Subject: [PATCH] LimeSurvey (#8364) * 'Add new script' * replace cat with nano to edit files * revert: use cat instead of nano --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com> --- ct/headers/limesurvey | 6 +++ ct/limesurvey.sh | 42 ++++++++++++++++ frontend/public/json/limesurvey.json | 40 +++++++++++++++ install/limesurvey-install.sh | 74 ++++++++++++++++++++++++++++ 4 files changed, 162 insertions(+) create mode 100644 ct/headers/limesurvey create mode 100644 ct/limesurvey.sh create mode 100644 frontend/public/json/limesurvey.json create mode 100644 install/limesurvey-install.sh diff --git a/ct/headers/limesurvey b/ct/headers/limesurvey new file mode 100644 index 000000000..9d071d0f1 --- /dev/null +++ b/ct/headers/limesurvey @@ -0,0 +1,6 @@ + __ _ _____ + / / (_)___ ___ ___ / ___/__ ________ _____ __ __ + / / / / __ `__ \/ _ \\__ \/ / / / ___/ | / / _ \/ / / / + / /___/ / / / / / / __/__/ / /_/ / / | |/ / __/ /_/ / +/_____/_/_/ /_/ /_/\___/____/\__,_/_/ |___/\___/\__, / + /____/ diff --git a/ct/limesurvey.sh b/ct/limesurvey.sh new file mode 100644 index 000000000..b51580225 --- /dev/null +++ b/ct/limesurvey.sh @@ -0,0 +1,42 @@ +#!/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: Slaviša Arežina (tremor021) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://community.limesurvey.org/ + +APP="LimeSurvey" +var_tags="${var_tags:-os}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-512}" +var_disk="${var_disk:-2}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +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/limesurvey ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + msg_warn "Application is updated via Web Interface" + 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}http://${IP}${CL}" diff --git a/frontend/public/json/limesurvey.json b/frontend/public/json/limesurvey.json new file mode 100644 index 000000000..0d67ef391 --- /dev/null +++ b/frontend/public/json/limesurvey.json @@ -0,0 +1,40 @@ +{ + "name": "LimeSurvey", + "slug": "limesurvey", + "categories": [ + 25 + ], + "date_created": "2025-09-22", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 80, + "documentation": "https://www.limesurvey.org/manual/LimeSurvey_Manual", + "config_path": "", + "website": "https://community.limesurvey.org/", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/limesurvey.webp", + "description": "LimeSurvey is the simple, quick and anonymous online survey tool that's bursting with juicy insights. Calling students, professionals and enterprises: design a survey and get the best insights, it’s free and as easy as squeezing a lime. Make a free online survey now!", + "install_methods": [ + { + "type": "default", + "script": "ct/limesurvey.sh", + "resources": { + "cpu": 1, + "ram": 512, + "hdd": 2, + "os": "Debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "You will need to input database credentials into LimeSurvey installer. Use `cat ~/limesurvey.creds` inside LXC.", + "type": "info" + } + ] +} diff --git a/install/limesurvey-install.sh b/install/limesurvey-install.sh new file mode 100644 index 000000000..2f619776a --- /dev/null +++ b/install/limesurvey-install.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: Slaviša Arežina (tremor021) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://community.limesurvey.org/ + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +PHP_VERSION="8.3" PHP_APACHE="YES" PHP_FPM="YES" PHP_MODULE="imap,ldap,mysql" setup_php +setup_mariadb + +msg_info "Configuring MariaDB Database" +DB_NAME=limesurvey_db +DB_USER=limesurvey +DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) +$STD mariadb -u root -e "CREATE DATABASE $DB_NAME CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" +$STD mariadb -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';" +$STD mariadb -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;" +{ + echo "LimeSurvey-Credentials" + echo "LimeSurvey Database User: $DB_USER" + echo "LimeSurvey Database Password: $DB_PASS" + echo "LimeSurvey Database Name: $DB_NAME" +} >>~/limesurvey.creds +msg_ok "Configured MariaDB Database" + +msg_info "Setting up LimeSurvey" +temp_file=$(mktemp) +RELEASE=$(curl -s https://community.limesurvey.org/downloads/ | grep -oE 'https://download\.limesurvey\.org/latest-master/limesurvey[0-9.+]+\.zip' | head -n1) +curl -fsSL "$RELEASE" -o "$temp_file" +unzip -q "$temp_file" -d /opt + +cat </etc/apache2/sites-enabled/000-default.conf + + ServerAdmin webmaster@localhost + DocumentRoot /opt/limesurvey + DirectoryIndex index.php index.html index.cgi index.pl index.xhtml + Options +ExecCGI + + + Options FollowSymLinks + Require all granted + AllowOverride All + + + + Require all granted + + + ErrorLog /var/log/apache2/error.log + CustomLog /var/log/apache2/access.log combined + +EOF +chown -R www-data:www-data "/opt/limesurvey" +chmod -R 750 "/opt/limesurvey" +systemctl reload apache2 +msg_ok "Set up LimeSurvey" + +motd_ssh +customize + +msg_info "Cleaning up" +rm -rf "$temp_file" +$STD apt -y autoremove +$STD apt -y autoclean +$STD apt -y clean +msg_ok "Cleaned"