mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2026-11-13 09:20:39 +00:00
Add cypht (ct) (#18659)
Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
a57e899058
commit
dd75297935
2 files changed
+152
No files matched your search
+68
@@ -0,0 +1,68 @@
|
||||
#!/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/cypht-org/cypht
|
||||
|
||||
APP="Cypht"
|
||||
var_tags="${var_tags:-email;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_admin_user="${var_admin_user:-}"
|
||||
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 [[ ! -d /opt/cypht ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "cypht" "cypht-org/cypht"; then
|
||||
msg_info "Stopping Cypht"
|
||||
systemctl stop nginx php8.4-fpm
|
||||
msg_ok "Stopped Cypht"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "cypht" "cypht-org/cypht" "prebuild" "latest" "/opt/cypht" "cypht.tar.gz"
|
||||
|
||||
msg_info "Updating Cypht"
|
||||
ln -sf /opt/cypht_data/.env /opt/cypht/.env
|
||||
cd /opt/cypht
|
||||
$STD php scripts/setup_database.php
|
||||
$STD php scripts/config_gen.php
|
||||
chown -R www-data:www-data /opt/cypht_data/users /opt/cypht_data/attachments
|
||||
msg_ok "Updated Cypht"
|
||||
|
||||
msg_info "Starting Cypht"
|
||||
systemctl start php8.4-fpm nginx
|
||||
msg_ok "Started Cypht"
|
||||
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}"
|
||||
echo -e "${INFO}${YW}Login: /opt/cypht_data/.env (inside the container)${CL}"
|
||||
@@ -0,0 +1,84 @@
|
||||
#!/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/cypht-org/cypht
|
||||
|
||||
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
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
PHP_VERSION="8.4" PHP_FPM="YES" PHP_MODULE="soap,ldap" setup_php
|
||||
fetch_and_deploy_gh_release "cypht" "cypht-org/cypht" "prebuild" "latest" "/opt/cypht" "cypht.tar.gz"
|
||||
|
||||
msg_info "Configuring Cypht"
|
||||
var_admin_user="${var_admin_user:-admin}"
|
||||
var_admin_pass="${var_admin_pass:-$(random_password)}"
|
||||
mkdir -p /opt/cypht_data/{users,attachments}
|
||||
cp /opt/cypht/.env /opt/cypht_data/.env
|
||||
sed -i \
|
||||
-e 's|^DB_DRIVER=.*|DB_DRIVER=sqlite|' \
|
||||
-e 's|^DB_NAME=.*|DB_NAME=/opt/cypht_data/users/cypht.db|' \
|
||||
-e 's|^SESSION_TYPE=.*|SESSION_TYPE=DB|' \
|
||||
-e 's|^AUTH_TYPE=.*|AUTH_TYPE=DB|' \
|
||||
-e 's|^USER_CONFIG_TYPE=.*|USER_CONFIG_TYPE=DB|' \
|
||||
-e 's|^USER_SETTINGS_DIR=.*|USER_SETTINGS_DIR=/opt/cypht_data/users|' \
|
||||
-e 's|^ATTACHMENT_DIR=.*|ATTACHMENT_DIR=/opt/cypht_data/attachments|' \
|
||||
-e "s|^ADMIN_USERS=.*|ADMIN_USERS=${var_admin_user}|" \
|
||||
-e 's|^ENABLE_REDIS=.*|ENABLE_REDIS=false|' \
|
||||
-e 's|^ENABLE_MEMCACHED=.*|ENABLE_MEMCACHED=false|' \
|
||||
/opt/cypht_data/.env
|
||||
cat <<EOF >>/opt/cypht_data/.env
|
||||
|
||||
CYPHT_ADMIN_USER='${var_admin_user}'
|
||||
CYPHT_ADMIN_PASS='${var_admin_pass}'
|
||||
EOF
|
||||
ln -sf /opt/cypht_data/.env /opt/cypht/.env
|
||||
cd /opt/cypht
|
||||
$STD php scripts/setup_database.php
|
||||
$STD php scripts/create_account.php "$var_admin_user" "$var_admin_pass"
|
||||
$STD php scripts/config_gen.php
|
||||
chown -R www-data:www-data /opt/cypht_data/users /opt/cypht_data/attachments
|
||||
chown root:www-data /opt/cypht_data/.env
|
||||
chmod 640 /opt/cypht_data/.env
|
||||
msg_ok "Configured Cypht"
|
||||
|
||||
msg_info "Configuring Nginx"
|
||||
PHP_SOCK=$(get_php_fpm_socket)
|
||||
cat <<EOF >/etc/nginx/sites-available/cypht
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
root /opt/cypht/site;
|
||||
index index.php;
|
||||
client_max_body_size 60M;
|
||||
|
||||
location / {
|
||||
try_files \$uri /index.php\$is_args\$args;
|
||||
}
|
||||
location ~ \.php\$ {
|
||||
try_files \$uri =404;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)\$;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_pass unix:${PHP_SOCK};
|
||||
}
|
||||
}
|
||||
EOF
|
||||
nginx_enable_site "cypht"
|
||||
msg_ok "Configured Nginx"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
Reference in new issue
Block a user