Files
ProxmoxVE/install/pocketbase-install.sh

50 lines
1.2 KiB
Bash
Raw Normal View History

2024-05-07 23:13:55 +02:00
#!/usr/bin/env bash
# Copyright (c) 2021-2025 tteck
2024-05-07 23:13:55 +02:00
# Author: tteck (tteckster)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://pocketbase.io/
2024-05-07 23:13:55 +02:00
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
2024-05-07 23:13:55 +02:00
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
2025-08-04 15:43:07 +02:00
fetch_and_deploy_gh_release "pocketbase" "pocketbase/pocketbase" "prebuild" "latest" "/opt/pocketbase" "pocketbase*linux_amd64.zip"
msg_info "Configuring Pocketbase"
2024-05-07 23:13:55 +02:00
mkdir -p /opt/pocketbase/{pb_public,pb_migrations,pb_hooks}
2025-08-04 15:43:07 +02:00
msg_ok "Configured Pocketbase"
2024-05-07 23:13:55 +02:00
2025-08-04 15:43:07 +02:00
msg_info "Creating service"
2024-05-07 23:13:55 +02:00
cat <<EOF >/etc/systemd/system/pocketbase.service
[Unit]
Description = pocketbase
[Service]
Type = simple
LimitNOFILE = 4096
Restart = always
RestartSec = 5s
StandardOutput = append:/opt/pocketbase/errors.log
StandardError = append:/opt/pocketbase/errors.log
ExecStart = /opt/pocketbase/pocketbase serve --http=0.0.0.0:8080
[Install]
WantedBy = multi-user.target
EOF
systemctl enable -q --now pocketbase
2025-08-04 15:43:07 +02:00
msg_ok "Service created"
2024-05-07 23:13:55 +02:00
motd_ssh
customize
msg_info "Cleaning up"
$STD apt -y autoremove
$STD apt -y autoclean
$STD apt -y clean
2024-05-07 23:13:55 +02:00
msg_ok "Cleaned"