mirror of https://github.com/tteck/Proxmox.git
Compare commits
7 Commits
8b7820b03a
...
4c5f70b7bf
Author | SHA1 | Date |
---|---|---|
|
4c5f70b7bf | |
|
e8501df16e | |
|
e79b61c138 | |
|
5f3bd5904e | |
|
df25fe9446 | |
|
c73a2909f7 | |
|
e27191e607 |
|
@ -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.
|
- 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
|
## 2024-01-04
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -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"
|
|
@ -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"
|
|
@ -34,8 +34,6 @@ catch_errors() {
|
||||||
}
|
}
|
||||||
|
|
||||||
error_handler() {
|
error_handler() {
|
||||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID; fi
|
|
||||||
printf "\e[?25h"
|
|
||||||
local exit_code="$?"
|
local exit_code="$?"
|
||||||
local line_number="$1"
|
local line_number="$1"
|
||||||
local command="$2"
|
local command="$2"
|
||||||
|
@ -43,37 +41,17 @@ error_handler() {
|
||||||
echo -e "\n$error_message\n"
|
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() {
|
msg_info() {
|
||||||
local msg="$1"
|
local msg="$1"
|
||||||
echo -ne " ${HOLD} ${YW}${msg} "
|
echo -ne " ${HOLD} ${YW}${msg}..."
|
||||||
spinner &
|
|
||||||
SPINNER_PID=$!
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# This function displays a success message with a green color.
|
|
||||||
msg_ok() {
|
msg_ok() {
|
||||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID; fi
|
|
||||||
printf "\e[?25h"
|
|
||||||
local msg="$1"
|
local msg="$1"
|
||||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# This function displays a error message with a red color.
|
|
||||||
msg_error() {
|
msg_error() {
|
||||||
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID; fi
|
|
||||||
printf "\e[?25h"
|
|
||||||
local msg="$1"
|
local msg="$1"
|
||||||
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue