2023-09-28 16:14:58 +00:00
|
|
|
#!/usr/bin/env bash
|
2024-11-02 07:48:05 +00:00
|
|
|
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
2025-01-01 12:37:29 +00:00
|
|
|
# Copyright (c) 2021-2025 tteck
|
2023-09-28 16:14:58 +00:00
|
|
|
# Author: tteck (tteckster)
|
2024-12-16 11:42:51 +00:00
|
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
2023-09-28 16:14:58 +00:00
|
|
|
|
2024-12-16 11:42:51 +00:00
|
|
|
# App Default Values
|
2023-09-28 16:14:58 +00:00
|
|
|
APP="Alpine-Nextcloud"
|
2024-12-16 12:31:48 +00:00
|
|
|
var_tags="alpine;cloud"
|
2023-09-28 16:14:58 +00:00
|
|
|
var_cpu="2"
|
2023-12-27 20:52:59 +00:00
|
|
|
var_ram="1024"
|
2024-12-16 11:42:51 +00:00
|
|
|
var_disk="2"
|
2023-09-28 16:14:58 +00:00
|
|
|
var_os="alpine"
|
2024-12-16 11:42:51 +00:00
|
|
|
var_version="3.20"
|
|
|
|
var_unprivileged="1"
|
|
|
|
|
|
|
|
# App Output & Base Settings
|
|
|
|
header_info "$APP"
|
|
|
|
base_settings
|
|
|
|
|
|
|
|
# Core
|
2023-09-28 16:14:58 +00:00
|
|
|
variables
|
|
|
|
color
|
|
|
|
catch_errors
|
|
|
|
|
|
|
|
function update_script() {
|
|
|
|
if [[ ! -d /usr/share/webapps/nextcloud ]]; then
|
|
|
|
msg_error "No ${APP} Installation Found!"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
if ! apk -e info newt >/dev/null 2>&1; then
|
|
|
|
apk add -q newt
|
|
|
|
fi
|
|
|
|
while true; do
|
|
|
|
CHOICE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "SUPPORT" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 3 \
|
2024-06-30 13:09:08 +00:00
|
|
|
"1" "Nextcloud Login Credentials" ON \
|
|
|
|
"2" "Renew Self-signed Certificate" OFF \
|
2023-09-28 16:14:58 +00:00
|
|
|
3>&1 1>&2 2>&3)
|
|
|
|
exit_status=$?
|
|
|
|
if [ $exit_status == 1 ]; then
|
|
|
|
clear
|
|
|
|
exit-script
|
|
|
|
fi
|
|
|
|
header_info
|
|
|
|
case $CHOICE in
|
|
|
|
1)
|
|
|
|
cat nextcloud.creds
|
|
|
|
exit
|
|
|
|
;;
|
2024-06-30 13:09:08 +00:00
|
|
|
2)
|
2023-09-28 16:14:58 +00:00
|
|
|
openssl req -x509 -nodes -days 365 -newkey rsa:4096 -keyout /etc/ssl/private/nextcloud-selfsigned.key -out /etc/ssl/certs/nextcloud-selfsigned.crt -subj "/C=US/O=Nextcloud/OU=Domain Control Validated/CN=nextcloud.local" > /dev/null 2>&1
|
|
|
|
rc-service nginx restart
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
start
|
|
|
|
build_container
|
|
|
|
description
|
|
|
|
|
2023-09-29 10:48:31 +00:00
|
|
|
msg_ok "Completed Successfully!\n"
|
2023-09-30 11:03:00 +00:00
|
|
|
echo -e "${APP} should be reachable by going to the following URL.
|
2023-09-28 16:14:58 +00:00
|
|
|
${BL}https://${IP}${CL} \n"
|