-
-
Notifications
You must be signed in to change notification settings - Fork 501
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] Fix database creation and Nginx config #1226
Conversation
- Database was created with wrong privileges for user "root", thus user "oc_admin" is not able to access. - On top, "occ maintenance:install" creates the database and user automatically, thus if "create_mysql_db" is used to create database with correct user oc_admin (<prefix>_$username), Nextcloud will create "oc_admin1" as user via "occ maintenance:install" and use it. => Remove "create_mysql_db" works fine for me, Nextcloud is accessible.
Tested with VirtualBox VMs on Stretch (MariaDB) and Jessie (MySQL). |
- Put "fastcgi_param PHP_ADMIN_VALUE ..." into \.php location, where is works. - Add X-Headers to the location base, so they are active for the whole location and prevent Nextcloud admin panel warnings. - Comment out "fastcgi_param HTTPS on;" to prevent auto redirect to https:// on non-ssl environments => Uncommenting on SSL activation needs to be added. - Uncommenting "fastcgi_request_buffering off;" on Stretch. Tested on Jessie and Stretch VM.
I added fixes for Nginx configuration. @Fourdee |
Looks good, i'll do a full review when I can 👍
If you can give me example of line/value that exists and what you want it to be pulled in as, i'll see if I can assist?
In theory:
|
The
I just realized that
Ah nice 🙂. Would implement it also in |
CLI URL also needs to be switched to HTTPS on SSL environments
About last commit: |
This check is to determine if we need to apply a SSL or non-SSL nginx configuration? If so,
If you can find a quicker and stable replacement for the current @MichaIng |
Ah no, if the check gets a (negative) response, it doesn't check for 20s but directly gives the negative result. So everything is fine. Will implement it on Nextcloud installation.
Not yet, will implement SSL check + config adjustments in about 2 hours, afterwards will be ready to merge. €: Could you give me a hint for the right command to get the database user(+host) from €€: Corrected some comment typos and spacing here and there 😉. |
Ah, €: For now I just also allow error code 5 here. |
Legend, thanks 👍 Ran out of time today, i'll check PR and merge in next day/two.
Quick solution. You could probably optimize this to do it one
|
- occ maintenance:install also creates obsolete 'oc_admin'@'%' mysql user, which can directly be removed. - The effort to get user and host is actually a bid high, as we exactly know the defaults that Nextcloud creates. - But at least on removal we do not know, if user changed something, for whatever reason.
- Tiny database cleanup 😉 - Needed to add $GLOBAL_PW for this, copied from dietpi-software.
Just realized that the
|
|
||
#Global Password: Exception to AUTO first run init. | ||
GLOBAL_PW=$(cat /DietPi/dietpi.txt | grep -m1 '^AUTO_Global_Password=' | sed 's/.*=//') | ||
if [ ! -n "$GLOBAL_PW" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice 👍
Looks good, great work, many thanks 👍 |
+ avoid grep: /var/www/nextcloud/config/config.php: No such file or directory during patch: https://github.com/Fourdee/DietPi/issues/1067 https://github.com/Fourdee/DietPi/pull/1226
I apologize if this is out of place, but I'm getting an http error 500 on a fresh (single) install of Nextcloud and Dietpi v158 (main branch), Raspberry Pi 3. Is this related? |
@flappysquirrel Could be related to https://github.com/Fourdee/DietPi/issues/1233
|
Thank you, I've also made another reinstall and filed a bug report about this, my reference code is: 9ef16341-5f32-4baf-acc2-7bd706d08d6d-0 Should I open an issue? I'm new to this. To answer your questions:
Jessie.
Nope, I changed the log format to full, then chose 'Nextcloud'; ran the installer, and filed the bug report.
I think so. If this is right, I ran
|
@flappysquirrel But as you posted it here, you chose nginx as webserver first, or didn't you switch that eather and lighttpd is installed? I rust tried with nginx and ran into a crazy database privilege error. occ installation went successfull, right user was created and linked in config.php, just his privileges were somehow lost. Granting them again, solved the problem and enabled access to nextcloud web ui: mysql> So far, will create PR in the evening. |
root
, thus useroc_admin
is not able to access.occ maintenance:install
creates the database and user automatically, thus ifcreate_mysql_db
is used to create database with correct useroc_admin
(_$username), Nextcloud will createoc_admin1
as user viaocc maintenance:install
and use it.=> Removing
create_mysql_db
works fine for me, Nextcloud is accessible.Actually I would also like to remove the user on Nextcloud uninstallation, but I am not too good in creating the right command to get the right string from
nextcloud/config/config.php
😅.