nocodb-install.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. msg_ok "Installed Dependencies"
  19. msg_info "Setting up Node.js Repository"
  20. $STD bash <(curl -fsSL https://deb.nodesource.com/setup_16.x)
  21. msg_ok "Set up Node.js Repository"
  22. msg_info "Installing Node.js"
  23. $STD sudo apt-get install -y nodejs git make g++ gcc
  24. msg_ok "Installed Node.js"
  25. msg_info "Installing NocoDB"
  26. $STD git clone https://github.com/nocodb/nocodb-seed
  27. mv nocodb-seed /opt/nocodb
  28. cd /opt/nocodb
  29. $STD npm install
  30. msg_ok "Installed NocoDB"
  31. msg_info "Creating Service"
  32. service_path="/etc/systemd/system/nocodb.service"
  33. echo "[Unit]
  34. Description=nocodb
  35. [Service]
  36. Type=simple
  37. Restart=always
  38. User=root
  39. WorkingDirectory=/opt/nocodb
  40. ExecStart=/usr/bin/npm start
  41. [Install]
  42. WantedBy=multi-user.target" >$service_path
  43. systemctl enable --now nocodb.service &>/dev/null
  44. msg_ok "Created Service"
  45. motd_ssh
  46. root
  47. msg_info "Cleaning up"
  48. $STD apt-get autoremove
  49. $STD apt-get autoclean
  50. msg_ok "Cleaned"