[GH-ISSUE #5] Fix 'sed' command for hash password for auth credential #3

Closed
opened 2026-02-27 21:00:44 +03:00 by kerem · 5 comments
Owner

Originally created by @HoLengZai on GitHub (Jun 8, 2025).
Original GitHub issue: https://github.com/sfnemis/proxmox-traefikproxy-cloudflaretunnel/issues/5

I faced an issue regarding the command provide in this part of the documentation:

https://github.com/sfnemis/proxmox-traefikproxy-cloudflaretunnel/tree/main?tab=readme-ov-file#create-the-dynamic-configuration-and-set-basic-auth-credentials

The issue is the HASH password can contain some special characters which can break the fileConfig.yml file (like it will miss the double quote at the end of the line replaced

Here the updated more secure way to handle special characters on the HASH password part

read -p "Enter username: " USER && read -s -p "Enter password: " PASS && echo && HASH=$(htpasswd -nbB "$USER" "$PASS") && SAFE_HASH=$(printf '%s\n' "$HASH" | sed -e 's/[&\\|]/\\&/g') && sed -i "s|- \".*\"|- \"$SAFE_HASH\"|" /etc/traefik/dynamic/fileConfig.yml
Originally created by @HoLengZai on GitHub (Jun 8, 2025). Original GitHub issue: https://github.com/sfnemis/proxmox-traefikproxy-cloudflaretunnel/issues/5 I faced an issue regarding the command provide in this part of the documentation: https://github.com/sfnemis/proxmox-traefikproxy-cloudflaretunnel/tree/main?tab=readme-ov-file#create-the-dynamic-configuration-and-set-basic-auth-credentials The issue is the HASH password can contain some special characters which can break the fileConfig.yml file (like it will miss the double quote at the end of the line replaced Here the updated more secure way to handle special characters on the HASH password part ```shell read -p "Enter username: " USER && read -s -p "Enter password: " PASS && echo && HASH=$(htpasswd -nbB "$USER" "$PASS") && SAFE_HASH=$(printf '%s\n' "$HASH" | sed -e 's/[&\\|]/\\&/g') && sed -i "s|- \".*\"|- \"$SAFE_HASH\"|" /etc/traefik/dynamic/fileConfig.yml ```
kerem closed this issue 2026-02-27 21:00:45 +03:00
Author
Owner

@sfnemis commented on GitHub (Jun 12, 2025):

Thank you, if you want can be contributor ...

<!-- gh-comment-id:2964808047 --> @sfnemis commented on GitHub (Jun 12, 2025): Thank you, if you want can be contributor ...
Author
Owner

@HoLengZai commented on GitHub (Jun 12, 2025):

Happy to help. I'm quite new on Proxmox, Traefik, Cloudflared Tunnel but i'm building everything from scratch and your script help me a lot to understand all the concept.

Right now I am building this architecture:

  • OVH dedicated server:
    • Proxmox VE 8
      • Node (vmbr0 (public ip) and vmbr1 (internet network + NAT through vmbr0)
        • Cloudflared Tunnel Agent (LXC) - Act as the reverse-proxy "Traffic Manager"

          Traefik (LXC) - Act as the Load Balancer and the "Internal Route Manager"
          Debian 12 - Docker (VM)
          Docker - "Containers Manager"
          > Portainer (Container) - "Containers Orchestrator"
          > Website1 (Container)
          > MariaDB (Container)
          > ... (ContainerS)
          All are in the vmbr1 and Cloudflared handles all the traffic from outside.
          I am more or less at the end of "my journey", I have just finished with Docker instalaltion... now i do some check up and i will contianer with Portainer

I will provide update/contribute when I have finished to cleanup my note :)

<!-- gh-comment-id:2964835461 --> @HoLengZai commented on GitHub (Jun 12, 2025): Happy to help. I'm quite new on Proxmox, Traefik, Cloudflared Tunnel but i'm building everything from scratch and your script help me a lot to understand all the concept. Right now I am building this architecture: - OVH dedicated server: - Proxmox VE 8 - Node (vmbr0 (public ip) and vmbr1 (internet network + NAT through vmbr0) - Cloudflared Tunnel Agent (LXC) _- Act as the reverse-proxy "Traffic Manager"_ > Traefik (LXC) _- Act as the Load Balancer and the "Internal Route Manager"_ > Debian 12 - Docker (VM) > Docker _- "Containers Manager"_ > Portainer (Container) _- "Containers Orchestrator"_ > Website1 (Container) > MariaDB (Container) > ... (ContainerS) All are in the vmbr1 and Cloudflared handles all the traffic from outside. I am more or less at the end of "my journey", I have just finished with Docker instalaltion... now i do some check up and i will contianer with Portainer I will provide update/contribute when I have finished to cleanup my note :)
Author
Owner

@sfnemis commented on GitHub (Jun 12, 2025):

Happy to help. I'm quite new on Proxmox, Traefik, Cloudflared Tunnel but i'm building everything from scratch and your script help me a lot to understand all the concept.

Right now I am building this architecture:

* OVH dedicated server:
  
  * Proxmox VE 8
    
    * Node (vmbr0 (public ip) and vmbr1 (internet network + NAT through vmbr0)
      
      * Cloudflared Tunnel Agent (LXC) _- Act as the reverse-proxy "Traffic Manager"_
        > Traefik (LXC) _- Act as the Load Balancer and the "Internal Route Manager"_
        > Debian 12 - Docker (VM)
        > Docker _- "Containers Manager"_
        > > Portainer (Container) _- "Containers Orchestrator"_
        > > Website1 (Container)
        > > MariaDB (Container)
        > > ... (ContainerS)
        > All are in the vmbr1 and Cloudflared handles all the traffic from outside.
        > I am more or less at the end of "my journey", I have just finished with Docker instalaltion... now i do some check up and i will contianer with Portainer

I will provide update/contribute when I have finished to cleanup my note :)

Actually, i want to use also Crowdsec with Traefik LXC but i couldn't be success so i am using right now Cloudflare Tunnel --> Caddy with Crowdsec --> and my services on the docker.

<!-- gh-comment-id:2964838951 --> @sfnemis commented on GitHub (Jun 12, 2025): > Happy to help. I'm quite new on Proxmox, Traefik, Cloudflared Tunnel but i'm building everything from scratch and your script help me a lot to understand all the concept. > > Right now I am building this architecture: > > * OVH dedicated server: > > * Proxmox VE 8 > > * Node (vmbr0 (public ip) and vmbr1 (internet network + NAT through vmbr0) > > * Cloudflared Tunnel Agent (LXC) _- Act as the reverse-proxy "Traffic Manager"_ > > Traefik (LXC) _- Act as the Load Balancer and the "Internal Route Manager"_ > > Debian 12 - Docker (VM) > > Docker _- "Containers Manager"_ > > > Portainer (Container) _- "Containers Orchestrator"_ > > > Website1 (Container) > > > MariaDB (Container) > > > ... (ContainerS) > > All are in the vmbr1 and Cloudflared handles all the traffic from outside. > > I am more or less at the end of "my journey", I have just finished with Docker instalaltion... now i do some check up and i will contianer with Portainer > > > I will provide update/contribute when I have finished to cleanup my note :) Actually, i want to use also Crowdsec with Traefik LXC but i couldn't be success so i am using right now Cloudflare Tunnel --> Caddy with Crowdsec --> and my services on the docker.
Author
Owner

@HoLengZai commented on GitHub (Jun 12, 2025):

Have you heard about that one?

https://boringproxy.io/

I might try to it to see if it can replace cloudflared tunnel

<!-- gh-comment-id:2964948949 --> @HoLengZai commented on GitHub (Jun 12, 2025): Have you heard about that one? https://boringproxy.io/ I might try to it to see if it can replace cloudflared tunnel
Author
Owner

@sfnemis commented on GitHub (Jul 16, 2025):

Have you heard about that one?

https://boringproxy.io/

I might try to it to see if it can replace cloudflared tunnel

Hey 👋 Sorry for late response, did you try boringproxy ?

<!-- gh-comment-id:3081307721 --> @sfnemis commented on GitHub (Jul 16, 2025): > Have you heard about that one? > > https://boringproxy.io/ > > I might try to it to see if it can replace cloudflared tunnel Hey 👋 Sorry for late response, did you try boringproxy ?
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/proxmox-traefikproxy-cloudflaretunnel#3
No description provided.