1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/traccar_ynh.git synced 2024-09-03 20:35:56 +02:00

Merge pull request #2 from YunoHost-Apps/postgresql

fix
This commit is contained in:
eric_G 2023-11-19 14:58:58 +01:00 committed by GitHub
commit 4414818530
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 10 deletions

View file

@ -18,8 +18,8 @@
--> -->
<entry key='database.driver'>com.mysql.cj.jdbc.Driver</entry> <entry key='database.driver'>org.postgresql.Driver</entry>
<entry key='database.url'>jdbc:mysql://localhost/__DB_NAME__?zeroDateTimeBehavior=round&amp;serverTimezone=UTC&amp;allowPublicKeyRetrieval=true&amp;useSSL=false&amp;allowMultiQueries=true&amp;autoReconnect=true&amp;useUnicode=yes&amp;characterEncoding=UTF-8&amp;sessionVariables=sql_mode=''</entry> <entry key='database.url'>jdbc:postgresql://localhost/__DB_NAME__</entry>
<entry key='database.user'>__DB_USER__</entry> <entry key='database.user'>__DB_USER__</entry>
<entry key='database.password'>__DB_PWD__</entry> <entry key='database.password'>__DB_PWD__</entry>
@ -34,6 +34,8 @@
<entry key='mail.smtp.starttls.enable'>false</entry> <entry key='mail.smtp.starttls.enable'>false</entry>
<entry key='mail.smtp.username'>__APP__</entry> <entry key='mail.smtp.username'>__APP__</entry>
<entry key='mail.smtp.password'>__MAIL_PWD__</entry> <entry key='mail.smtp.password'>__MAIL_PWD__</entry>
<entry key='mail.smtp.from'>__APP__@__MAIN_DOMAIN__</entry>
<!-- <!--
<entry key='ldap.url'>ldap://127.0.0.1</entry> <entry key='ldap.url'>ldap://127.0.0.1</entry>
<entry key='ldap.port'>389</entry> <entry key='ldap.port'>389</entry>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 554 KiB

After

Width:  |  Height:  |  Size: 438 KiB

View file

@ -67,7 +67,7 @@ ram.runtime = "50M"
[resources.ports] [resources.ports]
[resources.apt] [resources.apt]
packages = "mariadb-server, openjdk-11-jre-headless" packages = "postgresql, openjdk-11-jre-headless"
[resources.database] [resources.database]
type = "mysql" type = "postgresql"

View file

@ -41,11 +41,11 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/etc/systemd/system/$app.service"
#================================================= #=================================================
# BACKUP THE MYSQL DATABASE # BACKUP THE SQL DATABASE
#================================================= #=================================================
ynh_print_info --message="Backing up the MySQL database..." ynh_print_info --message="Backing up the PostgreSQL database..."
ynh_mysql_dump_db --database="$db_name" > db.sql ynh_psql_dump_db --database="$db_name" > db.sql
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -9,6 +9,8 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
main_domain=$(cat /etc/yunohost/current_host)
#================================================= #=================================================
# APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC) # APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC)
#================================================= #=================================================

View file

@ -31,11 +31,11 @@ ynh_restore_file --origin_path="$data_dir" --not_mandatory
chown -R $app:www-data "$data_dir" chown -R $app:www-data "$data_dir"
#================================================= #=================================================
# RESTORE THE MYSQL DATABASE # RESTORE THE POSTGRESQL DATABASE
#================================================= #=================================================
ynh_script_progression --message="Restoring the MySQL database..." --weight=1 ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
#================================================= #=================================================
# RESTORE SYSTEM CONFIGURATIONS # RESTORE SYSTEM CONFIGURATIONS