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

Migrate from php8.0 to php8.1 #2309

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

kiekerjan
Copy link
Contributor

This pull request proposes the upgrade from php8.0 to php8.1. This would remove the dependency on an external ppa.
The logic works by introducing on a number of places a variable containing the php version. This makes the code independent of the used php version.
The upgrade logic is embedded in the nextcloud installation logic. If a version of nextcloud that does not support php8.1 is to be installed, the code will also install php8.0. Once a new enough version of nextcloud is detected, php8.0 is removed.

Installation has been tested via vagrant. Todo: test upgrade from v60 to this, and test upgrade from v57 to this.

@jvolkenant
Copy link
Contributor

I'm not understanding why we would stop using

PHP_VER=8.0

I understood why PHP still had 'php8.0' as it didn't have access to that variable, but with get_php_version() we shouldn't need to go back to having 8.0 or 8.1 everywhere

@kiekerjan
Copy link
Contributor Author

kiekerjan commented Oct 3, 2023

Sorry, I'm not sure what you mean.
This pull request will remove the hardcoded uses of php8.0 or 8.1, and replace them by the mentioned get_php_version(). We can no longer depend on the hardcoded PHP_VER variable as the generic code needs to be able to handle either php8.0 or php8.1. The only place where the version is mentioned is on the places where it is installed by apt-get, and to set the default used php.
Or do you mean something else?

Anyway, also note that @binarykitchen proposed to split this pull request up into a version handling bit (see #2308, derived from this work) and a php upgrade bit.

@binarykitchen
Copy link
Contributor

Right @jvolkenant

MiaB must depend on a clearly defined PHP version, not on whatever is installed by random on the server.

That's why my low-risk PR doesn't do that, nor is upgrading anything. All my PR does it to keep its version consistent across all the code base without having it hardcoded too much.

Secondly, there is no need to upgrade PHP to v8.1 right now.

Although, I'd like to give credit to @kiekerjan for some inspiration in my other PR.

@matidau
Copy link
Contributor

matidau commented Oct 9, 2023

TLDR; Nextcloud's strict requirements on maximum PHP version has made our Nextcloud upgrades tricky. I don't have an answer, just stating some possibilities.

I've had a few thoughts around our potential PHP8.1 and Nextcloud conundrum. This might be a bit long winded so please bear with me. I'm also likely to repeat a lot of what was raised in the other issues and PRs related to this.

Nextcloud v27 minimum non-deprecated version of PHP is 8.1. and presumably in a year it will be 8.2 for whatever version is released. This is Nextcloud keeping in step with PHP release cycles (aggressively so?).

As we upgrade each previous Nextcloud version through all the current ones, it might be reasoned that users will need to have PHP8.0 installed to upgrade up to Version24 (only applicable if coming from a MIAB version prior to v60 and the current version is on PHP8.1)

Options
These are the different options that we could consider as I see them.

I understood @kiekerjan 's function was to help resolve if we have multiple versions of PHP needed during the installation process so that Nextcloud could be upgraded no matter what version of PHP or Nextcloud database there is or is needed. Possibly the idea being able to determine what version of PHP was installed so the correct commands and sequence get called.

Another similar option, having looked at the Nextcloud repo it seems that the version check for the command line is only for versions below 8.0 for v27 and the current master. Perhaps we could use PHP8.0 to do all the upgrades and then finally upgrade to PHP 8.1 (or PHP8.x in the future). This is in a way similar to the function approach but we would hardcode installing, utilising and removing PHP8.0 just for the steps that are needed.

Alternatively we could enforce that users have to upgrade to a specific version of MIAB if coming from previous nextcloud ones. I have more to say on this one. Either at the start of the setup scripts or during Nextcloud's one.

Or last find an alternative solution to Nextcloud so we aren't tied to their strict PHP versions. I don't think anyone has time to work on an alternative and the scripted migration process needed. If they had it would have probably been done by now :)

PHP Versions
Just a couple of notes
Both web.sh and webmail.sh, which run before nextcloud.sh, already install the current version of PHP as listed in $PHP_VER, so 8.1 would be installed with the current arrangement of setup files.
It might be possible to have 2 versions of PHP (php-cli) installed during the nextcloud setup for upgrade purposes, then remove php8.0 after the upgrade to v24 or v27 where it is no longer needed. This would need to be tested.
php8.0 packages might need to be removed so that only 8.1 is left.

different classes of users

  1. those that stay up to date
  2. those that fall a few versions behind
  3. those that haven't updated since v60
  4. those that are still on versions lower than v60

Hopefully most are in 1 and no one is in 4 but we still need to (should?) allow for these upgrade paths.
Those in 1 aren't a problem as the upgrade will generally work no matter what solution we go for.
Those in 2 won't be for PHP8.1, but when PHP8.2 is required they might be caught out, depending on how far behind they are.
3 won't be a problem for PHP8.1 but will be if they are still on this version when PHP8.2 is required.
4 will be a problem as they can't get to V24 without php8.0 installed.

Bit more on each option

Use PHP8.0 and 8.1 during nextcloud upgrade
I think this might be the trickiest to get right but would likely offer the most pleasant upgrade experience for those on older versions of MIAB. we could be on v69 with some later Nextcloud and users in group 3 and 4 moving from v57a or upgrading from v60 would be clueless to all the effort going on to enable this. Using a function to determine the version, already having 8.1 installed from earlier scripts, having PHP8.0 installed alongside PHP8.1, or removing PHP8.1 installing PHP8.0 and then back again all seem risky to me. For users that are staying up to date there is no upside for them on this one just risk. These are my opinions, not fact, but others may share them.

Force users to update to a certain version
This is a bit different from how MIAB would normally do it. moving from 18.04 to 22.04 they will need to specify the MIAB version using the TAG environment variable to a PHP8.0 version, say TAG=v64, and do the migration with that. We would also need to include a warning message in the Nextcloud setup for people moving as they might have already installed the latest version post 8.0 before trying to restore their 18.04 backup.

Updates to the upgrade doco on the website and probably a pinned post on the forum would probably also need to be done for the late comers as that is likely the first places they will look.

When we move to 8.2 we may need to include something in the bootstrap to check the version and update it to the latest supported range of pre8.2.

This obviously has a fair few drawbacks, and will confuse some people when it comes to updating.

Summary
I don't see a super easy path forward when we hit v27 and PHP8.1 or future versions.

Hopefully be corrected on the above and an easy solution is put forward.

Also sorry for the long post and thank you for reading.

@kiekerjan
Copy link
Contributor Author

kiekerjan commented Oct 9, 2023

Thank you for that elaborate post. I don't have a detailed reply on all your arguments right now, but I wanted to add some insight into this pull request.

Use PHP8.0 and 8.1 during nextcloud upgrade

I think this is what this pu request proposes. By default, php8.1 will be installed from the ubuntu repositories. This works for all software installed.
Only on upgrades of nextcloud will php8.0 be temporarily installed, and only for nexrcloud versions that need it.

I like the statement on different classes of users

those that stay up to date

Should have no issues, on update php8.1 is installed, and php8.0 removed

those that fall a few versions behind

Similare to the previous class. On an update, php8.1 is installed. Php8.0 is already installed, might be used to accomodate nextcloud upgrades, then is removed

those that haven't updated since v60

Same as previous class

those that are still on versions lower than v60

On upgrade, php8.1 is installed. During upgrade of nextcloud, php8.0 is temporarily installed to accomodate upgrades.

@downtownallday
Copy link
Contributor

One more option that I had proposed during the discussion on upgrading to Jammy is to use docker and the Nextcloud images on docker hub to upgrade the MIAB Nextcloud database. This eliminates all OS/Nextcloud/PHP version issues because the docker image contains everything.

The purpose would be to get you to a Nextcloud version that works with the desired PHP installed on the system.

The steps are:

o install docker, if not already installed
o pull the nextcloud image for the next major version (eg. docker pull nextcloud:21 if you're at 20)
o start the image with STORAGE_ROOT/owncloud mounted in the image at the same location (docker run -d --network=none -p 127.0.0.1:8080:80 -v $STORAGE_ROOT/owncloud:$STORAGE_ROOT/owncloud nextcloud:21)
o link the image's config.php to ours (docker exec $CONTAINER_ID /bin/ln -sf $STORAGE_ROOT/owncloud/config.php /var/www/html/config/config.php)
o copy calendar, contacts and user_external to the image (docker cp /usr/local/lib/owncloud/apps/calendar $CONTAINER_ID:/var/www/html/apps/, etc)
o perform the upgrade (docker exec --user www-data $CONTAINER_ID php occ upgrade)
o destroy the image

At this point owncloud.db and config.php are upgraded to (in this example) Nextcloud 21. Repeat the steps until the database and config.php are upgraded to the desired Nextcloud version.

Finally, copy the Nextcloud installation files onto the production system (download and untar), and you're good to go.

The whole upgrade process doesn't even have to happen in situ. Copy the database and config to a local machine, run through the docker sequence there, then copy them back.

@downtownallday
Copy link
Contributor

Regarding this PR...

Why not use PHP_VER for setup\*.sh and /usr/bin/php --version for management?

That would avoid the hard coded php version numbers in setup.

It might be clearer that way.

@JoshData
Copy link
Member

and /usr/bin/php --version for management?

I would prefer to see an explicit version number everywhere in case there are multiple versions of PHP installed.

@matidau
Copy link
Contributor

matidau commented Oct 27, 2023

And just to add another option to the mix:
main...matidau:mailinabox:test-php81

Modifying nextcloud's versioncheck.php so as to remove the restriction on PHP8.1 for older nextcloud versions used for the upgrade.

Tested this with a test v57a upgrade to v64.

Pros:
Keeps the code changes to a minimum.
Easy to add an additional line for when we come to needing PHP 8.2.

Cons:
Modifying the Nextcloud package directly
While there isn't (shouldn't be?) any breaking changes between the PHP 8 versions, this might not be able to be widely tested enough for our risk appetite.

I haven't done a PR for this as the branch isn't complete by itself, More wanted to demonstrate this as an idea. Happy for someone else to pick it up if it provides inspiration.

@binarykitchen
Copy link
Contributor

@matidau Thanks for giving fresh ideas and listing the Pros + Cons.

Regarding "risk appetite", MiaB has always been and must be well-tested for any version bumps of any dependencies. MiaB is about reliable services without excuses. If one email doesn't arrive, goodbye.

Our release frequency is low and everyone is busy, so cannot afford regressions. We need more unit tests, automated tests and the missing gaps must be tested by humans.

Just adding my two cents. Low risks, please.

@kiekerjan
Copy link
Contributor Author

I would prefer to see an explicit version number everywhere in case there are multiple versions of PHP installed.

@JoshData I see that you have a different opinion on how multiple versions of php should be handled. I'm willing to put in some more time to realize this, but I would like to ask you for your input beforehand. Are there conditions you want to see before you would consider merging? What kind of things would you reject?
I will not ask you for an exhaustive list, just want to know your thoughts on this matter.

@binarykitchen
Copy link
Contributor

Hello all - what's happening with this PR? Any problems? We need PHP v8.1 soon ...

@binarykitchen
Copy link
Contributor

Ping?

@binarykitchen
Copy link
Contributor

@kiekerjan I see you pushed and rebased. Ready for review and merge?

@matidau matidau mentioned this pull request Aug 5, 2024
@binarykitchen
Copy link
Contributor

Hello all, what's up with this PR? It's significant. We need it before upgrading Nextcloud ...

@kiekerjan
Copy link
Contributor Author

kiekerjan commented Feb 8, 2025

Nothing has happened.

I think this needs:

  • check to verify that it can cleanly merge with upstream.
  • repeat upgrade path tests: from v57 (ubuntu 18) and v60 (ubuntu 22) to verify it works correctly. Also good to have multiple people test this, as sometimes installations differ between different VPS providers.
  • support from maintainers so it can actually be merged.

I can do steps 1 and 2, but I'm hesitant to put in the time because of lack of interest.

Note that Nextcloud 29 still supports php8.0, so this pull request is not yet necessary.

@binarykitchen
Copy link
Contributor

Thanks, @kiekerjan

check to verify that it can cleanly merge with upstream.

Tried a git rebase with master yet?

repeat upgrade path tests: from v57 (ubuntu 18) and v60 (ubuntu 22) to verify it works correctly. Also good to have multiple people test this, as sometimes installations differ between different VPS providers.

I am happy to help with tests if you write a test plan.

support from maintainers so it can actually be merged.

Would a money donation make a difference?

Note that Nextcloud 29 still supports php8.0, so this pull request is not yet necessary.

Well, PHP 8.0 is deprecated for NC v27, and since for MiaB, security is important, we're reluctant to run with a deprecated version, see:
https://docs.nextcloud.com/server/latest/admin_manual/release_notes/upgrade_to_27.html

@kiekerjan
Copy link
Contributor Author

Tried a git rebase with master yet?

No, but it's "just work" ;)

I am happy to help with tests if you write a test plan.

This I can do.

Would a money donation make a difference?

Definitely not ;)

Well, PHP 8.0 is deprecated for NC v27, and since for MiaB, security is important, we're reluctant to run with a deprecated version, see: https://docs.nextcloud.com/server/latest/admin_manual/release_notes/upgrade_to_27.html

Sure, but deprecated "only" means it will disappear in the future.

  • Nextcloud 29 still has support for PHP8.0.
  • Nextcloud 30 is the first release that requires PHP8.1, but even there, it is already deprecated.
  • Luckily we are not chained to Ubuntu releases for a usable version of PHP. The PPA we use has releases from PHP8.0 to PHP8.4 for Ubuntu 22.04.
  • PHP8.0 is out of support, while PHP8.1 gets security updates until the end of 2025. I think this is the most pressing reason to upgrade our PHP version.

My conclusions is that we should aim for being able to upgrade PHP to any version currently available. PHP8.1 is only a stepping stone, to be followed by PHP8.2 and maybe even 8.3 somewhere during the coming year.

@binarykitchen
Copy link
Contributor

Thanks for the recent rebase and your above input @kiekerjan

My conclusions is that we should aim for being able to upgrade PHP to any version currently available.
Yes, please.

And when you say, we can still bump to Nextcloud v27 using the deprecated PHP v8.0, I remember an older discussion I had with @yodax last year about that, see the other ticket I've created: #2399

  1. There Yodax confirmed: "... with a security issue present we probably should get that out of the way first" (the PHP upgrade first), see Upgrade Nextcloud to latest v27 #2399 (comment)
  2. File permissions seem to be a bigger challenge.

Can you please study the exchange I had on that issue 2399 and confirm, it is wise to go ahead upgrading NC to v27 now with a new PR without PHP v8.1?

If you think it's fine, then I'm happy to start working on a new PR to bump NC this weekend. Please let me know.

@kiekerjan
Copy link
Contributor Author

Checked testplan items 1 and 2 with the latest version.


ADMIN=$(./mail.py user admins | head -n 1)
ADMIN=$(sudo ./management/cli.py user admins | head -n 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why sudo?

Copy link
Contributor Author

@kiekerjan kiekerjan Feb 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cli.py needs admin rights to read certain file. I included it here because it's also on line 23/24 although there it actually mentions a specific user.
We should probably call this file as sudo tools/owncloud-unlockadmin.sh so it's not necessary to have sudo repeated here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, in theory, and sudo keywords in bash scripts should be avoided. Can you improve this please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove this sudo call.

@kiekerjan
Copy link
Contributor Author

Checked Update test number 1. This works fine, no issues detected.
Only remark is that php8.0 remains installed in this test case, as the php8.0 cleanup code is not run. It will only run if Nextcloud is updated. This will be checked in Update test number 2.

@@ -266,6 +266,9 @@ if [ ! -d /usr/local/lib/owncloud/ ] || [[ ! ${CURRENT_NEXTCLOUD_VER} =~ ^$nextc
apt-get purge -qq -y php8.0 php8.0-fpm php8.0-apcu php8.0-cli php8.0-sqlite3 php8.0-gd \
php8.0-imap php8.0-curl php8.0-dev php8.0-xml php8.0-mbstring php8.0-zip \
php8.0-common php8.0-opcache php8.0-readline

# Unhold packages
apt-mark unhold php7.0-apcu php7.1-apcu php7.2-apcu php7.3-apcu php7.4-apcu
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that held packages might prevent the quiet apt installation commands that mailinabox issues, I think specifically in case that the hold package can be updated. To prevent future issues, unhold these packages to be sure.

@kiekerjan
Copy link
Contributor Author

Checked Update test number 2. This works fine, no issues detected.
The php8.0 installation is now nicely cleaned up.

@kiekerjan
Copy link
Contributor Author

Finally performed test 5 Upgrade test. No issues detected.
For me, this wraps up the testing of this pull request. I have no additional updates or effort planned at this time.
Please ask here if there are questions on testing or the code proposed here.

@binarykitchen
Copy link
Contributor

Excellent, thank you so much @kiekerjan

I'll review shortly. Have you asked on our Slack channel for feedback as well?

Important to work, to communicate together and to keep the ball rolling :)

@@ -179,6 +179,9 @@ def wait_for_service(port, public, env, timeout):
return False
time.sleep(min(timeout/4, 1))

def get_php_version():
return "8.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you leave behind a new comment for the next developer that incrementing the version here alone isn't safe? (Like adding instructions how to increment PHP versions the safe way?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add a comment referencing the other location where this is defind

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pardon, I can't find it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's here

@@ -5,7 +5,7 @@
# -o pipefail: don't ignore errors in the non-last command in a pipeline
set -euo pipefail

PHP_VER=8.0
PHP_VER=8.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dito. Like mentioned before, it is safe to increment the version from here alone?

I'd add another inline comment here, that the version number is defined in two places.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a comment about versioning.

echo $VERSION > /usr/local/lib/z-push/version
fi

# Create admin and top scripts with PHP_VER
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious here, why did you move this code out of the if-else block?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @matidau noted in #2431, this code updates the used php version of zpush, but the code is only run on an update of zpush. Because PHP_VER is changed, the scripts should be updated even without a zpush update.

@kiekerjan
Copy link
Contributor Author

These two updates are to address review comments.

@@ -138,23 +141,23 @@ InstallNextcloud() {
if [ -e "$STORAGE_ROOT/owncloud/owncloud.db" ]; then
# ownCloud 8.1.1 broke upgrades. It may fail on the first attempt, but
# that can be OK.
sudo -u www-data php"$PHP_VER" /usr/local/lib/owncloud/occ upgrade
sudo -u www-data php"$NC_PHP_VER" /usr/local/lib/owncloud/occ upgrade
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking ahead to when we upgrade to later versions after 8.1, would it make more sense for nc_php_ver to be a parameter for this function in the same way the hashes are? We could also then include the installation of earlier versions as part of the function instead of the main body of the code. i.e. where nc_php_ver not equals PHP_VER.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did think of that, but didn´t want to make more changes then necessary (I like optimizing changes like this, so difficult for me 😉 )
If we make this a function parameter it does make the code clearer I think

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have already thought about it, All good by me then.

@@ -235,10 +255,31 @@ if [ ! -d /usr/local/lib/owncloud/ ] || [[ ! ${CURRENT_NEXTCLOUD_VER} =~ ^$nextc
InstallNextcloud 24.0.12 7aa5d61632c1ccf4ca3ff00fb6b295d318c05599 4.1.0 697f6b4a664e928d72414ea2731cb2c9d1dc3077 3.2.2 ce4030ab57f523f33d5396c6a81396d440756f5f 3.0.0 0df781b261f55bbde73d8c92da3f99397000972f
CURRENT_NEXTCLOUD_VER="24.0.12"
fi
if [[ ${CURRENT_NEXTCLOUD_VER} =~ ^24 ]]; then

if [[ ${CURRENT_NEXTCLOUD_VER} =~ ^2[456] ]]; then
Copy link
Contributor

@matidau matidau Mar 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we look look at a function for the removal of the PHP versions, we will need to call an identical or nearly identical code for 8.1 when we move to a higher version. In my mind this would keep the if [[ ${CURRENT_NEXTCLOUD_VER} sections closer to their current format of: check condition, call function.

Note this also could be a future improvement instead of being included in this PR, just thought I would raise it now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought of doing a separate version, but then I wondered if all dependencies are the same, so I didn´t put in the time to optimize that, just kept it as is.
Again, having two separate functions to install php dependencies and uninstall them, would make the code cleaner / clearer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, perfect later.

But then one of us, or a new developer, might forget? How about adding a TODO comment about it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don´t think we should put TODOs in the code. But I'm only one person 😉

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don´t think we should put TODOs in the code. But I'm only one person 😉

Was just about to post this.

I think as soon as 8.1 is merged we should put together a PR for 8.2 and we can include this as an improvement.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don´t think we should put TODOs in the code. But I'm only one person 😉

Great discussion. It's open source, developers come and leave. Any inline comments, TODO comments or whatever, are precious leftovers for the next developer to pick up.

I've done the same, for example this merged PR of mine, last year when I added plenty of comments:
https://github.com/mail-in-a-box/mailinabox/pull/2268/files

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think as soon as 8.1 is merged we should put together a PR for 8.2 and we can include this as an improvement.

Ah, PHP v8.2, tell me, why do you think about it? And are there any documentation or TODO comments on how to bump a PHP version?

Copy link
Contributor Author

@kiekerjan kiekerjan Mar 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we might be able to skip a php version:

  • Create one PR containing upgrades of versions 27, 28 and 29. All are supporting php 8.1
  • Create another PR containing upgrade to php 8.3. Supported by nextcloud 28 and further.
  • Create another PR optimizing the code (see earlier discussions in this thread)

Update: In hindsight, I'm going too fast. There's are also other applications that depend on PHP, e.g. Roundcube and zpush. And for instance Roundcube dependencies (see stremlau/html5_notifier#57) are also to be taken into account

I use a little table for supported versions:

Nextcloud version supported php versions
20 7.2, 7.3, 7.4
21 7.3, 7.4, 8.0
22 7.3, 7.4, 8.0
23 7.3, 7.4, 8.0
24 7.4, 8.0, 8.1
25 7.4, 8.0, 8.1
26 8.0, 8.1, 8.2
27 8.0 (d), 8.1, 8.2 (r)
28 8.0 (d), 8.1, 8.2 (r), 8.3
29 8.0 (d), 8.1, 8.2 (r), 8.3
30 8.1 (d), 8.2, 8.3 (r)
31 8.1 (d), 8.2, 8.3 (r), 8.4

Also take into account dependency on the user_external addon

user_external version Nextcloud version supported
2.1.0 21-22
3.0.0 22-24
3.1.0 22-25
3.2.0 25-27
3.3.0 25-28
3.4.0 25-29

This actually leads me to the next bump in the road: support by user_external. Support for newer Nextcloud versions seems to stall But at least by going to version 29 of Nextcloud we get some air in keeping up with the development tempo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent summary. We should put these tables somewhere better, maybe under CONTRIBUTING.md?

Once this PR gets merged, I'll create incremental PRs to slowly upgrade our NC versions step by step.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the interests of moving this PR forward, can we agree that any additional steps can be left to after the PR?

Copy link
Contributor

@matidau matidau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me


ADMIN=$(./mail.py user admins | head -n 1)
ADMIN=$(./management/cli.py user admins | head -n 1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an interesting change. Why rerun whole management-cli for unlocking only?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only made the change so it would work. Running the management-cli was already there. I think what this code does is checking that the requested user is actually an Admin according to the Mail-in-a-Box administration, before unlocking the nextcloud.

@binarykitchen
Copy link
Contributor

Awesome, well done 🙇

I'm itching to get this out, but double-checked all over again, asked a few more questions ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants