nocodb-install.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 make
  19. $STD apt-get install -y g++
  20. $STD apt-get install -y gcc
  21. msg_ok "Installed Dependencies"
  22. msg_info "Installing Node.js"
  23. $STD bash <(curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh)
  24. . ~/.bashrc
  25. $STD nvm install 16.20.1
  26. ln -sf /root/.nvm/versions/node/v16.20.1/bin/node /usr/bin/node
  27. ln -sf /root/.nvm/versions/node/v16.20.1/bin/npm /usr/bin/npm
  28. msg_ok "Installed Node.js"
  29. msg_info "Installing NocoDB"
  30. $STD git clone https://github.com/nocodb/nocodb-seed
  31. mv nocodb-seed /opt/nocodb
  32. cd /opt/nocodb
  33. $STD npm install
  34. msg_ok "Installed NocoDB"
  35. msg_info "Creating Service"
  36. service_path="/etc/systemd/system/nocodb.service"
  37. echo "[Unit]
  38. Description=nocodb
  39. [Service]
  40. Type=simple
  41. Restart=always
  42. User=root
  43. WorkingDirectory=/opt/nocodb
  44. ExecStart=/usr/bin/npm start
  45. [Install]
  46. WantedBy=multi-user.target" >$service_path
  47. systemctl enable --now nocodb.service &>/dev/null
  48. msg_ok "Created Service"
  49. motd_ssh
  50. customize
  51. msg_info "Cleaning up"
  52. $STD apt-get autoremove
  53. $STD apt-get autoclean
  54. msg_ok "Cleaned"