From 493db009ed8dcc430580b26dfcee852296e23540 Mon Sep 17 00:00:00 2001 From: Michiel de Jong Date: Tue, 27 Sep 2022 09:07:16 +0200 Subject: [PATCH 1/8] Remove Unattended install as a duplicate of Development install --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 03276885..0622e707 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,6 @@ A plugin to make Nextcloud compatible with Solid. You can download it via the Nextcloud app store: https://apps.nextcloud.com/apps/solid IMPORTANT: Follow the [additional install instructions!](https://github.com/pdsinterop/solid-nextcloud/blob/main/INSTALL.md). - -## Unattended install -To programmatically build a Nextcloud server that has this plugin working, -you can look at the [nextcloud-server image in the Solid test-suite](https://github.com/solid/test-suite/blob/main/servers/nextcloud-server/Dockerfile), -combined with [how it's initialized](https://github.com/solid/test-suite/blob/665824a/runTests.sh#L52-L53) in the runTests.sh script. - ## Development install Clone https://github.com/pdsinterop/test-suites, cd into it, and run: ```sh From 6bf0836877189fba7b71612772f0b142333ba2ee Mon Sep 17 00:00:00 2001 From: Michiel de Jong Date: Tue, 27 Sep 2022 09:14:25 +0200 Subject: [PATCH 2/8] Update situation around unattendend and manual testing --- README.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0622e707..c9d2b945 100644 --- a/README.md +++ b/README.md @@ -28,16 +28,10 @@ and then test whether https://your-nextcloud-server.com/.well-known/openid-confi Also, take the CORS instructions from site.conf and add them to your own webserver configuration. ## Unattended testing -To test whether your server is install correctly, you can run Solid's [webid-provider-tests](https://github.com/solid/webid-provider-tests#against-production) against it. +There is a [GitHub Action](https://github.com/pdsinterop/solid-nextcloud/actions/workflows/ci.yml) that runs a [Docker-based test script](https://github.com/pdsinterop/solid-nextcloud/blob/585b968/.github/workflows/ci.yml#L29). ## Manual testing -Go to https://solidcommunity.net and create a Solid pod. -Go to https://generator.inrupt.com/text-editor and log in with https://solidcommunity.net. Tick all 4 boxes in the consent dialog. -Click 'Load', type something, click 'Save'. -Grant access to co-editor https://your-nextcloud-server.com/apps/solid/@your-username/profile/card#me. -For instance if you're using the [development install](#development-install), that would be https://localhost/apps/solid/@alice/profile/card#me -Now in a separate browser window, log in to https://generator.inrupt.com/text-editor with https://your-nextcloud-server.com. -You should be able to edit the file as a co-author now, using your Nextcloud account as a webid identity provider. +You can try out the various Solid apps that show up in the Solid App GUI inside the Nextcloud GUI on first use. # Publishing to the Nextcloud app store From cdb42dee7a6f35bad8ad465be16a5a01c658e973 Mon Sep 17 00:00:00 2001 From: Michiel de Jong Date: Tue, 27 Sep 2022 09:26:55 +0200 Subject: [PATCH 3/8] merge manual install into install instructions --- INSTALL.md | 9 +++++++-- README.md | 8 ++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index d5c3f389..ebf88c37 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,13 +1,18 @@ # Installing this app to your Nextcloud ## Set up /.well-known/openid-configuration -After installing and enabling the app, take the JSON from e.g. +After installing and enabling the appin your Nextcloud instance, take the JSON from e.g. `https://cloud.pondersource.org/index.php/apps/solid/openid` (depending on your hostname and whether you have the `index.php/` part in there) and put that into e.g. `/var/www/html/.well-known/openid-configuration` (depending on your webroot being e.g. `/var/www/html`) +Or you should +[edit your .htaccess file](https://github.com/solid/test-suite/blob/665824af763ddd5dd7242cbc8b18faad4ac304e3/servers/nextcloud-server/init.sh#L5) +and then test whether https://your-nextcloud-server.com/.well-known/openid-configuration redirects to https://your-nextcloud-server.com/apps/solid/openid. + Check that it works: `https://cloud.pondersource.org/.well-known/openid-configuration` -Then add this section to your apache site.conf: +Then, take the CORS instructions from site.conf and add them to your own webserver configuration. +In particular, add this section to your apache site.conf: ``` Header always set Access-Control-Allow-Origin: * diff --git a/README.md b/README.md index c9d2b945..49f74cf0 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A plugin to make Nextcloud compatible with Solid. You can download it via the Nextcloud app store: https://apps.nextcloud.com/apps/solid -IMPORTANT: Follow the [additional install instructions!](https://github.com/pdsinterop/solid-nextcloud/blob/main/INSTALL.md). +IMPORTANT: Follow the [install instructions!](https://github.com/pdsinterop/solid-nextcloud/blob/main/INSTALL.md). ## Development install Clone https://github.com/pdsinterop/test-suites, cd into it, and run: @@ -21,11 +21,7 @@ docker exec -u root -it server service apache2 reload Now visit https://localhost and log in as alice / alice123. ## Manual install -If you enable this app in your Nextcloud instance, you should -[edit your .htaccess file](https://github.com/solid/test-suite/blob/665824af763ddd5dd7242cbc8b18faad4ac304e3/servers/nextcloud-server/init.sh#L5) -and then test whether https://your-nextcloud-server.com/.well-known/openid-configuration redirects to https://your-nextcloud-server.com/apps/solid/openid. - -Also, take the CORS instructions from site.conf and add them to your own webserver configuration. +Pleas follow the [install instructions](https://github.com/pdsinterop/solid-nextcloud/blob/main/INSTALL.md). ## Unattended testing There is a [GitHub Action](https://github.com/pdsinterop/solid-nextcloud/actions/workflows/ci.yml) that runs a [Docker-based test script](https://github.com/pdsinterop/solid-nextcloud/blob/585b968/.github/workflows/ci.yml#L29). From 58aa95aaecae0f9e7e844c9c0efbc60e286ce018 Mon Sep 17 00:00:00 2001 From: Michiel de Jong Date: Tue, 27 Sep 2022 09:30:32 +0200 Subject: [PATCH 4/8] merge sections about /.well-known/openid-configuration redirect --- INSTALL.md | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index ebf88c37..4b814560 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -5,25 +5,18 @@ After installing and enabling the appin your Nextcloud instance, take the JSON f `https://cloud.pondersource.org/index.php/apps/solid/openid` (depending on your hostname and whether you have the `index.php/` part in there) -and put that into e.g. `/var/www/html/.well-known/openid-configuration` (depending on your webroot being e.g. `/var/www/html`) -Or you should -[edit your .htaccess file](https://github.com/solid/test-suite/blob/665824af763ddd5dd7242cbc8b18faad4ac304e3/servers/nextcloud-server/init.sh#L5) -and then test whether https://your-nextcloud-server.com/.well-known/openid-configuration redirects to https://your-nextcloud-server.com/apps/solid/openid. - -Check that it works: `https://cloud.pondersource.org/.well-known/openid-configuration` -Then, take the CORS instructions from site.conf and add them to your own webserver configuration. -In particular, add this section to your apache site.conf: -``` - - Header always set Access-Control-Allow-Origin: * - -``` -Then restart Apache. +and put that into e.g. `/var/www/html/.well-known/openid-configuration` (depending on your webroot being e.g. `/var/www/html`). In earlier versions of this app (e.g. the one in the Dockerfile we use for running the Solid test suite) we used a redirect from /.well-known/openid-configuration to /index.php/apps/solid/openid but it's difficult to add CORS headers to a redirect, so that's why just copying the file into a folder like that is preferable. +If you do want to try doing it with the redirect, you should +[edit your .htaccess file](https://github.com/solid-contrib/test-suite/blob/665824af763ddd5dd7242cbc8b18faad4ac304e3/servers/nextcloud-server/init.sh#L5) +and then test whether https://your-nextcloud-server.com/.well-known/openid-configuration redirects to https://your-nextcloud-server.com/apps/solid/openid. + +Check that it works: `https://cloud.pondersource.org/.well-known/openid-configuration` + ## If your Nextcloud was installed using Snap Steps you probably already took: From ace8f0ad2f019c1de574ae6d01c1f4a2e9cd07ca Mon Sep 17 00:00:00 2001 From: Michiel de Jong Date: Tue, 27 Sep 2022 09:30:45 +0200 Subject: [PATCH 5/8] Update app version --- INSTALL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 4b814560..6b7c01e2 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -82,8 +82,8 @@ root@ubuntu-s-4vcpu-8gb-amd-ams3-01:~#  Screenshot 5 -* If you can't find v0.0.3 in through the search function, you can also download it explicitly: -> `root@ubuntu-s-4vcpu-8gb-amd-ams3-01:/var/snap/nextcloud/current/nextcloud/extra-apps# wget https://github.com/pdsinterop/solid-nextcloud/releases/download/v0.0.3/solid.tar.gz` +* If you can't find v0.4.3 in through the search function, you can also download it explicitly: +> `root@ubuntu-s-4vcpu-8gb-amd-ams3-01:/var/snap/nextcloud/current/nextcloud/extra-apps# wget https://github.com/pdsinterop/solid-nextcloud/releases/download/v0.4.3/solid.tar.gz` * In all cases, make sure you click 'Enable' for the Solid app on https://test-nextcloud-snap.michielbdejong.com/index.php/settings/apps * Now test with your browser: `https://test-nextcloud-snap.michielbdejong.com/index.php/apps/solid/openid` * It should be a JSON document, something like `{"id_token_signing_alg_values_supported":["RS256"],"subject_types_supported":["public"],"response_types_supported":[...` From 5987f039e2f6ce6c40e394466c74de63f31f78f8 Mon Sep 17 00:00:00 2001 From: Michiel de Jong Date: Tue, 27 Sep 2022 14:25:48 +0200 Subject: [PATCH 6/8] Update snap install instructions (see also #92) --- INSTALL.md | 127 +++++++++-------------------------------------------- 1 file changed, 20 insertions(+), 107 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 6b7c01e2..81df20e7 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,113 +1,25 @@ # Installing this app to your Nextcloud -## Set up /.well-known/openid-configuration -After installing and enabling the appin your Nextcloud instance, take the JSON from e.g. +If you have installed Nextcloud [using snap](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-nextcloud-on-ubuntu-22-04) +you should be able to run the latest version of this app. -`https://cloud.pondersource.org/index.php/apps/solid/openid` (depending on your hostname and whether you have the `index.php/` part in there) - -and put that into e.g. `/var/www/html/.well-known/openid-configuration` (depending on your webroot being e.g. `/var/www/html`). - -In earlier versions of this app (e.g. the one in the Dockerfile we use for running the Solid test suite) we -used a redirect from /.well-known/openid-configuration to /index.php/apps/solid/openid but it's difficult -to add CORS headers to a redirect, so that's why just copying the file into a folder like that is preferable. - -If you do want to try doing it with the redirect, you should -[edit your .htaccess file](https://github.com/solid-contrib/test-suite/blob/665824af763ddd5dd7242cbc8b18faad4ac304e3/servers/nextcloud-server/init.sh#L5) -and then test whether https://your-nextcloud-server.com/.well-known/openid-configuration redirects to https://your-nextcloud-server.com/apps/solid/openid. - -Check that it works: `https://cloud.pondersource.org/.well-known/openid-configuration` - -## If your Nextcloud was installed using Snap - -Steps you probably already took: -* Point a DNS A record to the server that will run Nextcloud, for instance "A test-nextcloud-snap 188.166.99.179" -* Install Nextcloud using Snap: -> root@ubuntu-s-4vcpu-8gb-amd-ams3-01:~# snap install nextcloud -> nextcloud 22.2.0snap2 from Nextcloud✓ installed - -* Browse to it over http and complete the setup: - -Screenshot 1 - -It's important that you have a public DNS A record pointing to the server, since you'll need it to enable https, which is a requirement for Solid: - -* Run this on your server to add a LetsEncrypt cert to your Nextcloud: - -```sh -root@ubuntu-s-4vcpu-8gb-amd-ams3-01:~# nextcloud.enable-https lets-encryptIn order for Let's Encrypt to verify that you actually own the -domain(s) for which you're requesting a certificate, there are a -number of requirements of which you need to be aware: - -1. In order to register with the Let's Encrypt ACME server, you must -   agree to the currently-in-effect Subscriber Agreement located -   here: - -       https://letsencrypt.org/repository/ - -   By continuing to use this tool you agree to these terms. Please -   cancel now if otherwise. - -2. You must have the domain name(s) for which you want certificates -   pointing at the external IP address of this machine. - -3. Both ports 80 and 443 on the external IP address of this machine -   must point to this machine (e.g. port forwarding might need to be -   setup on your router). - -Have you met these requirements? (y/n) -Please answer yes or no. -Have you met these requirements? (y/n) yes -Please enter an email address (for urgent notices or key recovery): michiel-testing@pondersource.com - -Please enter your domain name(s) (space-separated): test-nextcloud-snap.michielbdejong.com -Attempting to obtain certificates... done - -Restarting apache... done -root@ubuntu-s-4vcpu-8gb-amd-ams3-01:~#  -``` - -* Now you can visit your Nextcloud over https: - -Screenshot 2 - -* Go to the 'Apps' menu: - -Screenshot 3 - -* Search for 'solid': - -Screenshot 4 - -* Download and install: - -Screenshot 5 - -* If you can't find v0.4.3 in through the search function, you can also download it explicitly: -> `root@ubuntu-s-4vcpu-8gb-amd-ams3-01:/var/snap/nextcloud/current/nextcloud/extra-apps# wget https://github.com/pdsinterop/solid-nextcloud/releases/download/v0.4.3/solid.tar.gz` -* In all cases, make sure you click 'Enable' for the Solid app on https://test-nextcloud-snap.michielbdejong.com/index.php/settings/apps -* Now test with your browser: `https://test-nextcloud-snap.michielbdejong.com/index.php/apps/solid/openid` -* It should be a JSON document, something like `{"id_token_signing_alg_values_supported":["RS256"],"subject_types_supported":["public"],"response_types_supported":[...` -* The following [is a bit tricky](https://github.com/nextcloud-snap/nextcloud-snap/issues/412#issuecomment-930878692) but it seems to work: -```sh -sudo cp -r /snap/nextcloud/current/htdocs /var/snap/nextcloud/current/nextcloud/config/ -cd /var/snap/nextcloud/current/nextcloud/config/htdocs -sudo mount /var/snap/nextcloud/current/nextcloud/config/htdocs /snap/nextcloud/current/htdocs/ -o bind -``` -Now make the change described in the "Set up /.well-known/openid-configuration" section above, but using -`/var/snap/nextcloud/current/nextcloud/config/htdocs/.well-known/openid-configuration` as the directory. - -FIXME: How can you edit the Apache site.conf if installed via Snap? Maybe see if the Header directive -can live in `/var/snap/nextcloud/current/nextcloud/config/htdocs/.well-known/.htaccess` instead? - -Restart Apache using: -```sh -sudo snap restart nextcloud.apache -``` - -* Now test that `https://test-nextcloud-snap.michielbdejong.com/.well-known/openid-configuration` redirects to `https://test-nextcloud-snap.michielbdejong.com/index.php/apps/solid/openid` -* Add this to your /etc/fstabs and restart the server: +## Building from source +In the future you will be able to install the app just from the app store, or by running `sudo nextcloud.occ app:install solid`. +But currently (September 2022) that still installs version 0.0.3, which means you need to install from source. Specifically, you will need code from [this PR](https://github.com/pdsinterop/solid-nextcloud/pull/93) which is still unmerge at the time of writing. To switch the version of your Solid app from the "store-bought" version to the latest unreleased version, you will need to build from source: ``` -/var/snap/nextcloud/current/nextcloud/config/htdocs /snap/nextcloud/current/htdocs none auto,bind,x-systemd.before=snap.nextcloud.apache.service,x-systemd.requires-mounts-for=/snap/nextcloud/current/,x-systemd.required-by=snap.nextcloud.apache.service 0 0 +sudo /bin/bash +cd /var/snap/nextcloud/current/nextcloud/extra-apps/ +rm -r solid +git clone https://github.com/pdsinterop/solid-nextcloud +ln -s solid-nextcloud/solid +cd solid +git checkout well-known-cors +apt update +apt install -y php git php-curl php-gd php-opcache php-xml php-gd \ + php-curl php-zip php-json libxml2 libxml2-dev php-xml php-mbstring \ + build-essential curl php-sqlite3 php-xdebug php-mbstring php-zip \ + php-imagick imagemagick php-intl +make ``` ## Troubleshooting @@ -135,4 +47,5 @@ sudo snap restart nextcloud.apache ``` (notice, importantly, the `AllowOverride All` that makes apache read your .htaccess in the first place) and then run `systemctl restart apache2`. -* find a way to enable CORS headers (not sure exactly how to do this, see https://github.com/pdsinterop/solid-nextcloud/issues/57) +* if installed through snap, the logs you want to check server-side are in `/var/snap/nextcloud/current/logs/` +* if installed the old way with Apache, check `/var/log/apache2/error.log` and `/var/www/html/data/nextcloud.log` From 9cc1ad5dbb4a4126f64fccde8e7066df074c2a1b Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Fri, 30 Sep 2022 17:16:05 +0200 Subject: [PATCH 7/8] removed comment for merged branch --- INSTALL.md | 1 - 1 file changed, 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 81df20e7..74f05909 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -13,7 +13,6 @@ rm -r solid git clone https://github.com/pdsinterop/solid-nextcloud ln -s solid-nextcloud/solid cd solid -git checkout well-known-cors apt update apt install -y php git php-curl php-gd php-opcache php-xml php-gd \ php-curl php-zip php-json libxml2 libxml2-dev php-xml php-mbstring \ From 6ea869bdae916c19d3946ed3a58579d51a70c838 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Fri, 30 Sep 2022 17:17:28 +0200 Subject: [PATCH 8/8] remove reference to the merged PR --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 74f05909..494f5ed2 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -5,7 +5,7 @@ you should be able to run the latest version of this app. ## Building from source In the future you will be able to install the app just from the app store, or by running `sudo nextcloud.occ app:install solid`. -But currently (September 2022) that still installs version 0.0.3, which means you need to install from source. Specifically, you will need code from [this PR](https://github.com/pdsinterop/solid-nextcloud/pull/93) which is still unmerge at the time of writing. To switch the version of your Solid app from the "store-bought" version to the latest unreleased version, you will need to build from source: +But currently (September 2022) that still installs version 0.0.3, which means you need to install from source. To switch the version of your Solid app from the "store-bought" version to the latest unreleased version, you will need to build from source: ``` sudo /bin/bash cd /var/snap/nextcloud/current/nextcloud/extra-apps/