Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Sam Heinz
2025-05-19 20:18:49 +10:00
69 changed files with 2036 additions and 1122 deletions

View File

@@ -67,6 +67,7 @@ Example:
>
> - Add your username
> - When updating/reworking scripts, add "| Co-Author [YourUserName]"
> - Source is a URL of github repo containting source files of the application you're installing (not URL of your homepage or a blog)
### 1.3 **Variables and function import**
@@ -110,11 +111,8 @@ Example:
```bash
$STD apt-get install -y \
curl \
composer \
git \
sudo \
mc \
nginx
```
@@ -154,7 +152,7 @@ Example for a git release:
```bash
RELEASE=$(curl -fsSL https://api.github.com/repos/snipe/snipe-it/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
wget -q "https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE}.zip"
curl -fsSL "https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE}.zip" -o "v${RELEASE}.zip"
```
### 5.2 **Save the version for update checks**
@@ -165,7 +163,7 @@ wget -q "https://github.com/snipe/snipe-it/archive/refs/tags/v${RELEASE}.zip"
Example:
```bash
echo "${RELEASE}" >"/opt/AppName_version.txt"
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
```
---
@@ -177,6 +175,7 @@ echo "${RELEASE}" >"/opt/AppName_version.txt"
- Use standard functions like `msg_info`, `msg_ok` or `msg_error` to print status messages.
- Each `msg_info` must be followed with a `msg_ok` before any other output is made.
- Display meaningful progress messages at key stages.
- Taking user input with `read -p` must be outside of `msg_info`...`msg_ok` code block
Example:
@@ -184,6 +183,8 @@ Example:
msg_info "Installing Dependencies"
$STD apt-get install -y ...
msg_ok "Installed Dependencies"
read -p "${TAB3}Do you wish to enable HTTPS mode? (y/N): " httpschoice
```
### 6.2 **Verbosity**

View File

@@ -6,7 +6,7 @@
# Source: [SOURCE_URL]
# Import Functions und Setup
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
@@ -34,30 +34,28 @@ $STD mysql -u root -e "CREATE DATABASE $DB_NAME;"
$STD mysql -u root -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED WITH mysql_native_password AS PASSWORD('$DB_PASS');"
$STD mysql -u root -e "GRANT ALL ON $DB_NAME.* TO '$DB_USER'@'localhost'; FLUSH PRIVILEGES;"
{
echo "${APPLICATION} Credentials"
echo "Database User: $DB_USER"
echo "Database Password: $DB_PASS"
echo "Database Name: $DB_NAME"
} >> ~/$APP_NAME.creds
echo "${APPLICATION} Credentials"
echo "Database User: $DB_USER"
echo "Database Password: $DB_PASS"
echo "Database Name: $DB_NAME"
} >>~/"$APP_NAME".creds
msg_ok "Set up Database"
# Temp
# Setup App
msg_info "Setup ${APPLICATION}"
RELEASE=$(curl -fsSL https://api.github.com/repos/[REPO]/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
curl -fsSL -o "${RELEASE}.zip" "https://github.com/[REPO]/archive/refs/tags/${RELEASE}.zip"
unzip -q "${RELEASE}.zip"
mv "${APPLICATION}-${RELEASE}/" "/opt/${APPLICATION}"
#
#
#
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
#
#
echo "${RELEASE}" >/opt/"${APPLICATION}"_version.txt
msg_ok "Setup ${APPLICATION}"
# Creating Service (if needed)
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/${APPLICATION}.service
cat <<EOF >/etc/systemd/system/"${APPLICATION}".service
[Unit]
Description=${APPLICATION} Service
After=network.target
@@ -69,7 +67,7 @@ Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now ${APPLICATION}
systemctl enable -q --now "${APPLICATION}"
msg_ok "Created Service"
motd_ssh
@@ -77,7 +75,7 @@ customize
# Cleanup
msg_info "Cleaning up"
rm -f ${RELEASE}.zip
rm -f "${RELEASE}".zip
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"
msg_ok "Cleaned"