mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-11-29 14:41:35 +01:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab3453862b |
No files matched your search
@@ -0,0 +1,62 @@
|
||||
#!/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: TaiKamilla
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://www.cloudpanel.io/
|
||||
|
||||
APP="CloudPanel"
|
||||
var_tags="${var_tags:-webserver;hosting;php}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-20}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_arm64="${var_arm64:-yes}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
export var_db_engine="${var_db_engine:-}"
|
||||
export var_admin_user="${var_admin_user:-}"
|
||||
export var_admin_email="${var_admin_email:-}"
|
||||
export var_admin_pass="${var_admin_pass:-}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -f /home/clp/htdocs/app/data/db.sq3 ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
$STD apt update
|
||||
if [[ -z "$(apt list --upgradable 2>/dev/null | grep '/')" ]]; then
|
||||
msg_ok "No update required. ${APP} is already up to date"
|
||||
exit
|
||||
fi
|
||||
|
||||
msg_info "Updating CloudPanel"
|
||||
$STD clp-update
|
||||
$STD apt -y --with-new-pkgs --allow-downgrades upgrade
|
||||
msg_ok "Updated CloudPanel"
|
||||
msg_ok "Updated successfully!"
|
||||
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}https://${IP}:8443${CL}"
|
||||
echo -e "${INFO}${YW}Admin credentials: ~/cloudpanel.creds (inside the container)${CL}"
|
||||
@@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: TaiKamilla
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://www.cloudpanel.io/
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
var_db_engine="${var_db_engine:-MARIADB_12.3}"
|
||||
if [[ ! "$var_db_engine" =~ ^(MARIADB_12\.3|MARIADB_11\.8|MYSQL_8\.4)$ ]]; then
|
||||
msg_warn "Unsupported database engine '${var_db_engine}', using MARIADB_12.3"
|
||||
var_db_engine="MARIADB_12.3"
|
||||
fi
|
||||
var_admin_user="${var_admin_user:-admin}"
|
||||
if [[ ! "$var_admin_user" =~ ^[A-Za-z0-9._-]{3,}$ ]]; then
|
||||
msg_warn "Invalid admin user '${var_admin_user}' (3+ letters, digits, dots, dashes or underscores), using admin"
|
||||
var_admin_user="admin"
|
||||
fi
|
||||
var_admin_email="${var_admin_email:-admin@example.com}"
|
||||
if [[ ! "$var_admin_email" =~ ^[^@[:space:]]+@[^@[:space:]]+\.[^@[:space:]]+$ ]]; then
|
||||
msg_warn "Invalid admin email '${var_admin_email}', using admin@example.com"
|
||||
var_admin_email="admin@example.com"
|
||||
fi
|
||||
var_admin_pass="${var_admin_pass:-$(random_password 20)}"
|
||||
|
||||
confirm_external_installer "https://www.cloudpanel.io/" "https://installer.cloudpanel.io/ce/v2/install.sh"
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y openssh-server wget
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
msg_info "Installing CloudPanel (Patience)"
|
||||
curl_with_retry "https://installer.cloudpanel.io/ce/v2/install.sh" /tmp/cloudpanel-install.sh
|
||||
if ! sha256sum -c --status <<<"8146dbe0a488e7088b04071b0c34d59aa0ab1fe9dcec382d395fd155c9e6c476 /tmp/cloudpanel-install.sh"; then
|
||||
msg_error "The CloudPanel installer does not match the checksum published in its documentation"
|
||||
exit 1
|
||||
fi
|
||||
# SWAP=false: dphys-swapfile cannot manage swap inside a container
|
||||
$STD env HOME=/root SWAP=false DB_ENGINE="$var_db_engine" bash /tmp/cloudpanel-install.sh
|
||||
rm -f /tmp/cloudpanel-install.sh
|
||||
systemctl disable -q --now chrony
|
||||
if systemctl is-failed -q chrony; then
|
||||
systemctl reset-failed chrony
|
||||
fi
|
||||
msg_ok "Installed CloudPanel"
|
||||
|
||||
msg_info "Creating CloudPanel Admin"
|
||||
$STD clpctl user:add --userName="$var_admin_user" --email="$var_admin_email" --firstName="Admin" --lastName="CloudPanel" --password="$var_admin_pass" --role="admin" --timezone="UTC" --status="1"
|
||||
cat <<EOF >~/cloudpanel.creds
|
||||
CloudPanel Admin
|
||||
URL: https://${LOCAL_IP}:8443
|
||||
Username: ${var_admin_user}
|
||||
Password: ${var_admin_pass}
|
||||
EOF
|
||||
chmod 600 ~/cloudpanel.creds
|
||||
msg_ok "Created CloudPanel Admin"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
Reference in new issue
Block a user