From ade578edad0b4fef12d1dfaef000f13bce24063a Mon Sep 17 00:00:00 2001 From: "push-app-to-main[bot]" <203845782+push-app-to-main[bot]@users.noreply.github.com> Date: Mon, 18 May 2026 20:04:19 +0200 Subject: [PATCH] ESPconnect (#14444) * Add espconnect (ct) * update source * Update author attribution in espconnect.sh * Modify author info and remove SSL certificate creation Updated author information in the script and removed self-signed certificate generation. --------- 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/espconnect.sh | 54 ++++++++++++++++++++++++++++++++ ct/headers/espconnect | 6 ++++ install/espconnect-install.sh | 58 +++++++++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 ct/espconnect.sh create mode 100644 ct/headers/espconnect create mode 100644 install/espconnect-install.sh diff --git a/ct/espconnect.sh b/ct/espconnect.sh new file mode 100644 index 000000000..68ecda5e3 --- /dev/null +++ b/ct/espconnect.sh @@ -0,0 +1,54 @@ +#!/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: John Lombardo (programbo) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/thelastoutpostworkshop/ESPConnect + +APP="ESPConnect" +var_tags="${var_tags:-iot;esp32;flash}" +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_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/espconnect ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gh_release "espconnect" "thelastoutpostworkshop/ESPConnect"; then + msg_info "Stopping Nginx" + systemctl stop nginx + msg_ok "Stopped Nginx" + + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "espconnect" "thelastoutpostworkshop/ESPConnect" "prebuild" "latest" "/opt/espconnect" "dist.zip" + + msg_info "Starting Nginx" + systemctl start nginx + msg_ok "Started Nginx" + 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}${CL}" diff --git a/ct/headers/espconnect b/ct/headers/espconnect new file mode 100644 index 000000000..d7999dcaf --- /dev/null +++ b/ct/headers/espconnect @@ -0,0 +1,6 @@ + ___________ ____ ______ __ + / ____/ ___// __ \/ ____/___ ____ ____ ___ _____/ /_ + / __/ \__ \/ /_/ / / / __ \/ __ \/ __ \/ _ \/ ___/ __/ + / /___ ___/ / ____/ /___/ /_/ / / / / / / / __/ /__/ /_ +/_____//____/_/ \____/\____/_/ /_/_/ /_/\___/\___/\__/ + diff --git a/install/espconnect-install.sh b/install/espconnect-install.sh new file mode 100644 index 000000000..e57bbe7eb --- /dev/null +++ b/install/espconnect-install.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: John Lombardo (programbo) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/thelastoutpostworkshop/ESPConnect + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt install -y nginx +msg_ok "Installed Dependencies" + +fetch_and_deploy_gh_release "espconnect" "thelastoutpostworkshop/ESPConnect" "prebuild" "latest" "/opt/espconnect" "dist.zip" +create_self_signed_cert + +msg_info "Configuring Nginx" +mkdir -p /etc/ssl/private +cat <<'EOF' >/etc/nginx/sites-available/espconnect +server { + listen 80 default_server; + listen [::]:80 default_server; + + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl default_server; + listen [::]:443 ssl default_server; + + ssl_certificate /etc/ssl/certs/espconnect-selfsigned.crt; + ssl_certificate_key /etc/ssl/private/espconnect-selfsigned.key; + ssl_protocols TLSv1.2 TLSv1.3; + + root /opt/espconnect; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } +} +EOF +ln -sf /etc/nginx/sites-available/espconnect /etc/nginx/sites-enabled/espconnect +rm -f /etc/nginx/sites-enabled/default +$STD nginx -t +systemctl enable -q nginx +systemctl restart nginx +msg_ok "Configured Nginx" + +motd_ssh +customize +cleanup_lxc