rauchg / slackin

Public Slack organizations made easy
http://rauchg.com/slackin/
MIT License
6.51k stars 1.35k forks source link

AWS Setup #320

Open panleya opened 7 years ago

panleya commented 7 years ago

It would be great if you could create a directory out here with a static set of files I can drop onto an AWS EC2 apache web server... simple variables to change for my Slack room. You'd be a my hero for life!

nsoft commented 7 years ago

I agree, the "now" installation mechanism seems to require an account with them and only be free for limited use. A tar.gz distribution not tied to a commercialized deployment mechanism would be greatly appreciated.

Daniel15 commented 7 years ago

Here's some instructions that should work on any host:

  1. Install Node.js and npm - Refer to Node's docs. On Debian or Ubuntu you can just apt-get install nodejs
  2. Run npm install --global slackin
  3. Use the slackin command to run it.

On my system I'm using supervisord to keep it running:

[program:slackin]
command=slackin "example" --port=30861 --interval=60000
environment=SLACK_API_TOKEN=xxxxxxxxxxxx
user=www-data

(note: pass the API token as an environment variable rather than a command-line argument. Command-line arguments are visible to other applications on the system which could introduce a risk of the token leaking)

Then configure a web server to reverse proxy it - I'm using Nginx but Apache would work too. My Nginx config looks like:

server {
    server_name slack.example.com;
    listen 80;
    listen 443 http2;
    ssl_certificate /etc/letsencrypt/live/slack.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/slack.example.com/privkey.pem;

    location / {
        proxy_pass http://localhost:30861;
        proxy_http_version 1.1;
    }
}
NinjaTurtle007 commented 6 years ago

Thank you @Daniel15 I followed your instructions but got stuck after installing slacking and trying to run it

`root@vultr:~# npm install --global slackin /usr/local/bin/slackin -> /usr/local/lib/node_modules/slackin/bin/slackin /usr/local/lib └─┬ slackin@0.13.0 ├─┬ args@1.3.0 │ ├── camelcase@3.0.0 │ ├─┬ chalk@1.1.3 │ │ ├── ansi-styles@2.2.1 │ │ ├── escape-string-regexp@1.0.5 │ │ ├─┬ has-ansi@2.0.0 │ │ │ └── ansi-regex@2.1.1 │ │ ├── strip-ansi@3.0.1 │ │ └── supports-color@2.0.0 │ ├─┬ loud-rejection@1.6.0 │ │ ├─┬ currently-unhandled@0.4.1 │ │ │ └── array-find-index@1.0.2 │ │ └── signal-exit@3.0.2 │ ├── minimist@1.2.0 │ ├── pkginfo@0.4.1 │ └── replaceall@0.1.6 ├─┬ babel-polyfill@6.3.14 │ ├── babel-regenerator-runtime@6.5.0 │ ├── babel-runtime@5.8.38 │ └── core-js@1.2.7 ├─┬ body-parser@1.10.2 │ ├── bytes@1.0.0 │ ├── depd@1.0.1 │ ├── iconv-lite@0.4.6 │ ├── media-typer@0.3.0 │ ├─┬ on-finished@2.2.1 │ │ └── ee-first@1.1.0 │ ├── qs@2.3.3 │ ├── raw-body@1.3.2 │ └─┬ type-is@1.5.7 │ └─┬ mime-types@2.0.14 │ └── mime-db@1.12.0 ├─┬ cors@2.7.1 │ └── vary@1.1.2 ├─┬ debug@2.1.1 │ └── ms@0.6.2 ├── email-regex@1.0.0 ├─┬ express@4.11.0 │ ├─┬ accepts@1.2.13 │ │ ├─┬ mime-types@2.1.17 │ │ │ └── mime-db@1.30.0 │ │ └── negotiator@0.5.3 │ ├── content-disposition@0.5.0 │ ├── cookie@0.1.2 │ ├── cookie-signature@1.0.5 │ ├── escape-html@1.0.1 │ ├─┬ etag@1.5.1 │ │ └── crc@3.2.1 │ ├── finalhandler@0.3.3 │ ├── fresh@0.2.4 │ ├── merge-descriptors@0.0.2 │ ├── methods@1.1.2 │ ├── parseurl@1.3.2 │ ├── path-to-regexp@0.1.3 │ ├─┬ proxy-addr@1.0.10 │ │ ├── forwarded@0.1.2 │ │ └── ipaddr.js@1.0.5 │ ├── range-parser@1.0.3 │ ├─┬ send@0.11.0 │ │ ├── destroy@1.0.3 │ │ └── ms@0.7.0 │ ├─┬ serve-static@1.8.1 │ │ └─┬ send@0.11.1 │ │ └── ms@0.7.0 │ ├── utils-merge@1.0.0 │ └── vary@1.0.1 ├── hostenv@1.0.1 ├── opentype.js@0.4.4 ├─┬ socket.io@1.4.8 │ ├─┬ debug@2.2.0 │ │ └── ms@0.7.1 │ ├─┬ engine.io@1.6.11 │ │ ├─┬ accepts@1.1.4 │ │ │ └── negotiator@0.4.9 │ │ ├── base64id@0.1.0 │ │ ├─┬ debug@2.2.0 │ │ │ └── ms@0.7.1 │ │ ├─┬ engine.io-parser@1.2.4 │ │ │ ├── after@0.8.1 │ │ │ ├── arraybuffer.slice@0.0.6 │ │ │ ├── base64-arraybuffer@0.1.2 │ │ │ ├── blob@0.0.4 │ │ │ ├── has-binary@0.1.6 │ │ │ └── utf8@2.1.0 │ │ └─┬ ws@1.1.0 │ │ ├── options@0.0.6 │ │ └── ultron@1.0.2 │ ├─┬ has-binary@0.1.7 │ │ └── isarray@0.0.1 │ ├─┬ socket.io-adapter@0.4.0 │ │ ├─┬ debug@2.2.0 │ │ │ └── ms@0.7.1 │ │ └─┬ socket.io-parser@2.2.2 │ │ ├── debug@0.7.4 │ │ └── json3@3.2.6 │ ├─┬ socket.io-client@1.4.8 │ │ ├── backo2@1.0.2 │ │ ├── component-bind@1.0.0 │ │ ├── component-emitter@1.2.0 │ │ ├─┬ debug@2.2.0 │ │ │ └── ms@0.7.1 │ │ ├─┬ engine.io-client@1.6.11 │ │ │ ├── component-inherit@0.0.3 │ │ │ ├─┬ debug@2.2.0 │ │ │ │ └── ms@0.7.1 │ │ │ ├── has-cors@1.1.0 │ │ │ ├── parsejson@0.0.1 │ │ │ ├── parseqs@0.0.2 │ │ │ ├── ws@1.0.1 │ │ │ ├── xmlhttprequest-ssl@1.5.1 │ │ │ └── yeast@0.1.2 │ │ ├── indexof@0.0.1 │ │ ├── object-component@0.0.3 │ │ ├─┬ parseuri@0.0.4 │ │ │ └─┬ better-assert@1.0.2 │ │ │ └── callsite@1.0.0 │ │ └── to-array@0.1.4 │ └─┬ socket.io-parser@2.2.6 │ ├── benchmark@1.0.0 │ ├─┬ debug@2.2.0 │ │ └── ms@0.7.1 │ └── json3@3.3.2 ├─┬ superagent@0.21.0 │ ├── component-emitter@1.1.2 │ ├── cookiejar@2.0.1 │ ├── extend@1.2.1 │ ├─┬ form-data@0.1.3 │ │ ├── async@0.9.2 │ │ └─┬ combined-stream@0.0.7 │ │ └── delayed-stream@0.0.5 │ ├── formidable@1.0.14 │ ├── methods@1.0.1 │ ├── mime@1.2.11 │ ├── qs@1.2.0 │ ├─┬ readable-stream@1.0.27-1 │ │ ├── core-util-is@1.0.2 │ │ ├── inherits@2.0.3 │ │ └── string_decoder@0.10.31 │ └── reduce-component@1.0.1 └─┬ vd@0.1.0 ├── array-flatten@1.0.0 ├── vcss@0.1.1 └── void-elements@1.0.0

root@vultr:~# slackin /usr/bin/env: 'node': No such file or directory root@vultr:~# `

Daniel15 commented 6 years ago

@NinjaTurtle007 If you're on Debian or Ubuntu and installed the Node.js package, try apt-get install nodejs-legacy. Alternatively, run nodejs /usr/local/lib/node_modules/slackin/bin/slackin instead of just running slackin.