From f9ce0ff7c0b785a42800282c8c8419931c105d1b Mon Sep 17 00:00:00 2001 From: Brett Costabile Date: Thu, 5 Nov 2015 20:16:11 -0500 Subject: [PATCH 1/4] Postgres Added lines to try and get posrgresql installed for testing. Changed the required version of django back to 1.6.5 because 1.7.0 should not be in production. --- requirements.txt | 4 +++- vagrant/Vagrantfile | 7 ++++++- vagrant/bootstrap.sh | 24 ++++++++++++++++++++---- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/requirements.txt b/requirements.txt index 29f6b32c..41f248ad 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,7 @@ # Python Stuff # - see bootstrap.sh mysql-python +mysqlclient +psycopg2 evelink dnspython passlib @@ -7,7 +9,7 @@ xmpppy==0.5.0rc1 # python-openfire==0.2.3-beta # Django Stuff # -django==1.7.0 +django==1.6.5 django-evolution django-bootstrap-form django-celery diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile index 91d29ec3..938bdca5 100644 --- a/vagrant/Vagrantfile +++ b/vagrant/Vagrantfile @@ -16,7 +16,12 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # CD to install its guest extension from. # Create a forwarded port mapping which allows access to a specific port - # within the machine from a port on the host machine. + # within the machine from a port on the host machine. + config.vm.provider "virtualbox" do |v| + v.memory = 1024 + v.cpus = 2 + end + config.vm.network :forwarded_port, guest: 3306, host: 3306 config.vm.network :forwarded_port, guest: 9090, host: 9090 config.vm.network :forwarded_port, guest: 8000, host: 8000 diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh index b933faf5..14188278 100755 --- a/vagrant/bootstrap.sh +++ b/vagrant/bootstrap.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +export DEBIAN_FRONTEND=noninteractive sudo add-apt-repository ppa:upubuntu-com/xampp @@ -10,16 +11,31 @@ sudo apt-get -y install libtool sudo apt-get -y install git sudo apt-get -y install python-dev libyaml-dev libffi-dev sudo apt-get -y install python-pip -sudo apt-get -y install mysql-server mysql-client +sudo apt-get -y install mysql-server mysql-client libmysqlclient-dev #Python 3 stuff sudo apt-get -y install python-software-properties sudo add-apt-repository ppa:fkrull/deadsnakes sudo apt-get -y update -sudo apt-get -y install python3.3 +sudo apt-get -y install python3.4 #virtualenv stuff sudo apt-get -y install python-virtualenv +sudo virtualenv -p /usr/bin/python3.4 /opt/allianceVenv + +#Postgresql stuff +sudo apt-get -y postgresql-9.1 libpq5 libpq-dev postgresql-client-9.1 postgresql-common ssl-cert postgresql-contrib-9.1 postgresql-server-dev-9.1 +sudo apt-get -y install -f +cat << EOF | su - postgres -c psql +-- Create database user: +CREATE USER vagrant WITH PASSWORD 'password'; +GRANT ALL PRIVILEGES ON DATABASE alliance% to vagrant; +EOF +createdb alliance_auth +createdb alliance_forum +createdb alliance_jabber +createdb alliance_mumble +createdb alliance_killboard cd /vagrant/ @@ -28,8 +44,6 @@ sudo pip install --upgrade pip # Pip moved location after upgrade from 1.0 sudo ln -s /usr/local/bin/pip /usr/bin/pip 2>/dev/null -sudo apt-get -y install libmysqlclient-dev - sudo pip install --allow-external mysql-connector-python mysql-connector-python sudo pip install --allow-external python-openfire python-openfire==0.2.3-beta sudo pip install https://github.com/eve-val/evelink/zipball/master @@ -60,7 +74,9 @@ sudo mysqladmin -p$MYSQL_ROOT_PASS flush-privileges sudo apt-get -y install rabbitmq-server +source /opt/allianceVenv/bin/activate sudo pip install -r requirements.txt +deactivate chmod +x *.sh From 57a1c6aaaa035802b289ae91c6ba8165afa73dc2 Mon Sep 17 00:00:00 2001 From: Brett Costabile Date: Wed, 18 Nov 2015 23:08:59 -0500 Subject: [PATCH 2/4] Removed experimental setup Alot of my experimental stuff for postgresql was causing issues, so I'm removing that for a different project. This way I can get a clean setup out. --- requirements.txt | 1 - vagrant/bootstrap.sh | 28 +--------------------------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/requirements.txt b/requirements.txt index 480ae4e6..7f6251f2 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,6 @@ # Python Stuff # - see bootstrap.sh mysql-python mysqlclient -psycopg2 evelink dnspython passlib diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh index 14188278..f6015bb4 100755 --- a/vagrant/bootstrap.sh +++ b/vagrant/bootstrap.sh @@ -13,30 +13,6 @@ sudo apt-get -y install python-dev libyaml-dev libffi-dev sudo apt-get -y install python-pip sudo apt-get -y install mysql-server mysql-client libmysqlclient-dev -#Python 3 stuff -sudo apt-get -y install python-software-properties -sudo add-apt-repository ppa:fkrull/deadsnakes -sudo apt-get -y update -sudo apt-get -y install python3.4 - -#virtualenv stuff -sudo apt-get -y install python-virtualenv -sudo virtualenv -p /usr/bin/python3.4 /opt/allianceVenv - -#Postgresql stuff -sudo apt-get -y postgresql-9.1 libpq5 libpq-dev postgresql-client-9.1 postgresql-common ssl-cert postgresql-contrib-9.1 postgresql-server-dev-9.1 -sudo apt-get -y install -f -cat << EOF | su - postgres -c psql --- Create database user: -CREATE USER vagrant WITH PASSWORD 'password'; -GRANT ALL PRIVILEGES ON DATABASE alliance% to vagrant; -EOF -createdb alliance_auth -createdb alliance_forum -createdb alliance_jabber -createdb alliance_mumble -createdb alliance_killboard - cd /vagrant/ sudo pip install --upgrade pip @@ -65,7 +41,7 @@ sudo mysqladmin -p$MYSQL_ROOT_PASS create alliance_jabber sudo mysqladmin -p$MYSQL_ROOT_PASS create alliance_mumble sudo mysqladmin -p$MYSQL_ROOT_PASS create alliance_killboard -sudo mysql -u root -p$MYSQL_ROOT_PASS -e "CREATE USER 'allianceauth'@'localhost' IDENTIFIED BY 'allianceauth'" +sudo mysql -u root -p$MYSQL_ROOT_PASS -e "CREATE USER 'allianceserver'@'localhost' IDENTIFIED BY 'password'" sudo mysql -u root -p$MYSQL_ROOT_PASS -e "GRANT ALL PRIVILEGES ON * . * TO 'allianceauth'@'localhost'"; sudo mysql -u root -p$MYSQL_ROOT_PASS -e "CREATE USER 'alliancemumble'@'localhost' IDENTIFIED BY 'alliancemumble'" sudo mysql -u root -p$MYSQL_ROOT_PASS -e "GRANT ALL PRIVILEGES ON * . * TO 'alliancemumble'@'localhost'"; @@ -74,9 +50,7 @@ sudo mysqladmin -p$MYSQL_ROOT_PASS flush-privileges sudo apt-get -y install rabbitmq-server -source /opt/allianceVenv/bin/activate sudo pip install -r requirements.txt -deactivate chmod +x *.sh From 8a6c244e67b50ae91334e6337265248f88547ffc Mon Sep 17 00:00:00 2001 From: Brett Costabile Date: Wed, 18 Nov 2015 23:24:56 -0500 Subject: [PATCH 3/4] corrected username missed that line --- vagrant/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh index f6015bb4..a7ded303 100755 --- a/vagrant/bootstrap.sh +++ b/vagrant/bootstrap.sh @@ -42,7 +42,7 @@ sudo mysqladmin -p$MYSQL_ROOT_PASS create alliance_mumble sudo mysqladmin -p$MYSQL_ROOT_PASS create alliance_killboard sudo mysql -u root -p$MYSQL_ROOT_PASS -e "CREATE USER 'allianceserver'@'localhost' IDENTIFIED BY 'password'" -sudo mysql -u root -p$MYSQL_ROOT_PASS -e "GRANT ALL PRIVILEGES ON * . * TO 'allianceauth'@'localhost'"; +sudo mysql -u root -p$MYSQL_ROOT_PASS -e "GRANT ALL PRIVILEGES ON * . * TO 'allianceserver'@'localhost'"; sudo mysql -u root -p$MYSQL_ROOT_PASS -e "CREATE USER 'alliancemumble'@'localhost' IDENTIFIED BY 'alliancemumble'" sudo mysql -u root -p$MYSQL_ROOT_PASS -e "GRANT ALL PRIVILEGES ON * . * TO 'alliancemumble'@'localhost'"; From 3318486e9cee96d0e6698b389c93f29164a75e45 Mon Sep 17 00:00:00 2001 From: Brett Costabile Date: Thu, 19 Nov 2015 00:42:47 -0500 Subject: [PATCH 4/4] Added missing step in manual setup Gotta run corp_update --- vagrant/bootstrap.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh index a7ded303..166973be 100755 --- a/vagrant/bootstrap.sh +++ b/vagrant/bootstrap.sh @@ -62,5 +62,6 @@ echo 'Next steps:\n' echo '1. Adjust mysql root password if you feel so inclined.' echo '2. Adjust all the stuff in ./alliance_auth/settings.py.' echo '3. Run sudo python manage.py syncdb to set up the database tables' -echo "4. run cd /vagrant/; ./startup.sh to start, and ./shutdown.sh to stop." +echo '4. Run python manage.py shell < run_alliance_corp_update.py' +echo "5. run cd /vagrant/; ./startup.sh to start, and ./shutdown.sh to stop." echo '--------'