-
Bug
-
Resolution: Fixed
-
Major
-
3.11.7, 4.0.1, 4.1
-
MOODLE_311_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
MDL-74718-master -
Prerequisite for testing
- Docker
- ngrok
For instance, use this ngrok for nextcloud:
ngrok http --region=in 8081 |
Setup nextcloud instance
1. Using docker (make sure docker is installed in your machine), run the command below:
docker run -d -p 8081:80 nextcloud |
You should get the latest version of nextcloud installed on your machine. Access it using the URL generated by ngrok say, https://23ba1b00d3fa.in.ngrok.io
2. Create the admin user and login to the nextcloud instance. This would automatically add domain '23ba1b00d3fa.in.ngrok.io' to the trusted domain and 'overwrite.cli.url'.
3. Make sure to disable the password policy app in nextcloud. You can login to the admin account and navigate to the apps page and disable the app. Else this app would cause problems while creating credentials like s1/test or t1/test etc.
4. Now access the config/config.php file of your Nextcloud instance from the terminal using:
docker exec -it <CONTAINER ID> bash |
Where ID is the container ID of your Nextcloud instance( you may get it from 'docker ps' command)
After this open config/config.php
and update the config.php by adding this line:
'overwriteprotocol' => 'https',
|
5. Save the changes in the config.php and access the nextcloud instance in the browser (ex. https://23ba1b00d3fa.in.ngrok.io)
6. Navigate to Settings -> Security page
7. Under OAuth 2.0 clients fill up the details like:
a) Name: Moodle
b) Redirection URI: http://localhost/m/pg_stable_master/admin/oauth2callback.php
The redirection URL is your moodle URL + admin/oauth2callback.php
8. Click on "Add" button, which would generate Client Identifier a Secret. Copy both values which are required in future steps.
9. Create a student user
username: s1
password: test
Configure moodle instance
1. Log in to moodle as admin.
2. Navigate to Site Administration -> Server -> OAuth 2 services
3. In the "Create new service" section select Nextcloud.
4. Now fill the Client ID (copy it from step 4 of Nextcloud setup instance)
5. Fill in the Client secret (copy it from step 4 of Nextcloud setup instance)
6. Fill in the "Service base URL". This has to be https address. Kindly refer to the ngrok https address which you executed in the prerequisite section. Use the https URL in "Service base URL".
7. Click on the button "Save changes"
8. Click on "System account connected" section of Nextcloud. And login as an admin account of Nextcloud.
9. Navigate to: Site administration -> Plugins -> Repositories -> Manage repositories
10. Select Nextcloud as "Enabled and visible".
11. Click on the "Settings" link right next to "Enable and visible" option.
12. Click the button "Create a repository instance".
13. Give a name to your repo: Nextcloud repo
Select issuer as Nextcloud
Select Default return types as 'External (only links stored in Moodle)'
And Save it.
Steps to test
- Create a course and enroll a student in the course
- Create an assignment activity in the course
- Login as a student and try to attach an image from Nextcloud instance's Photo directory.
- On version 24 of nextcloud ( which I am testing at the moment), I can see 9 images are there by default. But in the file picker, I could see only 5 images. After a frequent refresh of the page, I can see 9 images.
- blocks
-
MDL-69756 Nextcloud error when moving/copying access controlled link file over existing file having the same name
- Closed