wantguns / bin

highly opinionated, minimal pastebin
https://basedbin.fly.dev
GNU Lesser General Public License v3.0
194 stars 20 forks source link

entropy random string environment variable #31

Open mrpops2ko opened 2 months ago

mrpops2ko commented 2 months ago

hi it would be really nice if there was an env variable like UPLOAD_LENGTH=6 so that we could modify how random we want our strings to be. the default 6 is quite low and its possible to guess them if an attacker cared enough, which 99.9999% of the time they wont be.

additionally a range would be even better, being able to specify an upper and lower bound so it generates random strings between x and y length

thank you for this awesome tool! for anybody who wants it, here are my traefik rules which just slap an auth on pretty much anything that isn't the pastes

      - "traefik.http.routers.pastebin-public.rule=Host(`bin.example.com`) && (PathPrefix(`/p/`) || PathPrefix(`/static/`))" 
      - 'traefik.http.routers.pastebin-public.rule=Host(`bin.example.com`) && PathRegexp(`/[\w.-]+\.\w+$`)'
      - "traefik.http.routers.pastebin-public.entrypoints=websecure"
      - "traefik.http.routers.pastebin-public.service=pastebin-public"
      - "traefik.http.services.pastebin-public.loadbalancer.server.port=6163"

      - "traefik.http.routers.pastebin-private.rule=Host(`bin.example.com`)"   
      - "traefik.http.routers.pastebin-private.entrypoints=websecure"
      - "traefik.http.routers.pastebin-private.service=pastebin-private"
      - "traefik.http.services.pastebin-private.loadbalancer.server.port=6163"
      - "traefik.http.routers.pastebin-private.middlewares=authentik@file"