Skip to content
Permalink
Browse files

Change the env vars and deployment paths

  • Loading branch information
emedvedev committed Oct 23, 2017
1 parent 649b27e commit d7a959f45f45ac0337e164328a8031be2c006358
Showing with 52 additions and 38 deletions.
  1. +1 −1 .eslintrc.js
  2. +1 −6 Dockerfile
  3. +1 −1 Procfile
  4. +29 −9 app.json
  5. +1 −1 app.yaml
  6. +2 −2 azuredeploy.json
  7. +3 −2 lib/index.js
  8. +1 −3 package.json
  9. +6 −6 readme.md
  10. +7 −7 scripts/azuredeploy.sh
@@ -1,3 +1,3 @@
module.exports = {
"extends": "airbnb-base"
};
}
@@ -1,11 +1,6 @@
FROM node:alpine

ADD . /srv/www

WORKDIR /srv/www

RUN npm install --unsafe-perm

EXPOSE 8080

CMD ./bin/slackin --coc "$SLACK_COC" --channels "$SLACK_CHANNELS" --port $APP_PORT $SLACK_SUBDOMAIN $SLACK_API_TOKEN $GOOGLE_CAPTCHA_SECRET $GOOGLE_CAPTCHA_SITEKEY
CMD ./bin/slackin --coc "$SLACKIN_COC" --channels "$SLACKIN_CHANNELS" $SLACK_SUBDOMAIN $SLACK_API_TOKEN
@@ -1 +1 @@
web: bin/slackin --coc "$SLACK_COC" --channels "$SLACK_CHANNELS" --port $PORT $SLACK_SUBDOMAIN $SLACK_API_TOKEN $GOOGLE_CAPTCHA_SECRET $GOOGLE_CAPTCHA_SITEKEY
web: bin/slackin --coc "$SLACKIN_COC" --channels "$SLACKIN_CHANNELS" $SLACK_SUBDOMAIN $SLACK_API_TOKEN
@@ -1,8 +1,8 @@
{
"name": "Slackin",
"name": "slackin-extended",
"description": "Let people invite themselves to your Slack",
"logo": "https://i.imgur.com/odDO1Fx.png",
"repository": "https://github.com/rauchg/slackin",
"repository": "https://github.com/emedvedev/slackin-extended",
"keywords": ["node", "slack"],
"env": {
"SLACK_SUBDOMAIN": {
@@ -13,21 +13,41 @@
"description": "A Slack API token (find it on https://api.slack.com/web)",
"required": true
},
"GOOGLE_CAPTCHA_SECRET": {
"RECAPTCHA_SECRET": {
"description": "Google captcha secret key",
"required": true
"required": false
},
"GOOGLE_CAPTCHA_SITEKEY": {
"RECAPTCHA_SITEKEY": {
"description": "Google captcha site key",
"required": true
"required": false
},
"SLACK_COC": {
"RECAPTCHA_INVISIBLE": {
"description": "Use invisible reCAPTCHA instead of reCAPTCHA v2",
"required": false
},
"SLACKIN_COC": {
"description": "A URL to a Code of Conduct people must agree on before joining.",
"required": false
},
"SLACK_CHANNELS": {
"SLACKIN_CHANNELS": {
"description": "Comma-separated list of single guest channels to invite them to (leave blank for a normal, all-channel invite). In order to make this work, you have to have a paid account. You'll only be able to invite as many people as your number of paying members times 5.",
"required": false
}
},
"SLACKIN_INTERVAL": {
"description": "How frequently (ms) to poll Slack",
"required": false
},
"SLACKIN_ANALYTICS": {
"description": "Google Analytics ID",
"required": false
},
"SLACKIN_THEME": {
"description": "Color scheme to use, \"light\" (default) or \"dark\"",
"required": false
},
"SLACKIN_ACCENT": {
"description": "Accent color to use instead of a theme default",
"required": false
},
}
}
@@ -2,7 +2,7 @@ env: flex
runtime: custom
env_variables:
FQDN: "your.slackin.subdomain.com"
APP_PORT: "8080"
SLACKIN_PORT: "8080"
SLACK_INTERVAL: "25000"
SLACK_SUBDOMAIN: "your-slack-workspace"
SLACK_API_TOKEN: "your-slack-api-token"
@@ -99,8 +99,8 @@
"SLACK_SUBDOMAIN": "[parameters('slackTeamId')]",
"SLACK_API_TOKEN": "[parameters('slackApiToken')]",
"SLACKIN_RELEASE": "[parameters('slackinRelease')]",
"WEBSITE_NPM_DEFAULT_VERSION": "3.3.12",
"WEBSITE_NODE_DEFAULT_VERSION": "5.1.1",
"WEBSITE_NPM_DEFAULT_VERSION": "5.4.2",
"WEBSITE_NODE_DEFAULT_VERSION": "8.7.0",
"command": "bash scripts/azuredeploy.sh"
}
},
@@ -29,6 +29,7 @@ export default function slackin({
path = '/',
recaptcha,
silent,
analytics,
...params
}) {
// must haves
@@ -122,7 +123,7 @@ export default function slackin({
return res
.type('html')
.render('main', {
coc, path, name, org, logo, channels, active, total, recaptcha, css, theme,
coc, path, name, org, logo, channels, active, total, recaptcha, css, theme, analytics,
});
});

@@ -208,7 +209,7 @@ export default function slackin({
}
res.type('html');
res.render('main', {
coc, path, name, org, channels, active, total, large, recaptcha, theme, iframe: true,
coc, path, name, org, channels, active, total, large, recaptcha, theme, analytics, iframe: true,
});
});

@@ -79,9 +79,7 @@
],
"env": [
"SLACK_API_TOKEN",
"SLACK_SUBDOMAIN",
"GOOGLE_CAPTCHA_SECRET",
"GOOGLE_CAPTCHA_SITEKEY"
"SLACK_SUBDOMAIN"
]
}
}
@@ -14,15 +14,15 @@ Check out the [Demo](https://slackin.now.sh/) or read more about the [motivation
Set up [Now](https://zeit.co/now) on your device and run this command. [Now](https://zeit.co/now) will automatically ask you for the required information and then spin up a deployment instantly. That easy!

```bash
now rauchg/slackin
now emedvedev/slackin-extended
```

Other platforms:

- [Heroku](https://heroku.com/deploy?template=https://github.com/rauchg/slackin/tree/master)
- [Heroku](https://heroku.com/deploy?template=https://github.com/emedvedev/slackin-extended/tree/master)
- [Azure](https://azuredeploy.net/)
- [OpenShift](https://github.com/rauchg/slackin/wiki/OpenShift)
- [IBM Bluemix](https://bluemix.net/deploy?repository=https://github.com/rauchg/slackin)
- [IBM Bluemix](https://bluemix.net/deploy?repository=https://github.com/emedvedev/slackin-extended)

### Tips

@@ -59,7 +59,7 @@ sitekey](https://www.google.com/recaptcha/admin) for Google reCAPTCHA.
Loading `slackin` will return a `Function` that creates a `HTTP.Server` instance:

```js
const slackin = require('slackin')
const slackin = require('slackin-extended')
slackin.default({
token: 'yourtoken', // required
@@ -78,8 +78,8 @@ All the metadata for your organization can be fetched via a JSON HTTP request to
## Caught a Bug?

1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
2. Uninstall slackin if it's already installed: `npm uninstall -g slack`
2. Uninstall slackin if it's already installed: `npm uninstall -g slackin-extended`
3. Link it to the global module directory: `npm link`
4. Transpile the source code and watch for changes: `npm start`

Yey! Now can use the `slack` command everywhere.
Yey! Now can use the `slackin` command everywhere.
@@ -81,7 +81,7 @@ selectNodeVersion () {
NODE_EXE=`cat "$DEPLOYMENT_TEMP/__nodeVersion.tmp"`
exitWithMessageOnError "getting node version failed"
fi

if [[ -e "$DEPLOYMENT_TEMP/.tmp" ]]; then
NPM_JS_PATH=`cat "$DEPLOYMENT_TEMP/__npmVersion.tmp"`
exitWithMessageOnError "getting npm version failed"
@@ -114,12 +114,12 @@ echo Deploying Slackin: $SLACKIN_RELEASE

if [[ "$SLACKIN_RELEASE" == "stable" ]]; then
# Stable
echo Installing from npm
echo Installing from npm

cd "$DEPLOYMENT_TARGET"

# 1. Install latest release of slackin from npm
eval $NPM_CMD install slackin
eval $NPM_CMD install slackin-extended

# 2. Copy to root folder
cp -rv node_modules/slackin/* .
@@ -130,12 +130,12 @@ else
# Latest (from git repo)
echo Installing from git repo

# 1. KuduSync
# 1. KuduSync
if [[ "$IN_PLACE_DEPLOYMENT" -ne "1" ]]; then
"$KUDU_SYNC_CMD" -v 50 -f "$DEPLOYMENT_SOURCE" -t "$DEPLOYMENT_TARGET" -n "$NEXT_MANIFEST_PATH" -p "$PREVIOUS_MANIFEST_PATH" -i ".git;.hg;.deployment;deploy.sh"
exitWithMessageOnError "Kudu Sync failed"
fi

# 2. Install npm packages
if [ -e "$DEPLOYMENT_TARGET/package.json" ]; then
echo npm install

0 comments on commit d7a959f

Please sign in to comment.
You can’t perform that action at this time.