New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

depsite

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

depsite

A TypeScript CLI tool that automates the deployment of nginx reverse proxy configurations for Node.js applications

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
0
Created
Source

DepSite - Nginx Site Deployment Tool

A TypeScript CLI tool that automates the deployment of nginx reverse proxy configurations for Node.js applications.

Features

  • 🚀 Interactive CLI with colored output
  • 🔧 Automatic nginx configuration generation
  • 🔒 SSL certificate setup with Certbot
  • ✅ Configuration validation and testing
  • 🔄 Automatic rollback on failure
  • 📝 Comprehensive deployment summary

Prerequisites

  • Node.js (>=14.0.0)
  • Nginx installed and running
  • Certbot (optional, for SSL setup)
  • Sudo privileges for nginx configuration

Quick Start

# Install globally
npm install -g depsite

# Deploy a site
depsite

# Remove a site
depsite remove my-project

# Show help
depsite --help

Installation

# Clone or download the project
cd ~/Desktop/Code/NodeJs/depsite

# Install dependencies
yarn install

# Build the project
yarn build

Usage

Development Mode

yarn dev

Production Mode

# Build first
yarn build

# Run the built version
yarn start

What it does

  • Validates Environment: Checks for nginx installation and sudo privileges
  • Collects Input: Prompts for project name, domain, and port number
  • Generates Configuration: Creates nginx upstream and server blocks
  • Validates Setup: Tests nginx configuration before applying
  • Enables Site: Creates symbolic links in sites-enabled
  • SSL Setup: Optionally configures SSL certificates with Certbot
  • Provides Summary: Shows deployment details and useful commands

Example nginx Configuration Generated

# Upstream for my-app Production
upstream my-app_prod {
    ip_hash;
    server 127.0.0.1:3000;
}

# HTTP Server Block
server {
    listen 80;
    server_name my-app.example.com;

    client_max_body_size 20M;
    charset utf-8;

    # Custom error pages
    error_page 404 /not-found;
    error_page 500 502 503 504 /bad-request;

    location / {
        proxy_pass http://my-app_prod;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_cache_bypass $http_upgrade;
        proxy_read_timeout 300s;
        proxy_connect_timeout 75s;
    }
}

Project Structure

depsite/
├── src/
│   └── index.ts          # Main application file
├── dist/                 # Compiled JavaScript (after build)
├── package.json          # Project configuration
├── tsconfig.json         # TypeScript configuration
└── README.md            # This file

Error Handling

  • Automatic rollback on configuration errors
  • Validation of user input
  • Dependency checking
  • Graceful error messages with colored output

Contributing

  • Fork the repository
  • Create a feature branch
  • Make your changes
  • Test thoroughly
  • Submit a pull request

License

MIT License - see LICENSE file for details

Keywords

nginx

FAQs

Package last updated on 02 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts