Paul's remarks

pull/915/head
fflorent 4 weeks ago
parent 1309169e24
commit d6e470c8a6

@ -235,11 +235,11 @@ Grist can be configured in many ways. Here are the main environment variables it
| Variable | Purpose | | Variable | Purpose |
|------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ALLOWED_WEBHOOK_DOMAINS | comma-separated list of permitted domains to use in webhooks (e.g. webhook.site,zapier.com). You can set this to `*` to allow all domains, but if doing so, we recommend using a carefully locked-down proxy (see `GRIST_HTTPS_PROXY`) if you do not entirely trust users. Otherwise services on your internal network may become vulnerable to manipulation. | | ALLOWED_WEBHOOK_DOMAINS | comma-separated list of permitted domains to use in webhooks (e.g. webhook.site,zapier.com). You can set this to `*` to allow all domains, but if doing so, we recommend using a carefully locked-down proxy (see `GRIST_HTTPS_PROXY`) if you do not entirely trust users. Otherwise services on your internal network may become vulnerable to manipulation. |
| APP_DOC_URL | doc worker url, set when starting an individual doc worker (other servers will find doc worker urls via redis) | | APP_DOC_URL | doc worker url, set when starting an individual doc worker (other servers will find doc worker urls via redis) |
| APP_DOC_INTERNAL_URL | like `APP_DOC_URL` but used by the home server to reach the server using an internal domain name resolution (like in a docker environment). You may only define this value in the doc worker. Defaults to `APP_DOC_URL`. | | APP_DOC_INTERNAL_URL | like `APP_DOC_URL` but used by the home server to reach the server using an internal domain name resolution (like in a docker environment). It only makes sense to define this value in the doc worker. Defaults to `APP_DOC_URL`. |
| APP_HOME_URL | url prefix for home api (home and doc servers need this) | | APP_HOME_URL | url prefix for home api (home and doc servers need this) |
| APP_HOME_INTERNAL_URL | like `APP_HOME_URL` but used by the home server to reach any home workers using an internal domain name resolution (like in a docker environment). Defaults to `APP_HOME_URL` | | APP_HOME_INTERNAL_URL | like `APP_HOME_URL` but used by the home and the doc servers to reach any home workers using an internal domain name resolution (like in a docker environment). Defaults to `APP_HOME_URL` |
| APP_STATIC_URL | url prefix for static resources | | APP_STATIC_URL | url prefix for static resources |
| APP_STATIC_INCLUDE_CUSTOM_CSS | set to "true" to include custom.css (from APP_STATIC_URL) in static pages | | APP_STATIC_INCLUDE_CUSTOM_CSS | set to "true" to include custom.css (from APP_STATIC_URL) in static pages |
| APP_UNTRUSTED_URL | URL at which to serve/expect plugin content. | | APP_UNTRUSTED_URL | URL at which to serve/expect plugin content. |

@ -1157,7 +1157,7 @@ export class DocAPIImpl extends BaseAPI implements DocAPI {
} }
/** /**
* Reprensents information to build public doc worker url. * Represents information to build public doc worker url.
* *
* Structure that may contain either **exclusively**: * Structure that may contain either **exclusively**:
* - a selfPrefix when no pool of doc worker exist. * - a selfPrefix when no pool of doc worker exist.
@ -1191,7 +1191,7 @@ export function getUrlFromPrefix(homeUrl: string, prefix: string) {
* (result of the call to /api/worker/:docId) * (result of the call to /api/worker/:docId)
*/ */
export function getPublicDocWorkerUrl(homeUrl: string, docWorkerInfo: PublicDocWorkerUrlInfo) { export function getPublicDocWorkerUrl(homeUrl: string, docWorkerInfo: PublicDocWorkerUrlInfo) {
return docWorkerInfo.selfPrefix ? return docWorkerInfo.selfPrefix !== null ?
getUrlFromPrefix(homeUrl, docWorkerInfo.selfPrefix) : getUrlFromPrefix(homeUrl, docWorkerInfo.selfPrefix) :
docWorkerInfo.docWorkerUrl!; docWorkerInfo.docWorkerUrl;
} }

@ -197,7 +197,7 @@ function hostMatchesUrl(host?: string, url?: string) {
* @param {string?} host The host to check * @param {string?} host The host to check
*/ */
function isOwnInternalUrlHost(host?: string) { function isOwnInternalUrlHost(host?: string) {
// Note: APP_HOME_INTERNAL_URL may also defined in doc worker as well as in Home worker // Note: APP_HOME_INTERNAL_URL may also be defined in doc worker as well as in home worker
if (process.env.APP_HOME_INTERNAL_URL && hostMatchesUrl(host, process.env.APP_HOME_INTERNAL_URL)) { if (process.env.APP_HOME_INTERNAL_URL && hostMatchesUrl(host, process.env.APP_HOME_INTERNAL_URL)) {
return true; return true;
} }

@ -6,7 +6,7 @@ import log from 'app/server/lib/log';
import {adaptServerUrl} from 'app/server/lib/requestUtils'; import {adaptServerUrl} from 'app/server/lib/requestUtils';
import * as express from 'express'; import * as express from 'express';
import fetch, {Response as FetchResponse, RequestInit} from 'node-fetch'; import fetch, {Response as FetchResponse, RequestInit} from 'node-fetch';
import { getAssignmentId } from './idUtils'; import {getAssignmentId} from './idUtils';
/** /**
* This method transforms a doc worker's public url as needed based on the request. * This method transforms a doc worker's public url as needed based on the request.

Loading…
Cancel
Save