You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To provide some safety when linking to user-supplied external images, we
provide a simple image proxy handler. Images accessed through this proxy
will only be served if they meet the following criteria:
- Appear to be valid image files
- Are in a permitted format: GIF, JPEG, PNG or WebP
- Do not have an excessive width or height (5000 pixels max, by default)
To serve an image through this proxy, its URL should be passed to the
handler's path as a `src` query param. The path is supplied to the
application in the `IMAGE_PROXY_PATH` environment variable.
We also provide a helper method to make forming the proxy links easier:
Thruster.image_proxy_path('https://example.com/image.jpg')
|`SSL_DOMAIN`| The domain name to use for SSL provisioning. If not set, SSL will be disabled. | None |
63
-
|`TARGET_PORT`| The port that your Puma server should run on. Thruster will set `PORT` to this when starting your server. | 3000 |
64
-
|`CACHE_SIZE`| The size of the HTTP cache in bytes. | 64MB |
65
-
|`MAX_CACHE_ITEM_SIZE`| The maximum size of a single item in the HTTP cache in bytes. | 1MB |
66
-
|`X_SENDFILE_ENABLED`| Whether to enable X-Sendfile support. Set to `0` or `false` to disable. | Enabled |
67
-
|`MAX_REQUEST_BODY`| The maximum size of a request body in bytes. Requests larger than this size will be refused; `0` means no maximum size. |`0`|
68
-
|`STORAGE_PATH`| The path to store Thruster's internal state. |`./storage/thruster`|
69
-
|`BAD_GATEWAY_PAGE`| Path to an HTML file to serve when the backend server returns a 502 Bad Gateway error. If there is no file at the specific path, Thruster will serve an empty 502 response instead. |`./public/502.html`|
70
-
|`HTTP_PORT`| The port to listen on for HTTP traffic. | 80 |
71
-
|`HTTPS_PORT`| The port to listen on for HTTPS traffic. | 443 |
72
-
|`HTTP_IDLE_TIMEOUT`| The maximum time in seconds that a client can be idle before the connection is closed. | 60 |
73
-
|`HTTP_READ_TIMEOUT`| The maximum time in seconds that a client can take to send the request headers. | 30 |
74
-
|`HTTP_WRITE_TIMEOUT`| The maximum time in seconds during which the client must read the response. | 30 |
75
-
|`DEBUG`| Set to `1` or `true` to enable debug logging. | Disabled |
|`SSL_DOMAIN`| The domain name to use for SSL provisioning. If not set, SSL will be disabled. | None |
94
+
|`TARGET_PORT`| The port that your Puma server should run on. Thruster will set `PORT` to this when starting your server. | 3000 |
95
+
|`CACHE_SIZE`| The size of the HTTP cache in bytes. | 64MB |
96
+
|`MAX_CACHE_ITEM_SIZE`| The maximum size of a single item in the HTTP cache in bytes. | 1MB |
97
+
|`X_SENDFILE_ENABLED`| Whether to enable X-Sendfile support. Set to `0` or `false` to disable. | Enabled |
98
+
|`IMAGE_PROXY_ENABLED`| Whether to enable the built in image proxy. Set to `0` or `false` to disable. | Enabled |
99
+
|`IMAGE_PROXY_MAX_DIMENSION`| When using the image proxy, only serve images with a width and height less than this, in pixels | 5000 |
100
+
|`MAX_REQUEST_BODY`| The maximum size of a request body in bytes. Requests larger than this size will be refused; `0` means no maximum size. |`0`|
101
+
|`STORAGE_PATH`| The path to store Thruster's internal state. |`./storage/thruster`|
102
+
|`BAD_GATEWAY_PAGE`| Path to an HTML file to serve when the backend server returns a 502 Bad Gateway error. If there is no file at the specific path, Thruster will serve an empty 502 response instead. |`./public/502.html`|
103
+
|`HTTP_PORT`| The port to listen on for HTTP traffic. | 80 |
104
+
|`HTTPS_PORT`| The port to listen on for HTTPS traffic. | 443 |
105
+
|`HTTP_IDLE_TIMEOUT`| The maximum time in seconds that a client can be idle before the connection is closed. | 60 |
106
+
|`HTTP_READ_TIMEOUT`| The maximum time in seconds that a client can take to send the request headers. | 30 |
107
+
|`HTTP_WRITE_TIMEOUT`| The maximum time in seconds during which the client must read the response. | 30 |
108
+
|`DEBUG`| Set to `1` or `true` to enable debug logging. | Disabled |
0 commit comments