New Script: seelf (#2023)

* add seelf script

* changed number of cores for LXC

* Update install/seelf-install.sh

Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com>

* Update install/seelf-install.sh

Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com>

---------

Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com>
This commit is contained in:
Slaviša Arežina 2025-02-05 13:29:49 +01:00 committed by GitHub
parent cb6e2c4455
commit 42b175144a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 196 additions and 0 deletions

77
ct/seelf.sh Normal file
View File

@ -0,0 +1,77 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2025 community-scripts ORG
# Author: tremor021
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/YuukanOO/seelf
APP="seelf"
TAGS="server;docker"
var_cpu="2"
var_ram="4096"
var_disk="10"
var_os="debian"
var_version="12"
var_unprivileged="1"
header_info "$APP"
base_settings
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/seelf ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
RELEASE=$(curl -s https://api.github.com/repos/YuukanOO/seelf/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
msg_info "Updating $APP"
msg_info "Stopping $APP"
systemctl stop seelf
msg_ok "Stopped $APP"
msg_info "Updating $APP to v${RELEASE}. Patience"
export PATH=$PATH:/usr/local/go/bin
source ~/.bashrc
wget -q "https://github.com/YuukanOO/seelf/archive/refs/tags/v${RELEASE}.tar.gz"
tar -xzf v${RELEASE}.tar.gz
cp -r seelf-${RELEASE}/ /opt/seelf
cd /opt/seelf
make build &> /dev/null
msg_ok "Updated $APP to v${RELEASE}"
msg_info "Starting $APP"
systemctl start seelf
msg_ok "Started $APP"
# Cleaning up
msg_info "Cleaning Up"
rm -f ~/*.tar.gz
rm -rf ~/seelf-${RELEASE}
msg_ok "Cleanup Completed"
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Update Successful"
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 "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8080${CL}"

80
install/seelf-install.sh Normal file
View File

@ -0,0 +1,80 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: tremor021
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/YuukanOO/seelf
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 \
sudo \
mc \
make \
gcc
wget -q https://go.dev/dl/go1.23.5.linux-amd64.tar.gz
curl -s -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash &> /dev/null
tar -C /usr/local -xzf go1.23.5.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
source ~/.bashrc
$STD nvm install node
msg_ok "Installed Dependencies"
msg_info "Setting up seelf. Patience"
RELEASE=$(curl -s https://api.github.com/repos/YuukanOO/seelf/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
wget -q "https://github.com/YuukanOO/seelf/archive/refs/tags/v${RELEASE}.tar.gz"
tar -xzf v${RELEASE}.tar.gz
mv seelf-${RELEASE}/ /opt/seelf
cd /opt/seelf
$STD make build
PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
{
echo "ADMIN_EMAIL=admin@example.com"
echo "ADMIN_PASSWORD=$PASS"
} | tee .env ~/seelf.creds > /dev/null
echo "${RELEASE}" >/opt/seelf_version.txt
SEELF_ADMIN_EMAIL=admin@example.com SEELF_ADMIN_PASSWORD=$PASS ./seelf serve &> /dev/null & sleep 5 ; kill $!
msg_ok "Done setting up seelf"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/seelf.service
[Unit]
Description=seelf Service
After=network.target
[Service]
Type=simple
User=root
Group=root
WorkingDirectory=/opt/seelf
ExecStart=/opt/seelf/./seelf serve
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now seelf
msg_ok "Created Service"
motd_ssh
customize
# Cleanup
msg_info "Cleaning up"
rm -f ~/v${RELEASE}.tar.gz
rm -f ~/go1.23.5.linux-amd64.tar.gz
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"
motd_ssh
customize

39
json/seelf.json Normal file
View File

@ -0,0 +1,39 @@
{
"name": "seelf",
"slug": "seelf",
"categories": [
4
],
"date_created": "2025-02-04",
"type": "ct",
"updateable": true,
"privileged": false,
"interface_port": 8080,
"documentation": "https://yuukanoo.github.io/seelf/guide/quickstart.html",
"website": "https://yuukanoo.github.io/seelf/",
"logo": "https://yuukanoo.github.io/seelf/logo-dark.svg",
"description": "seelf is a self-hosted software which makes it easy to deploy your own applications on your own hardware using an easy to use interface.",
"install_methods": [
{
"type": "default",
"script": "ct/seelf.sh",
"resources": {
"cpu": 2,
"ram": 4096,
"hdd": 10,
"os": "debian",
"version": "12"
}
}
],
"default_credentials": {
"username": null,
"password": null
},
"notes": [
{
"text": "Initial admin email and password: `cat ~/seelf.creds`",
"type": "info"
}
]
}