1 ########## begin pump.io setup ##########
3 # once pump adds a logrotation script, turn off nologger,
5 # "logfile": "/var/log/pumpio/pumpio.log",
7 s dd of=/etc/pump.io.json <<'EOF'
9 "secret": "SECRET_REPLACE_ME",
11 "params": { "dbname": "pumpio" },
13 "site": "pump.iankelling.org",
14 "owner": "Ian Kelling",
15 "ownerURL": "https://iankelling.org/",
18 "hostname": "pump.iankelling.org",
20 "datadir": "/home/pumpio/pumpdata",
21 "enableUploads": true,
23 "disableRegistration": true,
25 "key": "/home/pumpio/privkey.pem",
26 "cert": "/home/pumpio/fullchain.pem",
27 "address": "localhost",
31 s sed -i "s#SECRET_REPLACE_ME#$(cat /p/c/machine_specific/li/pump-secret)#" /etc/pump.io.json
33 # stretch node is too old
34 # https://nodejs.org/en/download/package-manager/
35 curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
36 pi nodejs graphicsmagick mongodb
38 if [[ -e pump.io ]]; then
42 git clone https://github.com/pump-io/pump.io.git
45 # note: these 2 commands seem
46 # note: doing this or the npm install pump.io as root had problems.
49 # normally, next command would be
50 # s npm install -g odb
51 # but it\'s this until a bug in pump gets fixed
52 # https://github.com/pump-io/pump.io/issues/1287
53 s npm install -g databank-mongodb@0.19.2
54 if ! getent passwd pumpio &>/dev/null; then
55 s useradd -Um -s /bin/false pumpio
57 sudo -u pumpio mkdir -p /home/pumpio/pumpdata
58 # for testing browser when only listening to localhost,
59 # in the pump.io.json, set hostname localhost, urlPort 5233
60 #ssh -L 5233:localhost:5233 li
62 s mkdir -p /var/log/pumpio/
63 s chown pumpio:pumpio /var/log/pumpio/
65 web-conf - apache2 pump.iankelling.org <<'EOF'
66 # currently a bug in pump that we cant terminate ssl
69 ProxyPass / https://127.0.0.1:8001/
70 ProxyPassReverse / https://127.0.0.1:8001/
71 # i have sockjs disabled per people suggesting that
72 # it won\'t work with apache right now.
73 # not sure if it would work with this,
74 # but afaik, this is pointless atm.
75 <Location /main/realtime/sockjs/>
76 ProxyPass wss://127.0.0.1:8001/main/realtime/sockjs/
77 ProxyPassReverse wss://127.0.0.1:8001/main/realtime/sockjs/
82 export RENEWED_LINEAGE=/etc/letsencrypt/live/pump.iankelling.org
83 /a/bin/distro-setup/certbot-renew-hook
86 s dd of=/etc/systemd/system/pump.service <<'EOF'
89 After=syslog.target network.target mongodb.service
90 Requires=mongodb.service
96 ExecStart=/home/iank/pump.io/bin/pump
97 Environment=NODE_ENV=production
98 # failed to find databank-mongodb without this.
99 # I just looked at my environment variables took a guess.
100 Environment=NODE_PATH=/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript
103 WantedBy=multi-user.target
107 ########## end pump.io setup ############