-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V2 postgresql #597
Open
ericgaspar
wants to merge
477
commits into
testing
Choose a base branch
from
v2_PostgreSQL
base: testing
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+229
−224
Open
V2 postgresql #597
Changes from 100 commits
Commits
Show all changes
477 commits
Select commit
Hold shift + click to select a range
a52df89
Merge branch 'testing' into v2_PostgreSQL
ericgaspar e215d9c
find files before chown them
kay0u 5dc5e8b
chown the root folder too
kay0u 8d682cb
fix find condition
kay0u 706d507
find ... chmod is not faster, at least avoid to chown -R the data_dir…
kay0u d240d55
add a button in the config panel to run chown/chmod on data_dir
kay0u 30b2d81
we can avoid this chmod too i guess?
kay0u 55b5c79
only nextcloud is allowed to read the config file
kay0u 07f90a8
zblerg, the config file doesn't exist before install
kay0u 5556fb6
wait until nginx has actually remove the nextcloud conf during upgrad…
kay0u d7f9b2c
create a function for that
kay0u 49ec72b
fix change-url dav detection
kay0u 73a3498
only if domain has changed...
kay0u fa5da4f
Update scripts/_common.sh
kay0u 79c87b1
Merge pull request #712 from YunoHost-Apps/fix-dav-detection
kay0u 4372e3d
Merge pull request #711 from YunoHost-Apps/speedup-chown
kay0u ad86334
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 8a7f99d
moar sleep
kay0u 5e498de
oups
kay0u 8cfdb4f
Merge branch 'testing' into v2_PostgreSQL
ericgaspar f985ed4
Update _common.sh
ericgaspar e83c680
minor typos
ericgaspar a86e321
Update backup
ericgaspar 31fd6a5
minor typos
ericgaspar 2f88a3e
Merge branch 'testing' into v2_PostgreSQL
ericgaspar bf5ef59
Merge branch 'master' into testing
ericgaspar b6793f8
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 1c8a1ba
Fix removing ACL permissions on uninstall
x3rAx aae9736
Fix: Add missing `file` argument to `setfacl`
x3rAx abfb04d
Fix: Use absolute path for removing ACL permissions
x3rAx d8737db
Update manifest.toml
ericgaspar a531164
Auto-update READMEs
yunohost-bot 79ef249
Update manifest.toml
ericgaspar 2794d04
Auto-update READMEs
yunohost-bot 291157f
Merge branch 'testing' into v2_PostgreSQL
ericgaspar d7d2403
Add notify push option (#417)
kay0u 42a511f
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 9da7de2
Merge pull request #717 from x3rAx/patch-1
kay0u 047cfa3
Merge branch 'master' into testing
ericgaspar 5f3de8b
Merge branch 'testing' into v2_PostgreSQL
ericgaspar aca04bd
Remove ~duplicate pre-upgrade message (#723)
alexAubin 19ae3b0
Fix notify_push after reboot/restart the service, create the folder /…
kay0u aa5842d
Update manifest.toml
ericgaspar 6f7509a
Auto-update READMEs
yunohost-bot 5164bc7
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 46bffb0
Update backup
ericgaspar 294298d
Update upgrade
ericgaspar 4e0a635
Update upgrade
ericgaspar 22e9fb5
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 090070c
Auto-update READMEs
yunohost-bot af3a571
29.0.7
ericgaspar f43dc34
Auto-update READMEs
yunohost-bot 3d6ee20
Merge branch 'testing' into v2_PostgreSQL
ericgaspar fd7cfa6
30.0.0
ericgaspar 9b0133f
Update manifest.toml
ericgaspar 68d6833
Auto-update READMEs
yunohost-bot 6c8718d
cleaning
ericgaspar 63cf35d
Add comment about the cron check for high perf backend
alexAubin 7a1274d
Add extended description of the notify push option
alexAubin 82bd58f
Merge branch 'master' into testing
ericgaspar bb6200c
Merge branch 'testing' into v2_PostgreSQL
ericgaspar e7c5a94
Fixed backup (#732)
orhtej2 77e3ed5
Auto-update READMEs
yunohost-bot ab2df75
Update backup
ericgaspar 28ac86d
cleaning
ericgaspar ae9f506
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 3c23d05
cleaning
ericgaspar d1d315c
Update ADMIN.md (#734)
tomdereub 7701925
Merge branch 'master' into testing
ericgaspar a5c5b13
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 616b11b
Update ADMIN.md (#734)
tomdereub 978e71f
Add experimental curl tests
alexAubin 27202f9
Merge remote-tracking branch 'origin/testing' into v2_PostgreSQL
ericgaspar f1cd393
Update tests.toml
ericgaspar 5070326
Update tests.toml
ericgaspar cca6695
Update config
ericgaspar 7a23074
29.0.8
ericgaspar fa49faa
Auto-update READMEs
yunohost-bot 9cee1eb
fix linter
ericgaspar e317420
fix linter
ericgaspar d0804d6
Update manifest.toml
ericgaspar 7d6591f
cleaning
ericgaspar 12bca63
Update remove
ericgaspar b3ac029
Update tests.toml
ericgaspar 219ede2
Update manifest.toml
ericgaspar eea5c59
Auto-update READMEs
yunohost-bot 12737f2
Update install
ericgaspar 1b9777c
Update install
ericgaspar 53012e4
Update config_panel.toml
ericgaspar cc04eb6
Add fr translation
ericgaspar e8e04de
remove duplicate extension "js" (#742)
ericgaspar d1b1b97
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 8f8a3af
Update config_panel.toml
ericgaspar 83dd697
Update manifest.toml
ericgaspar 31e8c7a
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 960a061
fix translations
ericgaspar b420d09
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 13f1a40
Update config_panel.toml
ericgaspar ccbdda1
Update config_panel.toml
ericgaspar fb76147
Update config_panel.toml
ericgaspar fc03006
Update config_panel.toml
ericgaspar c523500
Update config_panel.toml
ericgaspar b100f02
Update manifest.toml
ericgaspar 801b5b1
Update manifest.toml
ericgaspar c738087
Update manifest.toml
ericgaspar bd68f75
Update manifest.toml
ericgaspar c9b8e60
Update manifest.toml
ericgaspar 81958af
Update manifest.toml
ericgaspar e454580
Update install
ericgaspar 1456e66
cleaning
ericgaspar 3195268
cleaning
ericgaspar ba124ac
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 62ed82c
cleaning
ericgaspar 67ea5d8
cleaning
ericgaspar 3fce63e
Auto-update READMEs
yunohost-bot 2781404
add link to the help menu
ericgaspar 6f868da
remove onlyoffice doc (#743)
ericgaspar 96c0aaf
cleaning
ericgaspar 2a296b7
Auto-update READMEs
yunohost-bot f235e0d
Update DESCRIPTION.md
ericgaspar 9015178
Merge branch 'testing' of https://github.com/YunoHost-Apps/nextcloud_…
ericgaspar b48322e
Auto-update READMEs
yunohost-bot 3f09926
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 51b65ef
Auto-update READMEs
yunohost-bot 5775213
cleaning
ericgaspar f713adf
Update install
ericgaspar 6fdae34
cleaning options (#744)
ericgaspar 4dcc964
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 6adab0f
Update remove
ericgaspar f830038
Update tests.toml
ericgaspar 0b374b1
Update tests.toml
ericgaspar 159848e
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 41ecf07
Update manifest.toml
ericgaspar ee48880
Auto-update READMEs
yunohost-bot 47fe09a
29.0.9 (#747)
ericgaspar ccf915d
Merge branch 'master' into testing
ericgaspar 8e9d4a1
Update restore
grenagit e095ec2
Merge pull request #751 from grenagit/master
orhtej2 186ee85
Merge branch 'testing' into v2_PostgreSQL
ericgaspar be0378e
30.0.2 (#729)
ericgaspar 4251386
Merge branch 'master' into testing
ericgaspar b01ace6
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 2b41e99
[comit] Forward Email?
Thatoo 383f3b7
Update config_panel.toml
Thatoo c7f7043
Update config_panel.toml
Thatoo 16b5030
Update config_panel.toml
Thatoo e908223
Update config_panel.toml
Thatoo 9790ea9
Update config_panel.toml
Thatoo 866fb3c
Update tests.toml
ericgaspar cbc06de
add name nextcloud LDAP config to get__enable_forward_email
Thatoo 9e5bcc1
Add quote in if [ $(cmd) = value ] because i'm paranoid about [ synta…
alexAubin eb0d815
Merge pull request #753 from Thatoo/testing
alexAubin b9354d0
Auto-update READMEs
yunohost-bot d5dc328
Merge branch 'testing' into v2_PostgreSQL
ericgaspar f462401
Update manifest.toml: revert to 29.0.8 with prefetch = false to fix t…
alexAubin b7b5f34
Disable output buffering (#758)
tituspijean bbc4016
Merge branch 'testing' into v2_PostgreSQL
ericgaspar aea6a8d
Update backup
ericgaspar bbe67c1
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 4ec797a
Update manifest.toml
ericgaspar e4b820d
Auto-update READMEs
yunohost-bot 9c62179
Update manifest.toml
ericgaspar bb2c68f
Auto-update READMEs
yunohost-bot f7b29ec
Update manifest.toml
ericgaspar 86f7bcd
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 503d43e
Merge branch 'master' into testing
ericgaspar a40c87d
Auto-update READMEs
yunohost-bot 0963e9f
Update upgrade
ericgaspar c8bf2fa
Update tests.toml
ericgaspar 53e1dac
Update upgrade
ericgaspar daae841
Update scripts/upgrade: gotta use -E for grep to recognize the + quan…
alexAubin a29f995
Helpers 2.1 (v30.0.3) (#746)
ericgaspar e3c200f
Merge branch 'testing' into v2_PostgreSQL
ericgaspar e6ada49
fix
ericgaspar be5f0d3
fix
ericgaspar e13f8b0
Update install
ericgaspar befff2c
Update upgrade
ericgaspar 099d3f5
Update upgrade
ericgaspar 2d4c475
Update upgrade
ericgaspar 079f46d
fix linter (#761)
ericgaspar 738d340
Update upgrade
ericgaspar f1d20fa
Update upgrade
ericgaspar 0819230
Update upgrade
ericgaspar d4a85b7
Update upgrade
ericgaspar ec20544
Update manifest.toml
ericgaspar 765e53c
Update upgrade
ericgaspar 393c62f
Update backup
ericgaspar 3681366
Update install
ericgaspar b4a9834
cleaning
ericgaspar d70264b
Merge branch 'testing' into v2_PostgreSQL
ericgaspar ddbd0d2
Fix linter
ericgaspar 0065032
Update nginx.conf
ericgaspar 7a3de93
Update nginx.conf
ericgaspar 7bd9ff8
Update nginx.conf
ericgaspar 22449fe
Update nginx.conf
ericgaspar 6c9727c
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 9de599d
Update nginx.conf
ericgaspar 125789f
Update nginx.conf
ericgaspar 3acdd4e
Update nginx.conf
ericgaspar f482f01
Update nginx.conf
ericgaspar cfa6ef0
Update nginx.conf
ericgaspar 53ded55
Merge branch 'testing' into v2_PostgreSQL
ericgaspar e0a2903
Update nginx.conf
ericgaspar 6fa35e0
Update nginx.conf
ericgaspar 9b21787
Update nginx.conf
ericgaspar 43a05fe
Update nginx.conf
ericgaspar 27a0f35
Update nginx.conf
ericgaspar 3792e6a
Update nginx.conf
ericgaspar 2405cc4
Update nginx.conf
ericgaspar 284ce68
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 0de16ba
Update nginx.conf
ericgaspar 28bf9b0
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 8bc0cff
Update manifest.toml
ericgaspar 2e9a4c3
Auto-update READMEs
yunohost-bot c291b2e
Update manifest.toml
ericgaspar 3aa9f9c
Update manifest.toml
ericgaspar 807afd3
Auto-update READMEs
yunohost-bot 31bbb25
fix
ericgaspar 6912d19
Merge branch 'v2_PostgreSQL' of https://github.com/YunoHost-Apps/next…
ericgaspar 893daef
fix
ericgaspar fc6f6d1
cleaning
ericgaspar e577054
Merge branch 'testing' into v2_PostgreSQL
ericgaspar fb3b792
cleaning
ericgaspar c69a918
Merge branch 'master' into testing
ericgaspar d2da1e9
cleaning
ericgaspar 01c4e95
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 7638991
Update restore
ericgaspar 21f3762
Update nginx.conf
ericgaspar ccb2852
Update nginx.conf
ericgaspar d7f97a7
Update nginx.conf
ericgaspar c159f38
Update nginx.conf
ericgaspar a0cd8e2
Update nginx.conf
ericgaspar 8b0d660
Update nginx.conf
ericgaspar 9f434e5
Update nginx.conf
ericgaspar 6e5bf97
Update nginx.conf
ericgaspar e785d25
add headers (#763)
ericgaspar 94316af
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 2a8269b
Update manifest.toml
ericgaspar cc6a64f
Update manifest.toml
ericgaspar 43aae5d
Update nginx.conf
ericgaspar f6be830
Update tests.toml
ericgaspar fd1be95
Merge branch 'testing' into v2_PostgreSQL
ericgaspar bab7c6f
Merge branch 'master' into testing
ericgaspar 0add99d
move function to common.sh (#764)
ericgaspar 3ad7fa1
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 1e41918
add default_phone_region
ericgaspar f7a653d
Update nginx.conf
ericgaspar c0ef5cc
Merge branch 'testing' into v2_PostgreSQL
ericgaspar 46b5d9a
Update nginx.conf
ericgaspar fa73bf6
Update remove
ericgaspar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -62,6 +62,34 @@ exec_occ() { | |
php$NEXTCLOUD_PHP_VERSION --define apc.enable_cli=1 occ --no-interaction --no-ansi "$@") | ||
} | ||
|
||
#================================================= | ||
# HANDLE DATABASE MIGRATION FROM MYSL TO PSQL | ||
#================================================= | ||
|
||
mysql_db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) | ||
|
||
if [ -n "$mysql_db_pwd" ] | ||
then | ||
ynh_script_progression --message="Migrating to PostgreSQL database..." --weight=3 | ||
|
||
#ynh_backup_if_checksum_is_different --file="$install_dir/config/config.php" | ||
|
||
ynh_psql_test_if_first_run | ||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name #--db_pwd=$(ynh_string_random) | ||
#ynh_app_setting_set --app=$app --key=psqlpwd --value=$db_pwd | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that we are in packaging v2, the DB should already be provisioned before the upgrade happens so eeeeh |
||
|
||
exec_occ db:convert-type --all-apps --clear-schema pgsql $db_name 127.0.0.1 $db_name --password=$db_pwd -n | ||
|
||
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name | ||
ynh_app_setting_delete --app=$app --key=mysqlpwd | ||
|
||
#ynh_store_file_checksum --file="${install_dir}/config/config.php" | ||
fi | ||
ericgaspar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
#================================================= | ||
# DOWNLOAD, CHECK AND UNPACK SOURCE | ||
#================================================= | ||
|
||
# Define a function to add an external storage | ||
# Create the external storage for the given folders and enable sharing | ||
create_external_storage() { | ||
|
@@ -90,15 +118,6 @@ then | |
# Print the current version number of Nextcloud | ||
exec_occ -V | ||
|
||
if [ "$(exec_occ config:system:get mysql.utf8mb4)" != "true" ]; then | ||
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) | ||
# Change your databases character set and collation | ||
ynh_mysql_connect_as --user=$db_user --password="$db_pwd" --database=$db_name \ | ||
<<< "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;" | ||
# Set the mysql.utf8mb4 config to true in config.php | ||
exec_occ config:system:set mysql.utf8mb4 --type boolean --value="true" | ||
exec_occ maintenance:repair | ||
fi | ||
|
||
# Upgrade may fail if this app is enabled | ||
# Take all apps enabled, and check if mail is one of them | ||
|
@@ -202,13 +221,13 @@ EOF | |
#================================================= | ||
# CONFIGURE NEXTCLOUD | ||
#================================================= | ||
ynh_script_progression --message="Reconfiguring Nextcloud..." --weight=9 | ||
ynh_script_progression --message="Reconfiguring $app..." --weight=9 | ||
|
||
# Verify the checksum and backup the file if it's different | ||
ynh_backup_if_checksum_is_different --file="$install_dir/config/config.php" | ||
|
||
nc_conf="${install_dir}/config.json" | ||
ynh_add_config --template="../conf/config.json" --destination="$nc_conf" | ||
ynh_add_config --template="config.json" --destination="$nc_conf" | ||
|
||
# Reneable the mail app | ||
if [ $mail_app_must_be_reactived -eq 1 ]; then | ||
|
@@ -275,7 +294,7 @@ EOF | |
fi | ||
|
||
#================================================= | ||
# REGEN SYSTEM CONFIGURATIONS | ||
# REGEN PERMISSIONS | ||
#================================================= | ||
ynh_script_progression --message="Reapplying file permissions..." --weight=2 | ||
|
||
|
@@ -295,15 +314,15 @@ chmod 750 $install_dir | |
#================================================= | ||
ynh_script_progression --message="Regenerating system configurations for $app..." --weight=2 | ||
|
||
# ------- | ||
#------------------------------------------------- | ||
# PHP-FPM | ||
# ------- | ||
#------------------------------------------------- | ||
|
||
ynh_add_fpm_config | ||
|
||
# ------- | ||
#------------------------------------------------- | ||
# NGINX | ||
# ------- | ||
#------------------------------------------------- | ||
|
||
# Delete current NGINX configuration to be able to check if .well-known is already served. | ||
ynh_backup_if_checksum_is_different --file="/etc/nginx/conf.d/$domain.d/$app.conf" | ||
|
@@ -325,27 +344,29 @@ fi | |
# Create a dedicated NGINX config | ||
ynh_add_nginx_config | ||
|
||
# ------- | ||
#------------------------------------------------- | ||
# CRON JOB | ||
# ------- | ||
#------------------------------------------------- | ||
|
||
cron_path="/etc/cron.d/$app" | ||
ynh_add_config --template="../conf/nextcloud.cron" --destination="$cron_path" | ||
chown root: "$cron_path" | ||
chmod 644 "$cron_path" | ||
|
||
exec_occ background:cron | ||
|
||
# ------- | ||
#------------------------------------------------- | ||
# LOGROTATE | ||
# ------- | ||
#------------------------------------------------- | ||
|
||
ynh_use_logrotate --non-append | ||
|
||
# ------- | ||
#------------------------------------------------- | ||
# FAIL2BAN | ||
# ------- | ||
#------------------------------------------------- | ||
|
||
# Create a dedicated Fail2Ban config | ||
ynh_add_fail2ban_config --logpath="/home/yunohost.app/$app/data/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: '<HOST>'.*$" --max_retry=5 | ||
ynh_add_fail2ban_config --logpath="$data_dir/data/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: '<HOST>'.*$" --max_retry=5 | ||
|
||
#================================================= | ||
# END OF SCRIPT | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we can really rely on the mysqlpwd ... It's supposed to be automatically deleted and renamed to
db_pwd
during the v1->v2 transition (so before running this script), cf https://github.com/YunoHost/yunohost/blob/dev/src/utils/resources.py#L1366-L1372There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about something like Mattermost https://github.com/YunoHost-Apps/mattermost_ynh/blob/52d95b9785edbe71e84fb9b99a26bec68544f123/scripts/upgrade#L40