Skip to content
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
wants to merge 372 commits into
base: testing
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
372 commits
Select commit Hold shift + click to select a range
4a83c2b
Update manifest.toml
ericgaspar Feb 1, 2024
c67899f
Auto-update README
yunohost-bot Feb 1, 2024
37fe56f
Update config.json
ericgaspar Feb 1, 2024
8aab6f7
Update upgrade
ericgaspar Feb 1, 2024
29fc438
Update upgrade
ericgaspar Feb 1, 2024
8912fbe
Update upgrade
ericgaspar Feb 1, 2024
d5cfec0
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Feb 1, 2024
e9d9b28
Update nginx.conf
ericgaspar Feb 3, 2024
f592437
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Feb 21, 2024
98c13e0
Auto-update README
yunohost-bot Feb 21, 2024
08d190f
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Feb 27, 2024
ef5b058
Update manifest.toml
ericgaspar Feb 29, 2024
91b1e7f
Auto-update README
yunohost-bot Feb 29, 2024
c1d0950
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Feb 29, 2024
3c5f4f5
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Feb 29, 2024
bc905bc
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Mar 1, 2024
ec910e1
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Mar 8, 2024
8416531
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Mar 9, 2024
d0645b9
Update manifest.toml
ericgaspar Mar 28, 2024
b40d079
Auto-update READMEs
yunohost-bot Mar 28, 2024
061dcc1
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Apr 3, 2024
cbfc4bd
Auto-update READMEs
yunohost-bot Apr 3, 2024
6e7edc4
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Apr 9, 2024
aa462e9
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Apr 16, 2024
09219ab
remove upgrade_type
ericgaspar Apr 18, 2024
e509d37
Revert "remove upgrade_type"
ericgaspar Apr 19, 2024
a423112
29
ericgaspar Apr 23, 2024
cca9460
Auto-update READMEs
yunohost-bot Apr 23, 2024
06a9c07
Update manifest.toml
ericgaspar Apr 23, 2024
e5d224a
Auto-update READMEs
yunohost-bot Apr 23, 2024
611a61a
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Apr 24, 2024
89f4373
Merge branch 'testing' into 29.0.0
ericgaspar Apr 25, 2024
ded5039
Merge branch 'testing' into 29.0.0
ericgaspar Apr 26, 2024
eacd8f2
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Apr 26, 2024
3503f0e
add pre upgrade warning for NC 29
OniriCorpe Apr 26, 2024
8d7ac4c
Merge branch '29.0.0' into v2_PostgreSQL
ericgaspar May 17, 2024
1d0d3f1
Auto-update READMEs
yunohost-bot May 17, 2024
6d0c2ce
update to PHP8.3
ericgaspar May 22, 2024
2b1d579
Auto-update READMEs
yunohost-bot May 22, 2024
04b7894
Update manifest.toml
ericgaspar May 22, 2024
1ffe5e4
Auto-update READMEs
yunohost-bot May 22, 2024
7c9f968
Merge pull request #684 from YunoHost-Apps/29.0.0
ericgaspar May 23, 2024
cc263ec
Update manifest.toml
ericgaspar May 23, 2024
0d05a77
Auto-update READMEs
yunohost-bot May 23, 2024
1b66d7f
Fix space splitting in phpflags on install (#690)
lyynd Jun 1, 2024
c3ec387
Merge branch 'master' into testing
ericgaspar Jun 1, 2024
f6a8dc8
Auto-update READMEs
yunohost-bot Jun 1, 2024
652d6de
Update upgrade
ericgaspar Jun 2, 2024
a524e08
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Jun 2, 2024
2fef2c7
Update upgrade
ericgaspar Jun 3, 2024
253357a
Update manifest.toml
ericgaspar Jun 6, 2024
cc45b8e
Auto-update READMEs
yunohost-bot Jun 6, 2024
9a233f5
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Jun 6, 2024
38c2ecc
Fix phpflags (#691)
tituspijean Jun 8, 2024
1c3536c
Update upgrade
ericgaspar Jun 20, 2024
73a3f0d
Update upgrade
ericgaspar Jun 20, 2024
36cd0dc
Update upgrade
ericgaspar Jun 20, 2024
361f046
Update upgrade
ericgaspar Jun 20, 2024
1ab6c01
Fix upgrade: php version is 8.3 starting from 29.x ? (#692)
alexAubin Jun 20, 2024
ef6d230
Update manifest.toml
ericgaspar Jun 20, 2024
6aa7821
Auto-update READMEs
yunohost-bot Jun 20, 2024
6870be0
Update tests.toml
ericgaspar Jun 20, 2024
336bc29
Merge branch 'testing' of https://github.com/YunoHost-Apps/nextcloud_…
ericgaspar Jun 20, 2024
25b828b
Merge branch 'master' into testing
ericgaspar Jun 20, 2024
09e7966
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Jun 20, 2024
89899fd
[autopatch] Do not delete logs on app removal (#697)
yunohost-bot Jun 23, 2024
2f0cfe5
[autopatch] Do not delete logs on app removal (#698)
yunohost-bot Jun 23, 2024
d848e73
29.0.3
ericgaspar Jun 25, 2024
e584e31
Auto-update READMEs
yunohost-bot Jun 25, 2024
26bfa59
Update remove
ericgaspar Jun 25, 2024
0a4b38f
Merge branch 'testing' of https://github.com/YunoHost-Apps/nextcloud_…
ericgaspar Jun 25, 2024
7e51d53
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Jun 25, 2024
2d4ff6b
Update upgrade
ericgaspar Jun 25, 2024
1583a7c
Update upgrade
ericgaspar Jun 25, 2024
4d8b668
Update upgrade
ericgaspar Jun 25, 2024
88fbb73
Indent
alexAubin Jun 27, 2024
f7c21e4
Fix again upgrade ending with Nextcloud being in PHP 8.2 ?
alexAubin Jun 27, 2024
b96736a
Auto-update READMEs
yunohost-bot Jun 27, 2024
e33fafe
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Jun 27, 2024
d9b99c4
Update upgrade
ericgaspar Jun 27, 2024
42ae252
Update nginx.conf
ericgaspar Jul 1, 2024
0691cf4
Merge branch 'NGINX-upstream-setting' into v2_PostgreSQL
ericgaspar Jul 1, 2024
9fcb43a
Update manifest.toml
ericgaspar Jul 18, 2024
49e88d8
Auto-update READMEs
yunohost-bot Jul 18, 2024
7c23c3a
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Jul 18, 2024
0742c99
Auto-update READMEs
yunohost-bot Jul 18, 2024
70e9e72
Rework DESCRIPTION.md (#707)
alexAubin Jul 18, 2024
c0a58b2
bump all old versions
kay0u Jul 25, 2024
9d44878
oupsie
kay0u Jul 25, 2024
9bb5bee
Auto-update READMEs
yunohost-bot Jul 25, 2024
0380b1f
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Jul 26, 2024
8a090a9
Update upgrade
ericgaspar Jul 26, 2024
7d25e4e
Update upgrade
ericgaspar Jul 26, 2024
1cb2448
system_addressbook_exposed is a boolean
kay0u Jul 29, 2024
0c4ab48
Auto-update READMEs
yunohost-bot Jul 29, 2024
a3173b7
Merge pull request #703 from YunoHost-Apps/NGINX-upstream-setting
kay0u Jul 29, 2024
4da627e
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Jul 29, 2024
7f40b5a
migrate system_addressbook_exposed to boolean, fix upgrade test
kay0u Jul 29, 2024
4fa1f99
another fix for system_addressbook_exposed, update the dav conf accor…
kay0u Jul 29, 2024
ae91654
zblerg, do not modify system_addressbook_exposed config value in the …
kay0u Jul 29, 2024
4b9224f
add redis-server as deps
kay0u Jul 30, 2024
cbc8971
Update manifest.toml
ericgaspar Jul 30, 2024
de7afc9
Update manifest.toml
ericgaspar Jul 30, 2024
bc59bba
Merge pull request #710 from YunoHost-Apps/trying-to-fix-the-upgrade-…
kay0u Jul 30, 2024
12024a6
Merge branch 'master' into testing
ericgaspar Jul 30, 2024
a52df89
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Jul 30, 2024
e215d9c
find files before chown them
kay0u Jul 30, 2024
5dc5e8b
chown the root folder too
kay0u Jul 30, 2024
8d682cb
fix find condition
kay0u Jul 31, 2024
706d507
find ... chmod is not faster, at least avoid to chown -R the data_dir…
kay0u Jul 31, 2024
d240d55
add a button in the config panel to run chown/chmod on data_dir
kay0u Jul 31, 2024
30b2d81
we can avoid this chmod too i guess?
kay0u Jul 31, 2024
55b5c79
only nextcloud is allowed to read the config file
kay0u Jul 31, 2024
07f90a8
zblerg, the config file doesn't exist before install
kay0u Aug 1, 2024
5556fb6
wait until nginx has actually remove the nextcloud conf during upgrad…
kay0u Aug 1, 2024
d7f9b2c
create a function for that
kay0u Aug 1, 2024
49ec72b
fix change-url dav detection
kay0u Aug 1, 2024
73a3498
only if domain has changed...
kay0u Aug 1, 2024
fa5da4f
Update scripts/_common.sh
kay0u Aug 1, 2024
79c87b1
Merge pull request #712 from YunoHost-Apps/fix-dav-detection
kay0u Aug 1, 2024
4372e3d
Merge pull request #711 from YunoHost-Apps/speedup-chown
kay0u Aug 1, 2024
ad86334
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Aug 1, 2024
8a7f99d
moar sleep
kay0u Aug 1, 2024
5e498de
oups
kay0u Aug 1, 2024
8cfdb4f
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Aug 2, 2024
f985ed4
Update _common.sh
ericgaspar Aug 3, 2024
e83c680
minor typos
ericgaspar Aug 3, 2024
a86e321
Update backup
ericgaspar Aug 3, 2024
31fd6a5
minor typos
ericgaspar Aug 3, 2024
2f88a3e
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Aug 3, 2024
bf5ef59
Merge branch 'master' into testing
ericgaspar Aug 8, 2024
b6793f8
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Aug 8, 2024
1c8a1ba
Fix removing ACL permissions on uninstall
x3rAx Aug 13, 2024
aae9736
Fix: Add missing `file` argument to `setfacl`
x3rAx Aug 13, 2024
abfb04d
Fix: Use absolute path for removing ACL permissions
x3rAx Aug 13, 2024
d8737db
Update manifest.toml
ericgaspar Aug 20, 2024
a531164
Auto-update READMEs
yunohost-bot Aug 20, 2024
79ef249
Update manifest.toml
ericgaspar Aug 20, 2024
2794d04
Auto-update READMEs
yunohost-bot Aug 20, 2024
291157f
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Aug 22, 2024
d7d2403
Add notify push option (#417)
kay0u Aug 27, 2024
42a511f
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Aug 27, 2024
9da7de2
Merge pull request #717 from x3rAx/patch-1
kay0u Aug 27, 2024
047cfa3
Merge branch 'master' into testing
ericgaspar Aug 27, 2024
5f3de8b
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Aug 27, 2024
aca04bd
Remove ~duplicate pre-upgrade message (#723)
alexAubin Aug 30, 2024
19ae3b0
Fix notify_push after reboot/restart the service, create the folder /…
kay0u Sep 1, 2024
aa5842d
Update manifest.toml
ericgaspar Sep 3, 2024
6f7509a
Auto-update READMEs
yunohost-bot Sep 3, 2024
5164bc7
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Sep 3, 2024
46bffb0
Update backup
ericgaspar Sep 3, 2024
294298d
Update upgrade
ericgaspar Sep 3, 2024
4e0a635
Update upgrade
ericgaspar Sep 3, 2024
22e9fb5
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Sep 12, 2024
090070c
Auto-update READMEs
yunohost-bot Sep 12, 2024
af3a571
29.0.7
ericgaspar Sep 12, 2024
f43dc34
Auto-update READMEs
yunohost-bot Sep 12, 2024
3d6ee20
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Sep 12, 2024
fd7cfa6
30.0.0
ericgaspar Sep 14, 2024
9b0133f
Update manifest.toml
ericgaspar Sep 14, 2024
68d6833
Auto-update READMEs
yunohost-bot Sep 14, 2024
6c8718d
cleaning
ericgaspar Sep 15, 2024
63cf35d
Add comment about the cron check for high perf backend
alexAubin Sep 18, 2024
7a1274d
Add extended description of the notify push option
alexAubin Sep 18, 2024
82bd58f
Merge branch 'master' into testing
ericgaspar Sep 18, 2024
bb6200c
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Sep 18, 2024
e7c5a94
Fixed backup (#732)
orhtej2 Sep 25, 2024
77e3ed5
Auto-update READMEs
yunohost-bot Sep 25, 2024
ab2df75
Update backup
ericgaspar Sep 25, 2024
28ac86d
cleaning
ericgaspar Sep 25, 2024
ae9f506
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Sep 27, 2024
3c23d05
cleaning
ericgaspar Sep 27, 2024
d1d315c
Update ADMIN.md (#734)
tomdereub Sep 30, 2024
7701925
Merge branch 'master' into testing
ericgaspar Sep 30, 2024
a5c5b13
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Sep 30, 2024
27202f9
Merge remote-tracking branch 'origin/testing' into v2_PostgreSQL
ericgaspar Oct 1, 2024
f1cd393
Update tests.toml
ericgaspar Oct 1, 2024
5070326
Update tests.toml
ericgaspar Oct 1, 2024
cca6695
Update config
ericgaspar Oct 2, 2024
e317420
fix linter
ericgaspar Oct 11, 2024
d0804d6
Update manifest.toml
ericgaspar Oct 11, 2024
7d6591f
cleaning
ericgaspar Oct 11, 2024
219ede2
Update manifest.toml
ericgaspar Oct 17, 2024
eea5c59
Auto-update READMEs
yunohost-bot Oct 17, 2024
12737f2
Update install
ericgaspar Oct 25, 2024
1b9777c
Update install
ericgaspar Oct 25, 2024
53012e4
Update config_panel.toml
ericgaspar Oct 25, 2024
d1b1b97
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Oct 25, 2024
31e8c7a
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Nov 3, 2024
b420d09
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Nov 3, 2024
13f1a40
Update config_panel.toml
ericgaspar Nov 3, 2024
fb76147
Update config_panel.toml
ericgaspar Nov 3, 2024
fc03006
Update config_panel.toml
ericgaspar Nov 3, 2024
801b5b1
Update manifest.toml
ericgaspar Nov 3, 2024
c738087
Update manifest.toml
ericgaspar Nov 3, 2024
ba124ac
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Nov 3, 2024
62ed82c
cleaning
ericgaspar Nov 4, 2024
67ea5d8
cleaning
ericgaspar Nov 4, 2024
3fce63e
Auto-update READMEs
yunohost-bot Nov 4, 2024
3f09926
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Nov 4, 2024
51b65ef
Auto-update READMEs
yunohost-bot Nov 4, 2024
5775213
cleaning
ericgaspar Nov 4, 2024
f713adf
Update install
ericgaspar Nov 4, 2024
4dcc964
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Nov 4, 2024
159848e
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Nov 6, 2024
41ecf07
Update manifest.toml
ericgaspar Nov 7, 2024
ee48880
Auto-update READMEs
yunohost-bot Nov 7, 2024
186ee85
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Nov 11, 2024
b01ace6
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Nov 17, 2024
d5dc328
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Dec 3, 2024
bbc4016
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Dec 3, 2024
bbe67c1
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Dec 3, 2024
9c62179
Update manifest.toml
ericgaspar Dec 5, 2024
bb2c68f
Auto-update READMEs
yunohost-bot Dec 5, 2024
86f7bcd
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Dec 5, 2024
0963e9f
Update upgrade
ericgaspar Dec 5, 2024
e3c200f
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Dec 10, 2024
e6ada49
fix
ericgaspar Dec 11, 2024
be5f0d3
fix
ericgaspar Dec 11, 2024
e13f8b0
Update install
ericgaspar Dec 11, 2024
befff2c
Update upgrade
ericgaspar Dec 11, 2024
099d3f5
Update upgrade
ericgaspar Dec 11, 2024
2d4c475
Update upgrade
ericgaspar Dec 11, 2024
079f46d
fix linter (#761)
ericgaspar Dec 11, 2024
738d340
Update upgrade
ericgaspar Dec 11, 2024
f1d20fa
Update upgrade
ericgaspar Dec 11, 2024
0819230
Update upgrade
ericgaspar Dec 11, 2024
d4a85b7
Update upgrade
ericgaspar Dec 11, 2024
ec20544
Update manifest.toml
ericgaspar Dec 11, 2024
765e53c
Update upgrade
ericgaspar Dec 11, 2024
393c62f
Update backup
ericgaspar Dec 11, 2024
3681366
Update install
ericgaspar Dec 11, 2024
d70264b
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Dec 11, 2024
0065032
Update nginx.conf
ericgaspar Dec 11, 2024
22449fe
Update nginx.conf
ericgaspar Dec 11, 2024
6c9727c
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Dec 11, 2024
f482f01
Update nginx.conf
ericgaspar Dec 11, 2024
cfa6ef0
Update nginx.conf
ericgaspar Dec 11, 2024
53ded55
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Dec 11, 2024
9b21787
Update nginx.conf
ericgaspar Dec 11, 2024
43a05fe
Update nginx.conf
ericgaspar Dec 11, 2024
2405cc4
Update nginx.conf
ericgaspar Dec 11, 2024
284ce68
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Dec 11, 2024
28bf9b0
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Dec 11, 2024
c291b2e
Update manifest.toml
ericgaspar Dec 12, 2024
3aa9f9c
Update manifest.toml
ericgaspar Dec 12, 2024
807afd3
Auto-update READMEs
yunohost-bot Dec 12, 2024
31bbb25
fix
ericgaspar Dec 12, 2024
6912d19
Merge branch 'v2_PostgreSQL' of https://github.com/YunoHost-Apps/next…
ericgaspar Dec 12, 2024
e577054
Merge branch 'testing' into v2_PostgreSQL
ericgaspar Dec 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions conf/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"hashing_default_password": true,
"localstorage.allowsymlinks": true,
"simpleSignUpLink.shown": false,
"default_phone_region": "",
"maintenance_window_start": 1,
"mail_smtpmode": "smtp",
"mail_smtpport": "25",
Expand Down
7 changes: 4 additions & 3 deletions manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ multi_instance = true
ldap = true
sso = true

disk = "650M"
disk = "850M"
ram.build = "250M"
ram.runtime = "512M"

Expand Down Expand Up @@ -116,7 +116,8 @@ ram.runtime = "512M"
api.allowed = ["visitors", "all_users"]

[resources.apt]
packages = "mariadb-server, imagemagick, libmagickcore-6.q16-6-extra, acl, tar, smbclient, at, redis-server, php8.3-fpm, php8.3-bz2, php8.3-imap, php8.3-gmp, php8.3-gd, php8.3-intl, php8.3-curl, php8.3-apcu, php8.3-redis, php8.3-ldap, php8.3-imagick, php8.3-zip, php8.3-mbstring, php8.3-xml, php8.3-mysql, php8.3-igbinary, php8.3-bcmath"
packages = "postgresql, imagemagick, libmagickcore-6.q16-6-extra, acl, tar, smbclient, at, redis-server, php8.3-pgsql, php8.3-mysql, php8.3-fpm, php8.3-bz2, php8.3-imap, php8.3-gmp, php8.3-gd, php8.3-intl, php8.3-curl, php8.3-apcu, php8.3-redis, php8.3-ldap, php8.3-imagick, php8.3-zip, php8.3-mbstring, php8.3-xml, php8.3-igbinary, php8.3-bcmath"

[resources.database]
type = "mysql"
type = "postgresql"

6 changes: 3 additions & 3 deletions scripts/backup
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ ynh_backup "/etc/cron.d/$app"
ynh_backup "/var/log/$app"

#=================================================
# BACKUP THE MYSQL DATABASE
# BACKUP THE POSTGRESQL DATABASE
#=================================================
ynh_print_info "Backing up the MySQL database..."
ynh_print_info "Backing up the PostgreSQL database..."

ynh_mysql_dump_db > db.sql
ynh_psql_dump_db > db.sql

#=================================================
# BACKUP THE NOTIFY_PUSH APP
Expand Down
16 changes: 4 additions & 12 deletions scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ ynh_app_setting_set --key=enable_notify_push --value=0
system_addressbook_exposed="0"
ynh_app_setting_set --key=system_addressbook_exposed --value=0

#=================================================
# CREATE A MYSQL DATABASE
#=================================================
ynh_script_progression "Migrate MySQL database to utf8..."

ynh_mysql_db_shell <<< "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"

#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
Expand Down Expand Up @@ -89,7 +82,7 @@ admin_password="$(ynh_string_random --length=6)"

# Install Nextcloud using a temporary admin user
exec_occ maintenance:install \
--database "mysql" --database-name $db_name \
--database "pgsql" --database-name $db_name \
--database-user $db_user --database-pass "$db_pwd" \
--admin-user "admin" --admin-pass "$admin_password" \
--data-dir "$data_dir/data" \
Expand All @@ -100,9 +93,6 @@ exec_occ maintenance:install \
#=================================================
ynh_script_progression "Configuring $app..."

# Set the mysql.utf8mb4 config to true in config.php
exec_occ config:system:set mysql.utf8mb4 --type boolean --value="true"

# move the logs from the data_dir to the standard /var/log
exec_occ config:system:set logfile --value="/var/log/$app/nextcloud.log"

Expand Down Expand Up @@ -189,7 +179,7 @@ exec_occ config:system:set overwrite.cli.url --value="https://${domain}${path}"
#=================================================

# Set the user as admin
ynh_mysql_db_shell <<< "INSERT INTO oc_group_user VALUES ('admin','$admin');"
ynh_psql_db_shell <<< "INSERT INTO oc_group_user VALUES ('admin','$admin');"

# And delete admin user
exec_occ user:delete admin
Expand Down Expand Up @@ -253,10 +243,12 @@ ynh_script_progression "Adding multimedia directories..."

# Build YunoHost multimedia directories
ynh_multimedia_build_main_dir

# Mount the user directory in Nextcloud
exec_occ app:enable files_external
create_external_storage "/home/yunohost.multimedia/\$user" "Multimedia"
create_external_storage "/home/yunohost.multimedia/share" "Shared multimedia"

# Allow nextcloud to write into these directories
ynh_multimedia_addaccess $app

Expand Down
1 change: 1 addition & 0 deletions scripts/remove
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ source /usr/share/yunohost/helpers
ynh_script_progression "Removing system configurations related to $app..."

ynh_config_remove_nginx

ynh_safe_rm "/etc/nginx/conf.d/$domain.d/$app.d"

ynh_config_remove_phpfpm
Expand Down
6 changes: 3 additions & 3 deletions scripts/restore
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ ynh_script_progression "Restoring the app main directory..."
ynh_restore "$install_dir"

#=================================================
# RESTORE THE MYSQL DATABASE
# RESTORE THE POSTGRESQL DATABASE
#=================================================
ynh_script_progression "Restoring the MySQL database..."
ynh_script_progression "Restoring the PostgreSQL database..."

ynh_mysql_db_shell < ./db.sql
ynh_psql_db_shell < ./db.sql

#=================================================
# RESTORE THE PHP-FPM CONFIGURATION
Expand Down
55 changes: 40 additions & 15 deletions scripts/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ filter_boring_occ_warnings() {
sed -E 's@\s*([0-9]+\/[0-9]+\s+\[(-|>|=)+\]\s+[0-9]+%|\s*Starting ...|Nextcloud or one of the apps require upgrade - only a limited number of commands are available|You may use your browser or the occ upgrade command to do the upgrade)@@g'
}

current_version=$(grep OC_VersionString "$install_dir/version.php" | cut -d\' -f2)
current_major_version=${current_version%%.*}

last_version=$(ynh_read_manifest "resources.sources.main.url" | grep -Eo '[0-9][0-9]\.[0-9]\.[0-9]+')
last_major_version=${last_version%%.*}

# Define a function to execute commands with `occ`
exec_occ() {
# Backward compatibility to upgrade from older versions
Expand Down Expand Up @@ -87,6 +93,35 @@ exec_occ() {
php$NEXTCLOUD_PHP_VERSION --define apc.enable_cli=1 occ --no-interaction --no-ansi "$@") 2> >(filter_boring_occ_warnings >&2)
}

#=================================================
# HANDLE DATABASE MIGRATION FROM MYSL TO PSQL
#=================================================

# If we're moving through version 29.0.10~ynh1 (in which the switch to PostgreSQL is made)
if ynh_app_upgrading_from_version_before 29.0.10~ynh1
then
# Double-check the MySQL database is here
if ! mysql -e "USE $db_name" 2>/dev/null
then
ynh_print_warn "Uhoh? The Nextcloud MySQL database doesn't exist? We are supposed to move it to PostgreSQL... Maybe it was already migrated?"
# Double check the psql is not empty, otherwise big whoops?
if [[ "$(ynh_psql_db_shell --database=$db_name --sql="\dt" 2>/dev/null | wc -l)" == 0 ]]
then
ynh_die "Apparently the PostgreSQL database is also empty, this is kind of worrying, what happened?!"
else
ynh_print_warn "Apparently the PostgreSQL database is not empty, so this is probably OK?"
fi
else
ynh_print_info "Migrating to PostgreSQL database..."
exec_occ db:convert-type --all-apps --clear-schema pgsql $db_name 127.0.0.1 $db_name --password=$db_pwd -n
ynh_mysql_drop_db $db_name
fi
fi

#=================================================
# 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() {
Expand Down Expand Up @@ -122,11 +157,7 @@ function list_installed_apps_not_compatible_with_future_version()
comm -23 <(comm -23 $installed_apps $core_apps_in_current_version) $nextcloud_destination_appcatalog
}

current_version=$(grep OC_VersionString "$install_dir/version.php" | cut -d\' -f2)
current_major_version=${current_version%%.*}

last_version=$(ynh_read_manifest "resources.sources.main.url" | grep -Eo '[0-9][0-9]\.[0-9]\.[0-9]+')
last_major_version=${last_version%%.*}

if [[ "$last_major_version" != "$current_major_version" ]]
then
Expand All @@ -147,15 +178,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 --key=db_pwd)
# Change your databases character set and collation
ynh_mysql_db_shell <<< "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
# Then temporary disable the mail app
Expand Down Expand Up @@ -269,6 +291,11 @@ then
# Then remove the config file
ynh_safe_rm "$nc_conf"

# Occasionally new mimetypes are added to better handle certain file types.
# Migrating the mimetypes take a long time on larger instances
# so this is not done automatically during upgrades.
exec_occ maintenance:repair --include-expensive

#=================================================
# ALLOW USERS TO DISCONNECT FROM NEXTCLOUD
#=================================================
Expand Down Expand Up @@ -374,7 +401,6 @@ then
ynh_config_add --template="notify_push.conf" --destination="$nginx_extra_conf_dir/notify_push.conf"
fi

# Create a dedicated NGINX config
ynh_config_add_nginx

#=================================================
Expand Down Expand Up @@ -424,7 +450,6 @@ ynh_config_add_logrotate
# FAIL2BAN
#=================================================

# Create a dedicated Fail2Ban config
ynh_config_add_fail2ban --logpath="/var/log/$app/nextcloud.log" --failregex="^.*Login failed: '.*' \(Remote IP: '<HOST>'.*$"

#=================================================
Expand Down