Compare commits

...

7 Commits

Author SHA1 Message Date
tteckster 4c5f70b7bf
Update CHANGELOG.md 2024-01-07 12:24:55 -05:00
tteckster e8501df16e
Create sftpgo.sh 2024-01-07 12:01:21 -05:00
tteckster e79b61c138
Create sftpgo-install.sh 2024-01-07 12:00:24 -05:00
tteckster 5f3bd5904e
Update alpine-install.func
no spinner allowed
2024-01-07 10:50:17 -05:00
tteckster df25fe9446
Update alpine-install.func
add spinner, attempt 3
2024-01-07 10:43:29 -05:00
tteckster c73a2909f7
Update alpine-install.func
add spinner, attempt 2
2024-01-07 10:36:15 -05:00
tteckster e27191e607
Update alpine-install.func
revert add spinner
2024-01-07 09:41:22 -05:00
4 changed files with 124 additions and 23 deletions

View File

@ -7,6 +7,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-01-07
### Changed
- **SFTPGo LXC**
- NEW Script
## 2024-01-04
### Changed

69
ct/sftpgo.sh Normal file
View File

@ -0,0 +1,69 @@
#!/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="SFTPGo"
var_disk="4"
var_cpu="2"
var_ram="2048"
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=""
DISABLEIP6="no"
MTU=""
SD=""
NS=""
MAC=""
VLAN=""
SSH="no"
VERB="no"
echo_default
}
function update_script() {
header_info
if [[ ! -d /var ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
msg_info "Updating $APP LXC"
apt-get update &>/dev/null
apt-get -y upgrade &>/dev/null
msg_ok "Updated $APP LXC"
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}:8080/web/admin ${CL} \n"

47
install/sftpgo-install.sh Normal file
View File

@ -0,0 +1,47 @@
#!/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
$STD apt-get install -y gpg
$STD apt-get install -y sqlite3
msg_ok "Installed Dependencies"
msg_info "Installing Golang"
set +o pipefail
RELEASE=$(curl -s https://go.dev/dl/ | grep -o "go.*\linux-amd64.tar.gz" | head -n 1)
wget -q https://golang.org/dl/$RELEASE
tar -xzf $RELEASE -C /usr/local
$STD ln -s /usr/local/go/bin/go /usr/local/bin/go
set -o pipefail
msg_ok "Installed Golang"
msg_info "Installing SFTPGo"
curl -sS https://ftp.osuosl.org/pub/sftpgo/apt/gpg.key | gpg --dearmor -o /usr/share/keyrings/sftpgo-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/sftpgo-archive-keyring.gpg] https://ftp.osuosl.org/pub/sftpgo/apt bookworm main" >/etc/apt/sources.list.d/sftpgo.list
$STD apt-get update
$STD apt-get install -y sftpgo
msg_ok "Installed SFTPGo"
motd_ssh
customize
msg_info "Cleaning up"
rm -rf $RELEASE
$STD apt-get autoremove
$STD apt-get autoclean
msg_ok "Cleaned"

View File

@ -34,8 +34,6 @@ catch_errors() {
}
error_handler() {
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID; fi
printf "\e[?25h"
local exit_code="$?"
local line_number="$1"
local command="$2"
@ -43,37 +41,17 @@ error_handler() {
echo -e "\n$error_message\n"
}
# This function displays a spinner.
spinner() {
printf "\e[?25l"
spinner="/-\\|/-\\|"
spin_i=0
while true; do
printf "\b%s" "${spinner:spin_i++%${#spinner}:1}"
sleep 0.1
done
}
# This function displays an informational message with a yellow color.
msg_info() {
local msg="$1"
echo -ne " ${HOLD} ${YW}${msg} "
spinner &
SPINNER_PID=$!
echo -ne " ${HOLD} ${YW}${msg}..."
}
# This function displays a success message with a green color.
msg_ok() {
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID; fi
printf "\e[?25h"
local msg="$1"
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
}
# This function displays a error message with a red color.
msg_error() {
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID; fi
printf "\e[?25h"
local msg="$1"
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
}