Compare commits

...

7 Commits

Author SHA1 Message Date
tteckster d5b91a44d0
Update CHANGELOG.md 2024-05-08 00:26:06 -04:00
tteckster fc997a9f36
Create kernel-pin.sh 2024-05-08 00:08:39 -04:00
tteckster 1aff71d17f
Update pocketbase.sh
tweak
2024-05-07 21:22:04 -04:00
tteckster 4a36166929
Update CHANGELOG.md 2024-05-07 17:25:53 -04:00
tteckster 0209c9a7cd
Update CHANGELOG.md 2024-05-07 17:22:49 -04:00
tteckster c3cd3636e6
Update pocketbase.sh
tweak
2024-05-07 17:19:03 -04:00
Bram Suurd 9b96a64401
Pocketbase LXC script (#2929) 2024-05-07 17:13:55 -04:00
4 changed files with 199 additions and 0 deletions

View File

@ -10,6 +10,20 @@
- All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment.
- 🚨 **The scripts in the repository will no longer provide support for Proxmox VE 7 starting from July 2024 (scripts will not execute on PVE7). Subsequent <a href='https://forum.proxmox.com/threads/proxmox-ve-support-lifecycle.35755/' target='_blank' rel='noopener noreferrer'>Proxmox VE - Support Lifecycle</a>**
## 2024-05-08
### Changed
- **Kernel Pin**
- NEW Script
## 2024-05-07
### Changed
- **Pocketbase LXC**
- NEW Script
## 2024-05-05
### Changed

61
ct/pocketbase.sh Normal file
View File

@ -0,0 +1,61 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func)
# Copyright (c) 2021-2024 tteck
# Author: tteck (tteckster)
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
function header_info {
clear
cat <<"EOF"
____ __ __ __
/ __ \____ _____/ /_____ / /_/ /_ ____ _________
/ /_/ / __ \/ ___/ //_/ _ \/ __/ __ \/ __ `/ ___/ _ \
/ ____/ /_/ / /__/ ,< / __/ /_/ /_/ / /_/ (__ ) __/
/_/ \____/\___/_/|_|\___/\__/_.___/\__,_/____/\___/
EOF
}
header_info
echo -e "Loading..."
APP="Pocketbase"
var_disk="8"
var_cpu="1"
var_ram="512"
var_os="ubuntu"
var_version="22.04"
variables
color
catch_errors
function default_settings() {
CT_TYPE="1"
PW=""
CT_ID=$NEXTID
HN=$NSAPP
DISK_SIZE="$var_disk"
CORE_COUNT="$var_cpu"
RAM_SIZE="$var_ram"
BRG="vmbr0"
NET="dhcp"
GATE=""
APT_CACHER=""
APT_CACHER_IP=""
DISABLEIP6="no"
MTU=""
SD=""
NS=""
MAC=""
VLAN=""
SSH="no"
VERB="no"
echo_default
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8080/_${CL}"

View File

@ -0,0 +1,54 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2024 tteck
# Author: tteck (tteckster)
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y curl
$STD apt-get install -y sudo
$STD apt-get install -y mc
msg_ok "Installed Dependencies"
msg_info "Installing Pocketbase"
RELEASE=$(curl -s https://api.github.com/repos/pocketbase/pocketbase/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
wget -q https://github.com/pocketbase/pocketbase/releases/download/v${RELEASE}/pocketbase_${RELEASE}_linux_amd64.zip -O /tmp/pocketbase.zip
mkdir -p /opt/pocketbase/{pb_public,pb_migrations,pb_hooks}
unzip -q -o /tmp/pocketbase.zip -d /opt/pocketbase
cat <<EOF >/etc/systemd/system/pocketbase.service
[Unit]
Description = pocketbase
[Service]
Type = simple
LimitNOFILE = 4096
Restart = always
RestartSec = 5s
StandardOutput = append:/opt/pocketbase/errors.log
StandardError = append:/opt/pocketbase/errors.log
ExecStart = /opt/pocketbase/pocketbase serve --http=0.0.0.0:8080
[Install]
WantedBy = multi-user.target
EOF
systemctl enable -q --now pocketbase.service
msg_ok "Installed Pocketbase"
motd_ssh
customize
msg_info "Cleaning up"
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"

70
misc/kernel-pin.sh Normal file
View File

@ -0,0 +1,70 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2024 tteck
# Author: tteck (tteckster)
# License: MIT
# https://github.com/tteck/Proxmox/raw/main/LICENSE
function header_info {
clear
cat <<"EOF"
__ __ __ ____ _
/ //_/__ _________ ___ / / / __ \(_)___
/ ,< / _ \/ ___/ __ \/ _ \/ / / /_/ / / __ \
/ /| / __/ / / / / / __/ / / ____/ / / / /
/_/ |_\___/_/ /_/ /_/\___/_/ /_/ /_/_/ /_/
EOF
}
YW=$(echo "\033[33m")
RD=$(echo "\033[01;31m")
GN=$(echo "\033[1;92m")
CL=$(echo "\033[m")
BFR="\\r\\033[K"
HOLD="-"
CM="${GN}${CL}"
current_kernel=$(uname -r)
available_kernels=$(dpkg --list | grep 'kernel-.*-pve' | awk '{print substr($2, 16, length($2)-22)}')
header_info
function msg_info() {
local msg="$1"
echo -ne " ${HOLD} ${YW}${msg}..."
}
function msg_ok() {
local msg="$1"
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
}
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Proxmox VE Kernel Pin" --yesno "This will Pin/Unpin Kernel Images, Proceed?" 10 68 || exit
KERNEL_MENU=()
MSG_MAX_LENGTH=0
while read -r TAG ITEM; do
OFFSET=2
((${#ITEM} + OFFSET > MSG_MAX_LENGTH)) && MSG_MAX_LENGTH=${#ITEM}+OFFSET
KERNEL_MENU+=("$TAG" "$ITEM " "OFF")
done < <(echo "$available_kernels")
pin_kernel=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Current Kernel $current_kernel" --radiolist "\nSelect Kernel to pin:\nCancel to Unpin any Kernel" 16 $((MSG_MAX_LENGTH + 58)) 6 "${KERNEL_MENU[@]}" 3>&1 1>&2 2>&3 | tr -d '"') || exit
[ -z "$pin_kernel" ] && {
whiptail --backtitle "Proxmox VE Helper Scripts" --title "No Kernel Selected" --msgbox "It appears that no Kernel was selected\nUnpinning any pinned Kernel" 10 68
msg_info "Unpinning any Kernel"
proxmox-boot-tool kernel unpin &>/dev/null
msg_ok "Unpinned any Kernel\n"
proxmox-boot-tool kernel list
echo ""
msg_ok "Finished\n"
echo -e "${RD} REBOOT${CL}"
exit
}
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Proxmox VE Kernel Pin" --yesno "Would you like to pin the $pin_kernel Kernel?" 10 68 || exit
msg_info "Pinning $pin_kernel"
proxmox-boot-tool kernel pin $pin_kernel &>/dev/null
msg_ok "Successfully Pinned $pin_kernel\n"
proxmox-boot-tool kernel list
echo ""
msg_ok "Finished\n"
echo -e "${RD} REBOOT${CL}"