diff --git a/conf/app.src b/conf/app.src index 25328ed..5a0de3f 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,4 +1,4 @@ -SOURCE_URL=https://github.com/movim/movim/archive/v0.13.tar.gz -SOURCE_SUM=7aa5b2b6cd97e87a440981cfb6788a6f04ffd5eb4545026c49e1c61771593d11 +SOURCE_URL=https://github.com/movim/movim/archive/0.14.1.tar.gz +SOURCE_SUM=aa764569952fab61e681a54a03825308188931fa478783b32b58fb15a083292c SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz \ No newline at end of file diff --git a/conf/db.inc.php b/conf/db.inc.php index e876147..848cf9d 100644 --- a/conf/db.inc.php +++ b/conf/db.inc.php @@ -3,7 +3,7 @@ # You need to copy an rename this file to 'db.inc.php' and complete the values $conf = [ # The type can be 'pgsql' or 'mysql' - 'type' => 'mysql', + 'type' => 'pgsql', # The database username 'username' => '__DB_USER__', # The password @@ -11,7 +11,7 @@ $conf = [ # Where can we find the database ? 'host' => 'localhost', # The port number, 3306 for MySQL and 5432 for PostGreSQL - 'port' => 3306, + 'port' => 5432, # The database name 'database' => '__DB_NAME__' ]; diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index e6168d8..ba6e159 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -392,4 +392,6 @@ catch_workers_output = yes ;php_admin_value[memory_limit] = 32M php_admin_value[open_basedir] = none -php_admin_value[date.timezone] = "YHTZ" \ No newline at end of file +php_admin_value[date.timezone] = "YHTZ" + +extension=pdo_pgsql.so \ No newline at end of file diff --git a/conf/systemd.service b/conf/systemd.service index 2b90155..b5c9b52 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,13 +1,13 @@ [Unit] Description=Movim daemon (__APP__) -After=nginx.service network.target local-fs.target mysql.service +After=nginx.service network.target local-fs.target postgresql.service [Service] Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__/ -ExecStart=/usr/bin/php daemon.php start --url=https://YHURL --port=YHPORT +ExecStart=/usr/bin/php daemon.php start --url=https://__URL__ --port=__PORT__ StandardOutput=syslog SyslogIdentifier=__APP__ diff --git a/manifest.json b/manifest.json index d374662..4822f6b 100644 --- a/manifest.json +++ b/manifest.json @@ -5,7 +5,7 @@ "description": { "en": "The Kickass Social Network" }, - "version": "0.13.0~ynh2", + "version": "0.14.1~ynh1", "requirements": { "yunohost": ">= 3.4.0" }, @@ -23,7 +23,7 @@ "services": [ "nginx", "php-fpm", - "mysql", + "postgresql", "metronome" ], "multi_instance": false, diff --git a/scripts/install b/scripts/install index 278c35b..ad11e72 100644 --- a/scripts/install +++ b/scripts/install @@ -83,16 +83,25 @@ ynh_app_setting_set "$app" port "$port" #================================================= # Install packages -ynh_install_app_dependencies php-gd php-curl php-imagick php-cli php-zmq +ynh_install_app_dependencies php-curl php-cli php-mbstring php-pgsql php-xml \ + postgresql #================================================= -# CREATE A MYSQL DATABASE +# CREATE A PostgreSQL DATABASE #================================================= +ynh_psql_test_if_first_run + db_name=$(ynh_sanitize_dbid "$app") db_user=$db_name +db_pwd=$(ynh_string_random) ynh_app_setting_set "$app" db_name "$db_name" -ynh_mysql_setup_db "$db_user" "$db_name" +ynh_app_setting_set "$app" psqlpwd "$db_pwd" + +# Initialize database and store postgres password for upgrade +ynh_psql_create_db "$db_name" "$db_user" "$db_pwd" + +systemctl reload postgresql #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -148,8 +157,8 @@ ynh_replace_string "'/ws/'" "'${path_url%/}/ws/'" \ ( cd "$final_path" curl -sS https://getcomposer.org/installer | php -- --install-dir="$final_path" \ - && php composer.phar config --global discard-changes true --quiet \ - && php composer.phar install --no-interaction --quiet + && php composer.phar config --global discard-changes true --verbose \ + && php composer.phar install --no-interaction --verbose ) #================================================= @@ -157,8 +166,8 @@ ynh_replace_string "'/ws/'" "'${path_url%/}/ws/'" \ #================================================= # Create a dedicated systemd config -ynh_replace_string "__URL__" "${domain}${path_url}" ../conf/systemd.service -ynh_replace_string "__PORT__" "${port}" ../conf/systemd.service +ynh_replace_string "__URL__" "${domain}" ../conf/systemd.service +ynh_replace_string "__PORT__" "${port}" ../conf/systemd.service ynh_add_systemd_config #================================================= @@ -167,10 +176,13 @@ ynh_add_systemd_config ( cd "$final_path" - php mud.php db --set - php mud.php config --loglevel=1 \ - --locale="$language" --timezone="$timezone" \ - --username="$admin" --password="$password" + find | grep "phinx" + find | grep "daemon.php" + php vendor/bin/phinx migrate + php daemon.php config --username="$admin" --password="$password" + # php mud.php db --set + # php mud.php config --loglevel=1 \ + # --locale="$language" --timezone="$timezone" ) #================================================= @@ -192,7 +204,7 @@ chmod 400 "${final_path}/config/db.inc.php" # SSOwat configuration if [[ "$ssoenabled" -eq 0 ]]; then ynh_app_setting_set "$app" skipped_uris "/" - (cd "$final_path" && php mud.php config --xmppwhitelist="$domain") + #(cd "$final_path" && php mud.php config --xmppwhitelist="$domain") undo_sso_patch else ynh_app_setting_set "$app" unprotected_uris "/" diff --git a/scripts/remove b/scripts/remove index 8017332..5d33f5d 100644 --- a/scripts/remove +++ b/scripts/remove @@ -54,7 +54,7 @@ ynh_remove_app_dependencies # REMOVE THE MYSQL DATABASE #================================================= -ynh_mysql_remove_db "$db_user" "$db_name" +ynh_psql_remove_db "$db_user" "$db_name" #================================================= # REMOVE APP MAIN DIR diff --git a/scripts/upgrade b/scripts/upgrade index fb67c1e..2978da4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -82,7 +82,8 @@ path_url=$(ynh_normalize_url_path $path_url) # UPGRADE DEPENDENCIES #================================================= -ynh_install_app_dependencies php-gd php-curl php-imagick php-cli php-zmq +ynh_install_app_dependencies php-curl php-cli php-mbstring php-pgsql php-xml \ + postgresql #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -141,7 +142,7 @@ chmod 400 "${final_path}/config/db.inc.php" ( cd "$final_path" - php mud.php db --set + php vendor/bin/phinx migrate ) #================================================= @@ -170,7 +171,7 @@ fi # SSOwat configuration if [[ "$ssoenabled" = "No" ]]; then ynh_app_setting_set "$app" skipped_uris "/" - (cd "$final_path" && php mud.php config --xmppwhitelist="$domain") + #(cd "$final_path" && php mud.php config --xmppwhitelist="$domain") yunohost app ssowatconf undo_sso_patch else