Revert "nextcloud26: init at 26.0.0beta1"
This commit is contained in:
parent
f69c8b761a
commit
cef47da8e5
7 changed files with 36 additions and 256 deletions
|
@ -26,4 +26,4 @@ foldl
|
|||
};
|
||||
})
|
||||
{ }
|
||||
[ 24 25 26 ]
|
||||
[ 24 25 ]
|
||||
|
|
|
@ -2,18 +2,17 @@
|
|||
|
||||
let
|
||||
generic = {
|
||||
version, hash,
|
||||
version, sha256,
|
||||
eol ? false, extraVulnerabilities ? []
|
||||
}: let
|
||||
major = lib.versions.major version;
|
||||
prerelease = builtins.length (lib.versions.splitVersion version) > 3;
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "nextcloud";
|
||||
inherit version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.nextcloud.com/server/${if prerelease then "prereleases" else "release"}/${pname}-${version}.tar.bz2";
|
||||
inherit hash;
|
||||
url = "https://download.nextcloud.com/server/releases/${pname}-${version}.tar.bz2";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
patches = [ (./patches + "/v${major}/0001-Setup-remove-custom-dbuser-creation-behavior.patch") ];
|
||||
|
@ -52,19 +51,14 @@ in {
|
|||
|
||||
nextcloud24 = generic {
|
||||
version = "24.0.9";
|
||||
hash = "sha256-WAozhMnAmu+46bQVU9IabiAAF5lUnb0lsx3qIR2X3R4=";
|
||||
sha256 = "580a3384c9c09aefb8e9b41553d21a6e20001799549dbd25b31dea211d97dd1e";
|
||||
};
|
||||
|
||||
nextcloud25 = generic {
|
||||
version = "25.0.3";
|
||||
hash = "sha256-SysUI3Nu+SRpCW/iT2HCTK2Ho04HwceoGzhdPqJcAOw=";
|
||||
sha256 = "4b2b1423736ef92469096fe24f61c24cad87a34e07c1c7a81b385d3ea25c00ec";
|
||||
};
|
||||
|
||||
nextcloud26 = generic {
|
||||
version = "26.0.0beta1";
|
||||
hash = "sha256-EfSfn0KjQzciHa3VcrDhGC/aZUw/KDjihXs+qVIcYX0=";
|
||||
};
|
||||
|
||||
# tip: get hash with:
|
||||
# nix hash to-sri --type sha256 $(curl https://download.nextcloud.com/server/releases/nextcloud-${version}.tar.bz2.sha256 | cut -d' ' -f1)
|
||||
# tip: get the sha with:
|
||||
# curl 'https://download.nextcloud.com/server/releases/nextcloud-${version}.tar.bz2.sha256'
|
||||
}
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
]
|
||||
},
|
||||
"contacts": {
|
||||
"sha256": "1996f97w74slmh7ihv8p1lxl32rri5nnzp90mbb1imclpgac2i63",
|
||||
"url": "https://github.com/nextcloud-releases/contacts/releases/download/v4.2.4/contacts-v4.2.4.tar.gz",
|
||||
"version": "4.2.4",
|
||||
"sha256": "0qv3c7wmf9j74562xbjvhk6kbpna6ansiw3724dh4w8j5sldqysd",
|
||||
"url": "https://github.com/nextcloud-releases/contacts/releases/download/v4.2.3/contacts-v4.2.3.tar.gz",
|
||||
"version": "4.2.3",
|
||||
"description": "The Nextcloud contacts app is a user interface for Nextcloud's CardDAV server. Easily sync contacts from various devices with your Nextcloud and edit them online.\n\n* 🚀 **Integration with other Nextcloud apps!** Currently Mail and Calendar – more to come.\n* 🎉 **Never forget a birthday!** You can sync birthdays and other recurring events with your Nextcloud Calendar.\n* 👥 **Sharing of Adressbooks!** You want to share your contacts with your friends or coworkers? No problem!\n* 🙈 **We’re not reinventing the wheel!** Based on the great and open SabreDAV library.",
|
||||
"homepage": "https://github.com/nextcloud/contacts#readme",
|
||||
"licenses": [
|
||||
|
@ -110,9 +110,9 @@
|
|||
]
|
||||
},
|
||||
"news": {
|
||||
"sha256": "0iz1yrl7h60yhc1d1gkalkzc5vlj8sq6lff0ggns6a6qpsdpn9c5",
|
||||
"url": "https://github.com/nextcloud/news/releases/download/20.0.1/news.tar.gz",
|
||||
"version": "20.0.1",
|
||||
"sha256": "0pnriarr2iqci2v2hn6vpvszf4m4pkcxsd2i13bp7n1zqkg6swd7",
|
||||
"url": "https://github.com/nextcloud/news/releases/download/20.0.0/news.tar.gz",
|
||||
"version": "20.0.0",
|
||||
"description": "📰 A RSS/Atom Feed reader App for Nextcloud\n\n- 📲 Synchronize your feeds with multiple mobile or desktop [clients](https://nextcloud.github.io/news/clients/)\n- 🔄 Automatic updates of your news feeds\n- 🆓 Free and open source under AGPLv3, no ads or premium functions\n\n**System Cron is currently required for this app to work**\n\nRequirements can be found [here](https://nextcloud.github.io/news/install/#dependencies)\n\nThe Changelog is available [here](https://github.com/nextcloud/news/blob/master/CHANGELOG.md)\n\nCreate a [bug report](https://github.com/nextcloud/news/issues/new/choose)\n\nCreate a [feature request](https://github.com/nextcloud/news/discussions/new)\n\nReport a [feed issue](https://github.com/nextcloud/news/discussions/new)",
|
||||
"homepage": "https://github.com/nextcloud/news",
|
||||
"licenses": [
|
||||
|
@ -140,9 +140,9 @@
|
|||
]
|
||||
},
|
||||
"polls": {
|
||||
"sha256": "0qdm0hnljkv0df1s929awyjj1gsp3d6xv9llr52cxv66kkfx086y",
|
||||
"url": "https://github.com/nextcloud/polls/releases/download/v3.8.4/polls.tar.gz",
|
||||
"version": "3.8.4",
|
||||
"sha256": "b6ef0e8b34cdb5169341e30340bc9cefaa1254a1a6020e951f86e828f8591a11",
|
||||
"url": "https://github.com/nextcloud/polls/releases/download/v3.8.3/polls.tar.gz",
|
||||
"version": "3.8.3",
|
||||
"description": "A polls app, similar to Doodle/Dudle with the possibility to restrict access (members, certain groups/users, hidden and public).",
|
||||
"homepage": "https://github.com/nextcloud/polls",
|
||||
"licenses": [
|
||||
|
@ -160,9 +160,9 @@
|
|||
]
|
||||
},
|
||||
"spreed": {
|
||||
"sha256": "0c5b46g5vi8fsjcd2r0wqza7iqyvbgznwww5zcyajf29a32950c6",
|
||||
"url": "https://github.com/nextcloud-releases/spreed/releases/download/v14.0.8/spreed-v14.0.8.tar.gz",
|
||||
"version": "14.0.8",
|
||||
"sha256": "0frilxny4mvp34fxw0k8al3r5apy3q6vq7z35jkph3vaq1889m9k",
|
||||
"url": "https://github.com/nextcloud-releases/spreed/releases/download/v14.0.7/spreed-v14.0.7.tar.gz",
|
||||
"version": "14.0.7",
|
||||
"description": "Chat, video & audio-conferencing using WebRTC\n\n* 💬 **Chat integration!** Nextcloud Talk comes with a simple text chat. Allowing you to share files from your Nextcloud and mentioning other participants.\n* 👥 **Private, group, public and password protected calls!** Just invite somebody, a whole group or send a public link to invite to a call.\n* 💻 **Screen sharing!** Share your screen with participants of your call. You just need to use Firefox version 66 (or newer), latest Edge or Chrome 72 (or newer, also possible using Chrome 49 with this [Chrome extension](https://chrome.google.com/webstore/detail/screensharing-for-nextclo/kepnpjhambipllfmgmbapncekcmabkol)).\n* 🚀 **Integration with other Nextcloud apps** like Files, Contacts and Deck. More to come.\n\nAnd in the works for the [coming versions](https://github.com/nextcloud/spreed/milestones/):\n* ✋ [Federated calls](https://github.com/nextcloud/spreed/issues/21), to call people on other Nextclouds",
|
||||
"homepage": "https://github.com/nextcloud/spreed",
|
||||
"licenses": [
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
]
|
||||
},
|
||||
"calendar": {
|
||||
"sha256": "0yqpfp5nbzd7zar2rbcx3bhfgjxrp1sy6a57fdagndfi4y0r56hq",
|
||||
"url": "https://github.com/nextcloud-releases/calendar/releases/download/v4.2.2/calendar-v4.2.2.tar.gz",
|
||||
"version": "4.2.2",
|
||||
"sha256": "04g1xm3q46j7harxr0n56r7kkkqjxvah7xijddyq5fj7icr6qf5d",
|
||||
"url": "https://github.com/nextcloud-releases/calendar/releases/download/v4.2.1/calendar-v4.2.1.tar.gz",
|
||||
"version": "4.2.1",
|
||||
"description": "The Calendar app is a user interface for Nextcloud's CalDAV server. Easily sync events from various devices with your Nextcloud and edit them online.\n\n* 🚀 **Integration with other Nextcloud apps!** Currently Contacts - more to come.\n* 🌐 **WebCal Support!** Want to see your favorite team’s matchdays in your calendar? No problem!\n* 🙋 **Attendees!** Invite people to your events\n* ⌚️ **Free/Busy!** See when your attendees are available to meet\n* ⏰ **Reminders!** Get alarms for events inside your browser and via email\n* 🔍 Search! Find your events at ease\n* ☑️ Tasks! See tasks with a due date directly in the calendar\n* 🙈 **We’re not reinventing the wheel!** Based on the great [c-dav library](https://github.com/nextcloud/cdav-library), [ical.js](https://github.com/mozilla-comm/ical.js) and [fullcalendar](https://github.com/fullcalendar/fullcalendar) libraries.",
|
||||
"homepage": "https://github.com/nextcloud/calendar/",
|
||||
"licenses": [
|
||||
|
@ -20,9 +20,9 @@
|
|||
]
|
||||
},
|
||||
"contacts": {
|
||||
"sha256": "181lycyz4v7v1yir6ylmblgha625sn23nf3661g3izq1whi0wgr9",
|
||||
"url": "https://github.com/nextcloud-releases/contacts/releases/download/v5.0.3/contacts-v5.0.3.tar.gz",
|
||||
"version": "5.0.3",
|
||||
"sha256": "097a71if6kkc7nphfc8b6llqlsskjwp1vg83134hzgfscvllvaj8",
|
||||
"url": "https://github.com/nextcloud-releases/contacts/releases/download/v5.0.2/contacts-v5.0.2.tar.gz",
|
||||
"version": "5.0.2",
|
||||
"description": "The Nextcloud contacts app is a user interface for Nextcloud's CardDAV server. Easily sync contacts from various devices with your Nextcloud and edit them online.\n\n* 🚀 **Integration with other Nextcloud apps!** Currently Mail and Calendar – more to come.\n* 🎉 **Never forget a birthday!** You can sync birthdays and other recurring events with your Nextcloud Calendar.\n* 👥 **Sharing of Adressbooks!** You want to share your contacts with your friends or coworkers? No problem!\n* 🙈 **We’re not reinventing the wheel!** Based on the great and open SabreDAV library.",
|
||||
"homepage": "https://github.com/nextcloud/contacts#readme",
|
||||
"licenses": [
|
||||
|
@ -90,9 +90,9 @@
|
|||
]
|
||||
},
|
||||
"news": {
|
||||
"sha256": "0iz1yrl7h60yhc1d1gkalkzc5vlj8sq6lff0ggns6a6qpsdpn9c5",
|
||||
"url": "https://github.com/nextcloud/news/releases/download/20.0.1/news.tar.gz",
|
||||
"version": "20.0.1",
|
||||
"sha256": "0pnriarr2iqci2v2hn6vpvszf4m4pkcxsd2i13bp7n1zqkg6swd7",
|
||||
"url": "https://github.com/nextcloud/news/releases/download/20.0.0/news.tar.gz",
|
||||
"version": "20.0.0",
|
||||
"description": "📰 A RSS/Atom Feed reader App for Nextcloud\n\n- 📲 Synchronize your feeds with multiple mobile or desktop [clients](https://nextcloud.github.io/news/clients/)\n- 🔄 Automatic updates of your news feeds\n- 🆓 Free and open source under AGPLv3, no ads or premium functions\n\n**System Cron is currently required for this app to work**\n\nRequirements can be found [here](https://nextcloud.github.io/news/install/#dependencies)\n\nThe Changelog is available [here](https://github.com/nextcloud/news/blob/master/CHANGELOG.md)\n\nCreate a [bug report](https://github.com/nextcloud/news/issues/new/choose)\n\nCreate a [feature request](https://github.com/nextcloud/news/discussions/new)\n\nReport a [feed issue](https://github.com/nextcloud/news/discussions/new)",
|
||||
"homepage": "https://github.com/nextcloud/news",
|
||||
"licenses": [
|
||||
|
@ -120,9 +120,9 @@
|
|||
]
|
||||
},
|
||||
"polls": {
|
||||
"sha256": "0mqc9zmxrm98byy6v13si3hwii8hx85998c4kv91vk6ad0sfxjhb",
|
||||
"url": "https://github.com/nextcloud/polls/releases/download/v4.1.2/polls.tar.gz",
|
||||
"version": "4.1.2",
|
||||
"sha256": "1amywiw91acp4g90wazmqmnw51s7z6rf27bdrzxrcqryd8igsniq",
|
||||
"url": "https://github.com/nextcloud/polls/releases/download/v4.1.0-beta4/polls.tar.gz",
|
||||
"version": "4.1.0-beta4",
|
||||
"description": "A polls app, similar to Doodle/Dudle with the possibility to restrict access (members, certain groups/users, hidden and public).",
|
||||
"homepage": "https://github.com/nextcloud/polls",
|
||||
"licenses": [
|
||||
|
@ -140,9 +140,9 @@
|
|||
]
|
||||
},
|
||||
"spreed": {
|
||||
"sha256": "07nh7nlz8di69ms1156fklj29526i3phlvki5vf2mxnlcz8ihg27",
|
||||
"url": "https://github.com/nextcloud-releases/spreed/releases/download/v15.0.3/spreed-v15.0.3.tar.gz",
|
||||
"version": "15.0.3",
|
||||
"sha256": "1w5v866lkd0skv666vhz75zwalr2w83shrhdvv354kill9k53awh",
|
||||
"url": "https://github.com/nextcloud-releases/spreed/releases/download/v15.0.2/spreed-v15.0.2.tar.gz",
|
||||
"version": "15.0.2",
|
||||
"description": "Chat, video & audio-conferencing using WebRTC\n\n* 💬 **Chat integration!** Nextcloud Talk comes with a simple text chat. Allowing you to share files from your Nextcloud and mentioning other participants.\n* 👥 **Private, group, public and password protected calls!** Just invite somebody, a whole group or send a public link to invite to a call.\n* 💻 **Screen sharing!** Share your screen with participants of your call. You just need to use Firefox version 66 (or newer), latest Edge or Chrome 72 (or newer, also possible using Chrome 49 with this [Chrome extension](https://chrome.google.com/webstore/detail/screensharing-for-nextclo/kepnpjhambipllfmgmbapncekcmabkol)).\n* 🚀 **Integration with other Nextcloud apps** like Files, Contacts and Deck. More to come.\n\nAnd in the works for the [coming versions](https://github.com/nextcloud/spreed/milestones/):\n* ✋ [Federated calls](https://github.com/nextcloud/spreed/issues/21), to call people on other Nextclouds",
|
||||
"homepage": "https://github.com/nextcloud/spreed",
|
||||
"licenses": [
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
{
|
||||
"calendar": {
|
||||
"sha256": "0yqpfp5nbzd7zar2rbcx3bhfgjxrp1sy6a57fdagndfi4y0r56hq",
|
||||
"url": "https://github.com/nextcloud-releases/calendar/releases/download/v4.2.2/calendar-v4.2.2.tar.gz",
|
||||
"version": "4.2.2",
|
||||
"description": "The Calendar app is a user interface for Nextcloud's CalDAV server. Easily sync events from various devices with your Nextcloud and edit them online.\n\n* 🚀 **Integration with other Nextcloud apps!** Currently Contacts - more to come.\n* 🌐 **WebCal Support!** Want to see your favorite team’s matchdays in your calendar? No problem!\n* 🙋 **Attendees!** Invite people to your events\n* ⌚️ **Free/Busy!** See when your attendees are available to meet\n* ⏰ **Reminders!** Get alarms for events inside your browser and via email\n* 🔍 Search! Find your events at ease\n* ☑️ Tasks! See tasks with a due date directly in the calendar\n* 🙈 **We’re not reinventing the wheel!** Based on the great [c-dav library](https://github.com/nextcloud/cdav-library), [ical.js](https://github.com/mozilla-comm/ical.js) and [fullcalendar](https://github.com/fullcalendar/fullcalendar) libraries.",
|
||||
"homepage": "https://github.com/nextcloud/calendar/",
|
||||
"licenses": [
|
||||
"agpl"
|
||||
]
|
||||
},
|
||||
"files_texteditor": {
|
||||
"sha256": "0rmk14iw34pd81snp3lm01k07wm5j2nh9spcd4j0m43l20b7kxss",
|
||||
"url": "https://github.com/nextcloud-releases/files_texteditor/releases/download/v2.15.0/files_texteditor.tar.gz",
|
||||
"version": "2.15.0",
|
||||
"description": "This application enables Nextcloud users to open, save and edit text files in the web browser. If enabled, an entry called \"Text file\" in the \"New\" button menu at the top of the web browser appears. When clicked, a new text file opens in the browser and the file can be saved into the current Nextcloud directory. Further, when a text file is clicked in the web browser, it will be opened and editable. If the privileges allow, a user can also edit shared files and save these changes back into the web browser.\nMore information is available in the text editor documentation.",
|
||||
"homepage": "https://github.com/nextcloud/files_texteditor",
|
||||
"licenses": [
|
||||
"agpl"
|
||||
]
|
||||
},
|
||||
"mail": {
|
||||
"sha256": "",
|
||||
"url": "https://github.com/nextcloud-releases/mail/releases/download/v2.2.2/mail-v2.2.2.tar.gz",
|
||||
"version": "2.2.2",
|
||||
"description": "**💌 A mail app for Nextcloud**\n\n- **🚀 Integration with other Nextcloud apps!** Currently Contacts, Calendar & Files – more to come.\n- **📥 Multiple mail accounts!** Personal and company account? No problem, and a nice unified inbox. Connect any IMAP account.\n- **🔒 Send & receive encrypted mails!** Using the great [Mailvelope](https://mailvelope.com) browser extension.\n- **🙈 We’re not reinventing the wheel!** Based on the great [Horde](https://horde.org) libraries.\n- **📬 Want to host your own mail server?** We do not have to reimplement this as you could set up [Mail-in-a-Box](https://mailinabox.email)!",
|
||||
"homepage": "https://github.com/nextcloud/mail#readme",
|
||||
"licenses": [
|
||||
"agpl"
|
||||
]
|
||||
},
|
||||
"notes": {
|
||||
"sha256": "1jcgv3awr45jq3n3qv851qlpbdl2plixba0iq2s54dmhciypdckl",
|
||||
"url": "https://github.com/nextcloud/notes/releases/download/v4.6.0/notes.tar.gz",
|
||||
"version": "4.6.0",
|
||||
"description": "The Notes app is a distraction free notes taking app for [Nextcloud](https://www.nextcloud.com/). It provides categories for better organization and supports formatting using [Markdown](https://en.wikipedia.org/wiki/Markdown) syntax. Notes are saved as files in your Nextcloud, so you can view and edit them with every Nextcloud client. Furthermore, a separate [REST API](https://github.com/nextcloud/notes/blob/master/docs/api/README.md) allows for an easy integration into third-party apps (currently, there are notes apps for [Android](https://github.com/stefan-niedermann/nextcloud-notes), [iOS](https://github.com/owncloud/notes-iOS-App) and the [console](https://git.danielmoch.com/nncli/about) which allow convenient access to your Nextcloud notes). Further features include marking notes as favorites.",
|
||||
"homepage": "https://github.com/nextcloud/notes",
|
||||
"licenses": [
|
||||
"agpl"
|
||||
]
|
||||
},
|
||||
"tasks": {
|
||||
"sha256": "0jm13d6nm7cfsw27yfiq1il9xjlh0qrq8xby2yz9dmggn7lk1dx5",
|
||||
"url": "https://github.com/nextcloud/tasks/releases/download/v0.14.5/tasks.tar.gz",
|
||||
"version": "0.14.5",
|
||||
"description": "Once enabled, a new Tasks menu will appear in your Nextcloud apps menu. From there you can add and delete tasks, edit their title, description, start and due dates and mark them as important. Tasks can be shared between users. Tasks can be synchronized using CalDav (each task list is linked to an Nextcloud calendar, to sync it to your local client: Thunderbird, Evolution, KDE Kontact, iCal … - just add the calendar as a remote calendar in your client). You can download your tasks as ICS files using the download button for each calendar.",
|
||||
"homepage": "https://github.com/nextcloud/tasks/",
|
||||
"licenses": [
|
||||
"agpl"
|
||||
]
|
||||
},
|
||||
"unsplash": {
|
||||
"sha256": "17qqn6kwpvkq21c92jyy3pfvjaj5xms1hr07fnn39zxg0nmwjdd8",
|
||||
"url": "https://github.com/nextcloud/unsplash/releases/download/v2.1.1/unsplash.tar.gz",
|
||||
"version": "2.1.1",
|
||||
"description": "Show a new random featured nature photo in your nextcloud. Now with choosable motives!",
|
||||
"homepage": "https://github.com/nextcloud/unsplash/",
|
||||
"licenses": [
|
||||
"agpl"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1,149 +0,0 @@
|
|||
From fc3e14155b3c4300b691ab46579830e725457a54 Mon Sep 17 00:00:00 2001
|
||||
From: Maximilian Bosch <maximilian@mbosch.me>
|
||||
Date: Sat, 10 Sep 2022 15:18:05 +0200
|
||||
Subject: [PATCH] Setup: remove custom dbuser creation behavior
|
||||
|
||||
Both PostgreSQL and MySQL can be authenticated against from Nextcloud by
|
||||
supplying a database password. Now, during setup the following things
|
||||
happen:
|
||||
|
||||
* When using postgres and the db user has elevated permissions, a new
|
||||
unprivileged db user is created and the settings `dbuser`/`dbpass` are
|
||||
altered in `config.php`.
|
||||
|
||||
* When using MySQL, the password is **always** regenerated since
|
||||
24.0.5/23.0.9[1].
|
||||
|
||||
I consider both cases problematic: the reason why people do configuration
|
||||
management is to have it as single source of truth! So, IMHO any
|
||||
application that silently alters config and thus causes deployed
|
||||
nodes to diverge from the configuration is harmful for that.
|
||||
|
||||
I guess it was sheer luck that it worked for so long in NixOS because
|
||||
nobody has apparently used password authentication with a privileged
|
||||
user to operate Nextcloud (which is a good thing in fact).
|
||||
|
||||
[1] https://github.com/nextcloud/server/pull/33513
|
||||
---
|
||||
lib/private/Setup/MySQL.php | 53 --------------------------------
|
||||
lib/private/Setup/PostgreSQL.php | 37 ----------------------
|
||||
2 files changed, 90 deletions(-)
|
||||
|
||||
diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php
|
||||
index e3004c269bc..bc958e84e44 100644
|
||||
--- a/lib/private/Setup/MySQL.php
|
||||
+++ b/lib/private/Setup/MySQL.php
|
||||
@@ -141,62 +141,6 @@
|
||||
$rootUser = $this->dbUser;
|
||||
$rootPassword = $this->dbPassword;
|
||||
|
||||
- //create a random password so we don't need to store the admin password in the config file
|
||||
- $saveSymbols = str_replace(['\"', '\\', '\'', '`'], '', ISecureRandom::CHAR_SYMBOLS);
|
||||
- $password = $this->random->generate(22, ISecureRandom::CHAR_ALPHANUMERIC . $saveSymbols)
|
||||
- . $this->random->generate(2, ISecureRandom::CHAR_UPPER)
|
||||
- . $this->random->generate(2, ISecureRandom::CHAR_LOWER)
|
||||
- . $this->random->generate(2, ISecureRandom::CHAR_DIGITS)
|
||||
- . $this->random->generate(2, $saveSymbols)
|
||||
- ;
|
||||
- $this->dbPassword = str_shuffle($password);
|
||||
-
|
||||
- try {
|
||||
- //user already specified in config
|
||||
- $oldUser = $this->config->getValue('dbuser', false);
|
||||
-
|
||||
- //we don't have a dbuser specified in config
|
||||
- if ($this->dbUser !== $oldUser) {
|
||||
- //add prefix to the admin username to prevent collisions
|
||||
- $adminUser = substr('oc_' . $username, 0, 16);
|
||||
-
|
||||
- $i = 1;
|
||||
- while (true) {
|
||||
- //this should be enough to check for admin rights in mysql
|
||||
- $query = 'SELECT user FROM mysql.user WHERE user=?';
|
||||
- $result = $connection->executeQuery($query, [$adminUser]);
|
||||
-
|
||||
- //current dbuser has admin rights
|
||||
- $data = $result->fetchAll();
|
||||
- $result->closeCursor();
|
||||
- //new dbuser does not exist
|
||||
- if (count($data) === 0) {
|
||||
- //use the admin login data for the new database user
|
||||
- $this->dbUser = $adminUser;
|
||||
- $this->createDBUser($connection);
|
||||
-
|
||||
- break;
|
||||
- } else {
|
||||
- //repeat with different username
|
||||
- $length = strlen((string)$i);
|
||||
- $adminUser = substr('oc_' . $username, 0, 16 - $length) . $i;
|
||||
- $i++;
|
||||
- }
|
||||
- }
|
||||
- } else {
|
||||
- // Reuse existing password if a database config is already present
|
||||
- $this->dbPassword = $rootPassword;
|
||||
- }
|
||||
- } catch (\Exception $ex) {
|
||||
- $this->logger->info('Can not create a new MySQL user, will continue with the provided user.', [
|
||||
- 'exception' => $ex,
|
||||
- 'app' => 'mysql.setup',
|
||||
- ]);
|
||||
- // Restore the original credentials
|
||||
- $this->dbUser = $rootUser;
|
||||
- $this->dbPassword = $rootPassword;
|
||||
- }
|
||||
-
|
||||
$this->config->setValues([
|
||||
'dbuser' => $this->dbUser,
|
||||
'dbpassword' => $this->dbPassword,
|
||||
diff --git a/lib/private/Setup/PostgreSQL.php b/lib/private/Setup/PostgreSQL.php
|
||||
index af816c7ad04..e49e5508e15 100644
|
||||
--- a/lib/private/Setup/PostgreSQL.php
|
||||
+++ b/lib/private/Setup/PostgreSQL.php
|
||||
@@ -45,43 +45,6 @@ class PostgreSQL extends AbstractDatabase {
|
||||
$connection = $this->connect([
|
||||
'dbname' => 'postgres'
|
||||
]);
|
||||
- //check for roles creation rights in postgresql
|
||||
- $builder = $connection->getQueryBuilder();
|
||||
- $builder->automaticTablePrefix(false);
|
||||
- $query = $builder
|
||||
- ->select('rolname')
|
||||
- ->from('pg_roles')
|
||||
- ->where($builder->expr()->eq('rolcreaterole', new Literal('TRUE')))
|
||||
- ->andWhere($builder->expr()->eq('rolname', $builder->createNamedParameter($this->dbUser)));
|
||||
-
|
||||
- try {
|
||||
- $result = $query->execute();
|
||||
- $canCreateRoles = $result->rowCount() > 0;
|
||||
- } catch (DatabaseException $e) {
|
||||
- $canCreateRoles = false;
|
||||
- }
|
||||
-
|
||||
- if ($canCreateRoles) {
|
||||
- $connectionMainDatabase = $this->connect();
|
||||
- //use the admin login data for the new database user
|
||||
-
|
||||
- //add prefix to the postgresql user name to prevent collisions
|
||||
- $this->dbUser = 'oc_' . strtolower($username);
|
||||
- //create a new password so we don't need to store the admin config in the config file
|
||||
- $this->dbPassword = \OC::$server->getSecureRandom()->generate(30, ISecureRandom::CHAR_ALPHANUMERIC);
|
||||
-
|
||||
- $this->createDBUser($connection);
|
||||
-
|
||||
- // Go to the main database and grant create on the public schema
|
||||
- // The code below is implemented to make installing possible with PostgreSQL version 15:
|
||||
- // https://www.postgresql.org/docs/release/15.0/
|
||||
- // From the release notes: For new databases having no need to defend against insider threats, granting CREATE permission will yield the behavior of prior releases
|
||||
- // Therefore we assume that the database is only used by one user/service which is Nextcloud
|
||||
- // Additional services should get installed in a separate database in order to stay secure
|
||||
- // Also see https://www.postgresql.org/docs/15/ddl-schemas.html#DDL-SCHEMAS-PATTERNS
|
||||
- $connectionMainDatabase->executeQuery('GRANT CREATE ON SCHEMA public TO ' . addslashes($this->dbUser));
|
||||
- $connectionMainDatabase->close();
|
||||
- }
|
||||
|
||||
$this->config->setValues([
|
||||
'dbuser' => $this->dbUser,
|
||||
--
|
||||
2.38.1
|
||||
|
|
@ -9964,7 +9964,7 @@ with pkgs;
|
|||
grocy = callPackage ../servers/grocy { };
|
||||
|
||||
inherit (callPackage ../servers/nextcloud {})
|
||||
nextcloud23 nextcloud24 nextcloud25 nextcloud26;
|
||||
nextcloud23 nextcloud24 nextcloud25;
|
||||
|
||||
nextcloud23Packages = ( callPackage ../servers/nextcloud/packages {
|
||||
apps = lib.importJSON ../servers/nextcloud/packages/23.json;
|
||||
|
@ -9975,9 +9975,6 @@ with pkgs;
|
|||
nextcloud25Packages = ( callPackage ../servers/nextcloud/packages {
|
||||
apps = lib.importJSON ../servers/nextcloud/packages/25.json;
|
||||
});
|
||||
nextcloud26Packages = ( callPackage ../servers/nextcloud/packages {
|
||||
apps = lib.importJSON ../servers/nextcloud/packages/26.json;
|
||||
});
|
||||
|
||||
nextcloud-client = libsForQt5.callPackage ../applications/networking/nextcloud-client { };
|
||||
|
||||
|
|
Loading…
Reference in a new issue