Compare commits

...
Author SHA1 Message Date
push-app-to-main[bot] 9932962490 Add roundcube (ct) 2026-11-30 15:06:32 +00:00
2 changed files with 148 additions and 0 deletions

No files matched your search

+65
View File
@@ -0,0 +1,65 @@
#!/usr/bin/env bash
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/roundcube/roundcubemail
APP="Roundcube"
var_tags="${var_tags:-mail;webmail}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-512}"
var_disk="${var_disk:-4}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
export var_imap_host="${var_imap_host:-}"
export var_smtp_host="${var_smtp_host:-}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/roundcube ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "roundcube" "roundcube/roundcubemail"; then
msg_info "Stopping Roundcube"
systemctl stop nginx
msg_ok "Stopped Roundcube"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "roundcube" "roundcube/roundcubemail" "prebuild" "latest" "/opt/roundcube_update" "roundcubemail-*-complete.tar.gz"
msg_info "Updating Roundcube"
$STD php /opt/roundcube_update/bin/installto.sh -y /opt/roundcube
rm -rf /opt/roundcube_update
chown -R www-data:www-data /opt/roundcube /opt/roundcube_data
msg_ok "Updated Roundcube"
msg_info "Starting Roundcube"
systemctl start nginx
msg_ok "Started Roundcube"
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 "${GATEWAY}${BGN}http://${IP}${CL}"
+83
View File
@@ -0,0 +1,83 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/roundcube/roundcubemail
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt install -y nginx rsync
msg_ok "Installed Dependencies"
PHP_VERSION="8.4" PHP_FPM="YES" PHP_MODULE="ldap" setup_php
fetch_and_deploy_gh_release "roundcube" "roundcube/roundcubemail" "prebuild" "latest" "/opt/roundcube" "roundcubemail-*-complete.tar.gz"
msg_info "Configuring Roundcube"
mkdir -p /opt/roundcube_data
cat <<EOF >/opt/roundcube/config/config.inc.php
<?php
\$config = [];
\$config['db_dsnw'] = 'sqlite:////opt/roundcube_data/roundcube.db?mode=0640';
\$config['imap_host'] = '${var_imap_host:-}';
\$config['smtp_host'] = '${var_smtp_host:-%h:587}';
\$config['smtp_user'] = '%u';
\$config['smtp_pass'] = '%p';
\$config['product_name'] = 'Roundcube Webmail';
\$config['des_key'] = '$(random_password 24)';
\$config['plugins'] = ['archive', 'zipdownload'];
\$config['skin'] = 'elastic';
EOF
rm -rf /opt/roundcube/installer
chown -R www-data:www-data /opt/roundcube /opt/roundcube_data
chmod 640 /opt/roundcube/config/config.inc.php
cd /opt/roundcube
$STD runuser -u www-data -- php bin/initdb.sh --dir=SQL --update
msg_ok "Configured Roundcube"
msg_info "Configuring Nginx"
PHP_SOCK=$(get_php_fpm_socket)
cat <<EOF >/etc/nginx/sites-available/roundcube
server {
listen 80;
listen [::]:80;
server_name _;
root /opt/roundcube/public_html;
index index.php;
client_max_body_size 128M;
location = /favicon.ico {
rewrite ^ /static.php/skins/elastic/images/favicon.ico last;
}
location / {
try_files \$uri \$uri/ /index.php\$is_args\$args;
}
location ~ \.php(/|\$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)\$;
set \$path_info \$fastcgi_path_info;
try_files \$fastcgi_script_name =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
fastcgi_param PATH_INFO \$path_info;
fastcgi_pass unix:${PHP_SOCK};
}
location ~ /\. {
deny all;
}
}
EOF
nginx_enable_site "roundcube"
msg_ok "Configured Nginx"
motd_ssh
customize
cleanup_lxc