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.3 KiB

4 years ago
4 years ago
4 years ago
12345678910111213141516171819202122232425262728293031
  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 -y || die "Error installing apt packages"
  14. sudo pip3 install setuptools psycopg2-binary || die "Error installing pip packages"
  15. # Create DB user for current user, as superuser
  16. CURRENT_USER="$(whoami)"
  17. sudo su - postgres bash -c 'createuser -U postgres --createdb --createrole --superuser '"${CURRENT_USER}"'' || die "Error creating ${CURRENT_USER} DB user"
  18. PG_HBA=/etc/postgresql/10/main/pg_hba.conf
  19. 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}"
  20. sudo bash -c "cat /tmp/pg_hba.conf > ${PG_HBA}" || die "Error rewriting ${PG_HBA}"
  21. sudo service postgresql restart || die "Error restaring pgsql"
  22. # Create DB user 'bubble', with the ability to create databases
  23. createuser --createdb bubble || die "Error creating bubble DB user"
  24. # Create bubble database
  25. createdb --encoding=UTF-8 bubble || die "Error creating bubble DB"