Commit Graph

65 Commits (d92bf388b1c553ecd6bfb2a7400b990dcafe9c54)

Author SHA1 Message Date
Andy Scherzinger 8d8891c5bc
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-30 15:49:33 +07:00
Côme Chilliet 875d0a27b0 fix(user_ldap): Ignore unserialize error in group membership migration
The memberships will be checked by the background job later and data
 will be added to the table anyway.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-03-06 10:18:16 +07:00
Joas Schilling 92fc12918e
fix(migrations): Help developers to add description and copyright info
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-03-05 12:56:38 +07:00
Côme Chilliet 303e2febc7
Merge pull request #43387 from nextcloud/fix/migrate-away-from-ilogger-in-jobs 2024-02-08 18:27:44 +07:00
Louis Chemineau 898df41de9
Revert "Merge branch 'master' of github.com:nextcloud/server"
This reverts commit d9d60238c7, reversing
changes made to ba3fdb0cdc.
2024-02-08 15:31:19 +07:00
Côme Chilliet 166773879b fix!: Migrate jobs away from deprecated interfaces
BREAKING CHANGE: Removed ILogFactory::getCustomLogger deprecated method

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-02-08 10:28:29 +07:00
Côme Chilliet 6d0f0fc01b Fix upgrade of user_ldap when oc_group_members contains duplicated uids
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-01-04 11:51:33 +07:00
Joas Schilling aa5f037af7
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-23 10:36:13 +07:00
Côme Chilliet a0808111b4
Add unique index for user_ldap group memberships
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:37 +07:00
Côme Chilliet 5425f7d3bd
Use BIGINT for new table id field
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:36 +07:00
Côme Chilliet ec13f22ae3
Add missing primary key for ldap_group_membership
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:33 +07:00
Côme Chilliet d8142b6a5a
Refactor user_ldap group membership to use flat DB
Move away from serialized arrays. Also use a QBMapper class for the new table.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-10 10:57:25 +07:00
Faraz Samapoor b0938b9083 Refactors "strpos" calls in /apps/user_ldap to improve code readability.
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
2023-06-02 15:26:55 +07:00
John Molakvoæ 1e5a879d2e
Fix createNamedParameter in LDAP migrations
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-04-07 11:34:13 +07:00
Côme Chilliet d07208bd2c Use the new octetLength function to filter lines to migrate
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-30 14:43:09 +07:00
Arthur Schiwon 52b57eb753 shrink ldap_dn column to 4000
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-03-30 14:43:08 +07:00
Arthur Schiwon 2f49f4a0fe limit ldap_dn columns to 4000
- enlarging string cols from 255 to more than 4000 fails on default
  Oracle installations for invalid datatype conversion

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-03-30 14:43:08 +07:00
Côme Chilliet efebbacca4 Add octetLength and charLength to function builder, and tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 20:35:02 +07:00
Côme Chilliet 7dc3eb1e9e Use getLengthExpression to measure field length instead of like
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 20:35:02 +07:00
Arthur Schiwon 4656753df0
do not forget DB table prefix with truncate query
- as used in LDAP's AbstractMapping::clear() method
- and in Comment's ManagerTest::setUp()
- fixes a DB Exception with Oracle

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-03-18 16:59:46 +07:00
Côme Chilliet ccab35f23f
Fix similar potential problems with fetchOne loops
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-08 12:10:52 +07:00
Côme Chilliet 65a866556b
Fix duplicated UUID detection when there are empty uuids
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-08 11:57:33 +07:00
Arthur Schiwon 16b6504cc6
code style
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-03-03 21:32:54 +07:00
Arthur Schiwon f3668f2748
be conservative when reading from fresh created column
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-03-03 21:26:18 +07:00
Arthur Schiwon 601ce05dab
allow to re-run migration step when backup DB is already created
- to heal incomplete states from broken upgrades

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-02-10 10:14:59 +07:00
Arthur Schiwon 71fb44953e
invalidated duplicated UUIDs prior to migration change
- in a proper setup there are no duplicated UUIDs
- not all setups are proper
- log warning to admin

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-02-10 10:14:58 +07:00
Côme Chilliet 843b20c4e8
Remove useless indexes with duplicated names on backup table
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-01-13 17:21:26 +07:00
Côme Chilliet 7e4e919408
Fix user_ldap migration for long DNs support
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-01-13 14:06:59 +07:00
Côme Chilliet 23845755f2
Move duplicated code to a base class for group_mapping migrations
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com>
2022-01-13 14:06:59 +07:00
Côme Chilliet d4cabf8a84
Split dropTable and createTable in two migrations
It is not possible to drop and create the same table in one migration

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-01-13 14:06:58 +07:00
Côme Chilliet e64e08ecac
Fix primary key change in user_ldap migration
Use a backup table to copy the data, drop table and recreate it with
 correct primary key, then copy the data back and drop the backup table.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-01-13 14:06:58 +07:00
Côme Chilliet 57fda4414f
Add missing copyright headers in migration steps
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-12-09 17:42:17 +07:00
Côme Chilliet a35904749f
Use clearer names for variables
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-23 09:20:31 +07:00
Côme Chilliet 514324916b
Add an index for directory_uuid as well
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-23 09:20:30 +07:00
Côme Chilliet 14f00208e2
Add the columns and alter the index in Version1010Date20200630192842
This is to ensure new installations do not need to go through migration
 history.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-23 09:20:30 +07:00
Côme Chilliet c4d8bd9c05
Fixes in migration step
We cannot set ldap_dn_hash column as notnull because it is empty for
 existing users before postSchemaChange is called

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-23 09:20:29 +07:00
Côme Chilliet ce5192a461
Fixed migration step for user_ldap
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-23 09:20:29 +07:00
Joas Schilling 9a1df9ddca
Fix variable names
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-23 09:19:50 +07:00
Côme Chilliet 31a503b387
Change column names to ldap_dn and ldap_dn_hash and add migration
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-23 09:19:50 +07:00
Côme Chilliet 662e3240b0
Support LDAP dns longer than 255 characters
Adds an ldap_full_dn column to store the dn, and only store a sha256
 hash in the ldap_dn which is shorter and can be indexed without
 trouble.
Migration still needs to be implemented.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2021-11-23 09:19:49 +07:00
Arthur Schiwon 6ab30a669b
ensure that user and group IDs in LDAP's tables are also max 64chars
- limitation by core tables (e.g. sharing), IDs are always 64chars
- when longer group IDs were requested they are hashed (does not affect
  displaynames)

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-09-24 17:29:29 +07:00
Arthur Schiwon f62c066459
unset ldap provider when disabling user_ldap
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-06-30 15:25:00 +07:00
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07:00
Christoph Wurst c1d4f8161b
Migrate internal classes to the OCP db col types
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-01-12 14:09:13 +07:00
Christoph Wurst d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 18:48:22 +07:00
Christoph Wurst 334f3943ab
Migrate LDAP's install.php to a repair step
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-11-27 15:13:01 +07:00
Arthur Schiwon 86e5e7d927
LDAP simplify User_Proxy and Group_Proxy signatures
- make User_Proxy and Group_Proxy easy to instantiate
- simplify dependent code
- move commands to info.xml
- make UpdateGroups job class non-static

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-10-23 12:25:31 +07:00
Christoph Wurst 1f7f93a695
Update license headers for Nextcloud 20 (again)
There are still lots of outdated headers, so time for another round of
updates.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-09-07 14:37:44 +07:00
Arthur Schiwon aa2d754d5c
add repair step to clean up DB off lastFeatureRefresh entries in user prefs
- also removes related app setting "updateAttributesInterval"

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2020-09-04 12:59:57 +07:00
Christoph Wurst 2a054e6c04
Update the license headers for Nextcloud 20
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-08-24 14:54:25 +07:00