Compare commits

..

4 Commits

Author SHA1 Message Date
tteckster 72de387b5c
Update install.func
update the script to include IPv6 connectivity considerations
2024-02-02 07:40:50 -05:00
tteckster 29e012d282
Update CHANGELOG.md 2024-02-02 07:33:17 -05:00
tteckster 65a9ed0aea
Create readeck-install.sh 2024-02-02 07:18:48 -05:00
tteckster 74c47c8b07
Create readeck.sh 2024-02-02 07:17:43 -05:00
4 changed files with 158 additions and 7 deletions

View File

@ -9,6 +9,13 @@
- 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.
## 2024-02-02
### Changed
- **Readeck LXC**
- NEW Script
## 2024-01-25
### Changed

68
ct/readeck.sh Normal file
View File

@ -0,0 +1,68 @@
#!/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="Readeck"
var_disk="2"
var_cpu="1"
var_ram="512"
var_os="debian"
var_version="12"
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
}
function update_script() {
header_info
if [[ ! -d /opt/readeck ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
msg_error "There is currently no update path available."
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${APP} should be reachable by going to the following URL.
${BL}http://${IP}:8000${CL}\n"

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 Readeck"
mkdir -p /opt/readeck
cd /opt/readeck
wget -q -O readeck https://codeberg.org/readeck/readeck/releases/download/0.11.2/readeck-0.11.2-linux-amd64
chmod a+x readeck
msg_ok "Installed Readeck"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/readeck.service
[Unit]
Description=Readeck Service
After=network.target
[Service]
Environment=READECK_SERVER_HOST=0.0.0.0
Environment=READECK_SERVER_PORT=8000
ExecStart=/opt/readeck/./readeck serve
WorkingDirectory=/opt/readeck
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now readeck.service
msg_ok "Created Service"
motd_ssh
customize
msg_info "Cleaning up"
$STD apt-get autoremove
$STD apt-get autoclean
msg_ok "Cleaned"

View File

@ -112,16 +112,38 @@ setting_up_container() {
network_check() {
set +e
trap - ERR
if ping -c 1 -W 1 1.1.1.1 &>/dev/null; then msg_ok "Internet Connected"; else
msg_error "Internet NOT Connected"
read -r -p "Would you like to continue anyway? <y/N> " prompt
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
# Check if IPv4 is being used
if ip -o -4 addr show | grep -q "scope global"; then
if ping -c 1 -W 1 1.1.1.1 &>/dev/null; then
msg_ok "IPv4 Internet Connected";
else
echo -e " 🖧 Check Network Settings"
exit 1
msg_error "IPv4 Internet Not Connected";
read -r -p "Would you like to continue anyway? <y/N> " prompt
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
else
echo -e " 🖧 Check Network Settings"
exit 1
fi
fi
fi
# Check if IPv6 is being used
if ip -o -6 addr show | grep -q "scope global"; then
if ping6 -c 1 -W 1 2606:4700:4700::1111 &>/dev/null; then
msg_ok "IPv6 Internet Connected";
else
msg_error "IPv6 Internet Not Connected";
read -r -p "Would you like to continue anyway? <y/N> " prompt
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
else
echo -e " 🖧 Check Network Settings"
exit 1
fi
fi
fi
RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
set -e