Skip to content

Commit 336ea19

Browse files
authored
Re-add files (#595)
1 parent 1ca9978 commit 336ea19

File tree

3 files changed

+219
-0
lines changed

3 files changed

+219
-0
lines changed

ct/glance.sh

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2024 community-scripts ORG
4+
# Author: kristocopani
5+
# License: MIT
6+
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
7+
8+
function header_info {
9+
clear
10+
cat <<"EOF"
11+
________
12+
/ ____/ /___ _____ ________
13+
/ / __/ / __ `/ __ \/ ___/ _ \
14+
/ /_/ / / /_/ / / / / /__/ __/
15+
\____/_/\__,_/_/ /_/\___/\___/
16+
17+
EOF
18+
}
19+
header_info
20+
echo -e "Loading..."
21+
APP="Glance"
22+
var_disk="2"
23+
var_cpu="1"
24+
var_ram="512"
25+
var_os="debian"
26+
var_version="12"
27+
variables
28+
color
29+
catch_errors
30+
31+
function default_settings() {
32+
CT_TYPE="1"
33+
PW=""
34+
CT_ID=$NEXTID
35+
HN=$NSAPP
36+
DISK_SIZE="$var_disk"
37+
CORE_COUNT="$var_cpu"
38+
RAM_SIZE="$var_ram"
39+
BRG="vmbr0"
40+
NET="dhcp"
41+
GATE=""
42+
APT_CACHER=""
43+
APT_CACHER_IP=""
44+
DISABLEIP6="no"
45+
MTU=""
46+
SD=""
47+
NS=""
48+
MAC=""
49+
VLAN=""
50+
SSH="no"
51+
VERB="no"
52+
echo_default
53+
}
54+
55+
function update_script() {
56+
header_info
57+
check_container_storage
58+
check_container_resources
59+
60+
if [[ ! -f /etc/systemd/system/glance.service ]]; then
61+
msg_error "No ${APP} Installation Found!"
62+
exit
63+
fi
64+
65+
RELEASE=$(curl -s https://api.github.com/repos/glanceapp/glance/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
66+
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
67+
msg_info "Stopping Service"
68+
systemctl stop glance
69+
msg_ok "Stopped Service"
70+
71+
msg_info "Updating ${APP} to v${RELEASE}"
72+
cd /opt
73+
wget -q https://github.com/glanceapp/glance/releases/download/v${RELEASE}/glance-linux-amd64.tar.gz
74+
rm -rf /opt/glance/glance
75+
tar -xzf glance-linux-amd64.tar.gz -C /opt/glance
76+
echo "${RELEASE}" >"/opt/${APP}_version.txt"
77+
msg_ok "Updated ${APP} to v${RELEASE}"
78+
79+
msg_info "Starting Service"
80+
systemctl start glance
81+
msg_ok "Started Service"
82+
83+
msg_info "Cleaning up"
84+
rm -rf /opt/glance-linux-amd64.tar.gz
85+
msg_ok "Cleaned"
86+
msg_ok "Updated Successfully"
87+
else
88+
msg_ok "No update required. ${APP} is already at v${RELEASE}."
89+
fi
90+
exit
91+
}
92+
93+
start
94+
build_container
95+
description
96+
97+
msg_ok "Completed Successfully!\n"
98+
echo -e "${APP} should be reachable by going to the following URL.
99+
${BL}http://${IP}:8080${CL} \n"

install/glance-install.sh

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2024 community-scripts ORG
4+
# Author: kristocopani
5+
# License: MIT
6+
# https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y \
18+
curl \
19+
sudo \
20+
mc
21+
msg_ok "Installed Dependencies"
22+
23+
24+
msg_info "Installing Glance"
25+
RELEASE=$(curl -s https://api.github.com/repos/glanceapp/glance/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
26+
cd /opt
27+
wget -q https://github.com/glanceapp/glance/releases/download/v${RELEASE}/glance-linux-amd64.tar.gz
28+
mkdir -p /opt/glance
29+
tar -xzf glance-linux-amd64.tar.gz -C /opt/glance
30+
cat <<EOF >/opt/glance/glance.yml
31+
pages:
32+
- name: Startpage
33+
width: slim
34+
hide-desktop-navigation: true
35+
center-vertically: true
36+
columns:
37+
- size: full
38+
widgets:
39+
- type: search
40+
autofocus: true
41+
- type: bookmarks
42+
groups:
43+
- title: General
44+
links:
45+
- title: Google
46+
url: https://www.google.com/
47+
- title: Helper Scripts
48+
url: https://github.com/community-scripts/ProxmoxVE
49+
EOF
50+
51+
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
52+
msg_ok "Installed Glance"
53+
54+
msg_info "Creating Service"
55+
service_path="/etc/systemd/system/glance.service"
56+
echo "[Unit]
57+
Description=Glance Daemon
58+
After=network.target
59+
60+
[Service]
61+
Type=simple
62+
WorkingDirectory=/opt/glance
63+
ExecStart=/opt/glance/glance --config /opt/glance/glance.yml
64+
TimeoutStopSec=20
65+
KillMode=process
66+
Restart=on-failure
67+
68+
[Install]
69+
WantedBy=multi-user.target" >$service_path
70+
71+
systemctl enable -q --now glance.service
72+
msg_ok "Created Service"
73+
74+
motd_ssh
75+
customize
76+
77+
msg_info "Cleaning up"
78+
rm -rf /opt/glance-linux-amd64.tar.gz
79+
$STD apt-get -y autoremove
80+
$STD apt-get -y autoclean
81+
msg_ok "Cleaned"

json/glance.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "Glance",
3+
"slug": "glance",
4+
"categories": [
5+
15
6+
],
7+
"date_created": "2024-11-29",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 8080,
12+
"documentation": "https://github.com/glanceapp/glance/blob/main/docs/configuration.md",
13+
"website": "https://github.com/glanceapp/glance",
14+
"logo": "https://github.com/glanceapp/glance/blob/main/internal/assets/static/app-icon.png?raw=true",
15+
"description": "A self-hosted dashboard that puts all your feeds in one place",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "/ct/glance.sh",
20+
"resources": {
21+
"cpu": 1,
22+
"ram": 512,
23+
"hdd": 2,
24+
"os": "Debian",
25+
"version": "12"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": null,
31+
"password": null
32+
},
33+
"notes": [
34+
{
35+
"text": "Config file is located in /opt/glance/glance.yml",
36+
"type": "info"
37+
}
38+
]
39+
}

0 commit comments

Comments
 (0)