Skip to content

Commit 03eff3a

Browse files
authored
[refactor] Seelf (#4954)
* Refactor seelf * Update * Update * Update
1 parent ff12d80 commit 03eff3a

File tree

2 files changed

+30
-56
lines changed

2 files changed

+30
-56
lines changed

ct/seelf.sh

Lines changed: 24 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
33
# Copyright (c) 2021-2025 community-scripts ORG
4-
# Author: tremor021
4+
# Author: Slaviša Arežina (tremor021)
55
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
66
# Source: https://github.com/YuukanOO/seelf
77

@@ -20,49 +20,31 @@ color
2020
catch_errors
2121

2222
function update_script() {
23-
header_info
24-
check_container_storage
25-
check_container_resources
23+
header_info
24+
check_container_storage
25+
check_container_resources
2626

27-
if [[ ! -d /opt/seelf ]]; then
28-
msg_error "No ${APP} Installation Found!"
29-
exit
30-
fi
31-
32-
RELEASE=$(curl -fsSL https://api.github.com/repos/YuukanOO/seelf/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
33-
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
34-
msg_info "Updating $APP"
35-
36-
msg_info "Stopping $APP"
37-
systemctl stop seelf
38-
msg_ok "Stopped $APP"
39-
40-
msg_info "Updating $APP to v${RELEASE}. Patience"
41-
export PATH=$PATH:/usr/local/go/bin
42-
source ~/.bashrc
43-
curl -fsSL "https://github.com/YuukanOO/seelf/archive/refs/tags/v${RELEASE}.tar.gz" -o $(basename "https://github.com/YuukanOO/seelf/archive/refs/tags/v${RELEASE}.tar.gz")
44-
tar -xzf v${RELEASE}.tar.gz
45-
cp -r seelf-${RELEASE}/ /opt/seelf
46-
cd /opt/seelf
47-
$STD make build
48-
msg_ok "Updated $APP to v${RELEASE}"
49-
50-
msg_info "Starting $APP"
51-
systemctl start seelf
52-
msg_ok "Started $APP"
53-
54-
# Cleaning up
55-
msg_info "Cleaning Up"
56-
rm -f ~/*.tar.gz
57-
rm -rf ~/seelf-${RELEASE}
58-
msg_ok "Cleanup Completed"
59-
60-
echo "${RELEASE}" >/opt/${APP}_version.txt
61-
msg_ok "Update Successful"
62-
else
63-
msg_ok "No update required. ${APP} is already at v${RELEASE}"
64-
fi
27+
if [[ ! -d /opt/seelf ]]; then
28+
msg_error "No ${APP} Installation Found!"
6529
exit
30+
fi
31+
if fetch_and_deploy_gh_release "YuukanOO/seelf"; then
32+
msg_ok "$APP already at the latest version. No update required."
33+
else
34+
msg_info "Stopping $APP"
35+
systemctl stop seelf
36+
msg_ok "Stopped $APP"
37+
38+
msg_info "Updating $APP"
39+
cd /opt/seelf
40+
$STD make build
41+
msg_ok "Updated $APP"
42+
43+
msg_info "Starting $APP"
44+
systemctl start seelf
45+
msg_ok "Started $APP"
46+
fi
47+
exit
6648
}
6749

6850
start

install/seelf-install.sh

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
# Copyright (c) 2021-2025 community-scripts ORG
4-
# Author: tremor021
4+
# Author: Slaviša Arežina (tremor021)
55
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
66
# Source: https://github.com/YuukanOO/seelf
77

@@ -21,21 +21,17 @@ msg_ok "Installed Dependencies"
2121

2222
install_go
2323
NODE_VERSION="22" install_node_and_modules
24+
fetch_and_deploy_gh_release "YuukanOO/seelf"
2425

2526
msg_info "Setting up seelf. Patience"
26-
RELEASE=$(curl -fsSL https://api.github.com/repos/YuukanOO/seelf/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
27-
curl -fsSL "https://github.com/YuukanOO/seelf/archive/refs/tags/v${RELEASE}.tar.gz" -o "v${RELEASE}.tar.gz"
28-
tar -xzf v"${RELEASE}".tar.gz
29-
mv seelf-"${RELEASE}"/ /opt/seelf
3027
cd /opt/seelf
3128
$STD make build
3229
PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
30+
mkdir -p /opt/seelf/data
3331
{
3432
3533
echo "ADMIN_PASSWORD=$PASS"
3634
} | tee .env ~/seelf.creds >/dev/null
37-
38-
echo "${RELEASE}" >/opt/seelf_version.txt
3935
[email protected] SEELF_ADMIN_PASSWORD=$PASS ./seelf serve &>/dev/null &
4036
sleep 5
4137
kill $!
@@ -51,8 +47,10 @@ After=network.target
5147
Type=simple
5248
User=root
5349
Group=root
50+
EnvironmentFile=/opt/seelf/.env
51+
Environment=DATA_PATH=/opt/seelf/data
5452
WorkingDirectory=/opt/seelf
55-
ExecStart=/opt/seelf/./seelf serve
53+
ExecStart=/opt/seelf/./seelf -c data/conf.yml serve
5654
Restart=always
5755
5856
[Install]
@@ -64,13 +62,7 @@ msg_ok "Created Service"
6462
motd_ssh
6563
customize
6664

67-
# Cleanup
6865
msg_info "Cleaning up"
69-
rm -f ~/v"${RELEASE}".tar.gz
70-
rm -f "$temp_file"
7166
$STD apt-get -y autoremove
7267
$STD apt-get -y autoclean
7368
msg_ok "Cleaned"
74-
75-
motd_ssh
76-
customize

0 commit comments

Comments
 (0)