mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-27 12:25:05 +02:00
* Add mini-qr (ct) * Update ct/mini-qr.sh Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com> * Update ct/mini-qr.sh Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com> * Update install/mini-qr-install.sh Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com> --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: CanbiZ (MickLesk) <47820557+MickLesk@users.noreply.github.com> Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
61 lines
1.2 KiB
Bash
61 lines
1.2 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) 2021-2026 community-scripts ORG
|
|
# Author: doge0420
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
# Source: https://github.com/lyqht/mini-qr
|
|
|
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
|
color
|
|
verb_ip6
|
|
catch_errors
|
|
setting_up_container
|
|
network_check
|
|
update_os
|
|
|
|
msg_info "Installing Dependencies"
|
|
$STD apt install -y \
|
|
libharfbuzz0b \
|
|
caddy \
|
|
fontconfig
|
|
msg_ok "Installed Dependencies"
|
|
|
|
NODE_VERSION="20" setup_nodejs
|
|
fetch_and_deploy_gh_release "mini-qr" "lyqht/mini-qr" "tarball"
|
|
|
|
msg_info "Building MiniQR"
|
|
cd /opt/mini-qr
|
|
$STD npm install
|
|
$STD npm run build
|
|
msg_ok "Built MiniQR"
|
|
|
|
msg_info "Configuring Caddy"
|
|
cat <<EOF >/etc/caddy/Caddyfile
|
|
:80 {
|
|
root * /opt/mini-qr/dist
|
|
file_server
|
|
|
|
# Handle client-side routing
|
|
try_files {path} /index.html
|
|
|
|
# Cache static assets
|
|
@assets {
|
|
path /assets/*
|
|
}
|
|
header @assets Cache-Control "public, immutable, max-age=31536000"
|
|
|
|
# Correct MIME types for JS modules
|
|
@jsmodules {
|
|
path *.js *.mjs
|
|
}
|
|
header @jsmodules Content-Type "application/javascript"
|
|
}
|
|
EOF
|
|
systemctl enable -q --now caddy
|
|
systemctl reload caddy
|
|
msg_ok "Configured Caddy"
|
|
|
|
motd_ssh
|
|
customize
|
|
cleanup_lxc
|