Skip to content

Commit 4b07964

Browse files
committed
Update WebDAV Configuration #1008
1 parent c668a0a commit 4b07964

4 files changed

Lines changed: 61 additions & 107 deletions

File tree

content/modules/webdav/pages/configuration.adoc

Lines changed: 19 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -5,77 +5,39 @@
55

66
To authenticate desktop applications, the server must have HTTPS enabled. Here are simple instructions for configuring HTTPS in your development environment.
77

8-
[IMPORTANT]
9-
====
10-
Self-signed certificates are suitable solely for testing purposes. When running production applications, it's essential to utilize SSL certificates issued by a trusted authority.
11-
====
8+
[[trusted-certificate]]
9+
=== Generating Trusted Certificate
10+
11+
Trusted certificates can be obtained from SSL certificate providers or generated with `certbot`. But for the development purposes you can issue your own root certificate and sign development server's certificate with it. To simplify this task, we recommend using the `mkcert` tool.
1212

13-
[[keystore-file]]
14-
=== Creating a Keystore File
13+
. Install `mkcert` by following the instructions provided in its repository: https://github.com/FiloSottile/mkcert[https://github.com/FiloSottile/mkcert^].
1514

16-
. Generate a keystore using the https://docs.oracle.com/en/java/javase/11/tools/keytool.html[keytool utility^] provided by JDK:
15+
. Generate and install the root certificate:
1716
+
18-
[source,text]
17+
[source]
1918
----
20-
keytool -genkey -keyalg RSA -alias localhost -keystore localhost.jks -validity 365 -keysize 2048
19+
mkcert -install
2120
----
22-
+
23-
You will be asked for the keystore password and then for some names. Remember the password and the names.
2421

25-
. Export certificate from the keystore:
22+
. Create a certificate for localhost:
2623
+
27-
[source,text]
24+
[source]
2825
----
29-
keytool -export -keystore localhost.jks -storepass <password> -alias localhost -file localhost.cer
26+
mkcert -pkcs12 localhost 127.0.0.1 ::1
3027
----
3128
+
32-
Use the password entered on the first step instead of `<password>`.
29+
You will see the `localhost+2.p12` file in the current folder.
3330

34-
. Register the certificate as trusted in your operating system.
31+
. Create a keystore file with the certificate for your project:
3532
+
36-
* On Windows operating system:
33+
[source]
34+
----
35+
keytool -importkeystore -srckeystore localhost+2.p12 -srcstoretype pkcs12 -destkeystore localhost.jks
36+
----
3737
+
38-
1. Press the `Windows` key + `R` to open the *Run* dialog, then type `"certmgr.msc"` and press *Enter*. This will open the *Certificate Manager*.
39-
40-
2. In the left pane of the *Certificate Manager*, expand the *Trusted Root Certification Authorities* folder.
41-
42-
3. Right-click on the folder and select *All Tasks > Import...* from the context menu. This will open the *Certificate Import Wizard*.
43-
44-
4. In the *Certificate Import Wizard*, click *Next* and then browse to the location where your certificate file is stored. Select the certificate file and click *Next*.
45-
46-
5. Choose the option to place the certificate in the *Trusted Root Certification Authorities* store and click *Next*.
47-
48-
6. Review the information and click *Finish* to complete the import process.
49-
50-
7. You should see a message indicating that the import was successful. Click *OK* to close the wizard.
38+
Enter `changeit` as the source keystore password.
5139
+
52-
Once these steps are completed, the certificate should be registered as trusted in the Windows operating system.
53-
* On macOS:
54-
1. Double-click on `localhost.cer` file in Finder. The *Keychain Access* application will open.
55-
2. Find your certificate under the name entered on the first step as "your first and last name" on the *Certificates* tab.
56-
3. Double-click the certificate and select *Trust -> When using this certificate: Always Trust*.
57-
58-
=== Generate trusted certificate
59-
60-
Some use cases like opening WebDAV files in recent LibreOffice and Firefox versions may not work with self-signed certificates. Trusted
61-
certificates can be obtained from SSL-providers or generated with `certbot`. But for the development purposes you can issue
62-
your own root certificate and sign development server's certificate with it. To simplify this task we recommend to use
63-
`mkcert` generation/maintenance tool. You can skip this section in case you are ok with HTTPS warnings and restrictions.
64-
65-
. Install `mkcert` from the following repo: https://github.com/FiloSottile/mkcert[https://github.com/FiloSottile/mkcert].
66-
You can build it either from source (requires golang to be installed) and copy binary to `/usr/local/bin` or use binaries provided by vendor.
67-
68-
. Once having `mkcert` in path you can generate and install root certificate:
69-
70-
mkcert -install
71-
72-
. Navigate to keystore directory and create signed certificates for your development server:
73-
74-
mkcert -pkcs12 localhost 127.0.0.1 ::1
75-
76-
. Create `.jks` keystore file with certificates for your project:
77-
78-
keytool -importkeystore -srckeystore localhost+2.p12 -srcstoretype pkcs12 -destkeystore localhost.jks
40+
You will see the `localhost.jks` file in the current folder.
7941

8042
[[configuring-server]]
8143
=== Configuring Server

content/modules/webdav/pages/configuring-https.adoc

Lines changed: 37 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,52 @@
1-
= 3. Configuring to Work with Desktop Applications
1+
= 3. Working with Desktop Applications
22

33
To authenticate desktop applications, the server must have HTTPS enabled. Here are simple instructions for configuring HTTPS in your development environment.
44

5-
[IMPORTANT]
6-
====
7-
Self-signed certificates are suitable solely for testing purposes. When running production applications, it's essential to utilize SSL certificates issued by a trusted authority.
8-
====
5+
[[using-libreoffice]]
6+
== Using LibreOffice
7+
8+
Install LibreOffice and configure the xref:webdav-properties.adoc#jmix.webdav.applications[jmix.webdav.applications] property to open all files in it:
9+
10+
[source,properties]
11+
----
12+
jmix.webdav.applications = {"vnd.libreoffice.command":\
13+
{"name":"LibreOffice","protocols":\
14+
{"writable":"vnd.libreoffice.command:ofe|u|",\
15+
"read_only":"vnd.libreoffice.command:ofv|u|"},\
16+
"extensions":["odt", "ods", "odp", "doc", "docx", "xls", "xlsx", "ppt", "pptx"]}}
17+
----
918

1019
[[keystore-file]]
1120
== Creating a Keystore File
1221

13-
. Generate a keystore using the https://docs.oracle.com/en/java/javase/11/tools/keytool.html[keytool utility^] provided by JDK:
22+
. Install `mkcert` utility by following the instructions provided in its repository: https://github.com/FiloSottile/mkcert[https://github.com/FiloSottile/mkcert^].
23+
24+
. Generate and install the root certificate:
1425
+
15-
[source,text]
26+
[source]
1627
----
17-
keytool -genkey -keyalg RSA -alias localhost -keystore localhost.jks -validity 365 -keysize 2048
28+
mkcert -install
1829
----
19-
+
20-
You will be asked for the keystore password and then for some names. Remember the password and the names.
2130

22-
. Export certificate from the keystore:
31+
. Create a certificate for localhost:
2332
+
24-
[source,text]
33+
[source]
2534
----
26-
keytool -export -keystore localhost.jks -storepass <password> -alias localhost -file localhost.cer
35+
mkcert -pkcs12 localhost 127.0.0.1 ::1
2736
----
2837
+
29-
Use the password entered on the first step instead of `<password>`.
38+
You will see the `localhost+2.p12` file in the current folder.
3039

31-
. Register the certificate as trusted in your operating system.
40+
. Create a keystore file with the certificate for your project:
3241
+
33-
* On Windows operating system:
42+
[source]
43+
----
44+
keytool -importkeystore -srckeystore localhost+2.p12 -srcstoretype pkcs12 -destkeystore localhost.jks
45+
----
3446
+
35-
1. Press the `Windows` key + `R` to open the *Run* dialog, then type `"certmgr.msc"` and press *Enter*. This will open the *Certificate Manager*.
36-
37-
2. In the left pane of the *Certificate Manager*, expand the *Trusted Root Certification Authorities* folder.
38-
39-
3. Right-click on the folder and select *All Tasks > Import...* from the context menu. This will open the *Certificate Import Wizard*.
40-
41-
4. In the *Certificate Import Wizard*, click *Next* and then browse to the location where your certificate file is stored. Select the certificate file and click *Next*.
42-
43-
5. Choose the option to place the certificate in the *Trusted Root Certification Authorities* store and click *Next*.
44-
45-
6. Review the information and click *Finish* to complete the import process.
46-
47-
7. You should see a message indicating that the import was successful. Click *OK* to close the wizard.
47+
Enter `changeit` as the source keystore password.
4848
+
49-
Once these steps are completed, the certificate should be registered as trusted in the Windows operating system.
50-
* On macOS:
51-
1. Double-click on `localhost.cer` file in Finder. The *Keychain Access* application will open.
52-
2. Find your certificate under the name entered on the first step as "your first and last name" on the *Certificates* tab.
53-
3. Double-click the certificate and select *Trust -> When using this certificate: Always Trust*.
49+
You will see the `localhost.jks` file in the current folder.
5450

5551
[[configuring-server]]
5652
== Configuring Server
@@ -90,12 +86,12 @@ server.ssl.key-store = classpath:com/example/demo/keystore/localhost.jks
9086
[source,java,indent=0]
9187
----
9288
@EventListener
93-
public void printApplicationUrl(final ApplicationStartedEvent event) {
94-
LoggerFactory.getLogger(DemoApplication.class).info("Application started at "
95-
+ "https://localhost:"
96-
+ environment.getProperty("local.server.port")
97-
+ Strings.nullToEmpty(environment.getProperty("server.servlet.context-path")));
98-
}
89+
public void printApplicationUrl(final ApplicationStartedEvent event) {
90+
LoggerFactory.getLogger(DemoApplication.class).info("Application started at "
91+
+ "https://localhost:"
92+
+ environment.getProperty("local.server.port")
93+
+ Strings.nullToEmpty(environment.getProperty("server.servlet.context-path")));
94+
}
9995
----
10096

10197
[[running-application]]
@@ -107,13 +103,7 @@ Choose the *Knowledge base* item from the *Application* menu. Click on the WebDA
107103

108104
image::open-webdav-doc1.png[align="center", width="1432"]
109105

110-
The browser will display a dialog prompting the user to open the WebDAV file in a desktop office application.
111-
112-
image::open-webdav-doc2.png[align="center", width="1432"]
113-
114-
Agree to open the file and ensure that the WebDAV document opens in desktop office applications.
115-
116-
image::open-office.png[align="center", width="1080"]
106+
The browser will display a dialog prompting the user to open the WebDAV file in LibreOffice. Agree to open the file.
117107

118108
Once the WebDAV document is edited and saved, a new version of the document will be created, which will be the latest version.
119109

content/modules/webdav/pages/index.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ implementation 'io.jmix.webdav:jmix-webdav-flowui-starter'
4949
Desktop applications use basic authentication for server connections via WebDAV, so you have to set up HTTPS for your web application. Refer to the xref:configuration.adoc#https[Configuring HTTPS] section for guidance on configuring HTTPS on localhost for development purposes.
5050

5151
[[requirements]]
52-
== Minimal Requirements
52+
== Requirements
5353

54-
The minimum version of Microsoft Office needed to access documents via the WebDAV protocol is MS Office 2010 SP2 or higher. For LibreOffice, the minimum required version is 6.3.
54+
IMPORTANT: Due to recently disabled Basic authentication in Microsoft 365 applications (see https://learn.microsoft.com/en-us/microsoft-365-apps/security/basic-authentication-prompts-blocked[^]), the WebDAV add-on cannot work with the latest versions of Microsoft Office.
55+
56+
The minimum version of Microsoft Office needed to access documents via the WebDAV protocol is MS Office 2010 SP2. For LibreOffice, the minimum required version is 6.3.
5557

5658
To verify the installed versions of Microsoft Office and Service Pack (SP) on your computer, open MS Word and navigate to the *Product Information* section via *File → Help*. Service Pack 2 for MS Office 2010 (and subsequent versions) should display the following number: 14.0.7015.1000 (or higher). To update your Service Pack, click on this https://www.microsoft.com/en-US/download/details.aspx?id=39667[link^].

content/modules/webdav/pages/view-with-webdav-documents.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,5 @@ In this section, you have created the basic feature of the application: a knowle
9999

100100
You have learned that:
101101

102-
* The WebDAV add-on offers the `WebdavDocument` entity, which represents a document within the WebDAV functionality. This entity facilitates editing and viewing documents using external applications such as Microsoft Word and Excel, managing document versions, and controlling access to specific documents.
102+
* The WebDAV add-on offers the `WebdavDocument` entity, which represents a document within the WebDAV functionality. This entity facilitates editing and viewing documents using external applications, managing document versions, and controlling access to specific documents.
103103
* The xref:flow-ui:vc/components/entityPicker.adoc[entityPicker] component is used by default to select a reference in a generated detail view. Clicking the ellipsis button for the *WebDAV document* field will open the standard xref:webdav:webdav-documents.adoc[WebDAV documents view] provided by the add-on.

0 commit comments

Comments
 (0)