From 64902a3fff67ec9686c70d09ed42b0a1a3f211a8 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, 2 Dec 2025 10:15:30 +0000 Subject: [PATCH 1/5] 'Add new script' --- ct/headers/snowshare | 6 ++ ct/snowshare.sh | 60 ++++++++++++++++++++ frontend/public/json/snowshare.json | 35 ++++++++++++ install/snowshare-install.sh | 85 +++++++++++++++++++++++++++++ 4 files changed, 186 insertions(+) create mode 100644 ct/headers/snowshare create mode 100644 ct/snowshare.sh create mode 100644 frontend/public/json/snowshare.json create mode 100644 install/snowshare-install.sh diff --git a/ct/headers/snowshare b/ct/headers/snowshare new file mode 100644 index 00000000000..160614e0cd8 --- /dev/null +++ b/ct/headers/snowshare @@ -0,0 +1,6 @@ + _____ _____ __ + / ___/____ ____ _ __/ ___// /_ ____ _________ + \__ \/ __ \/ __ \ | /| / /\__ \/ __ \/ __ `/ ___/ _ \ + ___/ / / / / /_/ / |/ |/ /___/ / / / / /_/ / / / __/ +/____/_/ /_/\____/|__/|__//____/_/ /_/\__,_/_/ \___/ + diff --git a/ct/snowshare.sh b/ct/snowshare.sh new file mode 100644 index 00000000000..80b8b4a8aa8 --- /dev/null +++ b/ct/snowshare.sh @@ -0,0 +1,60 @@ +#!/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: TuroYT +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/TuroYT/snowshare + +APP="SnowShare" +var_tags="${var_tags:-file-sharing}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-1024}" +var_disk="${var_disk:-5}" +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/snowshare ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + if check_for_gh_release "snowshare" "TuroYT/snowshare"; then + msg_info "Stopping Service" + systemctl stop snowshare + msg_ok "Stopped Service" + + fetch_and_deploy_gh_release "snowshare" "TuroYT/snowshare" + + msg_info "Updating Snowshare" + cd /opt/snowshare + $STD npm ci + $STD npx prisma generate + $STD npm run build + msg_ok "Updated Snowshare" + + msg_info "Starting Service" + systemctl start snowshare + 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}http://${IP}:3000${CL}" diff --git a/frontend/public/json/snowshare.json b/frontend/public/json/snowshare.json new file mode 100644 index 00000000000..40433298cc9 --- /dev/null +++ b/frontend/public/json/snowshare.json @@ -0,0 +1,35 @@ +{ + "name": "SnowShare", + "slug": "snowshare", + "categories": [ + 11 + ], + "date_created": "2025-09-24", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 3000, + "documentation": "https://github.com/TuroYT/snowshare", + "config_path": "/opt/snowshare/.env", + "website": "https://github.com/TuroYT/snowshare", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/png/snowshare.png", + "description": "A modern, secure file and link sharing platform built with Next.js, Prisma, and NextAuth. Share URLs, code snippets, and files with customizable expiration, privacy, and QR codes.", + "install_methods": [ + { + "type": "default", + "script": "ct/snowshare.sh", + "resources": { + "cpu": 1, + "ram": 1024, + "hdd": 5, + "os": "Debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] +} diff --git a/install/snowshare-install.sh b/install/snowshare-install.sh new file mode 100644 index 00000000000..b953d1ad3b8 --- /dev/null +++ b/install/snowshare-install.sh @@ -0,0 +1,85 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: TuroYT +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +setup_nodejs +setup_postgresql +fetch_and_deploy_gh_release "snowshare" "TuroYT/snowshare" + +msg_info "Setting up PostgreSQL Database" +DB_NAME=snowshare +DB_USER=snowshare +DB_PASS="$(openssl rand -base64 18 | cut -c1-13)" +$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';" +$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;" +$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';" +$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';" +$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';" +{ + echo "SnowShare-Database-Credentials" + echo "Database Username: $DB_USER" + echo "Database Password: $DB_PASS" + echo "Database Name: $DB_NAME" +} >>~/snowshare.creds +msg_ok "Set up PostgreSQL Database" + +msg_info "Installing SnowShare" +cd /opt/snowshare +$STD npm ci +cat </opt/snowshare.env +DATABASE_URL="postgresql://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME" +NEXTAUTH_URL="http://localhost:3000" +NEXTAUTH_SECRET="$(openssl rand -base64 32)" +ALLOW_SIGNUP=true +NODE_ENV=production +EOF +set -a +source /opt/snowshare.env +set +a +$STD npx prisma generate +$STD npx prisma migrate deploy +$STD npm run build +cat </etc/systemd/system/snowshare.service +[Unit] +Description=SnowShare - Modern File Sharing Platform +After=network.target postgresql.service +Requires=postgresql.service + +[Service] +Type=simple +WorkingDirectory=/opt/snowshare +EnvironmentFile=/opt/snowshare.env +ExecStart=/usr/bin/npm start +Restart=on-failure +RestartSec=10 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now snowshare +msg_ok "Installed SnowShare" + +msg_info "Setting up Cleanup Cron Job" +cat </etc/cron.d/snowshare-cleanup +0 2 * * * root cd /opt/snowshare && /usr/bin/npm run cleanup:expired >> /var/log/snowshare-cleanup.log 2>&1 +EOF +msg_ok "Set up Cleanup Cron Job" + +motd_ssh +customize + +msg_info "Cleaning up" +$STD apt -y autoremove +$STD apt -y autoclean +$STD apt -y clean +msg_ok "Cleaned" From 376ea09d1a8e6bfae29f4e08e8b15cbc9e03f8e1 Mon Sep 17 00:00:00 2001 From: Tobias <96661824+CrazyWolf13@users.noreply.github.com> Date: Tue, 2 Dec 2025 11:40:06 +0100 Subject: [PATCH 2/5] Update logo URL in snowshare.json --- frontend/public/json/snowshare.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/public/json/snowshare.json b/frontend/public/json/snowshare.json index 40433298cc9..63585b9634e 100644 --- a/frontend/public/json/snowshare.json +++ b/frontend/public/json/snowshare.json @@ -12,7 +12,7 @@ "documentation": "https://github.com/TuroYT/snowshare", "config_path": "/opt/snowshare/.env", "website": "https://github.com/TuroYT/snowshare", - "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/png/snowshare.png", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@master/png/snowshare.png", "description": "A modern, secure file and link sharing platform built with Next.js, Prisma, and NextAuth. Share URLs, code snippets, and files with customizable expiration, privacy, and QR codes.", "install_methods": [ { From e5f034243a0c3a997f6d37f67273f6e8674a635a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Tue, 2 Dec 2025 12:12:02 +0100 Subject: [PATCH 3/5] Update snowshare-install.sh --- install/snowshare-install.sh | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/install/snowshare-install.sh b/install/snowshare-install.sh index b953d1ad3b8..b61e1ef9bc4 100644 --- a/install/snowshare-install.sh +++ b/install/snowshare-install.sh @@ -12,32 +12,16 @@ setting_up_container network_check update_os -setup_nodejs -setup_postgresql +NODE_VERSION="22" setup_nodejs +PG_VERSION="17" setup_postgresql fetch_and_deploy_gh_release "snowshare" "TuroYT/snowshare" - -msg_info "Setting up PostgreSQL Database" -DB_NAME=snowshare -DB_USER=snowshare -DB_PASS="$(openssl rand -base64 18 | cut -c1-13)" -$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN PASSWORD '$DB_PASS';" -$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;" -$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';" -$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';" -$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC';" -{ - echo "SnowShare-Database-Credentials" - echo "Database Username: $DB_USER" - echo "Database Password: $DB_PASS" - echo "Database Name: $DB_NAME" -} >>~/snowshare.creds -msg_ok "Set up PostgreSQL Database" +PG_DB_USER="snowshare" PG_DB_NAME="snowshare" setup_postgresql_db msg_info "Installing SnowShare" cd /opt/snowshare $STD npm ci cat </opt/snowshare.env -DATABASE_URL="postgresql://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME" +DATABASE_URL="postgresql://$PG_DB_USER:$PG_DB_PASS@localhost:5432/$PG_DB_NAME" NEXTAUTH_URL="http://localhost:3000" NEXTAUTH_SECRET="$(openssl rand -base64 32)" ALLOW_SIGNUP=true @@ -77,9 +61,4 @@ msg_ok "Set up Cleanup Cron Job" motd_ssh customize - -msg_info "Cleaning up" -$STD apt -y autoremove -$STD apt -y autoclean -$STD apt -y clean -msg_ok "Cleaned" +cleanup_lxc From 8f598f817044df516cd3f41a77b67e9d5ffd3111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Tue, 2 Dec 2025 12:12:35 +0100 Subject: [PATCH 4/5] Update snowshare-install.sh --- install/snowshare-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/snowshare-install.sh b/install/snowshare-install.sh index b61e1ef9bc4..e4b7fa3d712 100644 --- a/install/snowshare-install.sh +++ b/install/snowshare-install.sh @@ -14,8 +14,8 @@ update_os NODE_VERSION="22" setup_nodejs PG_VERSION="17" setup_postgresql -fetch_and_deploy_gh_release "snowshare" "TuroYT/snowshare" PG_DB_USER="snowshare" PG_DB_NAME="snowshare" setup_postgresql_db +fetch_and_deploy_gh_release "snowshare" "TuroYT/snowshare" msg_info "Installing SnowShare" cd /opt/snowshare From 13e8f7d09374a3ce8fc25b96c44ba1a2026f07c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Tue, 2 Dec 2025 12:13:00 +0100 Subject: [PATCH 5/5] Add source comment for snowshare-install.sh --- install/snowshare-install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install/snowshare-install.sh b/install/snowshare-install.sh index e4b7fa3d712..da197dd28bd 100644 --- a/install/snowshare-install.sh +++ b/install/snowshare-install.sh @@ -3,6 +3,7 @@ # Copyright (c) 2021-2025 community-scripts ORG # Author: TuroYT # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/TuroYT/snowshare source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" color