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

[Nextcloud] make install command parameters bulletproof #1332

Merged
merged 2 commits into from
Jan 3, 2023

Conversation

EV21
Copy link
Contributor

@EV21 EV21 commented Oct 19, 2022

In my test run my credentials are

[test42@hadar html]$ my_print_defaults client
--default-character-set=utf8mb4
--user=test42
--password=-M,W:YO9123456.TZz1C
[test42@hadar html]$ NEXTCLOUD_ADMIN_USER='Testadminuser'
[test42@hadar html]$ NEXTCLOUD_ADMIN_PASS='superUnSafePässwörd'
[test42@hadar html]$ MYSQL_PASSWORD='-M,W:YO9123456.TZz1C'

The --database-pass[=DATABASE-PASS] has an optional argument (not like the other ones) and in my case the password starts with -M, so the Symfony CLI logic sees this thing as flag

grafik

with = it works
grafik

Since the official documentation also uses the space separation it looks like a bug.
https://docs.nextcloud.com/server/latest/admin_manual/installation/command_line_installation.html

Maybe just let us use the bulletproof connected variant to avoid these cases when the password generator likes to have a - at the beginning 🤣 (It is not the first time I got a password like that, I also got it once on U5/U6 too)

grafik


deploy preview 👀

@EV21 EV21 changed the title [Nextcloud] fix guide for NC25 [Nextcloud] make install command parameters bulletproof Oct 21, 2022
@EV21 EV21 force-pushed the nextcloud branch 2 times, most recently from 30df924 to 954355c Compare November 18, 2022 19:59
@SalocinHB SalocinHB requested a review from kimdiallo December 15, 2022 13:35
@kimdiallo kimdiallo merged commit a00b38d into Uberspace:main Jan 3, 2023
@kimdiallo kimdiallo removed their assignment Jan 3, 2023
@EV21 EV21 deleted the nextcloud branch January 3, 2023 11:07
@@ -249,7 +249,7 @@ Add the following cronjob to your :manual:`crontab <daemons-cron>`:

::

*/5 * * * * sleep $(( 1 + $RANDOM \% 60 )) ; php -f $HOME/html/cron.php > $HOME/logs/nextcloud-cron.log 2>&1
*/5 * * * * sleep $(( 1 + RANDOM % 60 )) ; php -f $HOME/html/cron.php > $HOME/logs/nextcloud-cron.log 2>&1
Copy link
Member

Choose a reason for hiding this comment

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

The % needs to be escaped. From crontab's man page:

The "sixth" field (the rest of the line) specifies the command to be run. The entire command portion of the line, up to a new‐line or a "%" character, will be executed by /bin/sh or by the shell specified in the SHELL variable of the cronfile. A "%" character in the command, unless escaped with a backslash (), will be changed into newline characters, and all data after the first % will be sent to the command as standard input.

Copy link
Contributor Author

@EV21 EV21 Jan 31, 2023

Choose a reason for hiding this comment

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

#1479 That PR also adds a note as this is absolutely uncommon. This feature is actually a bug (in my opinion). They (the crontab devs) should not mess with the syntax in this way, instead crontab should use its own replacement code for such things.

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.

3 participants