Skip to content

umaar/wiki-globe

Repository files navigation

All credits go to: https://github.com/cedricpinson/globetweeter

Wiki Globe

Actions Status

TODO

"pool": {
  "min": 2,
  "max": 6,
  "createTimeoutMillis": 3000,
  "acquireTimeoutMillis": 30000,
  "idleTimeoutMillis": 30000,
  "reapIntervalMillis": 1000,
  "createRetryIntervalMillis": 100,
  "propagateCreateError": false // <- default is true, set to false
},

To start

npm i

To deploy on my server for the first time

cd ~/apps
git clone https://github.com/umaar/wiki-globe
cd wiki-globe
npm i
npm run start-production-process

Nginx Configuration (virtual host config file)

location /globe {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-NginX-Proxy true;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;
    proxy_http_version 1.1;
    proxy_pass http://127.0.0.1:<PORT_HERE>;
}

Github Webhook

cd ~/apps/wiki-globe/
git fetch origin master
git reset --hard origin/master
npm i
npm run stop-production-process
npm run start-production-process

Copy private vars

touch ~/development/wiki-globe/config/default.json && jq -s add ~/development/wiki-globe/config/default.json ~/.wiki-globe.json > ~/development/wiki-globe/__tmp__config.json && cp ~/development/wiki-globe/__tmp__config.json ~/development/wiki-globe/config/default.json && rm ~/development/wiki-globe/__tmp__config.json

Copy private vars on server

cp ~/.wiki-globe-production.json ~/apps/wiki-globe/config/production.json

Warning for node.js

A detached process is spawned by the server. Killing the main parent process with the process manager can also kill detached child processes in the same parent tree. Use the --no-treekill to avoid this issue, or, simply use pm2 restart instead of explicitly stopping and starting the process.

Process management

pm2 startup
# follow instructions of the above command

pm2 save

About

🌍️ Visualisation of Wikipedia Edits in Real-TIme

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published