Skip to content

Commit 8de6488

Browse files
author
Sorita Heng
committed
DOC-3135: Update documentaiton for Image Proxy service using Docker (individually licensed)
1 parent 1b8c3de commit 8de6488

File tree

5 files changed

+237
-0
lines changed

5 files changed

+237
-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 (individually licensed)
2+
:navtitle: Image Proxy service
3+
:description: How-to deploy the {productname} Image Proxy service server-side component using Docker (individually licensed).
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: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
[[installation]]
2+
== Installation
3+
4+
[NOTE]
5+
A valid xref:license-key.adoc[License Key] is **required** in order to install {pluginname} On-Premises.
6+
link:https://www.tiny.cloud/contact/[Contact us] for a trial xref:license-key.adoc[License Key].
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 [username] -p [password] 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+
=== Specify Configurations
27+
28+
After completing the previous steps, run the Docker container from the pulled image:
29+
30+
[source, sh, subs="attributes+"]
31+
----
32+
docker run -p 19040:19040 registry.containers.tiny.cloud/image-proxy-tiny:[version]
33+
----
34+
35+
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.
36+
37+
If set up correctly, the logs should display output similar to the following:
38+
39+
[source, log]
40+
----
41+
2025-01-08 12:03:15 [io-compute-3] INFO emissary - emissary
42+
...
43+
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)
44+
2025-01-08 12:03:16 [io-compute-blocker-3] WARN c.e.d.config.AllowedOriginsConfig$ - No allowed-origins specified in config!
45+
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))
46+
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
47+
2025-01-08 12:03:17 [io-compute-1] INFO o.h.blaze.server.BlazeServerBuilder -
48+
_ _ _ _ _
49+
| |_| |_| |_ _ __| | | ___
50+
| ' \\ _| _| '_ \\_ _(_-<
51+
|_||_\\__|\\__| .__/ |_|/__/
52+
|_|
53+
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/
54+
----
55+
56+
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.
57+
58+
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].
59+
60+
This configuration file requires at least the following information:
61+
62+
* allowed-origins - Specifies the domains allowed to communicate with server-side editor features. This is **mandatory** for all server-side components.
63+
64+
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.
65+
66+
* link:https://www.tiny.cloud/docs/tinymce/latest/configure-common-settings-services/#proxy[proxy configuration]
67+
* link:https://www.tiny.cloud/docs/tinymce/latest/configure-common-settings-services/#http[http configuration]
68+
69+
The following settings for the Image Proxy service premium server-side component are optional:
70+
71+
* link:https://www.tiny.cloud/docs/tinymce/latest/configure-imageproxy-service/#image-proxy[image-proxy configuration]
72+
73+
=== Launch the Docker Container
74+
75+
Once the application configuration file is ready, proceed with the Docker Compose setup to configure and run the service.
76+
77+
. Create the `docker-compose.yml` file:
78+
79+
+
80+
[source, yml]
81+
----
82+
services:
83+
image-proxy-tiny:
84+
image: registry.containers.tiny.cloud/image-proxy-tiny:[version]
85+
ports:
86+
- "19040:19040"
87+
restart: always
88+
init: true
89+
volumes:
90+
- type: bind
91+
source: <PATH_TO_APPLICATION_CONF_FILE_IN_HOST_MACHINE>
92+
target: /ephox-image-proxy/ephox-image-proxy-docker-env.conf
93+
read_only: true
94+
----
95+
96+
. Run the service (within the same directory where `docker-compose.yaml` was placed):
97+
98+
+
99+
[source, sh]
100+
----
101+
docker compose up
102+
----
103+
104+
+
105+
If the setup is correct, the initiation logs should appear as follows:
106+
107+
+
108+
[source, log]
109+
----
110+
✔ Container image-proxy-tiny-image-proxy-tiny-1 Created 0.0s
111+
Attaching to image-proxy-tiny-1
112+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-8] INFO emissary - emissary
113+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-8] INFO emissary - * External Configuration
114+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-8] INFO emissary - * External configuration via System Properties
115+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * parseConfigSources
116+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * looking up property: ephox.config.url
117+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - -> Property not set
118+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * looking up property: config.url
119+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - -> Property not set
120+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * parseConfigSources
121+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * looking up property: ephox.config.file
122+
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
123+
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
124+
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
125+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * External application.conf => /opt/ephox/application.conf
126+
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
127+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * Internal Configuration
128+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - -> No extra internal configuration specified - skipping
129+
image-proxy-tiny-1 | 2025-01-08 15:02:36 [io-compute-blocker-8] INFO emissary - * Default (Reference) Configuration
130+
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.
131+
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)
132+
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:
133+
image-proxy-tiny-1 | - good.com
134+
image-proxy-tiny-1 | - example.com
135+
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))
136+
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
137+
image-proxy-tiny-1 | 2025-01-08 15:02:37 [io-compute-1] INFO o.h.blaze.server.BlazeServerBuilder -
138+
image-proxy-tiny-1 | _ _ _ _ _
139+
image-proxy-tiny-1 | | |_| |_| |_ _ __| | | ___
140+
image-proxy-tiny-1 | | ' \\ _| _| '_ \\_ _(_-<
141+
image-proxy-tiny-1 | |_||_\\__|\\__| .__/ |_|/__/
142+
image-proxy-tiny-1 | |_|
143+
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/
144+
----
145+
146+
=== Next Steps
147+
148+
. Test the service via cURL command
149+
150+
+
151+
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.
152+
153+
+
154+
To check the service is running use:
155+
156+
+
157+
[source, sh]
158+
----
159+
curl <http://localhost:19040/version>
160+
----
161+
162+
+
163+
An example output is: 2.111.1
164+
165+
+
166+
To confirm that a request is being sent to the Image Proxy service, use:
167+
168+
+
169+
[source, sh]
170+
----
171+
curl --location '<http://localhost:19040/2/image?url=https%3A%2F%2Fraw.githubusercontent.com%2Fsrikomm%2FBMP-EDITING%2Frefs%2Fheads%2Fmaster%2Fsrc%2FInputs%2Ffish.bmp>' \\
172+
--header 'Origin: <http://good.com>'
173+
----
174+
175+
+
176+
Finally, to verify if a request is unauthorized and originates from an incorrect origin, use:
177+
178+
+
179+
[source, sh]
180+
----
181+
curl --location '<http://localhost:19040/2/image?url=https%3A%2F%2Fraw.githubusercontent.com%2Fsrikomm%2FBMP-EDITING%2Frefs%2Fheads%2Fmaster%2Fsrc%2FInputs%2Ffish.bmp>' \\
182+
--header 'Origin: <http://bad.com>'
183+
----
184+
185+
+
186+
If an error occurs, the expected message is: `{ "message": "The supplied authentication is not authorized to access this resource" }`.
187+
188+
. Test directly in {productname}
189+
190+
+
191+
Before deploying, it is recommended to test this service within the {productname} editor itself.
192+
193+
+
194+
To do this, configure the {pluginname} feature in the editor and call it via `tinymce.init`. If running locally on the default port `19040`, use the following settings:
195+
196+
+
197+
[source, js]
198+
----
199+
tinymce.init({
200+
…,
201+
editimage_cors_hosts: [ 'example.com', 'good.com' ],
202+
editimage_proxy_service_url: "<http://localhost:19040>"
203+
});
204+
----
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+
A valid xref:license-key.adoc[License Key] is required in order to install {pluginname} Proxy Service On-Premises. link:https://www.tiny.cloud/contact/[Contact Tiny Support] to request a trial xref:license-key.adoc[License Key].
7+
8+
The only requirement to run this service On-Premises is a container runtime or orchestration tool e.g. Docker, Kubernetes, Podman.
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 Linux, Unix or macOS operating system.
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)