uptimekuma-install.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/usr/bin/env bash
  2. # Copyright (c) 2021-2023 tteck
  3. # Author: tteck (tteckster)
  4. # License: MIT
  5. # https://github.com/tteck/Proxmox/raw/main/LICENSE
  6. source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
  7. color
  8. verb_ip6
  9. catch_errors
  10. setting_up_container
  11. network_check
  12. update_os
  13. msg_info "Installing Dependencies"
  14. $STD apt-get install -y curl
  15. $STD apt-get install -y sudo
  16. $STD apt-get install -y mc
  17. $STD apt-get install -y git
  18. $STD apt-get install -y ca-certificates
  19. $STD apt-get install -y gnupg
  20. msg_ok "Installed Dependencies"
  21. msg_info "Setting up Node.js Repository"
  22. mkdir -p /etc/apt/keyrings
  23. curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
  24. echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
  25. msg_ok "Set up Node.js Repository"
  26. msg_info "Installing Node.js"
  27. $STD apt-get update
  28. $STD apt-get install -y nodejs
  29. msg_ok "Installed Node.js"
  30. msg_info "Installing Uptime Kuma"
  31. $STD git clone https://github.com/louislam/uptime-kuma.git
  32. mv uptime-kuma /opt/uptime-kuma
  33. cd /opt/uptime-kuma
  34. $STD npm run setup
  35. msg_ok "Installed Uptime Kuma"
  36. msg_info "Creating Service"
  37. service_path="/etc/systemd/system/uptime-kuma.service"
  38. echo "[Unit]
  39. Description=uptime-kuma
  40. [Service]
  41. Type=simple
  42. Restart=always
  43. User=root
  44. WorkingDirectory=/opt/uptime-kuma
  45. ExecStart=/usr/bin/npm start
  46. [Install]
  47. WantedBy=multi-user.target" >$service_path
  48. $STD systemctl enable --now uptime-kuma.service
  49. msg_ok "Created Service"
  50. motd_ssh
  51. customize
  52. msg_info "Cleaning up"
  53. $STD apt-get autoremove
  54. $STD apt-get autoclean
  55. msg_ok "Cleaned"