Skip to content

Latest commit

 

History

History
204 lines (155 loc) · 5.19 KB

File metadata and controls

204 lines (155 loc) · 5.19 KB

LinkGen - IIS Deployment Guide

LinkGen is a secure, one-time markdown document sharing application with file upload support and admin management. This guide covers deployment to Windows IIS.

🚀 Quick Start

# Build the deployment package
npm run build:iis

# Or use the convenience script
./deploy-iis.sh

📋 Prerequisites

Server Requirements

  • Windows Server with IIS installed
  • Node.js 18+ installed
  • iisnode module for IIS (Download)

Local Development

  • Node.js 18+
  • npm

📦 Deployment Process

1. Build the Package

npm run build:iis

This creates a deploy/ folder with everything needed for IIS.

2. Upload to Server

Upload the entire deploy/ folder contents to your IIS website directory (e.g., C:\inetpub\wwwroot\linkgen\)

3. Install Dependencies

On the server, open Command Prompt in the deployment directory:

npm install --production

Or simply run the included install.bat file.

4. Configure IIS

  1. Create Website/Application

    • Open IIS Manager
    • Create new website or application
    • Point to your deployment directory
  2. Set Application Pool

    • Set Application Pool to "No Managed Code"
    • Ensure Application Pool Identity has read/write permissions
  3. Environment Variables (Optional)

    • ADMIN_PASSWORD: Your admin password (default: admin123)
    • JWT_SECRET: Secure random string for JWT tokens
    • NODE_ENV: production

5. Test Deployment

  • Browse to your website URL
  • Test document creation and sharing
  • Access admin panel at /admin

🎯 Features

Core Functionality

  • ✅ One-time markdown document sharing
  • ✅ Configurable view limits (1-100 views)
  • ✅ Time-based expiry (1 hour to 1 week)
  • ✅ File attachments (up to 10MB each)
  • ✅ HTML-to-markdown conversion
  • ✅ Material Design 3 interface

Admin Features

  • ✅ Secure admin authentication
  • ✅ Document management dashboard
  • ✅ View active documents and statistics
  • ✅ JWT-based session management

Security Features

  • ✅ Temporary storage (data lost on restart)
  • ✅ Configurable admin passwords
  • ✅ Automatic document cleanup
  • ✅ File size limits and validation

🔧 Configuration

Environment Variables

Set these in IIS for your application:

ADMIN_PASSWORD=your-secure-password
JWT_SECRET=your-jwt-secret-key
NODE_ENV=production
PORT=80

File Limits

  • Maximum file size: 10MB per file
  • Multiple files supported per document
  • Common file types supported (images, documents, etc.)

🛠️ Troubleshooting

Application Won't Start

  1. Verify Node.js is installed and in system PATH
  2. Check that iisnode is properly installed
  3. Ensure Application Pool is set to "No Managed Code"
  4. Review IIS logs and Node.js error logs

Permission Errors

  1. Give IIS Application Pool identity Full Control to deployment folder
  2. Check Windows Event Logs for detailed errors
  3. Ensure web.config is properly configured

File Upload Issues

  1. Check IIS request size limits
  2. Verify temp directory permissions
  3. Review upload size restrictions in web.config

Performance Issues

  1. Enable gzip compression in IIS
  2. Configure static file caching
  3. Monitor memory usage (data is stored in-memory)

📱 Usage

Creating Documents

  1. Visit the website
  2. Enter your markdown content
  3. Optionally add a title
  4. Attach files if needed
  5. Set view limit and expiry time
  6. Generate shareable link

Admin Access

  1. Go to /admin
  2. Enter admin password (default: admin123)
  3. View active documents
  4. Monitor system usage

API Endpoints

  • POST /api/upload - Create document
  • GET /api/document/:id - Retrieve document
  • POST /api/upload-file - Upload file
  • GET /api/attachment/:id - Download attachment
  • POST /api/admin/login - Admin login
  • GET /api/admin/documents - Admin dashboard

🔒 Security Notes

Production Deployment

  • Always change the default admin password
  • Use HTTPS in production
  • Set a secure JWT_SECRET
  • Consider reverse proxy for additional security
  • Monitor for unusual access patterns

Data Storage

  • All data is stored in memory (temporary)
  • Data is lost when the application restarts
  • No persistent database required
  • Automatic cleanup of expired documents

🆘 Support

Common Issues

  • Icons not showing: Ensure Material Icons font is loaded
  • File uploads failing: Check file size limits and permissions
  • Admin login issues: Verify password and JWT secret configuration
  • 404 errors: Check IIS URL rewriting configuration

Log Locations

  • IIS logs: C:\inetpub\logs\LogFiles\
  • Node.js logs: Check IIS application event logs
  • Application logs: Console output in IIS logs

🔄 Updates

To update the application:

  1. Build new deployment package
  2. Stop IIS application
  3. Replace files (keep web.config if customized)
  4. Restart IIS application

📈 Monitoring

Health Check

  • Endpoint: /api/test
  • Returns server status and timestamp

Admin Dashboard

  • View active document count
  • Monitor memory usage
  • Track document expiry

LinkGen - Secure, temporary document sharing made simple.

For technical support or feature requests, please refer to the project documentation.