Skip to content

Commit 393f0f1

Browse files
soritahengSorita Hengfrossi933kemister85
authored
DOC-3135: Update documentation for Image Proxy service using Docker (Individually licensed) (#3630)
* DOC-3135: Update documentaiton for Image Proxy service using Docker (individually licensed) * Minor fixes and adjustment for clarity * DOC-3135: Remove License key notes from docs about Image proxy service using Docker * Update modules/ROOT/partials/docker/image-proxy-service/image-proxy-service-overview.adoc Co-authored-by: Karl Kemister-Sheppard <[email protected]> * Update modules/ROOT/partials/docker/image-proxy-service/image-proxy-service-requirements.adoc Co-authored-by: Karl Kemister-Sheppard <[email protected]> * Update modules/ROOT/partials/docker/image-proxy-service/image-proxy-service-requirements.adoc Co-authored-by: Karl Kemister-Sheppard <[email protected]> * Update modules/ROOT/partials/docker/image-proxy-service/image-proxy-service-requirements.adoc Co-authored-by: Karl Kemister-Sheppard <[email protected]> * Update modules/ROOT/partials/docker/image-proxy-service/image-proxy-service-installation.adoc Co-authored-by: Karl Kemister-Sheppard <[email protected]> * Update modules/ROOT/partials/docker/image-proxy-service/image-proxy-service-installation.adoc Co-authored-by: Karl Kemister-Sheppard <[email protected]> * Update modules/ROOT/partials/docker/image-proxy-service/image-proxy-service-installation.adoc Co-authored-by: Karl Kemister-Sheppard <[email protected]> * Update modules/ROOT/partials/docker/image-proxy-service/image-proxy-service-installation.adoc Co-authored-by: Karl Kemister-Sheppard <[email protected]> * Update modules/ROOT/partials/docker/image-proxy-service/image-proxy-service-installation.adoc Co-authored-by: Karl Kemister-Sheppard <[email protected]> * Update modules/ROOT/partials/docker/image-proxy-service/image-proxy-service-installation.adoc Co-authored-by: Karl Kemister-Sheppard <[email protected]> * Update modules/ROOT/partials/docker/image-proxy-service/image-proxy-service-installation.adoc Co-authored-by: Karl Kemister-Sheppard <[email protected]> * Update modules/ROOT/partials/docker/image-proxy-service/image-proxy-service-installation.adoc Co-authored-by: Karl Kemister-Sheppard <[email protected]> * Update modules/ROOT/partials/docker/image-proxy-service/image-proxy-service-installation.adoc Co-authored-by: Karl Kemister-Sheppard <[email protected]> * Update yaml file example --------- Co-authored-by: Sorita Heng <[email protected]> Co-authored-by: Federico Rossi <[email protected]> Co-authored-by: Karl Kemister-Sheppard <[email protected]>
1 parent 777f3c9 commit 393f0f1

File tree

5 files changed

+265
-0
lines changed

5 files changed

+265
-0
lines changed

modules/ROOT/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
***** xref:bundle-imageproxy-container.adoc[Image Proxy service]
136136
**** Individually licensed plugin services
137137
***** xref:individual-hyperlinking-container.adoc[Hyperlinking service]
138+
***** xref:individual-image-proxy-container.adoc[Image Proxy service]
138139
***** xref:individual-spelling-container.adoc[Spelling service]
139140
***** xref:individual-export-to-pdf-on-premises.adoc[Export to PDF]
140141
***** xref:individual-import-from-word-and-export-to-word-on-premises.adoc[Import from Word and Export to Word]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
= Deploy the {productname} Image Proxy service server-side component using Docker
2+
:navtitle: Image Proxy service
3+
:description: How-to deploy the {productname} Image Proxy service server-side component using Docker.
4+
:shbundledockerfiles: false
5+
:pluginname: Image Editing
6+
7+
//include::partial$docker/dockerized-hyperlinking-service.adoc[]
8+
include::partial$docker/image-proxy-service/image-proxy-service-overview.adoc[]
9+
10+
include::partial$docker/image-proxy-service/image-proxy-service-requirements.adoc[]
11+
12+
include::partial$docker/image-proxy-service/image-proxy-service-installation.adoc[]
13+
14+
Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
[[installation]]
2+
== Installation
3+
4+
[IMPORTANT]
5+
A valid access token is **required** in order to retrieve On-Premises services images from {companyname} Cloud Docker Registry.
6+
link:https://www.tiny.cloud/contact/[Contact {companyname} Support^] to request the access token.
7+
8+
=== Retrieve Docker Image
9+
10+
. Login into the {companyname} Cloud Docker Registry:
11+
+
12+
[source, sh, subs="attributes+"]
13+
----
14+
docker login -u tiny -p [access-token] registry.containers.tiny.cloud
15+
----
16+
17+
. Pull the Docker Image from the Docker registry:
18+
+
19+
[source, sh, subs="attributes+"]
20+
----
21+
docker pull registry.containers.tiny.cloud/image-proxy-tiny:<VERSION>
22+
----
23+
+
24+
Replace `<VERSION>` with `latest` or the specific version number.
25+
26+
[NOTE]
27+
Currently, the Docker images are only supported on x86-64 (also known as AMD64) architecture processors.
28+
=== Specify Configurations
29+
30+
After completing the previous steps, run the Docker container from the pulled image:
31+
32+
[source, sh, subs="attributes+"]
33+
----
34+
docker run -p 19040:19040 registry.containers.tiny.cloud/image-proxy-tiny:<VERSION>
35+
----
36+
37+
This triggers `-p 19040:19040`, exposing the service on `localhost:19040`. The service runs on port `19040` inside the Docker container, and this maps it to the same port on your localhost.
38+
39+
If set up correctly, the logs should display output similar to the following:
40+
41+
[source, log]
42+
----
43+
2025-01-08 12:03:15 [io-compute-3] INFO emissary - emissary
44+
...
45+
2025-01-08 12:03:16 [io-compute-blocker-3] INFO emissary - -> Raw Config assembled from various sources: ConfigOrigin(merge of /ephox-image-proxy/ephox-image-proxy-docker-env.conf: 1,system properties,reference.conf @ jar:file:/ephox-image-proxy/ephox-image-proxy.jar!/reference.conf: 1)
46+
2025-01-08 12:03:16 [io-compute-blocker-3] WARN c.e.d.config.AllowedOriginsConfig$ - No allowed-origins specified in config!
47+
2025-01-08 12:03:16 [io-compute-blocker-3] INFO emissary - emissary config loaded successfully: EmissaryConfig(SdkHttpConfig(HttpConfig(100,10,10,3,HttpConfigTimeouts(10,10,10),JvmTrustModel()),None),OriginWhitelist(List(),OriginPrecision(true)),Some(10000000))
48+
2025-01-08 12:03:17 [io-compute-1] INFO o.h.b.c.nio1.NIO1SocketServerGroup - Service bound to address /0:0:0:0:0:0:0:0:19040
49+
2025-01-08 12:03:17 [io-compute-1] INFO o.h.blaze.server.BlazeServerBuilder -
50+
_ _ _ _ _
51+
| |_| |_| |_ _ __| | | ___
52+
| ' \\ _| _| '_ \\_ _(_-<
53+
|_||_\\__|\\__| .__/ |_|/__/
54+
|_|
55+
2025-01-08 12:03:17 [io-compute-1] INFO o.h.blaze.server.BlazeServerBuilder - http4s v0.23.27 on blaze v0.23.16 started at http://[::]:19040/
56+
----
57+
58+
Running this command will generate a log warning about `allowed-origins` not being configured. This is expected, as it will be set up in the next step.
59+
60+
The {productname} server-side components require a configuration file to function correctly. By convention, this file is named `application.conf`. For more information, refer to link:https://www.tiny.cloud/docs/tinymce/latest/configure-required-services/[Required configuration for the server-side components].
61+
62+
This configuration file requires at least the following information:
63+
64+
* allowed-origins - Specifies the domains allowed to communicate with server-side editor features. This is **mandatory** for all server-side components.
65+
66+
The following settings for the premium server-side components are optional and will apply to all services that make outgoing HTTP/HTTPS requests using the configuration file.
67+
68+
* link:https://www.tiny.cloud/docs/tinymce/latest/configure-common-settings-services/#proxy[proxy configuration]
69+
* link:https://www.tiny.cloud/docs/tinymce/latest/configure-common-settings-services/#http[http configuration]
70+
71+
The following settings for the Image Proxy service premium server-side component are optional:
72+
73+
* link:https://www.tiny.cloud/docs/tinymce/latest/configure-imageproxy-service/#image-proxy[image-proxy configuration]
74+
75+
=== Run the Docker Container
76+
77+
The Docker container can also be run with `docker compose`. In this example, the following directory structure is assumed:
78+
79+
[source,sh]
80+
----
81+
tiny-image-proxy/
82+
└── docker-compose.yaml # Docker Compose file to define and run the service
83+
└── application.conf # Configuration file for allowed origins and other settings
84+
----
85+
86+
Here is an example of the `application.conf` file with the basic configurations:
87+
88+
[source, conf]
89+
----
90+
ephox {
91+
allowed-origins {
92+
origins = [
93+
"<http://example.com>",
94+
"<http://good.com> ",
95+
"*.my.company.org"
96+
]
97+
}
98+
}
99+
----
100+
101+
Once the application configuration file is ready, proceed with the Docker Compose setup to configure and run the service.
102+
103+
. Create the `docker-compose.yaml` file:
104+
105+
+
106+
[source, yaml]
107+
----
108+
services:
109+
image-proxy-tiny:
110+
image: registry.containers.tiny.cloud/image-proxy-tiny:[version]
111+
ports:
112+
- "19040:19040"
113+
restart: always
114+
init: true
115+
volumes:
116+
- type: bind
117+
source: ./application.conf #change this to the path on your local machine
118+
target: /ephox-image-proxy/ephox-image-proxy-docker-env.conf
119+
read_only: true
120+
----
121+
122+
. Run the service (within the same directory where `docker-compose.yaml` was placed):
123+
124+
+
125+
[source, sh]
126+
----
127+
docker compose up
128+
----
129+
130+
+
131+
If the setup is correct, the initiation logs should appear as follows:
132+
133+
+
134+
[source, log]
135+
----
136+
✔ Container image-proxy-tiny-image-proxy-tiny-1 Created 0.0s
137+
Attaching to image-proxy-tiny-1
138+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-8] INFO emissary - emissary
139+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-8] INFO emissary - * External Configuration
140+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-8] INFO emissary - * External configuration via System Properties
141+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * parseConfigSources
142+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * looking up property: ephox.config.url
143+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - -> Property not set
144+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * looking up property: config.url
145+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - -> Property not set
146+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * parseConfigSources
147+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * looking up property: ephox.config.file
148+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - -> Found value for property: /ephox-image-proxy/ephox-image-proxy-docker-env.conf
149+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * Parsing config defined by /ephox-image-proxy/ephox-image-proxy-docker-env.conf from property: ephox.config.file
150+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - -> Processing file: /ephox-image-proxy/ephox-image-proxy-docker-env.conf
151+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * External application.conf => /opt/ephox/application.conf
152+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * Optional File (/opt/ephox/application.conf). Defaults to empty if file not found
153+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * Internal Configuration
154+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - -> No extra internal configuration specified - skipping
155+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * Default (Reference) Configuration
156+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * Loading configuration files from classpath (reference.conf and integration.conf). Neither is required.
157+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - -> Raw Config assembled from various sources: ConfigOrigin(merge of /ephox-image-proxy/ephox-image-proxy-docker-env.conf: 1,system properties,reference.conf @ jar:file:/ephox-image-proxy/ephox-image-proxy.jar!/reference.conf: 1)
158+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO c.e.d.config.AllowedOriginsConfig$ - Read allowed-origins config (ignoring ports = true) as:
159+
image-proxy-tiny-1 | - good.com
160+
image-proxy-tiny-1 | - example.com
161+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - emissary config loaded successfully: EmissaryConfig(SdkHttpConfig(HttpConfig(100,10,10,3,HttpConfigTimeouts(10,10,10),JvmTrustModel()),None),OriginWhitelist(List(good.com, example.com),OriginPrecision(true)),Some(10000000))
162+
image-proxy-tiny-1 | 2025-01-08 15:02:37 [io-compute-1] INFO o.h.b.c.nio1.NIO1SocketServerGroup - Service bound to address /0:0:0:0:0:0:0:0:19040
163+
image-proxy-tiny-1 | 2025-01-08 15:02:37 [io-compute-1] INFO o.h.blaze.server.BlazeServerBuilder -
164+
image-proxy-tiny-1 | _ _ _ _ _
165+
image-proxy-tiny-1 | | |_| |_| |_ _ __| | | ___
166+
image-proxy-tiny-1 | | ' \\ _| _| '_ \\_ _(_-<
167+
image-proxy-tiny-1 | |_||_\\__|\\__| .__/ |_|/__/
168+
image-proxy-tiny-1 | |_|
169+
image-proxy-tiny-1 | 2025-01-08 15:02:37 [io-compute-1] INFO o.h.blaze.server.BlazeServerBuilder - http4s v0.23.27 on blaze v0.23.16 started at http://[::]:19040/
170+
----
171+
172+
=== Next Steps
173+
174+
. Test the service via cURL command
175+
176+
+
177+
To verify that the Image Proxy service is set up and functioning correctly within the container, ensure the service is running on port `19040`. Once active, it should be ready to receive requests. The expected outputs below confirm proper configuration, assuming `http://good.com` is in the allowed origins and `http://bad.com` is not.
178+
179+
+
180+
To check the service is running use:
181+
182+
+
183+
[source, sh]
184+
----
185+
curl http://localhost:19040/version
186+
----
187+
188+
+
189+
An example output is: `2.111.1`
190+
191+
+
192+
To confirm that a request is being sent to the Image Proxy service, use:
193+
194+
+
195+
[source, sh]
196+
----
197+
curl --location 'http://localhost:19040/2/image?url=https%3A%2F%2Fraw.githubusercontent.com%2Fsrikomm%2FBMP-EDITING%2Frefs%2Fheads%2Fmaster%2Fsrc%2FInputs%2Ffish.bmp' \\
198+
--header 'Origin: http://good.com'
199+
----
200+
201+
+
202+
Finally, to verify if a request is unauthorized and originates from an incorrect origin, use:
203+
204+
+
205+
[source, sh]
206+
----
207+
curl --location 'http://localhost:19040/2/image?url=https%3A%2F%2Fraw.githubusercontent.com%2Fsrikomm%2FBMP-EDITING%2Frefs%2Fheads%2Fmaster%2Fsrc%2FInputs%2Ffish.bmp' \\
208+
--header 'Origin: http://bad.com'
209+
----
210+
211+
+
212+
If an error occurs, the expected message is: `{ "message": "The supplied authentication is not authorized to access this resource" }`.
213+
214+
. Test directly in {productname}
215+
216+
+
217+
Before deploying, it is recommended to test this service within the {productname} editor itself.
218+
219+
+
220+
To do this, configure the xref:editimage.adoc[{pluginname}] feature in the editor and call it via `tinymce.init`. If running locally on the default port `19040`, use the following settings:
221+
222+
+
223+
[source, js]
224+
----
225+
tinymce.init({
226+
selector: 'textarea', // change this value according to your HTML
227+
toolbar: 'image',
228+
plugins: 'image editimage',
229+
editimage_cors_hosts: [ 'example.com', 'good.com' ],
230+
editimage_proxy_service_url: "http://localhost:19040"
231+
});
232+
----
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[[overview]]
2+
== Overview
3+
4+
The On-Premises version of link:https://www.tiny.cloud/docs/tinymce/latest/editimage/[{pluginname}] is an application that can be installed and run on the customer’s in-house servers and computing infrastructure, including a private cloud.
5+
6+
The only requirement to run this service On-Premises is a container runtime or orchestration tool e.g. Docker, Kubernetes, Podman.
7+
8+
A valid access token is required to access the {companyname} Cloud Docker registry and pull the Docker image. Contact link:https://www.tiny.cloud/contact/[{companyname} Support^] to request the access token.
9+
10+
include::partial$misc/admon-dont-push-docker-images.adoc[]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[[requirements]]
2+
== Requirements
3+
4+
* The link:https://docs.docker.com/engine/docker-overview/[Docker Engine^] is installed and running.
5+
* The user has Administrative or Root user access to run the Docker commands.
6+
* The user is either:
7+
** Using a Unix-like operating system, such as Linux or macOS.
8+
** Using Windows and has access to unix command line tools using link:https://gitforwindows.org/[Git for Windows^], link:https://www.cygwin.com/[Cygwin^], or the link:https://docs.microsoft.com/en-us/windows/wsl/install-win10[Windows Subsystem for Linux^].

0 commit comments

Comments
 (0)