2017-04-09 11:05:39 +02:00
|
|
|
|
|
|
|
function install_dependencies()
|
|
|
|
{
|
|
|
|
# Dependencies
|
2017-08-02 16:26:44 +02:00
|
|
|
ynh_install_app_dependencies gunicorn python-dev python-pip libldap2-dev libpq-dev libsasl2-dev libjpeg-dev libxml2-dev libxslt1-dev libffi-dev python-cairo libpango1.0-0 postgresql postgresql-contrib #libmysqlclient-dev
|
2017-04-09 11:05:39 +02:00
|
|
|
}
|
|
|
|
|
2017-08-02 16:26:44 +02:00
|
|
|
function init_db()
|
|
|
|
{
|
|
|
|
sed -i '/local\s*all\s*all\s*peer/i \
|
2018-08-17 18:10:37 +02:00
|
|
|
local all coin password' /etc/postgresql/9.*/main/pg_hba.conf
|
2017-08-02 16:26:44 +02:00
|
|
|
service postgresql reload
|
|
|
|
# Generate random password
|
|
|
|
db_name=$app
|
|
|
|
db_user=$app
|
|
|
|
db_pwd=$(ynh_string_random)
|
|
|
|
# Initialize database and store pssql password for upgrade
|
|
|
|
ynh_psql_create_db $db_name $db_user $db_pwd
|
|
|
|
ynh_app_setting_set "$app" psqlpassword "$db_pwd"
|
|
|
|
}
|