diff --git a/ct/radicale.sh b/ct/radicale.sh new file mode 100644 index 00000000..b6962a30 --- /dev/null +++ b/ct/radicale.sh @@ -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}" \ No newline at end of file diff --git a/install/radicale-install.sh b/install/radicale-install.sh new file mode 100644 index 00000000..faed4838 --- /dev/null +++ b/install/radicale-install.sh @@ -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 </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 </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" \ No newline at end of file diff --git a/json/radicale.json b/json/radicale.json new file mode 100644 index 00000000..35e6307e --- /dev/null +++ b/json/radicale.json @@ -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" + } + ] + } \ No newline at end of file