From 298f91b3929a6ddd83787a189b6560adfe4ec58c Mon Sep 17 00:00:00 2001 From: Tobias Salzmann <796084+Eun@users.noreply.github.com> Date: Thu, 23 Apr 2026 15:45:17 +0200 Subject: [PATCH] cinny --- ct/alpine-cinny.sh | 57 +++++++++++++++++++++++++++++++ install/alpine-cinny-install.sh | 59 +++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 ct/alpine-cinny.sh create mode 100644 install/alpine-cinny-install.sh diff --git a/ct/alpine-cinny.sh b/ct/alpine-cinny.sh new file mode 100644 index 00000000..f69fa26f --- /dev/null +++ b/ct/alpine-cinny.sh @@ -0,0 +1,57 @@ +#!/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: Tobias Salzmann (Eun) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/cinnyapp/cinny + +APP="Alpine-Cinny" +var_tags="${var_tags:-alpine;matrix}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-256}" +var_disk="${var_disk:-2}" +var_os="${var_os:-alpine}" +var_version="${var_version:-3.21}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + + if [ ! -d /usr/share/nginx/html ]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + RELEASE=$(curl -fsSL https://api.github.com/repos/cinnyapp/cinny/releases/latest | grep '"tag_name":' | cut -d '"' -f4) + if [ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ] || [ ! -f /opt/${APP}_version.txt ]; then + msg_info "Updating ${APP} LXC" + $STD apk -U upgrade + temp_file=$(mktemp) + curl -fsSL "https://github.com/cinnyapp/cinny/releases/download/${RELEASE}/cinny-${RELEASE}.tar.gz" -o "$temp_file" + cp /usr/share/nginx/html/config.json /tmp/cinny_config.json + rm -rf /usr/share/nginx/html/* + tar -xzf "$temp_file" --strip-components=1 -C /usr/share/nginx/html + cp /tmp/cinny_config.json /usr/share/nginx/html/config.json + rm -f /tmp/cinny_config.json "$temp_file" + echo "${RELEASE}" >/opt/${APP}_version.txt + $STD rc-service nginx restart + msg_ok "Updated successfully!" + else + msg_ok "No update required. ${APP} is already at ${RELEASE}" + fi + exit 0 +} + +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 IP:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8080${CL}" diff --git a/install/alpine-cinny-install.sh b/install/alpine-cinny-install.sh new file mode 100644 index 00000000..9dd388cb --- /dev/null +++ b/install/alpine-cinny-install.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: Tobias Salzmann (Eun) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/cinnyapp/cinny + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apk add --no-cache \ + nginx +msg_ok "Installed Dependencies" + +msg_info "Installing Cinny" +RELEASE=$(curl -fsSL https://api.github.com/repos/cinnyapp/cinny/releases/latest | grep '"tag_name":' | cut -d '"' -f4) +temp_file=$(mktemp) +curl -fsSL "https://github.com/cinnyapp/cinny/releases/download/${RELEASE}/cinny-${RELEASE}.tar.gz" -o "$temp_file" +mkdir -p /usr/share/nginx/html +tar -xzf "$temp_file" --strip-components=1 -C /usr/share/nginx/html +rm -f "$temp_file" +cat <<'EOF' >/etc/nginx/http.d/default.conf +server { + listen 8080; + server_name localhost; + + location / { + root /usr/share/nginx/html/; + + rewrite ^/config.json$ /config.json break; + rewrite ^/manifest.json$ /manifest.json break; + + rewrite ^/sw.js$ /sw.js break; + rewrite ^/pdf.worker.min.js$ /pdf.worker.min.js break; + + rewrite ^/public/(.*)$ /public/$1 break; + rewrite ^/assets/(.*)$ /assets/$1 break; + + rewrite ^(.+)$ /index.html break; + } +} +EOF +$STD rc-update add nginx default +$STD rc-service nginx start +echo "${RELEASE}" >/opt/"${APPLICATION}"_version.txt +msg_ok "Installed Cinny" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apk cache clean +msg_ok "Cleaned"