Skip to content
This repository was archived by the owner on Jul 17, 2025. It is now read-only.

Aswintechie/slack-join

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

334 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Slackin - Modernized πŸš€

A modernized version of the public Slack invite system, updated for 2025 with the latest dependencies and Node.js features.

✨ What's New

This is a completely modernized version of the original slackin project with:

πŸ”§ Technology Updates

  • Express 5.1.0 (latest) - from Express 4.15.4
  • Socket.io 4.8.1 (latest) - from Socket.io 2.0.3
  • Node.js 18+ support - from Node.js 6.11.1
  • ES Modules - converted from CommonJS
  • Modern HTTP client - replaced superagent with undici
  • Zero vulnerabilities - all dependencies updated and secure

πŸ—οΈ Architecture Improvements

  • Removed Babel transpilation (native ES modules)
  • Removed Gulp build system (no longer needed)
  • Updated to modern async/await patterns
  • Improved error handling and logging
  • Built-in body parsing (Express 5.x)
  • Graceful shutdown handling

πŸ›‘οΈ Security Enhancements

  • Latest Express with security improvements
  • Updated reCAPTCHA integration
  • Modern IP address handling
  • Secure dependency versions

πŸ“‹ Requirements

  • Node.js 18.0.0 or higher
  • Slack API token with admin privileges
  • Google reCAPTCHA site key and secret

πŸ“– Need help getting tokens? See SETUP.md for detailed step-by-step instructions.

πŸ†“ Free Plan Compatibility

βœ… Slackin works on Slack FREE plans!

  • Works with free Slack workspaces (with limitations)
  • You must be a workspace admin to generate API tokens
  • User count updates will be slower due to 2025 API rate limits
  • Uses 1 of your 10 allowed app installations

πŸ“‹ Full details: See Free Plan Summary in SETUP.md

πŸš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/Aswintechie/slack-join.git
cd slack-join

# Install dependencies
npm install

# Set up environment variables
cp env.example .env
# Edit .env with your Slack and reCAPTCHA credentials
# See SETUP.md for detailed instructions on getting tokens

# Start the server
npm start

Environment Variables

Option 1: Using .env file (Recommended)

Copy the example environment file and edit it with your values:

cp env.example .env
# Edit .env with your actual values

Option 2: Export manually

Set these environment variables or pass them as command line arguments:

export SLACK_SUBDOMAIN=your-team-name
export SLACK_API_TOKEN=xoxp-your-token
export GOOGLE_CAPTCHA_SECRET=your-secret
export GOOGLE_CAPTCHA_SITEKEY=your-sitekey

πŸ”‘ Quick Token Reference

Token Where to Get It Example
SLACK_SUBDOMAIN Your Slack URL: https://TEAM.slack.com mycompany
SLACK_API_TOKEN Slack API xoxp-123...
GOOGLE_CAPTCHA_SECRET reCAPTCHA Admin 6LcYYY...
GOOGLE_CAPTCHA_SITEKEY reCAPTCHA Admin 6LcXXX...

πŸ“‹ Detailed instructions: See SETUP.md for complete step-by-step guides.

Command Line Usage

# Basic usage
node bin/slackin.js team-name api-token captcha-secret captcha-sitekey

# With options
node bin/slackin.js \
  --port 3000 \
  --hostname 0.0.0.0 \
  --channels "general,random" \
  --cors \
  team-name api-token captcha-secret captcha-sitekey

Development Mode

# Auto-restart on changes (Node 18+ built-in)
npm run dev

βš™οΈ Configuration Options

Option Environment Variable Description Default
--port PORT Port to listen on 3000
--hostname HOSTNAME Hostname to bind to 0.0.0.0
--channels SLACK_CHANNELS Comma-separated channel list All channels
--interval SLACK_INTERVAL Polling interval (ms) 5000
--cors - Enable CORS false
--silent - Disable logging false
--coc - Code of Conduct URL none
--css - Custom CSS URL none

πŸƒβ€β™‚οΈ Running in Production

Using PM2

npm install -g pm2

# Create ecosystem file
cat > ecosystem.config.js << 'EOF'
module.exports = {
  apps: [{
    name: 'slackin',
    script: 'bin/slackin.js',
    env: {
      NODE_ENV: 'production',
      PORT: 3000,
      SLACK_SUBDOMAIN: 'your-team',
      SLACK_API_TOKEN: 'xoxp-your-token',
      GOOGLE_CAPTCHA_SECRET: 'your-secret',
      GOOGLE_CAPTCHA_SITEKEY: 'your-sitekey'
    }
  }]
}
EOF

# Start with PM2
pm2 start ecosystem.config.js

Using Docker

FROM node:18-alpine

WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production

COPY . .

USER node
EXPOSE 3000

CMD ["node", "bin/slackin.js"]

Using systemd

[Unit]
Description=Slackin Slack Invite System
After=network.target

[Service]
Type=simple
User=node
WorkingDirectory=/opt/slackin
ExecStart=/usr/bin/node bin/slackin.js
Restart=always
RestartSec=10

Environment=NODE_ENV=production
Environment=PORT=3000
Environment=SLACK_SUBDOMAIN=your-team
Environment=SLACK_API_TOKEN=xoxp-your-token
Environment=GOOGLE_CAPTCHA_SECRET=your-secret
Environment=GOOGLE_CAPTCHA_SITEKEY=your-sitekey

[Install]
WantedBy=multi-user.target

πŸ”§ API Endpoints

  • GET / - Slack invite page
  • POST /invite - Submit invite request
  • GET /iframe - Embeddable iframe
  • GET /iframe/dialog - Iframe dialog version
  • GET /badge.svg - SVG status badge
  • GET /data - JSON status data

🌐 Integration

Embed as iframe

<iframe 
  src="https://your-domain.com/iframe" 
  width="174" 
  height="30"
  frameborder="0">
</iframe>

Status Badge

![Slack](https://your-domain.com/badge.svg)

πŸ› οΈ Development

Project Structure

slack-join/
β”œβ”€β”€ bin/
β”‚   └── slackin.js           # CLI entry point
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ index.js             # Main server logic
β”‚   β”œβ”€β”€ slack.js             # Slack API integration
β”‚   β”œβ”€β”€ slack-invite.js      # Invite functionality
β”‚   β”œβ”€β”€ vd-wrapper.js        # Virtual DOM wrapper
β”‚   β”œβ”€β”€ splash.js            # Main page template
β”‚   β”œβ”€β”€ iframe.js            # Iframe template
β”‚   β”œβ”€β”€ badge.js             # SVG badge generator
β”‚   β”œβ”€β”€ log.js               # Logging utilities
β”‚   └── assets/              # Static assets
β”œβ”€β”€ package.json             # Dependencies and scripts
└── README.md               # This file

Key Dependencies

  • express ^5.1.0 - Web framework
  • socket.io ^4.8.1 - Real-time communication
  • undici ^7.11.0 - Modern HTTP client
  • virtual-dom ^2.1.1 - Virtual DOM for templates
  • email-regex ^1.0.0 - Email validation
  • cors ^2.8.5 - CORS handling

πŸ”„ Migration from Original Slackin

If you're migrating from the original slackin:

  1. Node.js: Update to Node.js 18+
  2. Dependencies: Run npm install (all updated automatically)
  3. Environment: Same environment variables work
  4. API: All endpoints remain compatible
  5. Build: No build step required (removed Babel/Gulp)

🚨 Breaking Changes from Original

  • Node.js 18+ required (was 6.11.1)
  • ES Modules (may affect custom integrations)
  • Updated Slack API usage (ensure your token has correct scopes)
  • Modern reCAPTCHA (v2 - ensure your keys are compatible)

πŸ“ Environment Variables Reference

# Required
SLACK_SUBDOMAIN=your-slack-team        # Your Slack workspace name
SLACK_API_TOKEN=xoxp-...               # Slack API token (admin required)
GOOGLE_CAPTCHA_SECRET=...              # reCAPTCHA secret key  
GOOGLE_CAPTCHA_SITEKEY=...             # reCAPTCHA site key

# Optional
PORT=3000                              # Server port
HOSTNAME=0.0.0.0                       # Bind hostname
SLACK_CHANNELS=general,random          # Allowed channels
SLACK_INTERVAL=5000                    # Polling interval (ms)
EMAIL_SLACK_LIST=user@domain.com       # Restricted email list

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test with npm test
  5. Submit a pull request

πŸ“„ License

MIT License - see LICENSE file for details

πŸ™ Acknowledgments

  • Original slackin by @rauchg
  • Modernization updates for 2025 compatibility
  • Express.js, Socket.io, and Node.js communities

Ready to invite the world to your Slack? 🌍✨

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 62