|
1 | 1 | # Installing this app to your Nextcloud |
2 | 2 |
|
3 | | -## Set up /.well-known/openid-configuration |
4 | | -After installing and enabling the app, take the JSON from e.g. |
5 | | - |
6 | | -`https://cloud.pondersource.org/index.php/apps/solid/openid` (depending on your hostname and whether you have the `index.php/` part in there) |
7 | | - |
8 | | -and put that into e.g. `/var/www/html/.well-known/openid-configuration` (depending on your webroot being e.g. `/var/www/html`) |
9 | | -Check that it works: `https://cloud.pondersource.org/.well-known/openid-configuration` |
10 | | -Then add this section to your apache site.conf: |
11 | | -``` |
12 | | -<Directory /var/www/html/.well-known/> |
13 | | - Header always set Access-Control-Allow-Origin: * |
14 | | -</Directory> |
15 | | -``` |
16 | | -Then restart Apache. |
17 | | - |
18 | | -In earlier versions of this app (e.g. the one in the Dockerfile we use for running the Solid test suite) we |
19 | | -used a redirect from /.well-known/openid-configuration to /index.php/apps/solid/openid but it's difficult |
20 | | -to add CORS headers to a redirect, so that's why just copying the file into a folder like that is preferable. |
21 | | - |
22 | | -## If your Nextcloud was installed using Snap |
23 | | - |
24 | | -Steps you probably already took: |
25 | | -* Point a DNS A record to the server that will run Nextcloud, for instance "A test-nextcloud-snap 188.166.99.179" |
26 | | -* Install Nextcloud using Snap: |
27 | | -> root@ubuntu-s-4vcpu-8gb-amd-ams3-01:~# snap install nextcloud |
28 | | -> nextcloud 22.2.0snap2 from Nextcloud✓ installed |
29 | | -
|
30 | | -* Browse to it over http and complete the setup: |
31 | | - |
32 | | -<img width="960" alt="Screenshot 1" src="https://user-images.githubusercontent.com/408412/140734318-2872d19c-8a2d-40a5-8e89-e0474c705840.png"> |
33 | | - |
34 | | -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: |
35 | | - |
36 | | -* Run this on your server to add a LetsEncrypt cert to your Nextcloud: |
37 | | - |
38 | | -```sh |
39 | | -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 |
40 | | -domain(s) for which you're requesting a certificate, there are a |
41 | | -number of requirements of which you need to be aware: |
42 | | -
|
43 | | -1. In order to register with the Let's Encrypt ACME server, you must |
44 | | - agree to the currently-in-effect Subscriber Agreement located |
45 | | - here: |
46 | | - |
47 | | - https://letsencrypt.org/repository/ |
48 | | - |
49 | | - By continuing to use this tool you agree to these terms. Please |
50 | | - cancel now if otherwise. |
51 | | - |
52 | | -2. You must have the domain name(s) for which you want certificates |
53 | | - pointing at the external IP address of this machine. |
54 | | - |
55 | | -3. Both ports 80 and 443 on the external IP address of this machine |
56 | | - must point to this machine (e.g. port forwarding might need to be |
57 | | - setup on your router). |
58 | | - |
59 | | -Have you met these requirements? (y/n) |
60 | | -Please answer yes or no. |
61 | | -Have you met these requirements? (y/n) yes |
62 | | -Please enter an email address (for urgent notices or key recovery): michiel-testing@pondersource.com |
63 | | - |
64 | | -Please enter your domain name(s) (space-separated): test-nextcloud-snap.michielbdejong.com |
65 | | -Attempting to obtain certificates... done |
66 | | - |
67 | | -Restarting apache... done |
68 | | -root@ubuntu-s-4vcpu-8gb-amd-ams3-01:~# |
69 | | -``` |
70 | | -
|
71 | | -* Now you can visit your Nextcloud over https: |
72 | | -
|
73 | | -<img width="960" alt="Screenshot 2" src="https://user-images.githubusercontent.com/408412/140734389-b3d30abd-8568-415f-a3b9-38d8d4249018.png"> |
74 | | -
|
75 | | -* Go to the 'Apps' menu: |
76 | | -
|
77 | | -<img width="960" alt="Screenshot 3" src="https://user-images.githubusercontent.com/408412/140734411-49661501-43ab-4821-b8a2-60dbc442f964.png"> |
78 | | -
|
79 | | -* Search for 'solid': |
80 | | -
|
81 | | -<img width="1270" alt="Screenshot 4" src="https://user-images.githubusercontent.com/408412/140734420-6bb1ac6f-b4ee-4df5-b88d-544cdb82f174.png"> |
82 | | -
|
83 | | -* Download and install: |
84 | | -
|
85 | | -<img width="1152" alt="Screenshot 5" src="https://user-images.githubusercontent.com/408412/140734504-5cdc4837-9e35-4b47-b091-69b9ff913081.png"> |
86 | | -
|
87 | | -* If you can't find v0.0.3 in through the search function, you can also download it explicitly: |
88 | | -> `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` |
89 | | -* In all cases, make sure you click 'Enable' for the Solid app on https://test-nextcloud-snap.michielbdejong.com/index.php/settings/apps |
90 | | -* Now test with your browser: `https://test-nextcloud-snap.michielbdejong.com/index.php/apps/solid/openid` |
91 | | -* It should be a JSON document, something like `{"id_token_signing_alg_values_supported":["RS256"],"subject_types_supported":["public"],"response_types_supported":[...` |
92 | | -* The following [is a bit tricky](https://github.com/nextcloud-snap/nextcloud-snap/issues/412#issuecomment-930878692) but it seems to work: |
93 | | -```sh |
94 | | -sudo cp -r /snap/nextcloud/current/htdocs /var/snap/nextcloud/current/nextcloud/config/ |
95 | | -cd /var/snap/nextcloud/current/nextcloud/config/htdocs |
96 | | -sudo mount /var/snap/nextcloud/current/nextcloud/config/htdocs /snap/nextcloud/current/htdocs/ -o bind |
97 | | -``` |
98 | | -Now make the change described in the "Set up /.well-known/openid-configuration" section above, but using |
99 | | -`/var/snap/nextcloud/current/nextcloud/config/htdocs/.well-known/openid-configuration` as the directory. |
100 | | -
|
101 | | -FIXME: How can you edit the Apache site.conf if installed via Snap? Maybe see if the Header directive |
102 | | -can live in `/var/snap/nextcloud/current/nextcloud/config/htdocs/.well-known/.htaccess` instead? |
103 | | -
|
104 | | -Restart Apache using: |
105 | | -```sh |
106 | | -sudo snap restart nextcloud.apache |
107 | | -``` |
108 | | -
|
109 | | -* 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` |
110 | | -* Add this to your /etc/fstabs and restart the server: |
111 | | -``` |
112 | | -/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 |
| 3 | +If you have installed Nextcloud [using snap](https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-nextcloud-on-ubuntu-22-04) |
| 4 | +you should be able to run the latest version of this app. |
| 5 | + |
| 6 | +## Building from source |
| 7 | +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`. |
| 8 | +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: |
| 9 | +``` |
| 10 | +sudo /bin/bash |
| 11 | +cd /var/snap/nextcloud/current/nextcloud/extra-apps/ |
| 12 | +rm -r solid |
| 13 | +git clone https://github.com/pdsinterop/solid-nextcloud |
| 14 | +ln -s solid-nextcloud/solid |
| 15 | +cd solid |
| 16 | +apt update |
| 17 | +apt install -y php git php-curl php-gd php-opcache php-xml php-gd \ |
| 18 | + php-curl php-zip php-json libxml2 libxml2-dev php-xml php-mbstring \ |
| 19 | + build-essential curl php-sqlite3 php-xdebug php-mbstring php-zip \ |
| 20 | + php-imagick imagemagick php-intl |
| 21 | +make |
113 | 22 | ``` |
114 | 23 |
|
115 | 24 | ## Troubleshooting |
@@ -137,4 +46,5 @@ sudo snap restart nextcloud.apache |
137 | 46 | </Directory> |
138 | 47 | ``` |
139 | 48 | (notice, importantly, the `AllowOverride All` that makes apache read your .htaccess in the first place) and then run `systemctl restart apache2`. |
140 | | -* find a way to enable CORS headers (not sure exactly how to do this, see https://github.com/pdsinterop/solid-nextcloud/issues/57) |
| 49 | +* if installed through snap, the logs you want to check server-side are in `/var/snap/nextcloud/current/logs/` |
| 50 | +* if installed the old way with Apache, check `/var/log/apache2/error.log` and `/var/www/html/data/nextcloud.log` |
0 commit comments