New Script: Radicale (#1941)

* add radicale script

* Update install/radicale-install.sh

Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com>

* Update install/radicale-install.sh

Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com>

* Update install/radicale-install.sh

Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com>

* small fixes

* fixes

* fixes

* fixed json

* added update

* Update install/radicale-install.sh

Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com>

---------

Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com>
This commit is contained in:
Slaviša Arežina 2025-02-05 13:25:27 +01:00 committed by GitHub
parent c112edd8ac
commit f66f43d91a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 166 additions and 0 deletions

56
ct/radicale.sh Normal file
View File

@ -0,0 +1,56 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2025 community-scripts ORG
# Author: tremor021
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://radicale.org/
# App Default Values
APP="Radicale"
var_tags="calendar"
var_cpu="1"
var_ram="512"
var_disk="2"
var_os="debian"
var_version="12"
var_unprivileged="1"
# App Output & Base Settings
header_info "$APP"
base_settings
# Core
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/radicale ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating ${APP}"
python3 -m venv /opt/radicale
source /opt/radicale/bin/activate
python3 -m pip install --upgrade https://github.com/Kozea/Radicale/archive/master.tar.gz
msg_ok "Updated ${APP}"
msg_info "Starting Service"
systemctl enable -q --now radicale
msg_ok "Started Service"
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}:5232${CL}"

View File

@ -0,0 +1,71 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: Slaviša Arežina (tremor021)
# 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
msg_info "Installing Dependencies"
$STD apt-get install -y \
curl \
sudo \
mc \
apache2-utils \
python3-pip \
python3.11-venv
msg_ok "Installed Dependencies"
msg_info "Setting up Radicale"
python3 -m venv /opt/radicale
source /opt/radicale/bin/activate
python3 -m pip install --upgrade https://github.com/Kozea/Radicale/archive/master.tar.gz
RNDPASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
htpasswd -b -5 /opt/radicale/users admin $RNDPASS
{
echo "Radicale Credentials"
echo "Admin User: admin"
echo "Admin Password: $RNDPASS"
} >> ~/radicale.creds
msg_info "Setup Service"
cat <<EOF >/opt/radicale/start.sh
#!/usr/bin/env bash
source /opt/radicale/bin/activate
python3 -m radicale --storage-filesystem-folder=/var/lib/radicale/collections --hosts 0.0.0.0:5232 --auth-type htpasswd --auth-htpasswd-filename /opt/radicale/users --auth-htpasswd-encryption sha512
EOF
chmod +x /opt/radicale/start.sh
cat <<EOF >/etc/systemd/system/radicale.service
Description=A simple CalDAV (calendar) and CardDAV (contact) server
After=network.target
Requires=network.target
[Service]
ExecStart=/opt/radicale/start.sh
Restart=on-failure
# User=radicale
# Deny other users access to the calendar data
# UMask=0027
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now radicale
msg_ok "Created Service"
motd_ssh
customize
msg_info "Cleaning up"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"

39
json/radicale.json Normal file
View File

@ -0,0 +1,39 @@
{
"name": "Radicale",
"slug": "radicale",
"categories": [
6
],
"date_created": "2025-02-02",
"type": "ct",
"updateable": false,
"privileged": false,
"interface_port": 5232,
"documentation": "https://radicale.org/master.html#documentation-1",
"website": "https://radicale.org/",
"logo": "https://radicale.org/assets/logo.svg",
"description": "Radicale is a small but powerful CalDAV (calendars, to-do lists) and CardDAV (contacts)",
"install_methods": [
{
"type": "default",
"script": "ct/radicale.sh",
"resources": {
"cpu": 1,
"ram": 512,
"hdd": 2,
"os": "Debian",
"version": "12"
}
}
],
"default_credentials": {
"username": null,
"password": null
},
"notes": [
{
"text": "To view the user credentials : `cat radicale.creds`",
"type": "info"
}
]
}