|
| 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 | +---- |
0 commit comments