Coder Social home page Coder Social logo

Comments (4)

pirate avatar pirate commented on August 17, 2024 1

Ok I opened 2 PRs to improve the docs and example configs:

You can probably close out this issue now, or wait till the final PR is merged, up to you 👍

from send.

pirate avatar pirate commented on August 17, 2024

Based on https://github.com/timvisee/send/blob/master/server/config.js it looks like I might have to set EXPIRE_TIMES_SECONDS to get the UI to change?

If that's the case, should the documentation + example compose file be updated to include these extra vars that need to be set to update the UI?

(also are the ANON_ prefixed settings still used or are those removed? if not, we should update the example config in timvisee/send-docker-compose)

from send.

pirate avatar pirate commented on August 17, 2024

I managed to increase it to 100k downloads and 365 days max, but I still cant get it to allow more than that no matter how I set the environment variables. It seems to ignore anything over those values, but I cant figure out where they're hardcoded.

This config should allow 1h, 1d, 1w, 1m, 1y, 5y, 250k downloads, and 10GB limits, but the UI doesn't show anything over 100,000 and 365 Days:

services:
  send:
    ...
    environment:
      ...      
      # Edit: (this is broken, see bottom of this comment for working version)
      - EXPIRE_TIMES_SECONDS="[3600, 86400, 604800, 2592000, 31536000, 157680000]"
      - DEFAULT_EXPIRE_SECONDS=157680000
      - MAX_EXPIRE_SECONDS=315360000
      - DOWNLOAD_COUNTS="[1, 2, 5, 10, 15, 25, 50, 100, 1000, 10000, 100000, 250000]"
      - MAX_DOWNLOADS=250000
      - MAX_FILES_PER_ARCHIVE=4096
      - MAX_ARCHIVES_PER_USER=4096
      - MAX_FILE_SIZE=10747904000

image

Edit: the config is making it to the frontend correctly in DEFAULTS, so something in the UI code is preventing the highest options from appearing in the dropdowns

image

Edit2: Aha! A clue here. I think the array config vars are parsed as CSV, not JSON. It's breaking the first and last values because of the [ and ].

image

from send.

pirate avatar pirate commented on August 17, 2024

Ok got it working. Changing the array config options to CSV values worked.

Here's the final working config to allow up to 10GB uploaded for 5yr and 250k downloads.

services:
  send:
    ...
    environment:
      ...
      # these update both the backend limit and the limit shown/enforced in the UI
      - MAX_FILE_SIZE=10747904000
      - MAX_FILES_PER_ARCHIVE=1024
      
      # these update the UI dropdowns and should be a CSV of bare integers (first value is used as the dropdown default)
      - EXPIRE_TIMES_SECONDS=3600,86400,604800,2592000,31536000,157680000
      - DOWNLOAD_COUNTS=1,2,5,10,15,25,50,100,1000,10000,100000,250000
      
      # these are global limits enforced by the backend and have no effect on the UI
      - DEFAULT_EXPIRE_SECONDS=157680000
      - MAX_EXPIRE_SECONDS=315360000
      - MAX_DOWNLOADS=250000

image

from send.

Related Issues (20)

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.