-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
*.exe binary | ||
*.dll binary | ||
*.dll binary | ||
binaries/om/openMalaria binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Chef recipe to install OpenMalaria Portal | ||
|
||
Usage: | ||
sudo chef-client --local-mode chef.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package 'gsl' | ||
package 'xerces-c' | ||
package 'httpd' | ||
package 'mod_wsgi' | ||
package 'python-pip' | ||
package 'git' | ||
package 'vim' | ||
|
||
bash 'postgresql respository' do | ||
code <<-EOH | ||
yum install -y https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat96-9.6-3.noarch.rpm | ||
EOH | ||
not_if {::File.exist?('/etc/yum.repos.d/pgdg-96-redhat.repo')} | ||
end | ||
|
||
package 'postgresql96-server' | ||
package 'postgresql96-devel' | ||
|
||
|
||
bash 'postgresql initdb' do | ||
code <<-EOH | ||
/usr/pgsql-9.6/bin/postgresql96-setup initdb | ||
EOH | ||
not_if {::File.exist?('/var/lib/pgsql/9.6/data/')} | ||
end | ||
|
||
service 'postgresql-9.6' do | ||
action [:enable, :start] | ||
end | ||
|
||
bash 'postgresql create user' do | ||
code <<-EOH | ||
sudo -u postgres sh -c 'createdb om' | ||
sudo -u postgres psql -c "CREATE USER om WITH PASSWORD 'om'" | ||
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE \"om\" to om;" | ||
EOH | ||
ignore_failure true | ||
end | ||
|
||
file '/var/lib/pgsql/9.6/data/pg_hba.conf' do | ||
owner 'postgres' | ||
group 'postgres' | ||
mode '600' | ||
content <<-EOH | ||
local all all ident | ||
host all all all md5 | ||
EOH | ||
end | ||
|
||
directory 'opt/portal/aws.vecnet.org' do | ||
owner 'root' | ||
group 'apache' | ||
recursive true | ||
end | ||
|
||
git '/opt/portal/aws.vecnet.org' do | ||
group 'apache' | ||
repository 'https://github.com/vecnet/om' | ||
action :sync | ||
end | ||
|
||
file '/opt/portal/aws.vecnet.org/config_local.py' do | ||
group 'apache' | ||
mode '640' | ||
content <<-EOH | ||
import os | ||
settings_module="website.settings.aws" | ||
os.environ["SECRET_KEY"] = "lkl39#;l=01,<ML;lodfsd;lkOP(aa;dsf90adfsadfksldfjp90sdflsklilsdfslklkj" | ||
os.environ["DATABASE_NAME"] = "om" | ||
os.environ["DATABASE_USER"] = "om" | ||
os.environ["DATABASE_PASSWORD"] = "om" | ||
EOH | ||
end | ||
|
||
file '/opt/portal/aws.vecnet.org/django.log' do | ||
group 'apache' | ||
mode '660' | ||
end | ||
|
||
bash 'Install python packages' do | ||
code 'pip install -r /opt/portal/aws.vecnet.org/requirements/aws.txt' | ||
end | ||
|
||
service 'httpd' do | ||
action [:enable, :start] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
# http://stackoverflow.com/questions/18215973/how-to-check-if-running-as-root-in-a-bash-script | ||
# EUID Expands to the effective user ID of the current user, initialized at shell startup. | ||
# This variable is readonly. | ||
if [ "${EUID}" -ne 0 ] | ||
then echo "Please run as root" | ||
exit | ||
fi | ||
|
||
yum install xerces-c gsl git nginx python-pip python-devel | ||
# Repository for PostgreSQL 9.6 | ||
yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat96-9.6-3.noarch.rpm | ||
yum install postgresql96-devel postgresql96 | ||
/usr/pgsql-9.6/bin/postgresql96-setup initdb | ||
|
||
sudo cp /var/lib/pgsql/9.6/data/pg_hba.conf /var/lib/pgsql/9.6/data/pg_hba.conf.bak | ||
sudo sh -c 'echo "local all all ident" > /var/lib/pgsql/9.6/data/pg_hba.conf' | ||
sudo sh -c 'echo "host all all all md5">> /var/lib/pgsql/9.6/data/pg_hba.conf' | ||
|
||
systemctl enable postgresql-9.6 | ||
systemctl start postgresql-9.6 | ||
|
||
sudo systemctl start postgresql | ||
sudo -u postgres sh -c 'createdb om' | ||
sudo -u postgres psql -c "CREATE USER om WITH PASSWORD 'om'" | ||
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE \"om\" to om;" | ||
sudo systemctl restart postgresql-9.6 | ||
|