LuvSia Technical Blog

website·Indexed 31 days ago

https://luvsia.com

A collection of technical guides and tutorials covering server building, home network layout, and deployment. Topics include internal network port forwarding, DDNS for remote access, KMS server installation, automated frontend deployment using GitHub Actions, and setting up ChatGPT reverse proxies and web interfaces.

Tokens
39.1K
Snippets
233
Records
293
Agent score
46%

What's inside LuvSia

  1. Compare Hugo and Hexo for static site generation

    When choosing a static site generator, Hugo and Hexo are primary options. Hugo is implemented in Go, offering high performance, minimal environment dependencies, and fast deployment with LiveReload. Hexo is based on Node.js and is widely used for generating static pages hosted on GitHub Pages or Heroku.
  2. Implement a multi-application server architecture using subdomains

    When some applications do not support secondary directory root paths (sub-folders), the recommended architecture is to use unique subdomains for each application (e.g., a.example.com, b.example.com) and route traffic to the respective internal ports using Nginx reverse proxies.
  3. Compare Hugo and Hexo for static site generation

    When choosing a static site generator, Hugo and Hexo are primary options. Hugo is written in Go, offering high performance, fewer environment dependencies, and fast deployment with LiveReload. Hexo is based on Node.js and is widely used for generating static pages hosted on GitHub Pages or Heroku.
  4. Compare Hugo and Hexo for static site generation

    When choosing a static site generator, Hugo and Hexo are primary options. Hugo is implemented in Go, focusing on simplicity, high performance, and minimal environment dependencies, featuring LiveReload for a better writing experience. Hexo is based on Node.js and is widely used for generating static pages hosted on GitHub Pages or Heroku.
  5. Mount Google Drive using Rclone

    Install Rclone to mount Google Drive as a local directory. This requires fuse3 to be installed on the system.
    # Install Rclone
    wget https://www.moerats.com/usr/shell/rclone_debian.sh && bash rclone_debian.sh
    
    # Install FUSE3 dependency
    apt install fuse3
    
    # Initialize configuration
    rclone config
    
    # Create mount points
    mkdir -p /GoogleDrive
    mkdir -p /Downloads
    
    # Manual mount command
    rclone mount ventusoon:ventus /GoogleDrive \
     --umask 0000 \
     --default-permissions \
     --allow-non-empty \
     --allow-other \
     --transfers 4 \
     --buffer-size 32M \
     --low-level-retries 200 \
     --dir-cache-time 12h \
     --vfs-read-chunk-size 32M \
     --vfs-read-chunk-size-limit 1G
  6. Deploy Nginx Proxy Manager (Chinese Version) using Docker Compose

    Deploy the Chinese version of Nginx Proxy Manager using a Docker Compose file. Once deployed, the admin interface is accessible via port 81.
    # Create deployment directory
    mkdir -p /data/docker_data/npm
    cd /data/docker_data/npm
    
    # Create docker-compose.yml
    nano docker-compose.yml
    version: '3'
    services:
      app:
        image: 'chishin/nginx-proxy-manager-zh:latest'
        restart: always
        ports:
          - '80:80'
          - '81:81'
          - '443:443'
        volumes:
          - ./data:/data
          - ./letsencrypt:/etc/letsencrypt
    # Start the container
    docker-compose up -d

    Default Admin Credentials:

    • Email: admin@example.com
    • Password: changeme
  7. Deploy Nginx Proxy Manager (Chinese Version) using Docker Compose

    Deploy Nginx Proxy Manager using a Docker Compose file. This setup maps ports 80, 81 (admin UI), and 443, and persists data and SSL certificates to the host machine.
    # Create directory
    mkdir -p /data/docker_data/npm
    cd /data/docker_data/npm
    
    # Create docker-compose.yml
    nano docker-compose.yml
    version: '3'
    services:
      app:
        image: 'chishin/nginx-proxy-manager-zh:latest'
        restart: always
        ports:
          - '80:80'
          - '81:81'
          - '443:443'
        volumes:
          - ./data:/data
          - ./letsencrypt:/etc/letsencrypt
    # Start the container
    docker-compose up -d

    Default Admin Credentials:

    • Email: admin@example.com
    • Password: changeme
    • Access URL: http://<your-ip>:81
  8. Install Docker and Docker Compose on Linux

    Install Docker and Docker Compose to provide the environment for running Nginx Proxy Manager.
    # Update and install prerequisites
    apt-get update && apt-get install -y wget nano
    
    # Install Docker
    curl -sSL https://get.docker.com/ | sh
    
    # Enable and start Docker service
    systemctl start docker
    systemctl enable docker
    
    # Install Docker Compose
    sudo curl -L "https://github.com/docker/compose/releases/download/v2.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    sudo chmod +x /usr/local/bin/docker-compose
  9. Implement double-layered port forwarding for nested networks

    In complex home network environments where a device (like a PC) is behind a secondary gateway (like OpenWRT), a single port mapping from the main router to the host may fail. To resolve this, implement a two-step mapping process: first map the external port from the main router to the secondary gateway (OpenWRT), and then map that port from the secondary gateway to the final destination host's internal IP.

    Example Mapping Logic: Main Router (External Port) -> OpenWRT (Internal/External Port) -> Host PC (Internal Port)

  10. Access internal web services when port 80 is blocked

    When accessing internal web services via a domain, standard HTTP (port 80) is often blocked by ISPs. To bypass this, map the service to a non-standard external port and configure your web server or reverse proxy (e.g., BT Panel/宝塔面板) to handle the domain associated with that specific mapped port.
  11. Deploy sub-web-modify frontend via BT Panel

    After running yarn build, a dist directory is created in the project root. To deploy:

    1. Create a new site in the BT (Baota) Panel.
    2. Configure an SSL certificate for the site.
    3. Copy all files from the /root/sub-web-modify/dist folder to the site's root directory.
  12. Configure SSH keys and Git identity for GitHub

    Generate an RSA SSH key to authenticate with GitHub. The public key (id_rsa.pub) should be added to the GitHub account settings under 'SSH and GPG keys'. Additionally, configure the local Git identity to ensure commit history is correctly attributed.
    # Generate SSH key
    ssh-keygen -t rsa -C "your_email@example.com"
    
    # Configure Git identity
    git config user.name "yourname"
    git config user.email "your_email@example.com"
    
    # Test connection
    ssh -T git@github.com