From ffed8f67de60bfadada89d6eabd78032dea5c8c0 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 6 Mar 2025 12:14:00 +0100 Subject: [PATCH 1/5] fix update path check --- ct/inventree.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/inventree.sh b/ct/inventree.sh index 5bc1f9b..ff0f2d9 100644 --- a/ct/inventree.sh +++ b/ct/inventree.sh @@ -24,7 +24,7 @@ function update_script() { check_container_storage check_container_resources - if [[ ! -d "/opt/habitica" ]]; then + if [[ ! -d "/opt/inventree" ]]; then msg_error "No ${APP} Installation Found!" exit fi From 122c0a18553d8605ef2f74490e7155a43fce7bd7 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 6 Mar 2025 12:15:39 +0100 Subject: [PATCH 2/5] fix password cat --- json/inventree.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json/inventree.json b/json/inventree.json index d01f8bc..016d0e3 100644 --- a/json/inventree.json +++ b/json/inventree.json @@ -28,7 +28,7 @@ ], "default_credentials": { "username": "admin", - "password": "`cat /etc/inventree/admin_password`" + "password": "`cat /etc/inventree/admin_password.txt`" }, "notes": [ { From 20bbdf05db4c215f7cce053d4dcd09e250e164d7 Mon Sep 17 00:00:00 2001 From: tremor021 Date: Thu, 6 Mar 2025 13:01:16 +0100 Subject: [PATCH 3/5] feat: ignore vscode settings, annoying --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c6f9a44 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode/settings.json From 105cd47ec63dab40dbc42911d11cd154228acc66 Mon Sep 17 00:00:00 2001 From: vhsdream Date: Thu, 6 Mar 2025 07:36:05 -0500 Subject: [PATCH 4/5] New LXC: Fluid Calendar --- ct/fluid-calendar.sh | 78 +++++++++++++++++++++ install/fluid-calendar-install.sh | 112 ++++++++++++++++++++++++++++++ json/fluid-calendar.json | 44 ++++++++++++ 3 files changed, 234 insertions(+) create mode 100644 ct/fluid-calendar.sh create mode 100644 install/fluid-calendar-install.sh create mode 100644 json/fluid-calendar.json diff --git a/ct/fluid-calendar.sh b/ct/fluid-calendar.sh new file mode 100644 index 0000000..3b4fcfa --- /dev/null +++ b/ct/fluid-calendar.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env bash +source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: vhsdream +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://fluidcalendar.com + +APP="fluid-calendar" +var_tags="calendar,tasks" +var_cpu="2" +var_ram="4096" +var_disk="4" +var_os="debian" +var_version="12" +var_unprivileged="1" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -d /opt/fluid-calendar ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + RELEASE=$(curl -s https://api.github.com/repos/dotnetfactory/fluid-calendar/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') + if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then + msg_info "Stopping $APP" + systemctl stop fluid-calendar.service + msg_ok "Stopped $APP" + + msg_info "Creating Backup" + $STD tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /opt/fluid-calendar + msg_ok "Backup Created" + + msg_info "Updating $APP to v${RELEASE}" + tmp_file=$(mktemp) + wget -q "https://github.com/dotnetfactory/fluid-calendar/archive/refs/tags/v${RELEASE}.zip" -O $tmp_file + unzip -q $tmp_file + cp -rf ${APP}-${RELEASE}/* /opt/fluid-calendar + cd /opt/fluid-calendar + export NEXT_TELEMETRY_DISABLED=1 + $STD npm run setup + $STD npm run build + msg_ok "Updated $APP to v${RELEASE}" + + msg_info "Starting $APP" + systemctl start fluid-calendar.service + msg_ok "Started $APP" + + msg_info "Cleaning Up" + rm -rf $tmp_file + rm -rf "/opt/${APP}_backup_$(date +%F).tar.gz" + rm -rf /tmp/${APP}-${RELEASE} + msg_ok "Cleanup Completed" + + echo "${RELEASE}" >/opt/${APP}_version.txt + msg_ok "Update Successful" + else + msg_ok "No update required. ${APP} is already at v${RELEASE}" + 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/install/fluid-calendar-install.sh b/install/fluid-calendar-install.sh new file mode 100644 index 0000000..aac1343 --- /dev/null +++ b/install/fluid-calendar-install.sh @@ -0,0 +1,112 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: vhsdream +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/dotnetfactory/fluid-calendar + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y \ + curl \ + sudo \ + mc \ + zip \ + gnupg \ + postgresql-common +msg_ok "Installed Dependencies" + +msg_info "Installing Additional Dependencies" +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" >/etc/apt/sources.list.d/nodesource.list +echo "YES" | /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh &>/dev/null +$STD apt-get install -y postgresql-17 nodejs +msg_ok "Installed Additional Dependencies" + +msg_info "Setting up Postgresql Database" +DB_NAME="fluiddb" +DB_USER="fluiduser" +DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)" +NEXTAUTH_SECRET="$(openssl rand -base64 44 | tr -dc 'a-zA-Z0-9' | cut -c1-32)" +$STD sudo -u postgres psql -c "CREATE USER $DB_USER WITH ENCRYPTED 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 "GRANT ALL PRIVILEGES ON DATABASE $DB_NAME to $DB_USER;" +$STD sudo -u postgres psql -c "ALTER USER $DB_USER WITH SUPERUSER;" +{ + echo "${APPLICATION} Credentials" + echo "Database User: $DB_USER" + echo "Database Password: $DB_PASS" + echo "Database Name: $DB_NAME" + echo "NextAuth Secret: $NEXTAUTH_SECRET" +} >> ~/$APPLICATION.creds +msg_ok "Set up Postgresql Database" + +msg_info "Setup ${APPLICATION}" +tmp_file=$(mktemp) +RELEASE=$(curl -s https://api.github.com/repos/dotnetfactory/fluid-calendar/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') +wget -q "https://github.com/dotnetfactory/fluid-calendar/archive/refs/tags/v${RELEASE}.zip" -O $tmp_file +unzip -q $tmp_file +mv ${APPLICATION}-${RELEASE}/ /opt/${APPLICATION} +echo "${RELEASE}" >/opt/${APPLICATION}_version.txt + +cat </opt/fluid-calendar/.env +DATABASE_URL="postgresql://${DB_USER}:${DB_PASS}@localhost:5432/${DB_NAME}" + +# For OAuth integration with Google Calendar +# See https://console.cloud.google.com +GOOGLE_CLIENT_ID="" +GOOGLE_CLIENT_SECRET="" + +# Change the URL below to your external URL +NEXTAUTH_URL="http://localhost:3000" +NEXTAUTH_SECRET="${NEXTAUTH_SECRET}" + +# For optional Outlook Calendar Integration +# Create at https://portal.azure.com +AZURE_AD_CLIENT_ID="" +AZURE_AD_CLIENT_SECRET="" +AZURE_AD_TENANT_ID="" + +# Logging configuration +# Options: debug, none (check logger.js for more details) +LOG_LEVEL="none" +DEBUG_ENABLED=0 +EOF +export NEXT_TELEMETRY_DISABLED=1 +cd /opt/fluid-calendar +$STD npm run setup +$STD npm run build +msg_ok "Setup ${APPLICATION}" + +msg_info "Creating Service" +cat </etc/systemd/system/fluid-calendar.service +[Unit] +Description=Fluid Calendar Application +After=network.target postgresql.service + +[Service] +Restart=always +WorkingDirectory=/opt/fluid-calendar +ExecStart=/usr/bin/npm run start + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now fluid-calendar.service +msg_ok "Created Service" + +motd_ssh +customize + +msg_info "Cleaning up" +rm -f $tmp_file +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" diff --git a/json/fluid-calendar.json b/json/fluid-calendar.json new file mode 100644 index 0000000..b9d900f --- /dev/null +++ b/json/fluid-calendar.json @@ -0,0 +1,44 @@ +{ + "name": "Fluid-Calendar", + "slug": "fluid-calendar", + "categories": [ + 19, + 0 + ], + "date_created": "2025-03-04", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 3000, + "documentation": "https://github.com/dotnetfactory/fluid-calendar/tree/main/docs", + "website": "https://github.com/dotnetfactory/fluid-calendar", + "logo": "https://raw.githubusercontent.com/dotnetfactory/fluid-calendar/refs/heads/main/src/app/favicon.ico", + "description": "The open-source intelligent calendar that adapts to your workflow. Experience seamless task scheduling powered by AI, designed to make your time management effortless.", + "install_methods": [ + { + "type": "default", + "script": "ct/fluid-calendar.sh", + "resources": { + "cpu": 2, + "ram": 4096, + "hdd": 4, + "os": "Debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "RAM can be reduced to 2GB after installation", + "type": "info" + }, + { + "text": "Creds: cat ~/fluid-calendar.creds", + "type": "info" + } + ] +} From 47f69c08f158d8723302f04e4f831715151838b7 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 6 Mar 2025 12:37:28 +0000 Subject: [PATCH 5/5] Update .app files --- ct/headers/fluid-calendar | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 ct/headers/fluid-calendar diff --git a/ct/headers/fluid-calendar b/ct/headers/fluid-calendar new file mode 100644 index 0000000..02b3d8d --- /dev/null +++ b/ct/headers/fluid-calendar @@ -0,0 +1,6 @@ + ______ _ __ __ __ + / __/ /_ __(_)___/ / _________ _/ /__ ____ ____/ /___ ______ + / /_/ / / / / / __ /_____/ ___/ __ `/ / _ \/ __ \/ __ / __ `/ ___/ + / __/ / /_/ / / /_/ /_____/ /__/ /_/ / / __/ / / / /_/ / /_/ / / +/_/ /_/\__,_/_/\__,_/ \___/\__,_/_/\___/_/ /_/\__,_/\__,_/_/ +