Compare commits

...

5 Commits

Author SHA1 Message Date
Kristo Copani
7a0370c8ec
Merge c5d9a8bd9f into db1950a2bb 2024-12-16 13:41:25 -08:00
Rémi Bédard-Couture
db1950a2bb
Fix variable name for CT_TYPE override (#855) 2024-12-16 22:41:01 +01:00
community-scripts-pr-app[bot]
f449ca707a
Update CHANGELOG.md (#852)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-12-16 18:23:38 +01:00
Rémi Bédard-Couture
e410bdbf5e
Keeps the same style after writing the SEARCH icon (#851) 2024-12-16 18:21:41 +01:00
Kristo Copani
c5d9a8bd9f re-add files 2024-11-30 02:02:06 +02:00
5 changed files with 227 additions and 3 deletions

View File

@ -31,13 +31,17 @@ Do not break established syntax in this file, as it is automatically updated by
### 🚀 Updated Scripts
- Update Script: Remove Docker Compose Question [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#847](https://github.com/community-scripts/ProxmoxVE/pull/847))
- Increase Size | Description & Download-URL of Debian VM [@MickLesk](https://github.com/MickLesk) ([#837](https://github.com/community-scripts/ProxmoxVE/pull/837))
- Update Script: Remove Docker Compose Question [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#847](https://github.com/community-scripts/ProxmoxVE/pull/847))
### 🌐 Website
- Bump nanoid from 3.3.7 to 3.3.8 in /frontend [@dependabot[bot]](https://github.com/dependabot[bot]) ([#845](https://github.com/community-scripts/ProxmoxVE/pull/845))
### ❔ Unlabelled
- Keeps the same style after writing the SEARCH icon [@remz1337](https://github.com/remz1337) ([#851](https://github.com/community-scripts/ProxmoxVE/pull/851))
## 2024-12-13
### Changed

97
ct/semaphore.sh Normal file
View File

@ -0,0 +1,97 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/kristocopani/ProxmoxVE/build/misc/build.func)
# Copyright (c) 2021-2024 community-scripts ORG
# Author: kristocopani
# License: MIT
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
function header_info {
clear
cat <<"EOF"
_____ __
/ ___/___ ____ ___ ____ _____ / /_ ____ ________
\__ \/ _ \/ __ `__ \/ __ `/ __ \/ __ \/ __ \/ ___/ _ \
___/ / __/ / / / / / /_/ / /_/ / / / / /_/ / / / __/
/____/\___/_/ /_/ /_/\__,_/ .___/_/ /_/\____/_/ \___/
/_/
EOF
}
header_info
echo -e "Loading..."
APP="Semaphore"
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=""
APT_CACHER=""
APT_CACHER_IP=""
DISABLEIP6="no"
MTU=""
SD=""
NS=""
MAC=""
VLAN=""
SSH="no"
VERB="no"
echo_default
}
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /etc/systemd/system/semaphore.service ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -s https://api.github.com/repos/semaphoreui/semaphore/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping Service"
systemctl stop semaphore
msg_ok "Stopped Service"
msg_info "Updating ${APP} to v${RELEASE}"
cd /opt
wget -q https://github.com/semaphoreui/semaphore/releases/download/v${RELEASE}/semaphore_${RELEASE}_linux_amd64.deb
dpkg -i semaphore_${RELEASE}_linux_amd64.deb &>/dev/null
echo "${RELEASE}" >"/opt/${APP}_version.txt"
msg_ok "Updated ${APP} to v${RELEASE}"
msg_info "Starting Service"
systemctl start semaphore
msg_ok "Started Service"
msg_info "Cleaning up"
rm -rf /opt/semaphore_${RELEASE}_linux_amd64.deb
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at v${RELEASE}."
fi
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${APP} server should be reachable by connecting to the following server.
${BL}http://${IP}:3000${CL} \n"

View File

@ -0,0 +1,84 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2024 community-scripts ORG
# Author: kristocopani
# License: MIT
# https://github.com/community-scripts/ProxmoxVE/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 \
mc \
git \
gpg \
sudo
UBUNTU_CODENAME=jammy
wget -qO- "https://keyserver.ubuntu.com/pks/lookup?fingerprint=on&op=get&search=0x6125E2A8C77F2818FB7BD15B93C4A3FD7BB9C367" | gpg --dearmour >/usr/share/keyrings/ansible-archive-keyring.gpg
$STD echo "deb [signed-by=/usr/share/keyrings/ansible-archive-keyring.gpg] http://ppa.launchpad.net/ansible/ansible/ubuntu $UBUNTU_CODENAME main" | tee /etc/apt/sources.list.d/ansible.list
$STD apt update
$STD apt install -y \
ansible
msg_ok "Installed Dependencies"
msg_info "Installing Semaphore"
RELEASE=$(curl -s https://api.github.com/repos/semaphoreui/semaphore/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
mkdir -p /opt/semaphore
cd /opt/semaphore
wget -q https://github.com/semaphoreui/semaphore/releases/download/v${RELEASE}/semaphore_${RELEASE}_linux_amd64.deb
$STD dpkg -i semaphore_${RELEASE}_linux_amd64.deb
rm -rf semaphore_${RELEASE}_linux_amd64.deb
json_cookie_hash=$(head -c32 /dev/urandom | base64)
json_cookie_encryption=$(head -c32 /dev/urandom | base64)
json_access_key_encryption=$(head -c32 /dev/urandom | base64)
cat <<EOF >/opt/semaphore/config.json
{
"bolt": {
"host": "/opt/semaphore/semaphore_db.bolt"
},
"tmp_path": "/opt/semaphore/tmp",
"cookie_hash": "${json_cookie_hash}",
"cookie_encryption": "${json_cookie_encryption}",
"access_key_encryption": "${json_access_key_encryption}"
}
EOF
$STD semaphore user add --admin --login admin --email admin@example.com --name Administrator --password admin --config /opt/semaphore/config.json
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
msg_ok "Installed Semaphore"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/semaphore.service
[Unit]
Description=Semaphore UI
Documentation=https://docs.semaphoreui.com/
Wants=network-online.target
After=network-online.target
[Service]
ExecStart=/usr/bin/semaphore server --config /opt/semaphore/config.json
Restart=always
RestartSec=10s
[Install]
WantedBy=multi-user.target
EOF
systemctl enable --now -q semaphore.service
msg_ok "Created Service"
motd_ssh
customize
msg_info "Cleaning up"
rm -rf semaphore_${RELEASE}_linux_amd64.deb
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"

39
json/semaphore.json Normal file
View File

@ -0,0 +1,39 @@
{
"name": "Semaphore",
"slug": "semaphore",
"categories": [
11
],
"date_created": "2024-11-29",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": 3000,
"documentation": "https://docs.semaphoreui.com/",
"website": "https://semaphoreui.com/",
"logo": "https://docs.semaphoreui.com/favicon.png?x=",
"description": "Semaphore UI is a modern web interface for managing popular DevOps tools",
"install_methods": [
{
"type": "default",
"script": "/ct/semaphore.sh",
"resources": {
"cpu": 2,
"ram": 2048,
"hdd": 4,
"os": "Debian",
"version": "12"
}
}
],
"default_credentials": {
"username": "admin",
"password": "admin"
},
"notes": [
{
"text": "This instance uses BoltDB",
"type": "info"
}
]
}

View File

@ -204,7 +204,7 @@ base_settings() {
TAGS="community-script;"
# Override default settings with variables from ct script
CT_TYPE=${var_privileged:-$CT_TYPE}
CT_TYPE=${var_unprivileged:-$CT_TYPE}
DISK_SIZE=${var_disk:-$DISK_SIZE}
CORE_COUNT=${var_cpu:-$CORE_COUNT}
RAM_SIZE=${var_ram:-$RAM_SIZE}
@ -611,7 +611,7 @@ install_script() {
;;
2)
header_info
echo -e "${DEFAULT}${BOLD}${BL}Using Default Settings (${SEARCH} Verbose)${CL}"
echo -e "${DEFAULT}${BOLD}${BL}Using Default Settings (${SEARCH}${BOLD}${BL} Verbose)${CL}"
VERB="yes"
base_settings "$VERB"
echo_default