-
Notifications
You must be signed in to change notification settings - Fork 0
Home
By default the Puppeteer library will download it's own instance of Chromium, and it might not run on your server. To determine whether you have this issue you can attempt to manually launch Chromium from node_modules/puppeteer/.local-chromium. See the following resources for solutions:
It is generally desirable to manage server applications as services using systemd on Linux. As an example you can create a file at /lib/systemd/system/puppet-show.service with the following contents:
[Unit]
Description=Puppet Show web service
After=syslog.target network.target
[Service]
Type=simple
Environment=CHROME_DEVEL_SANDBOX=/opt/nodejs/v10.1.0/lib/node_modules/puppet-show/node_modules/puppeteer/.local-chromium/linux-555668/chrome-linux/chrome_sandbox
ExecStart=/opt/nodejs/v10.1.0/bin/node /opt/nodejs/v10.1.0/lib/node_modules/puppet-show/bin/www
User=nodejs
Group=nodejs
[Install]
WantedBy=multi-user.target
This example assumes you need the CHROME_DEVL_SANDBOX environment variable as a workaround to Chromium sandbox issues and also assumes nodejs is installed at /opt/nodejs/v10.1.0 and puppet-show was installed globally (-g option). You should probably run this service with a dedicated service account with limited privileges, the example uses user nodejs. Now execute the following to start the service and ensure it starts on machine boot:
systemctl enable puppet-show
systemctl start puppet-show
systemctl status puppet-show
It is generally desirable to use standard ports 80 and 443. One way to achieve this on Linux machines where only root can bind to port 80 and 443 is to reverse proxy via Apache httpd. Here is an example mod_proxy configuration:
ProxyPass /puppet-show http://localhost:3000/puppet-show disableReuse=On
ProxyPassReverse /puppet-show http://localhost:3000/puppet-show