The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

first_time_ubuntu.sh 1.5 KiB

4 years ago
4 years ago
4 years ago
4 years ago
1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. #
  3. # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
  4. #
  5. function die {
  6. echo 1>&2 "${1}"
  7. exit 1
  8. }
  9. # Ensure system is current
  10. sudo apt update -y || die "Error running apt update"
  11. sudo apt upgrade -y || die "Error running apt upgrade"
  12. # Install packages
  13. sudo apt install openjdk-11-jdk maven postgresql-10 redis-server jq python3 python3-pip npm webpack curl unzip -y || die "Error installing apt packages"
  14. sudo pip3 install setuptools psycopg2-binary || die "Error installing pip packages"
  15. # Install packer
  16. BUBBLE_BIN="$(cd "$(dirname "${0}")" && pwd)"
  17. "${BUBBLE_BIN}/install_packer.sh" || die "Error installing packer"
  18. # Create DB user for current user, as superuser
  19. CURRENT_USER="$(whoami)"
  20. sudo su - postgres bash -c 'createuser -U postgres --createdb --createrole --superuser '"${CURRENT_USER}"'' || die "Error creating ${CURRENT_USER} DB user"
  21. PG_HBA=/etc/postgresql/10/main/pg_hba.conf
  22. sudo cat ${PG_HBA} | sed -e 's/ peer/ trust/g' | sed -e 's/ md5/ trust/g' > /tmp/pg_hba.conf || die "Error filtering ${PG_HBA}"
  23. sudo bash -c "cat /tmp/pg_hba.conf > ${PG_HBA}" || die "Error rewriting ${PG_HBA}"
  24. sudo service postgresql restart || die "Error restaring pgsql"
  25. # Create DB user 'bubble', with the ability to create databases
  26. createuser --createdb bubble || die "Error creating bubble DB user"
  27. # Create bubble database
  28. createdb --encoding=UTF-8 bubble || die "Error creating bubble DB"