Skip to content

Instantly share code, notes, and snippets.

@SwagDevOps
Last active February 13, 2025 15:13
Show Gist options
  • Select an option

  • Save SwagDevOps/cecb0ca0b4c62e4fd65dff2829f7b920 to your computer and use it in GitHub Desktop.

Select an option

Save SwagDevOps/cecb0ca0b4c62e4fd65dff2829f7b920 to your computer and use it in GitHub Desktop.

Revisions

  1. SwagDevOps revised this gist Feb 13, 2025. 1 changed file with 35 additions and 0 deletions.
    35 changes: 35 additions & 0 deletions traefik.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    # file: /etc/traefik/traefik.yml
    entryPoints:
    glug:
    address: ":258"
    web:
    address: ":80"
    http:
    redirections:
    entryPoint:
    to: "web-sec"
    scheme: "https"
    permanent: true
    web-sec:
    address: ":443"
    certificatesResolvers:
    letsencrypt:
    acme:
    email: [email protected]
    storage: /etc/traefik/storage/acme.json
    httpChallenge: { entryPoint: web }
    api:
    dashboard: true
    debug: true
    insecure: false
    providers:
    file:
    directory: "/etc/traefik/providers/"
    watch: true
    log:
    filePath: "/var/log/traefik/messages.log"
    level: "DEBUG"
    noColor: true
    compress: true
    maxAge: 7
    maxSize: 500
  2. SwagDevOps revised this gist Feb 13, 2025. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions traefik.service
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    # file: /etc/systemd/system/traefik.service
    [Unit]
    Description=Traefik
    Documentation=https://doc.traefik.io/traefik/
  3. SwagDevOps revised this gist Feb 13, 2025. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions traefik-setup.md
    Original file line number Diff line number Diff line change
    @@ -7,4 +7,5 @@ systemctl daemon-reload
    useradd -r -s /bin/false -U -M traefik
    mkdir -pv /etc/traefik/storage
    mkdir -pv /var/log/traefik/
    chown -Rfv traefik:traefik /etc/traefik/ /var/log/traefik/
    ```
  4. SwagDevOps revised this gist Feb 13, 2025. 2 changed files with 29 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions traefik-setup.md
    Original file line number Diff line number Diff line change
    @@ -2,3 +2,9 @@
    vim /etc/systemd/system/traefik.service
    systemctl daemon-reload
    ```

    ```sh
    useradd -r -s /bin/false -U -M traefik
    mkdir -pv /etc/traefik/storage
    mkdir -pv /var/log/traefik/
    ```
    23 changes: 23 additions & 0 deletions traefik.service
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    [Unit]
    Description=Traefik
    Documentation=https://doc.traefik.io/traefik/
    After=network-online.target

    [Service]
    User=traefik
    AmbientCapabilities=CAP_NET_BIND_SERVICE
    Type=notify
    ExecStart=/usr/local/bin/traefik
    Restart=always
    WatchdogSec=1s
    ProtectHome=true
    PrivateDevices=true
    ProtectKernelTunables=true
    ProtectControlGroups=true
    ProtectSystem=strict
    ReadWritePaths=/var/log/traefik/ /etc/traefik/storage/
    InaccessibleDirectories=/boot /home /media /mnt /opt /root
    ReadOnlyDirectories=/bin /etc /lib -/lib64 /sbin /usr /var

    [Install]
    WantedBy=multi-user.target
  5. SwagDevOps created this gist Feb 13, 2025.
    4 changes: 4 additions & 0 deletions traefik-setup.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    ```sh
    vim /etc/systemd/system/traefik.service
    systemctl daemon-reload
    ```