mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-10-02 15:09:38 +00:00
* feat(glance): add alpine os * Increase default RAM and disk for Alpine OS --------- Co-authored-by: CanbiZ (MickLesk) <47820557+MickLesk@users.noreply.github.com>
116 lines
2.7 KiB
Bash
116 lines
2.7 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) 2021-2026 community-scripts ORG
|
|
# Author: kristocopani
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
# Source: https://github.com/glanceapp/glance
|
|
|
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
|
color
|
|
verb_ip6
|
|
catch_errors
|
|
setting_up_container
|
|
network_check
|
|
update_os
|
|
|
|
setup_deb_based() {
|
|
fetch_and_deploy_gh_release "glance" "glanceapp/glance" "prebuild" "latest" "/opt/glance" "glance-linux-$(arch_resolve).tar.gz"
|
|
|
|
msg_info "Configuring Glance"
|
|
mkdir -p /opt/glance_data
|
|
cat <<EOF >/opt/glance_data/glance.yml
|
|
pages:
|
|
- name: Startpage
|
|
width: slim
|
|
hide-desktop-navigation: true
|
|
center-vertically: true
|
|
columns:
|
|
- size: full
|
|
widgets:
|
|
- type: search
|
|
autofocus: true
|
|
- type: bookmarks
|
|
groups:
|
|
- title: General
|
|
links:
|
|
- title: Google
|
|
url: https://www.google.com/
|
|
- title: Helper Scripts
|
|
url: https://github.com/community-scripts/ProxmoxVE
|
|
EOF
|
|
msg_ok "Configured Glance"
|
|
|
|
msg_info "Creating Service"
|
|
cat <<EOF >/etc/systemd/system/glance.service
|
|
[Unit]
|
|
Description=Glance Daemon
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
WorkingDirectory=/opt/glance
|
|
ExecStart=/opt/glance/glance --config /opt/glance_data/glance.yml
|
|
TimeoutStopSec=20
|
|
KillMode=process
|
|
Restart=on-failure
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
EOF
|
|
systemctl enable -q --now glance
|
|
msg_ok "Created Service"
|
|
}
|
|
|
|
setup_alpine() {
|
|
fetch_and_deploy_gh_release "glance" "glanceapp/glance" "prebuild" "latest" "/opt/glance" "glance-linux-$(arch_resolve).tar.gz"
|
|
|
|
msg_info "Configuring Glance"
|
|
mkdir -p /opt/glance_data
|
|
cat <<EOF >/opt/glance_data/glance.yml
|
|
pages:
|
|
- name: Startpage
|
|
width: slim
|
|
hide-desktop-navigation: true
|
|
center-vertically: true
|
|
columns:
|
|
- size: full
|
|
widgets:
|
|
- type: search
|
|
autofocus: true
|
|
- type: bookmarks
|
|
groups:
|
|
- title: General
|
|
links:
|
|
- title: Google
|
|
url: https://www.google.com/
|
|
- title: Helper Scripts
|
|
url: https://github.com/community-scripts/ProxmoxVE
|
|
EOF
|
|
msg_ok "Configured Glance"
|
|
|
|
msg_info "Creating Service"
|
|
cat <<EOF >/etc/init.d/glance
|
|
#!/sbin/openrc-run
|
|
name="glance"
|
|
description="Glance Daemon"
|
|
command="/opt/glance/glance"
|
|
command_args="--config /opt/glance_data/glance.yml"
|
|
command_background="yes"
|
|
pidfile="/run/glance.pid"
|
|
|
|
depend() {
|
|
need net
|
|
}
|
|
EOF
|
|
chmod +x /etc/init.d/glance
|
|
rc-update add glance default
|
|
rc-service glance start
|
|
msg_ok "Created Service"
|
|
}
|
|
|
|
run_os_setup
|
|
|
|
motd_ssh
|
|
customize
|
|
cleanup_lxc
|