diff --git a/FAQ.md b/FAQ.md index 2a4e5e24c9122d839338c15a6bc7a5b351f2d470..f51efe1af956243eecbb280b8a8ecbb93dda8034 100644 --- a/FAQ.md +++ b/FAQ.md @@ -55,3 +55,7 @@ x = await User.query().where({username:"0000000210481437"}).first() x.admin = true x.save() ``` + +## What should PUBLIC_CLIENT_HOST be set to? + +This environment variable is currently only needed when deploying a _development_ build to a server (not to localhost). Set it to the server's name, e.g. `subdomain.myserver.com`. diff --git a/config/custom-environment-variables.js b/config/custom-environment-variables.js index 344823d928db6ffaa5d97e4b398f0c083cb71cc0..768d4698c3c720f04308fedc709594ae91e16953 100644 --- a/config/custom-environment-variables.js +++ b/config/custom-environment-variables.js @@ -5,7 +5,7 @@ module.exports = { }, 'pubsweet-client': { protocol: 'CLIENT_PROTOCOL', - host: 'CLIENT_HOST', + host: 'PUBLIC_CLIENT_HOST', port: 'CLIENT_PORT', }, 'pubsweet-server': { diff --git a/docker-compose.yml b/docker-compose.yml index a9e21fb04ac462009a8ac256e22b817d7620495d..ba141465cf0f85cc35f11367efaabcd3b5124bf5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,6 +22,7 @@ services: - SERVER_PROTOCOL=http - SERVER_HOST=server - SERVER_PORT=${SERVER_PORT:-3000} + - PUBLIC_CLIENT_HOST=${PUBLIC_CLIENT_HOST:-0.0.0.0} volumes: - ./app:/home/node/app/app - ./config:/home/node/app/config diff --git a/webpack/plugins.js b/webpack/plugins.js index c0c78395ce80326b96001043bb93e8b3ef25124a..17ed23a7ad9972e443380bccc57ba347d1e20db5 100644 --- a/webpack/plugins.js +++ b/webpack/plugins.js @@ -46,6 +46,7 @@ module.exports = (opts = {}) => { 'CLIENT_PROTOCOL', 'CLIENT_HOST', 'CLIENT_PORT', + 'PUBLIC_CLIENT_HOST', ]), )