mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
Update INSTALL.sh
This commit is contained in:
parent
dd7d4e14ce
commit
7fe74f93c9
@ -5,7 +5,7 @@
|
|||||||
# Usage: cd /home && (curl -sSL https://get.openpanel.co || wget -O - https://get.openpanel.co) | bash
|
# Usage: cd /home && (curl -sSL https://get.openpanel.co || wget -O - https://get.openpanel.co) | bash
|
||||||
# Author: Stefan Pejcic
|
# Author: Stefan Pejcic
|
||||||
# Created: 11.07.2023
|
# Created: 11.07.2023
|
||||||
# Last Modified: 30.05.2024
|
# Last Modified: 31.05.2024
|
||||||
# Company: openpanel.co
|
# Company: openpanel.co
|
||||||
# Copyright (c) OPENPANEL
|
# Copyright (c) OPENPANEL
|
||||||
#
|
#
|
||||||
@ -45,8 +45,9 @@ NO_SSH=false
|
|||||||
INSTALL_FTP=false
|
INSTALL_FTP=false
|
||||||
INSTALL_MAIL=false
|
INSTALL_MAIL=false
|
||||||
OVERLAY=false
|
OVERLAY=false
|
||||||
IPSETS=false
|
IPSETS=true
|
||||||
SET_HOSTNAME_NOW=false
|
SET_HOSTNAME_NOW=false
|
||||||
|
SELFHOSTED_SCREENSHOTS=false
|
||||||
|
|
||||||
# Paths
|
# Paths
|
||||||
LOG_FILE="openpanel_install.log"
|
LOG_FILE="openpanel_install.log"
|
||||||
@ -58,6 +59,9 @@ OPENPANEL_ERR_DIR="/var/log/openpanel/"
|
|||||||
SERVICES_DIR="/etc/systemd/system/"
|
SERVICES_DIR="/etc/systemd/system/"
|
||||||
TEMP_DIR="/tmp/"
|
TEMP_DIR="/tmp/"
|
||||||
|
|
||||||
|
# Domains
|
||||||
|
SCREENSHOTS_API_URL="http://screenshots-api.openpanel.co/screenshot"
|
||||||
|
|
||||||
# Redirect output to the log file
|
# Redirect output to the log file
|
||||||
exec > >(tee -a "$LOG_FILE") 2>&1
|
exec > >(tee -a "$LOG_FILE") 2>&1
|
||||||
|
|
||||||
@ -354,6 +358,9 @@ parse_args() {
|
|||||||
--skip-images)
|
--skip-images)
|
||||||
SKIP_IMAGES=true
|
SKIP_IMAGES=true
|
||||||
;;
|
;;
|
||||||
|
--skip-blacklists)
|
||||||
|
IPSETS=false
|
||||||
|
;;
|
||||||
--skip-ssl)
|
--skip-ssl)
|
||||||
SKIP_SSL=true
|
SKIP_SSL=true
|
||||||
;;
|
;;
|
||||||
@ -379,6 +386,10 @@ parse_args() {
|
|||||||
# Extract path after "--post_install="
|
# Extract path after "--post_install="
|
||||||
post_install_path="${1#*=}"
|
post_install_path="${1#*=}"
|
||||||
;;
|
;;
|
||||||
|
--screenshots=*)
|
||||||
|
# Extract path after "--screenshots="
|
||||||
|
SCREENSHOTS_API_URL="${1#*=}"
|
||||||
|
;;
|
||||||
--version=*)
|
--version=*)
|
||||||
# Extract path after "--version="
|
# Extract path after "--version="
|
||||||
CUSTOM_VERSION=true
|
CUSTOM_VERSION=true
|
||||||
@ -616,10 +627,14 @@ install_packages() {
|
|||||||
else
|
else
|
||||||
debug_log $PACKAGE_MANAGER -qq install "$package"
|
debug_log $PACKAGE_MANAGER -qq install "$package"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Error: Installation of $package failed."
|
echo "Error: Installation of $package failed. Retrying.."
|
||||||
|
$PACKAGE_MANAGER -qq install "$package"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
radovan 1 "ERROR: Installation failed. Please retry installation with '--retry' flag."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
@ -714,7 +729,7 @@ run_mysql_docker_container() {
|
|||||||
--memory="1g" --cpus="1" \
|
--memory="1g" --cpus="1" \
|
||||||
--restart=always \
|
--restart=always \
|
||||||
--oom-kill-disable \
|
--oom-kill-disable \
|
||||||
mysql/mysql-server
|
mysql/mysql-server > /dev/null 2>&1
|
||||||
|
|
||||||
|
|
||||||
if docker ps -a --format '{{.Names}}' | grep -q "openpanel_mysql"; then
|
if docker ps -a --format '{{.Names}}' | grep -q "openpanel_mysql"; then
|
||||||
@ -896,9 +911,16 @@ setup_openpanel() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo "Setting the API service for website screenshots.."
|
|
||||||
|
if [ "$SCREENSHOTS_API_URL" == "local" ]; then
|
||||||
|
echo "Setting the local API service for website screenshots.. (additional 1GB of disk space will be used for the self-hosted Playwright service)"
|
||||||
debug_log playwright install
|
debug_log playwright install
|
||||||
debug_log playwright install-deps
|
debug_log playwright install-deps
|
||||||
|
else
|
||||||
|
echo "Setting the remote API service '$SCREENSHOTS_API_URL' for website screenshots.."
|
||||||
|
sed -i 's#screenshots=.*#screenshots='"$SCREENSHOTS_API_URL"'#' "${OPENPANEL_DIR}conf/panel.config" # must use '#' as delimiter
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
mv ${OPENPANEL_DIR}icons/ ${OPENPANEL_DIR}static/images/icons
|
mv ${OPENPANEL_DIR}icons/ ${OPENPANEL_DIR}static/images/icons
|
||||||
}
|
}
|
||||||
@ -997,7 +1019,7 @@ setup_opencli() {
|
|||||||
|
|
||||||
# added in 0.1.8
|
# added in 0.1.8
|
||||||
mkdir -p /etc/openpanel/openadmin/config/
|
mkdir -p /etc/openpanel/openadmin/config/
|
||||||
wget -O /etc/openpanel/openadmin/config/forbidden_usernames.txt https://gist.githubusercontent.com/stefanpejcic/f08e6841fbf953b7aff108a8c154e9eb/raw/9ac3efabbde48faf95435221e7e09e28b46340ae/forbidden_usernames.ttxt
|
wget -O /etc/openpanel/openadmin/config/forbidden_usernames.txt https://gist.githubusercontent.com/stefanpejcic/f08e6841fbf953b7aff108a8c154e9eb/raw/9ac3efabbde48faf95435221e7e09e28b46340ae/forbidden_usernames.ttxt > /dev/null 2>&1
|
||||||
|
|
||||||
echo "Creating directories for logs.."
|
echo "Creating directories for logs.."
|
||||||
debug_log mkdir -p ${OPENPANEL_ERR_DIR}admin ${OPENPANEL_ERR_DIR}user
|
debug_log mkdir -p ${OPENPANEL_ERR_DIR}admin ${OPENPANEL_ERR_DIR}user
|
||||||
@ -1053,9 +1075,14 @@ download_and_import_docker_images() {
|
|||||||
echo "Downloading docker images in the background.."
|
echo "Downloading docker images in the background.."
|
||||||
|
|
||||||
if [ "$SKIP_IMAGES" = false ]; then
|
if [ "$SKIP_IMAGES" = false ]; then
|
||||||
opencli docker-update_images &
|
# See https://github.com/moby/moby/issues/16106#issuecomment-310781836 for pulling images in parallel
|
||||||
pid1=$!
|
# Nohup (no hang up) with trailing ampersand allows running the command in the background
|
||||||
disown $pid1
|
# The </dev/null bits redirects the outputs to files rather than strout/err
|
||||||
|
nohup sh -c "echo openpanel/nginx:latest openpanel/apache:latest | xargs -P4 -n1 docker pull" </dev/null >nohup.out 2>nohup.err &
|
||||||
|
# stopped working on 0.1.8 :(
|
||||||
|
# opencli docker-update_images &
|
||||||
|
# pid1=$!
|
||||||
|
# disown $pid1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1166,6 +1193,9 @@ success_message() {
|
|||||||
exec > /dev/tty
|
exec > /dev/tty
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
|
|
||||||
|
# for 0.1.9
|
||||||
|
echo "$version" > $OPENPANEL_DIR/version
|
||||||
|
|
||||||
opencli admin
|
opencli admin
|
||||||
echo "Username: admin"
|
echo "Username: admin"
|
||||||
echo "Password: $admin_password"
|
echo "Password: $admin_password"
|
||||||
|
Loading…
Reference in New Issue
Block a user