Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

58 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Buy me a coffee

Download and deploy directly from Docker Hub

services:
  easy_wg_mikrotik:
    image: rubyon/easy_wg_mikrotik
    container_name: easy_wg_mikrotik
    restart: unless-stopped
    ports:
      - "3000:3000"
    environment:
      RAILS_ENV: development
      MIKROTIK_HOST: 192.168.88.1
      MIKROTIK_PORT: 8728
      DEFAULT_LOCALE: ko

๐Ÿ“ Recent Updates | ์ตœ๊ทผ ์—…๋ฐ์ดํŠธ

Environment Configuration Enhancement | ํ™˜๊ฒฝ ์„ค์ • ๊ฐœ์„ 

  • ๐Ÿ”ง Environment Variables: Migrated from hardcoded values to .env configuration for better deployment flexibility
    • ํ™˜๊ฒฝ ๋ณ€์ˆ˜: ํ•˜๋“œ์ฝ”๋”ฉ๋œ ๊ฐ’์—์„œ .env ์„ค์ •์œผ๋กœ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ํ•˜์—ฌ ๋ฐฐํฌ ์œ ์—ฐ์„ฑ ํ–ฅ์ƒ
  • ๐ŸŒ Locale Management: Added DEFAULT_LOCALE environment variable to control application language settings
    • ๋กœ์ผ€์ผ ๊ด€๋ฆฌ: ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์–ธ์–ด ์„ค์ •์„ ์ œ์–ดํ•˜๋Š” DEFAULT_LOCALE ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ์ถ”๊ฐ€
  • ๐Ÿ“ก MikroTik Configuration: Replaced SERVER_ADDRESS with MIKROTIK_HOST and MIKROTIK_PORT for clearer router connection settings
    • MikroTik ์„ค์ •: ๋ช…ํ™•ํ•œ ๋ผ์šฐํ„ฐ ์—ฐ๊ฒฐ ์„ค์ •์„ ์œ„ํ•ด SERVER_ADDRESS๋ฅผ MIKROTIK_HOST์™€ MIKROTIK_PORT๋กœ ๋Œ€์ฒด
  • ๐Ÿณ Docker Integration: Updated Docker Compose configuration to use environment variables
    • Docker ํ†ตํ•ฉ: Docker Compose ์„ค์ •์—์„œ ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ์‚ฌ์šฉํ•˜๋„๋ก ์—…๋ฐ์ดํŠธ
  • ๐Ÿ“‹ Example Configuration: Added .env.example file for easy setup reference
    • ์˜ˆ์‹œ ์„ค์ •: ์‰ฌ์šด ์„ค์ • ์ฐธ์กฐ๋ฅผ ์œ„ํ•œ .env.example ํŒŒ์ผ ์ถ”๊ฐ€
  • ๐Ÿ”’ Security: Improved .gitignore to protect sensitive environment files while keeping examples
    • ๋ณด์•ˆ: ์˜ˆ์‹œ ํŒŒ์ผ์€ ์œ ์ง€ํ•˜๋ฉด์„œ ๋ฏผ๊ฐํ•œ ํ™˜๊ฒฝ ํŒŒ์ผ์„ ๋ณดํ˜ธํ•˜๋„๋ก .gitignore ๊ฐœ์„ 

Configuration Files Added | ์ถ”๊ฐ€๋œ ์„ค์ • ํŒŒ์ผ

  • .env - Environment variables for local development | ๋กœ์ปฌ ๊ฐœ๋ฐœ์šฉ ํ™˜๊ฒฝ ๋ณ€์ˆ˜
  • .env.example - Template file with example configuration values | ์˜ˆ์‹œ ์„ค์ • ๊ฐ’์ด ํฌํ•จ๋œ ํ…œํ”Œ๋ฆฟ ํŒŒ์ผ

Migration Notes | ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ ์•ˆ๋‚ด

If upgrading from a previous version, please: | ์ด์ „ ๋ฒ„์ „์—์„œ ์—…๊ทธ๋ ˆ์ด๋“œํ•˜๋Š” ๊ฒฝ์šฐ:

  1. Create a .env file based on .env.example | .env.example์„ ๊ธฐ๋ฐ˜์œผ๋กœ .env ํŒŒ์ผ ์ƒ์„ฑ
  2. Set your MikroTik router IP in MIKROTIK_HOST | MIKROTIK_HOST์— MikroTik ๋ผ์šฐํ„ฐ IP ์„ค์ •
  3. Configure your preferred locale in DEFAULT_LOCALE | DEFAULT_LOCALE์— ์„ ํ˜ธํ•˜๋Š” ์–ธ์–ด ์„ค์ •

Easy WireGuard MikroTik Manager

A simple and intuitive web interface for managing WireGuard VPN clients on MikroTik routers.

Features

  • ๐Ÿ”— MikroTik RouterOS API Integration: Direct connection to your MikroTik router with secure session management
  • ๐Ÿ”„ Dynamic Interface Selection: Automatically detect and select WireGuard interfaces with real-time updates
  • ๐Ÿ‘ฅ Client Management: Create, view, and delete WireGuard clients with live status monitoring
  • ๐Ÿ“ฑ QR Code Generation: Instant QR codes for mobile device configuration with Bootstrap Icons
  • ๐Ÿ’พ Configuration Downloads: Download .conf files for desktop clients via Stimulus controllers
  • โšก Real-time Updates: Turbo Stream-powered interface for seamless user experience
  • ๐ŸŽจ Modern UI: Clean, responsive design with Tailwind CSS 4.1.11 and backdrop blur effects
  • ๐ŸŒ Multi-language Support: Korean (default), English, Chinese, and Japanese localization
  • ๐Ÿ”’ Enhanced Security: XSS protection with input validation and safe QR code generation

Requirements

  • Ruby: 3.0+ (Tested with Ruby 3.4.2)
  • Rails: 8.0.2+ with Hotwire (Turbo + Stimulus)
  • MikroTik Router: RouterOS v7.0+ with WireGuard support
  • Dependencies: Node.js, Yarn for asset compilation
  • Browser: Modern browser with JavaScript enabled

Installation

Option 1: Docker Compose (Recommended)

  1. Clone the repository:
git clone https://github.com/rubyon/easy_wg_mikrotik.git
cd easy_wg_mikrotik
  1. Run with Docker Compose:
docker compose up --build
  1. Open your browser and navigate to http://localhost:3000

Option 2: Local Development

  1. Clone the repository:
git clone https://github.com/rubyon/easy_wg_mikrotik.git
cd easy_wg_mikrotik
  1. Install dependencies:
bundle install
yarn install
  1. Start the development server:
bin/dev
  1. Open your browser and navigate to http://localhost:3000

Usage

Initial Setup

  1. Login to MikroTik: Enter your MikroTik router's IP address, username, and password
  2. Ensure WireGuard Interface: Make sure you have at least one WireGuard interface configured on your MikroTik router

Creating WireGuard Clients

  1. Click "Create New Client" button
  2. Select your WireGuard interface from the dropdown
  3. Configure the following settings:
    • Endpoint: Your server's public IP and port (e.g., your-server.com:51820)
    • Allowed IPs: Networks the client can access (e.g., 10.1.1.0/24,192.168.1.0/24)
    • Client IP Range: Subnet prefix for client IPs (e.g., 10.1.1)
    • Keep Alive: Persistent keepalive interval in seconds (e.g., 25)
  4. Click "Create Client" button
  5. Download the configuration file or scan the QR code with your mobile device

Managing Clients

  • View Clients: Click "Client List" to see all configured clients
  • Filter by Interface: Select an interface to view only its clients
  • Delete Clients: Click the delete button next to any client to remove it
  • Refresh: Click the refresh button to update the client list

Configuration

The application uses session-based authentication to store your MikroTik credentials securely. No credentials are stored permanently on the server.

Technology Stack

Backend

  • Framework: Ruby on Rails 8.0.2
  • Authentication: Session-based with optional cookie persistence (no database)
  • API: RouterOS API gem for MikroTik integration
  • Security: Brakeman scanning, XSS protection, input validation

Frontend

  • JavaScript: Hotwire (Turbo + Stimulus) for reactive UI
  • CSS: Tailwind CSS 4.1.11 with modern features
  • Icons: Bootstrap Icons 1.11.3
  • Build Tools: esbuild for JavaScript, Tailwind CLI for CSS
  • Real-time: Turbo Streams for live updates

Core Libraries

  • Cryptography: RbNaCl for secure WireGuard key generation
  • QR Codes: RQRCode for mobile configuration
  • Localization: Rails I18n with 4 language support
  • Code Quality: RuboCop Rails Omakase, ERB Lint

Security Features

  • ๐Ÿ”’ XSS Protection: Input validation and safe output rendering
  • ๐Ÿ›ก๏ธ Session Security: Secure session management without persistent credential storage
  • ๐Ÿ” Security Scanning: Integrated Brakeman security analysis
  • โœ… Input Validation: Comprehensive validation for all WireGuard configuration parameters
  • ๐Ÿ” Safe QR Generation: Secure QR code generation with validation

Security Best Practices

  • Use strong passwords for your MikroTik router
  • Run behind HTTPS in production environments
  • Regularly update MikroTik RouterOS firmware
  • Monitor and remove unused VPN clients
  • Review application logs for suspicious activity

Development

Code Quality Commands

# Run security scan
bundle exec brakeman

# Check code style
bundle exec rubocop
erb_lint --lint-all

# Auto-fix style issues
bundle exec rubocop -A
erb_lint --lint-all --autocorrect

# Run tests
bin/rails test
bin/rails test:system

Project Structure

  • app/controllers/clients_controller.rb - Main WireGuard client management
  • app/helpers/qr_code_helper.rb - Secure QR code generation
  • app/javascript/controllers/ - Stimulus controllers for dynamic UI
  • app/views/clients/ - WireGuard client management views
  • config/locales/ - Multi-language support files

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes with proper tests
  4. Run code quality checks (rubocop -A && erb_lint --lint-all --autocorrect)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

License

This project is open source and available under the MIT License.


This README.md was generated with Claude Code


Easy WireGuard MikroTik Manager (ํ•œ๊ตญ์–ด)

MikroTik ๋ผ์šฐํ„ฐ์—์„œ WireGuard VPN ํด๋ผ์ด์–ธํŠธ๋ฅผ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ๊ฐ„๋‹จํ•˜๊ณ  ์ง๊ด€์ ์ธ ์›น ์ธํ„ฐํŽ˜์ด์Šค์ž…๋‹ˆ๋‹ค.

์ฃผ์š” ๊ธฐ๋Šฅ

  • ๐Ÿ”— MikroTik RouterOS API ์—ฐ๋™: ์•ˆ์ „ํ•œ ์„ธ์…˜ ๊ด€๋ฆฌ๋กœ MikroTik ๋ผ์šฐํ„ฐ์— ์ง์ ‘ ์—ฐ๊ฒฐ
  • ๐Ÿ”„ ๋™์  ์ธํ„ฐํŽ˜์ด์Šค ์„ ํƒ: ์‹ค์‹œ๊ฐ„ ์—…๋ฐ์ดํŠธ๋กœ WireGuard ์ธํ„ฐํŽ˜์ด์Šค ์ž๋™ ๊ฐ์ง€ ๋ฐ ์„ ํƒ
  • ๐Ÿ‘ฅ ํด๋ผ์ด์–ธํŠธ ๊ด€๋ฆฌ: ์‹ค์‹œ๊ฐ„ ์ƒํƒœ ๋ชจ๋‹ˆํ„ฐ๋ง์œผ๋กœ WireGuard ํด๋ผ์ด์–ธํŠธ ์ƒ์„ฑ, ์กฐํšŒ, ์‚ญ์ œ
  • ๐Ÿ“ฑ QR ์ฝ”๋“œ ์ƒ์„ฑ: Bootstrap Icons์™€ ํ•จ๊ป˜ ๋ชจ๋ฐ”์ผ ๋””๋ฐ”์ด์Šค ์„ค์ •์„ ์œ„ํ•œ ์ฆ‰์‹œ QR ์ฝ”๋“œ ์ƒ์„ฑ
  • ๐Ÿ’พ ์„ค์ • ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ: Stimulus ์ปจํŠธ๋กค๋Ÿฌ๋ฅผ ํ†ตํ•œ ๋ฐ์Šคํฌํ†ฑ ํด๋ผ์ด์–ธํŠธ์šฉ .conf ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ
  • โšก ์‹ค์‹œ๊ฐ„ ์—…๋ฐ์ดํŠธ: Turbo Stream ๊ธฐ๋ฐ˜ ์ธํ„ฐํŽ˜์ด์Šค๋กœ ์›ํ™œํ•œ ์‚ฌ์šฉ์ž ๊ฒฝํ—˜
  • ๐ŸŽจ ๋ชจ๋˜ UI: Tailwind CSS 4.1.11๊ณผ ๋ฐฑ๋“œ๋กญ ๋ธ”๋Ÿฌ ํšจ๊ณผ๋ฅผ ์‚ฌ์šฉํ•œ ๊น”๋”ํ•˜๊ณ  ๋ฐ˜์‘ํ˜• ๋””์ž์ธ
  • ๐ŸŒ ๋‹ค๊ตญ์–ด ์ง€์›: ํ•œ๊ตญ์–ด(๊ธฐ๋ณธ), ์˜์–ด, ์ค‘๊ตญ์–ด, ์ผ๋ณธ์–ด ํ˜„์ง€ํ™”
  • ๐Ÿ”’ ๊ฐ•ํ™”๋œ ๋ณด์•ˆ: ์ž…๋ ฅ ๊ฒ€์ฆ๊ณผ ์•ˆ์ „ํ•œ QR ์ฝ”๋“œ ์ƒ์„ฑ์œผ๋กœ XSS ๋ณดํ˜ธ

์‹œ์Šคํ…œ ์š”๊ตฌ์‚ฌํ•ญ

  • Ruby: 3.0+ (Ruby 3.4.2์—์„œ ํ…Œ์ŠคํŠธ๋จ)
  • Rails: 8.0.2+ with Hotwire (Turbo + Stimulus)
  • MikroTik ๋ผ์šฐํ„ฐ: RouterOS v7.0+ with WireGuard ์ง€์›
  • ์˜์กด์„ฑ: Node.js, Yarn (์—์…‹ ์ปดํŒŒ์ผ์šฉ)
  • ๋ธŒ๋ผ์šฐ์ €: JavaScript๊ฐ€ ํ™œ์„ฑํ™”๋œ ์ตœ์‹  ๋ธŒ๋ผ์šฐ์ €

์„ค์น˜ ๋ฐฉ๋ฒ•

๋ฐฉ๋ฒ• 1: Docker Compose (๊ถŒ์žฅ)

  1. ์ €์žฅ์†Œ ํด๋ก :
git clone https://github.com/rubyon/easy_wg_mikrotik.git
cd easy_wg_mikrotik
  1. Docker Compose๋กœ ์‹คํ–‰:
docker compose up --build
  1. ๋ธŒ๋ผ์šฐ์ €์—์„œ http://localhost:3000 ์ ‘์†

๋ฐฉ๋ฒ• 2: ๋กœ์ปฌ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ

  1. ์ €์žฅ์†Œ ํด๋ก :
git clone https://github.com/rubyon/easy_wg_mikrotik.git
cd easy_wg_mikrotik
  1. ์˜์กด์„ฑ ์„ค์น˜:
bundle install
yarn install
  1. ๊ฐœ๋ฐœ ์„œ๋ฒ„ ์‹œ์ž‘:
bin/dev
  1. ๋ธŒ๋ผ์šฐ์ €์—์„œ http://localhost:3000 ์ ‘์†

์‚ฌ์šฉ ๋ฐฉ๋ฒ•

์ดˆ๊ธฐ ์„ค์ •

  1. MikroTik ๋กœ๊ทธ์ธ: MikroTik ๋ผ์šฐํ„ฐ์˜ IP ์ฃผ์†Œ, ์‚ฌ์šฉ์ž๋ช…, ๋น„๋ฐ€๋ฒˆํ˜ธ ์ž…๋ ฅ
  2. WireGuard ์ธํ„ฐํŽ˜์ด์Šค ํ™•์ธ: MikroTik ๋ผ์šฐํ„ฐ์— ์ตœ์†Œ ํ•˜๋‚˜์˜ WireGuard ์ธํ„ฐํŽ˜์ด์Šค๊ฐ€ ๊ตฌ์„ฑ๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธ

WireGuard ํด๋ผ์ด์–ธํŠธ ์ƒ์„ฑ

  1. "์ƒˆ ํด๋ผ์ด์–ธํŠธ ์ƒ์„ฑ" ๋ฒ„ํŠผ ํด๋ฆญ
  2. ๋“œ๋กญ๋‹ค์šด์—์„œ WireGuard ์ธํ„ฐํŽ˜์ด์Šค ์„ ํƒ
  3. ๋‹ค์Œ ์„ค์ • ๊ตฌ์„ฑ:
    • ์—”๋“œํฌ์ธํŠธ: ์„œ๋ฒ„์˜ ๊ณต์ธ IP์™€ ํฌํŠธ (์˜ˆ: your-server.com:51820)
    • ํ—ˆ์šฉ๋œ IP: ํด๋ผ์ด์–ธํŠธ๊ฐ€ ์•ก์„ธ์Šคํ•  ์ˆ˜ ์žˆ๋Š” ๋„คํŠธ์›Œํฌ (์˜ˆ: 10.1.1.0/24,192.168.1.0/24)
    • ํด๋ผ์ด์–ธํŠธ IP ๋Œ€์—ญ: ํด๋ผ์ด์–ธํŠธ IP์šฉ ์„œ๋ธŒ๋„ท ์ ‘๋‘์‚ฌ (์˜ˆ: 10.1.1)
    • ํ‚ต์–ผ๋ผ์ด๋ธŒ: ์ง€์†์ ์ธ ํ‚ต์–ผ๋ผ์ด๋ธŒ ๊ฐ„๊ฒฉ(์ดˆ) (์˜ˆ: 25)
  4. "์ƒˆ ํด๋ผ์ด์–ธํŠธ ์ƒ์„ฑ" ๋ฒ„ํŠผ ํด๋ฆญ
  5. ์„ค์ • ํŒŒ์ผ์„ ๋‹ค์šด๋กœ๋“œํ•˜๊ฑฐ๋‚˜ ๋ชจ๋ฐ”์ผ ๋””๋ฐ”์ด์Šค๋กœ QR ์ฝ”๋“œ ์Šค์บ”

ํด๋ผ์ด์–ธํŠธ ๊ด€๋ฆฌ

  • ํด๋ผ์ด์–ธํŠธ ๋ณด๊ธฐ: "ํด๋ผ์ด์–ธํŠธ ๋ชฉ๋ก"์„ ํด๋ฆญํ•˜์—ฌ ๋ชจ๋“  ๊ตฌ์„ฑ๋œ ํด๋ผ์ด์–ธํŠธ ํ™•์ธ
  • ์ธํ„ฐํŽ˜์ด์Šค๋ณ„ ํ•„ํ„ฐ๋ง: ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์„ ํƒํ•˜์—ฌ ํ•ด๋‹น ํด๋ผ์ด์–ธํŠธ๋งŒ ํ‘œ์‹œ
  • ํด๋ผ์ด์–ธํŠธ ์‚ญ์ œ: ํด๋ผ์ด์–ธํŠธ ์˜†์˜ ์‚ญ์ œ ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ ์ œ๊ฑฐ
  • ์ƒˆ๋กœ๊ณ ์นจ: ์ƒˆ๋กœ๊ณ ์นจ ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ ํด๋ผ์ด์–ธํŠธ ๋ชฉ๋ก ์—…๋ฐ์ดํŠธ

๊ตฌ์„ฑ

์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์€ ์„ธ์…˜ ๊ธฐ๋ฐ˜ ์ธ์ฆ์„ ์‚ฌ์šฉํ•˜์—ฌ MikroTik ์ž๊ฒฉ ์ฆ๋ช…์„ ์•ˆ์ „ํ•˜๊ฒŒ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. ์„œ๋ฒ„์—๋Š” ์ž๊ฒฉ ์ฆ๋ช…์ด ์˜๊ตฌ์ ์œผ๋กœ ์ €์žฅ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

๊ธฐ์ˆ  ์Šคํƒ

๋ฐฑ์—”๋“œ

  • ํ”„๋ ˆ์ž„์›Œํฌ: Ruby on Rails 8.0.2
  • ์ธ์ฆ: ์„ ํƒ์  ์ฟ ํ‚ค ์ง€์†์„ฑ์„ ๊ฐ€์ง„ ์„ธ์…˜ ๊ธฐ๋ฐ˜ ์ธ์ฆ (๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์—†์Œ)
  • API: MikroTik ํ†ตํ•ฉ์„ ์œ„ํ•œ RouterOS API gem
  • ๋ณด์•ˆ: Brakeman ์Šค์บ๋‹, XSS ๋ณดํ˜ธ, ์ž…๋ ฅ ๊ฒ€์ฆ

ํ”„๋ก ํŠธ์—”๋“œ

  • JavaScript: ๋ฐ˜์‘ํ˜• UI๋ฅผ ์œ„ํ•œ Hotwire (Turbo + Stimulus)
  • CSS: ์ตœ์‹  ๊ธฐ๋Šฅ์„ ๊ฐ€์ง„ Tailwind CSS 4.1.11
  • ์•„์ด์ฝ˜: Bootstrap Icons 1.11.3
  • ๋นŒ๋“œ ๋„๊ตฌ: JavaScript์šฉ esbuild, CSS์šฉ Tailwind CLI
  • ์‹ค์‹œ๊ฐ„: ์‹ค์‹œ๊ฐ„ ์—…๋ฐ์ดํŠธ๋ฅผ ์œ„ํ•œ Turbo Streams

ํ•ต์‹ฌ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ

  • ์•”ํ˜ธํ™”: ์•ˆ์ „ํ•œ WireGuard ํ‚ค ์ƒ์„ฑ์„ ์œ„ํ•œ RbNaCl
  • QR ์ฝ”๋“œ: ๋ชจ๋ฐ”์ผ ์„ค์ •์„ ์œ„ํ•œ RQRCode
  • ํ˜„์ง€ํ™”: 4๊ฐœ ์–ธ์–ด ์ง€์›์„ ๊ฐ€์ง„ Rails I18n
  • ์ฝ”๋“œ ํ’ˆ์งˆ: RuboCop Rails Omakase, ERB Lint

๋ณด์•ˆ ๊ธฐ๋Šฅ

  • ๐Ÿ”’ XSS ๋ณดํ˜ธ: ์ž…๋ ฅ ๊ฒ€์ฆ๊ณผ ์•ˆ์ „ํ•œ ์ถœ๋ ฅ ๋ Œ๋”๋ง
  • ๐Ÿ›ก๏ธ ์„ธ์…˜ ๋ณด์•ˆ: ์˜๊ตฌ ์ž๊ฒฉ ์ฆ๋ช… ์ €์žฅ ์—†์ด ์•ˆ์ „ํ•œ ์„ธ์…˜ ๊ด€๋ฆฌ
  • ๐Ÿ” ๋ณด์•ˆ ์Šค์บ๋‹: ํ†ตํ•ฉ๋œ Brakeman ๋ณด์•ˆ ๋ถ„์„
  • โœ… ์ž…๋ ฅ ๊ฒ€์ฆ: ๋ชจ๋“  WireGuard ์„ค์ • ๋งค๊ฐœ๋ณ€์ˆ˜์— ๋Œ€ํ•œ ํฌ๊ด„์  ๊ฒ€์ฆ
  • ๐Ÿ” ์•ˆ์ „ํ•œ QR ์ƒ์„ฑ: ๊ฒ€์ฆ์„ ํ†ตํ•œ ์•ˆ์ „ํ•œ QR ์ฝ”๋“œ ์ƒ์„ฑ

๋ณด์•ˆ ๋ชจ๋ฒ” ์‚ฌ๋ก€

  • MikroTik ๋ผ์šฐํ„ฐ์— ๊ฐ•๋ ฅํ•œ ๋น„๋ฐ€๋ฒˆํ˜ธ ์‚ฌ์šฉ
  • ํ”„๋กœ๋•์…˜ ํ™˜๊ฒฝ์—์„œ HTTPS ๋’ค์—์„œ ์‹คํ–‰
  • MikroTik RouterOS ํŽŒ์›จ์–ด ์ •๊ธฐ ์—…๋ฐ์ดํŠธ
  • ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” VPN ํด๋ผ์ด์–ธํŠธ ๋ชจ๋‹ˆํ„ฐ๋ง ๋ฐ ์ œ๊ฑฐ
  • ์˜์‹ฌ์Šค๋Ÿฌ์šด ํ™œ๋™์— ๋Œ€ํ•œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋กœ๊ทธ ๊ฒ€ํ† 

๊ฐœ๋ฐœ

์ฝ”๋“œ ํ’ˆ์งˆ ๋ช…๋ น์–ด

# ๋ณด์•ˆ ์Šค์บ” ์‹คํ–‰
bundle exec brakeman

# ์ฝ”๋“œ ์Šคํƒ€์ผ ๊ฒ€์‚ฌ
bundle exec rubocop
erb_lint --lint-all

# ์Šคํƒ€์ผ ์ด์Šˆ ์ž๋™ ์ˆ˜์ •
bundle exec rubocop -A
erb_lint --lint-all --autocorrect

# ํ…Œ์ŠคํŠธ ์‹คํ–‰
bin/rails test
bin/rails test:system

ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ

  • app/controllers/clients_controller.rb - ๋ฉ”์ธ WireGuard ํด๋ผ์ด์–ธํŠธ ๊ด€๋ฆฌ
  • app/helpers/qr_code_helper.rb - ์•ˆ์ „ํ•œ QR ์ฝ”๋“œ ์ƒ์„ฑ
  • app/javascript/controllers/ - ๋™์  UI๋ฅผ ์œ„ํ•œ Stimulus ์ปจํŠธ๋กค๋Ÿฌ
  • app/views/clients/ - WireGuard ํด๋ผ์ด์–ธํŠธ ๊ด€๋ฆฌ ๋ทฐ
  • config/locales/ - ๋‹ค๊ตญ์–ด ์ง€์› ํŒŒ์ผ

๊ธฐ์—ฌํ•˜๊ธฐ

  1. ์ €์žฅ์†Œ๋ฅผ ํฌํฌํ•ฉ๋‹ˆ๋‹ค
  2. ๊ธฐ๋Šฅ ๋ธŒ๋žœ์น˜๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค (git checkout -b feature/amazing-feature)
  3. ์ ์ ˆํ•œ ํ…Œ์ŠคํŠธ์™€ ํ•จ๊ป˜ ๋ณ€๊ฒฝ์‚ฌํ•ญ์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค
  4. ์ฝ”๋“œ ํ’ˆ์งˆ ๊ฒ€์‚ฌ๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค (rubocop -A && erb_lint --lint-all --autocorrect)
  5. ๋ณ€๊ฒฝ์‚ฌํ•ญ์„ ์ปค๋ฐ‹ํ•ฉ๋‹ˆ๋‹ค (git commit -m 'Add amazing feature')
  6. ๋ธŒ๋žœ์น˜์— ํ‘ธ์‹œํ•ฉ๋‹ˆ๋‹ค (git push origin feature/amazing-feature)
  7. Pull Request๋ฅผ ์—ฝ๋‹ˆ๋‹ค

๋ผ์ด์„ผ์Šค

์ด ํ”„๋กœ์ ํŠธ๋Š” ์˜คํ”ˆ ์†Œ์Šค์ด๋ฉฐ MIT ๋ผ์ด์„ผ์Šค ํ•˜์— ์ œ๊ณต๋ฉ๋‹ˆ๋‹ค.


์ด README.md๋Š” Claude Code๋กœ ์ƒ์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages