mirror of https://github.com/tteck/Proxmox.git
Merge branch 'main' of https://github.com/nicedevil007/Proxmox
This commit is contained in:
commit
c5ef77bee8
|
@ -52,11 +52,14 @@ function default_settings() {
|
|||
|
||||
function update_script() {
|
||||
header_info
|
||||
if [[ ! -d /var ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||
msg_info "Updating ${APP} LXC"
|
||||
if [[ ! -f /etc/apt/sources.list.d/grafana.list ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||
msg_info "Updating ${APP}"
|
||||
apt-key del 4E40DDF6D76E284A4A6780E48C8C34C524098CB6
|
||||
wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key
|
||||
echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" | tee /etc/apt/sources.list.d/grafana.list
|
||||
apt-get update &>/dev/null
|
||||
apt-get -y upgrade &>/dev/null
|
||||
msg_ok "Updated ${APP} LXC"
|
||||
msg_ok "Updated ${APP}"
|
||||
msg_ok "Update Successfull"
|
||||
exit
|
||||
}
|
||||
|
|
|
@ -53,10 +53,14 @@ function default_settings() {
|
|||
function update_script() {
|
||||
header_info
|
||||
if [[ ! -f /etc/apt/sources.list.d/influxdb.list ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||
msg_info "Updating ${APP} LXC"
|
||||
msg_info "Updating ${APP}"
|
||||
wget -q https://repos.influxdata.com/influxdata-archive_compat.key
|
||||
cat influxdata-archive_compat.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null
|
||||
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main' | tee /etc/apt/sources.list.d/influxdata.list
|
||||
rm -f /etc/apt/trusted.gpg.d/influxdb.gpg
|
||||
apt-get update &>/dev/null
|
||||
apt-get -y upgrade &>/dev/null
|
||||
msg_ok "Updated ${APP} LXC"
|
||||
msg_ok "Updated ${APP}"
|
||||
msg_ok "Update Successfull"
|
||||
exit
|
||||
}
|
||||
|
|
|
@ -74,18 +74,18 @@ function update_script() {
|
|||
/var/cache/nginx &>/dev/null
|
||||
msg_ok "Cleaned Old Files"
|
||||
|
||||
msg_info "Downloading NPM v2.9.22"
|
||||
wget -q https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/v2.9.22 -O - | tar -xz &>/dev/null
|
||||
cd nginx-proxy-manager-2.9.22
|
||||
msg_ok "Downloaded NPM v2.9.22"
|
||||
msg_info "Downloading NPM v2.10.2"
|
||||
wget -q https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/v2.10.2 -O - | tar -xz &>/dev/null
|
||||
cd nginx-proxy-manager-2.10.2
|
||||
msg_ok "Downloaded NPM v2.10.2"
|
||||
|
||||
msg_info "Setting up Enviroment"
|
||||
ln -sf /usr/bin/python3 /usr/bin/python
|
||||
ln -sf /usr/bin/certbot /opt/certbot/bin/certbot
|
||||
ln -sf /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx
|
||||
ln -sf /usr/local/openresty/nginx/ /etc/nginx
|
||||
sed -i "s+0.0.0+2.9.22+g" backend/package.json
|
||||
sed -i "s+0.0.0+2.9.22+g" frontend/package.json
|
||||
sed -i "s+0.0.0+2.10.2+g" backend/package.json
|
||||
sed -i "s+0.0.0+2.10.2+g" frontend/package.json
|
||||
sed -i 's+^daemon+#daemon+g' docker/rootfs/etc/nginx/nginx.conf
|
||||
NGINX_CONFS=$(find "$(pwd)" -type f -name "*.conf")
|
||||
for NGINX_CONF in $NGINX_CONFS; do
|
||||
|
@ -124,6 +124,11 @@ function update_script() {
|
|||
mkdir -p /app/global /app/frontend/images
|
||||
cp -r backend/* /app
|
||||
cp -r global/* /app/global
|
||||
wget -q "https://github.com/just-containers/s6-overlay/releases/download/v3.1.4.1/s6-overlay-noarch.tar.xz"
|
||||
wget -q "https://github.com/just-containers/s6-overlay/releases/download/v3.1.4.1/s6-overlay-x86_64.tar.xz"
|
||||
tar -C / -Jxpf s6-overlay-noarch.tar.xz
|
||||
tar -C / -Jxpf s6-overlay-x86_64.tar.xz
|
||||
python3 -m pip install --no-cache-dir certbot-dns-cloudflare &>/dev/null
|
||||
msg_ok "Setup Enviroment"
|
||||
|
||||
msg_info "Building Frontend"
|
||||
|
@ -158,13 +163,14 @@ EOF
|
|||
msg_ok "Initialized Backend"
|
||||
|
||||
msg_info "Starting Services"
|
||||
sed -i -e 's/^pid/#pid/' -e 's/npmuser/root/' /usr/local/openresty/nginx/conf/nginx.conf
|
||||
systemctl enable npm &>/dev/null
|
||||
systemctl start openresty
|
||||
systemctl start npm
|
||||
msg_ok "Started Services"
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -rf ~/nginx-proxy-manager-*
|
||||
rm -rf ~/nginx-proxy-manager-* s6-overlay-noarch.tar.xz s6-overlay-x86_64.tar.xz
|
||||
msg_ok "Cleaned"
|
||||
|
||||
msg_ok "Update Successfull"
|
||||
|
|
|
@ -57,58 +57,80 @@ function default_settings() {
|
|||
function update_script() {
|
||||
if [[ ! -f /etc/systemd/system/homeassistant.service ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
|
||||
UPD=$(whiptail --title "UPDATE" --radiolist --cancel-button Exit-Script "Spacebar = Select" 11 58 4 \
|
||||
"1" "Update Podman" ON \
|
||||
"1" "Update system and containers" ON \
|
||||
"2" "Install HACS" OFF \
|
||||
"3" "Install FileBrowser" OFF \
|
||||
"4" "Remove ALL Unused Images" OFF \
|
||||
3>&1 1>&2 2>&3)
|
||||
header_info
|
||||
if [ "$UPD" == "1" ]; then
|
||||
msg_info "Updating ${APP} LXC"
|
||||
apt-get update &>/dev/null
|
||||
apt-get -y upgrade &>/dev/null
|
||||
msg_ok "Updated ${APP} LXC"
|
||||
msg_ok "Update Successfull"
|
||||
exit
|
||||
msg_info "Updating ${APP} LXC"
|
||||
apt-get update &>/dev/null
|
||||
apt-get -y upgrade &>/dev/null
|
||||
msg_ok "Updated ${APP} LXC"
|
||||
msg_ok "Update os system Successfull"
|
||||
|
||||
msg_info "Updating All Containers\n"
|
||||
CONTAINER_LIST="${1:-$(podman ps -q)}"
|
||||
for container in ${CONTAINER_LIST}; do
|
||||
CONTAINER_IMAGE="$(podman inspect --format "{{.Config.Image}}" --type container ${container})"
|
||||
RUNNING_IMAGE="$(podman inspect --format "{{.Image}}" --type container "${container}")"
|
||||
podman pull "docker.io/${CONTAINER_IMAGE}"
|
||||
LATEST_IMAGE="$(podman inspect --format "{{.Id}}" --type image "${CONTAINER_IMAGE}")"
|
||||
if [[ "${RUNNING_IMAGE}" != "${LATEST_IMAGE}" ]]; then
|
||||
echo "Updating ${container} image ${CONTAINER_IMAGE}"
|
||||
systemctl restart homeassistant
|
||||
fi
|
||||
done
|
||||
msg_ok "All containers updated."
|
||||
exit
|
||||
fi
|
||||
if [ "$UPD" == "2" ]; then
|
||||
msg_info "Installing Home Assistant Comunity Store (HACS)"
|
||||
apt update &>/dev/null
|
||||
apt install unzip &>/dev/null
|
||||
cd /var/lib/containers/storage/volumes/hass_config/_data
|
||||
bash <(curl -fsSL https://get.hacs.xyz) &>/dev/null
|
||||
msg_ok "Installed Home Assistant Comunity Store (HACS)"
|
||||
echo -e "\n Reboot Home Assistant and clear browser cache then Add HACS integration.\n"
|
||||
exit
|
||||
msg_info "Installing Home Assistant Comunity Store (HACS)"
|
||||
apt update &>/dev/null
|
||||
apt install unzip &>/dev/null
|
||||
cd /var/lib/containers/storage/volumes/hass_config/_data
|
||||
bash <(curl -fsSL https://get.hacs.xyz) &>/dev/null
|
||||
msg_ok "Installed Home Assistant Comunity Store (HACS)"
|
||||
echo -e "\n Reboot Home Assistant and clear browser cache then Add HACS integration.\n"
|
||||
exit
|
||||
fi
|
||||
if [ "$UPD" == "3" ]; then
|
||||
IP=$(hostname -I | awk '{print $1}')
|
||||
msg_info "Installing FileBrowser"
|
||||
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash &>/dev/null
|
||||
filebrowser config init -a '0.0.0.0' &>/dev/null
|
||||
filebrowser config set -a '0.0.0.0' &>/dev/null
|
||||
filebrowser users add admin changeme --perm.admin &>/dev/null
|
||||
msg_ok "Installed FileBrowser"
|
||||
IP=$(hostname -I | awk '{print $1}')
|
||||
msg_info "Installing FileBrowser"
|
||||
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash &>/dev/null
|
||||
filebrowser config init -a '0.0.0.0' &>/dev/null
|
||||
filebrowser config set -a '0.0.0.0' &>/dev/null
|
||||
filebrowser users add admin changeme --perm.admin &>/dev/null
|
||||
msg_ok "Installed FileBrowser"
|
||||
|
||||
msg_info "Creating Service"
|
||||
service_path="/etc/systemd/system/filebrowser.service"
|
||||
echo "[Unit]
|
||||
Description=Filebrowser
|
||||
After=network-online.target
|
||||
[Service]
|
||||
User=root
|
||||
WorkingDirectory=/root/
|
||||
ExecStart=/usr/local/bin/filebrowser -r /
|
||||
[Install]
|
||||
WantedBy=default.target" >$service_path
|
||||
msg_info "Creating Service"
|
||||
service_path="/etc/systemd/system/filebrowser.service"
|
||||
echo "[Unit]
|
||||
Description=Filebrowser
|
||||
After=network-online.target
|
||||
[Service]
|
||||
User=root
|
||||
WorkingDirectory=/root/
|
||||
ExecStart=/usr/local/bin/filebrowser -r /
|
||||
[Install]
|
||||
WantedBy=default.target" >$service_path
|
||||
|
||||
systemctl enable --now filebrowser.service &>/dev/null
|
||||
msg_ok "Created Service"
|
||||
systemctl enable --now filebrowser.service &>/dev/null
|
||||
msg_ok "Created Service"
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "FileBrowser should be reachable by going to the following URL.
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "FileBrowser should be reachable by going to the following URL.
|
||||
${BL}http://$IP:8080${CL} admin|changeme\n"
|
||||
exit
|
||||
exit
|
||||
fi
|
||||
if [ "$UPD" == "4" ]; then
|
||||
msg_info "Removing ALL Unused Images"
|
||||
podman image prune -a -f
|
||||
msg_ok "Removed ALL Unused Images"
|
||||
exit
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
start
|
||||
|
|
|
@ -40,7 +40,7 @@ $STD python3 -m venv /opt/certbot/
|
|||
if [ "$(getconf LONG_BIT)" = "32" ]; then
|
||||
$STD python3 -m pip install --no-cache-dir -U cryptography==3.3.2
|
||||
fi
|
||||
$STD python3 -m pip install --no-cache-dir cffi certbot
|
||||
$STD python3 -m pip install --no-cache-dir cffi certbot certbot-dns-cloudflare
|
||||
msg_ok "Installed Python"
|
||||
|
||||
msg_info "Installing Openresty"
|
||||
|
@ -66,10 +66,10 @@ RELEASE=$(curl -s https://api.github.com/repos/NginxProxyManager/nginx-proxy-man
|
|||
grep "tag_name" |
|
||||
awk '{print substr($2, 3, length($2)-4) }')
|
||||
|
||||
msg_info "Downloading Nginx Proxy Manager v2.9.22"
|
||||
wget -q https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/v2.9.22 -O - | tar -xz
|
||||
cd ./nginx-proxy-manager-2.9.22
|
||||
msg_ok "Downloaded Nginx Proxy Manager v2.9.22"
|
||||
msg_info "Downloading Nginx Proxy Manager v2.10.2"
|
||||
wget -q https://codeload.github.com/NginxProxyManager/nginx-proxy-manager/tar.gz/v2.10.2 -O - | tar -xz
|
||||
cd ./nginx-proxy-manager-2.10.2
|
||||
msg_ok "Downloaded Nginx Proxy Manager v2.10.2"
|
||||
|
||||
msg_info "Setting up Enviroment"
|
||||
ln -sf /usr/bin/python3 /usr/bin/python
|
||||
|
@ -77,8 +77,8 @@ ln -sf /usr/bin/certbot /opt/certbot/bin/certbot
|
|||
ln -sf /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx
|
||||
ln -sf /usr/local/openresty/nginx/ /etc/nginx
|
||||
|
||||
sed -i "s+0.0.0+2.9.22+g" backend/package.json
|
||||
sed -i "s+0.0.0+2.9.22+g" frontend/package.json
|
||||
sed -i "s+0.0.0+2.10.2+g" backend/package.json
|
||||
sed -i "s+0.0.0+2.10.2+g" frontend/package.json
|
||||
|
||||
sed -i 's+^daemon+#daemon+g' docker/rootfs/etc/nginx/nginx.conf
|
||||
NGINX_CONFS=$(find "$(pwd)" -type f -name "*.conf")
|
||||
|
@ -124,6 +124,10 @@ fi
|
|||
mkdir -p /app/global /app/frontend/images
|
||||
cp -r backend/* /app
|
||||
cp -r global/* /app/global
|
||||
wget -q "https://github.com/just-containers/s6-overlay/releases/download/v3.1.4.1/s6-overlay-noarch.tar.xz"
|
||||
wget -q "https://github.com/just-containers/s6-overlay/releases/download/v3.1.4.1/s6-overlay-x86_64.tar.xz"
|
||||
tar -C / -Jxpf s6-overlay-noarch.tar.xz
|
||||
tar -C / -Jxpf s6-overlay-x86_64.tar.xz
|
||||
msg_ok "Set up Enviroment"
|
||||
|
||||
msg_info "Building Frontend"
|
||||
|
@ -181,12 +185,13 @@ motd_ssh
|
|||
root
|
||||
|
||||
msg_info "Starting Services"
|
||||
sed -i -e 's/^pid/#pid/' -e 's/npmuser/root/' /usr/local/openresty/nginx/conf/nginx.conf
|
||||
$STD systemctl enable --now openresty
|
||||
$STD systemctl enable --now npm
|
||||
msg_ok "Started Services"
|
||||
|
||||
msg_info "Cleaning up"
|
||||
rm -rf ../nginx-proxy-manager-*
|
||||
rm -rf ../nginx-proxy-manager-* s6-overlay-noarch.tar.xz s6-overlay-x86_64.tar.xz
|
||||
$STD apt-get autoremove
|
||||
$STD apt-get autoclean
|
||||
msg_ok "Cleaned"
|
||||
|
|
Loading…
Reference in New Issue