Git Product home page Git Product logo

docker-traefik-logrotate's People

Contributors

dependabot[bot] avatar gezhl avatar kurz-schluss avatar phaeton avatar sebthom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-traefik-logrotate's Issues

Bug?: Compression

It seems that the log files don't seem to get compressed.

Whilst I can see it in the template, it doesn't seem to compress the files into gz.

image

release with semver tag

Hi,

first of all thanks for this, it's really helpful. :)

Wanted to ask if you could please create a release version with semver tagging, I'm using WUD and without the semver tag this container gets an update notification very often because the digest changes using tag latest.

Thanks in advance. :)

Proposed TRAEFIK_CONTAINER_ID_COMMAND not working for pinned version image

My compose config for Traefik:

  traefik:
    image: traefik:v2.8.3
    container_name: traefik
    hostname: traefik
    restart: unless-stopped

The documented command doesn't find the image:

      # command to determine the id of the container running Traefik:
      TRAEFIK_CONTAINER_ID_COMMAND: docker ps --quiet --filter ancestor=traefik

Had to replace with one of the following:

      TRAEFIK_CONTAINER_ID_COMMAND: docker inspect --format="{{.Id}}" traefik
      TRAEFIK_CONTAINER_ID_COMMAND: docker ps --no-trunc -aqf "name=^traefik$$"

Hope it helps anyone else having with the same issue.

Not an issue. Build schedule

Any reason you build new container on daily basis? I think it’s more propitiate to push new images ones a week if there were no code change. I have my containers with automatic update with new images. Yours updates every single day.

Feature Request: Accept mutiple directories for rotating logs

Hi,

as many people are using traefik + crowdsec or fail2ban I think it would be beneficial to accept multiple directories to do the log rotation.

E.g.:

    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:rw # required to send USR1 signal to Traefik after log rotation
      - ./log:/var/log/traefik:rw # folder containing access.log file
      - ../crowdsec/log:/var/log/crowdsec:rw
    environment:
      TZ: "Europe/Berlin"
      LOGROTATE_LOGS: "/var/log/traefik/*.log, /var/loge/crowdsec/*.log"

Feature Request: Change owner of log file

Would it be possible to have the ability to change the owner of the log file after rotation?

Currently, it defaults to root:root as that's what the container runs as.

My Traefik logs are currently owned by a different user and group.

An env var to override the create 0644 root root section would probably do it quite nicely.

skipping "/logs/traefik/access.log" because parent directory has insecure permissions

hi,

I am running this with Docker traefik

I get the following issue

error: skipping "/logs/traefik/access.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.

I have tried changing the directory ownership, setting the puid and guid

Any help greatly appreciated.
Mo

full output below:


*********************
* TRAEFIK LOGROTATE *
*********************

GIT_REPO:    https://github.com/vegardit/docker-traefik-logrotate
GIT_BRANCH:  main
GIT_COMMIT:  45ab8ef @ 2022-03-25 14:53:41 UTC
IMAGE_BUILD: 2022-05-09T01:52:20Z


2022-05-09 18:13:21 INFO [/opt/run.sh:26] Timezone is UTC +0000
2022-05-09 18:13:21 INFO [/opt/run.sh:48] Generating [/etc/logrotate.conf] based on template [/opt/logrotate.conf.template]...
  /logs/traefik/access.log {
�
y
    maxsize 50M
    rotate 14
    start 1
  
    missingok
    notifempty
  
�
    compress
    delaycompress
  
    create 0644 root root
  
    sharedscripts
    postrotate
       /opt/notify-traefik.sh
    endscript
  }
2022-05-09 18:13:21 INFO [/opt/run.sh:61] Scheduling logrotate cronjob...
2022-05-09 18:13:21 INFO [/opt/run.sh:64] Starting cron daemon...
2022-05-09 18:14:00 INFO [/opt/rotate-logs.sh:16] ########## logrotate START ##########
  reading config file /etc/logrotate.conf
  Creating stub state file: /var/lib/logrotate.status
  Reading state from file: /var/lib/logrotate.status
  Allocating hash table for state file, size 64 entries
  
  Handling 1 logs
  
  rotating pattern: /logs/traefik/access.log  after 1 days (14 rotations)
  empty log files are not rotated, log files >= 52428800 are rotated earlier, old logs are removed
  considering log /logs/traefik/access.log
  error: skipping "/logs/traefik/access.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
  Creating new state
18:14:00 Error - exited with status 1 in [/opt/rotate-logs.sh] at line 18:
    15	#################################################
    16	log INFO "########## logrotate START ##########"
    17	
    18	/usr/sbin/logrotate --verbose /etc/logrotate.conf 2> >(sed 's/^/  /' >&2)
    19	
    20	log INFO "########## logrotate END ############"
2022-05-09 18:15:00 INFO [/opt/rotate-logs.sh:16] ########## logrotate START ##########
  reading config file /etc/logrotate.conf
  Reading state from file: /var/lib/logrotate.status
  Allocating hash table for state file, size 64 entries
  Creating new state
  
  Handling 1 logs
  
  rotating pattern: /logs/traefik/access.log  after 1 days (14 rotations)
  empty log files are not rotated, log files >= 52428800 are rotated earlier, old logs are removed
  considering log /logs/traefik/access.log
  error: skipping "/logs/traefik/access.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
18:15:00 Error - exited with status 1 in [/opt/rotate-logs.sh] at line 18:
    15	#################################################
    16	log INFO "########## logrotate START ##########"
    17	
    18	/usr/sbin/logrotate --verbose /etc/logrotate.conf 2> >(sed 's/^/  /' >&2)
    19	
    20	log INFO "########## logrotate END ############"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.