Skip to content

Commit fe956f6

Browse files
authored
New Script: Fluid Calendar (#2869)
* New Script: Fluid Calendar * Small changes requested * Fluidcal: Adjust resource levels * Fluidcal: remove info from json
1 parent 3dd67e4 commit fe956f6

File tree

3 files changed

+230
-0
lines changed

3 files changed

+230
-0
lines changed

ct/fluid-calendar.sh

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: vhsdream
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://fluidcalendar.com
7+
8+
APP="fluid-calendar"
9+
var_tags="calendar,tasks"
10+
var_cpu="3"
11+
var_ram="4096"
12+
var_disk="7"
13+
var_os="debian"
14+
var_version="12"
15+
var_unprivileged="1"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
27+
if [[ ! -d /opt/fluid-calendar ]]; then
28+
msg_error "No ${APP} Installation Found!"
29+
exit
30+
fi
31+
32+
RELEASE=$(curl -s https://api.github.com/repos/dotnetfactory/fluid-calendar/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
33+
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
34+
msg_info "Stopping $APP"
35+
systemctl stop fluid-calendar.service
36+
msg_ok "Stopped $APP"
37+
38+
msg_info "Creating Backup"
39+
$STD tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /opt/fluid-calendar
40+
msg_ok "Backup Created"
41+
42+
msg_info "Updating $APP to v${RELEASE}"
43+
tmp_file=$(mktemp)
44+
wget -q "https://github.com/dotnetfactory/fluid-calendar/archive/refs/tags/v${RELEASE}.zip" -O $tmp_file
45+
unzip -q $tmp_file
46+
cp -rf ${APP}-${RELEASE}/* /opt/fluid-calendar
47+
cd /opt/fluid-calendar
48+
export NEXT_TELEMETRY_DISABLED=1
49+
$STD npm run setup
50+
$STD npm run build
51+
msg_ok "Updated $APP to v${RELEASE}"
52+
53+
msg_info "Starting $APP"
54+
systemctl start fluid-calendar.service
55+
msg_ok "Started $APP"
56+
57+
msg_info "Cleaning Up"
58+
rm -rf $tmp_file
59+
rm -rf "/opt/${APP}_backup_$(date +%F).tar.gz"
60+
rm -rf /tmp/${APP}-${RELEASE}
61+
msg_ok "Cleanup Completed"
62+
63+
echo "${RELEASE}" >/opt/${APP}_version.txt
64+
msg_ok "Update Successful"
65+
else
66+
msg_ok "No update required. ${APP} is already at v${RELEASE}"
67+
fi
68+
exit
69+
}
70+
71+
start
72+
build_container
73+
description
74+
75+
msg_ok "Completed Successfully!\n"
76+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
77+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
78+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"

install/fluid-calendar-install.sh

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: vhsdream
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://github.com/dotnetfactory/fluid-calendar
7+
8+
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y \
18+
curl \
19+
sudo \
20+
mc \
21+
zip \
22+
gnupg \
23+
postgresql-common
24+
msg_ok "Installed Dependencies"
25+
26+
msg_info "Installing Additional Dependencies"
27+
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
28+
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
29+
echo "YES" | /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh &>/dev/null
30+
$STD apt-get install -y postgresql-17 nodejs
31+
msg_ok "Installed Additional Dependencies"
32+
33+
msg_info "Setting up Postgresql Database"
34+
DB_NAME="fluiddb"
35+
DB_USER="fluiduser"
36+
DB_PASS="$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)"
37+
NEXTAUTH_SECRET="$(openssl rand -base64 44 | tr -dc 'a-zA-Z0-9' | cut -c1-32)"
38+
$STD sudo -u postgres psql -c "CREATE USER $DB_USER WITH ENCRYPTED PASSWORD '$DB_PASS';"
39+
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;"
40+
$STD sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE $DB_NAME to $DB_USER;"
41+
$STD sudo -u postgres psql -c "ALTER USER $DB_USER WITH SUPERUSER;"
42+
{
43+
echo "${APPLICATION} Credentials"
44+
echo "Database User: $DB_USER"
45+
echo "Database Password: $DB_PASS"
46+
echo "Database Name: $DB_NAME"
47+
echo "NextAuth Secret: $NEXTAUTH_SECRET"
48+
} >> ~/$APPLICATION.creds
49+
msg_ok "Set up Postgresql Database"
50+
51+
msg_info "Setup ${APPLICATION}"
52+
tmp_file=$(mktemp)
53+
RELEASE=$(curl -s https://api.github.com/repos/dotnetfactory/fluid-calendar/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
54+
wget -q "https://github.com/dotnetfactory/fluid-calendar/archive/refs/tags/v${RELEASE}.zip" -O $tmp_file
55+
unzip -q $tmp_file
56+
mv ${APPLICATION}-${RELEASE}/ /opt/${APPLICATION}
57+
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
58+
59+
cat <<EOF >/opt/fluid-calendar/.env
60+
DATABASE_URL="postgresql://${DB_USER}:${DB_PASS}@localhost:5432/${DB_NAME}"
61+
62+
# For OAuth integration with Google Calendar
63+
# See https://console.cloud.google.com
64+
GOOGLE_CLIENT_ID=""
65+
GOOGLE_CLIENT_SECRET=""
66+
67+
# Change the URL below to your external URL
68+
NEXTAUTH_URL="http://localhost:3000"
69+
NEXTAUTH_SECRET="${NEXTAUTH_SECRET}"
70+
71+
# For optional Outlook Calendar Integration
72+
# Create at https://portal.azure.com
73+
AZURE_AD_CLIENT_ID=""
74+
AZURE_AD_CLIENT_SECRET=""
75+
AZURE_AD_TENANT_ID=""
76+
77+
# Logging configuration
78+
# Options: debug, none (check logger.js for more details)
79+
LOG_LEVEL="none"
80+
DEBUG_ENABLED=0
81+
EOF
82+
export NEXT_TELEMETRY_DISABLED=1
83+
cd /opt/fluid-calendar
84+
$STD npm run setup
85+
$STD npm run build
86+
msg_ok "Setup ${APPLICATION}"
87+
88+
msg_info "Creating Service"
89+
cat <<EOF >/etc/systemd/system/fluid-calendar.service
90+
[Unit]
91+
Description=Fluid Calendar Application
92+
After=network.target postgresql.service
93+
94+
[Service]
95+
Restart=always
96+
WorkingDirectory=/opt/fluid-calendar
97+
ExecStart=/usr/bin/npm run start
98+
99+
[Install]
100+
WantedBy=multi-user.target
101+
EOF
102+
systemctl enable -q --now fluid-calendar.service
103+
msg_ok "Created Service"
104+
105+
motd_ssh
106+
customize
107+
108+
msg_info "Cleaning up"
109+
rm -f $tmp_file
110+
$STD apt-get -y autoremove
111+
$STD apt-get -y autoclean
112+
msg_ok "Cleaned"

json/fluid-calendar.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "Fluid-Calendar",
3+
"slug": "fluid-calendar",
4+
"categories": [
5+
19,
6+
0
7+
],
8+
"date_created": "2025-03-04",
9+
"type": "ct",
10+
"updateable": true,
11+
"privileged": false,
12+
"interface_port": 3000,
13+
"documentation": "https://github.com/dotnetfactory/fluid-calendar/tree/main/docs",
14+
"website": "https://github.com/dotnetfactory/fluid-calendar",
15+
"logo": "https://raw.githubusercontent.com/dotnetfactory/fluid-calendar/refs/heads/main/src/app/favicon.ico",
16+
"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.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/fluid-calendar.sh",
21+
"resources": {
22+
"cpu": 3,
23+
"ram": 4096,
24+
"hdd": 7,
25+
"os": "Debian",
26+
"version": "12"
27+
}
28+
}
29+
],
30+
"default_credentials": {
31+
"username": null,
32+
"password": null
33+
},
34+
"notes": [
35+
{
36+
"text": "Creds: cat ~/fluid-calendar.creds",
37+
"type": "info"
38+
}
39+
]
40+
}

0 commit comments

Comments
 (0)