toptal / haste-server

open source pastebin written in node.js

Home Page:https://www.toptal.com/developers/hastebin/about

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add paste expiration for file storage configuration

C0rn3j opened this issue · comments

staticMaxAge - max age for static assets (86400)

I see this line in README in the settings section, do you call pastes "static assets" and if so, does that mean they expire in a day by default?

Is that after last view or actual death time?

This is the extent of my config.js, I installed hastebin through this PKGBUILD on Arch - https://aur.archlinux.org/packages/haste-server-git/

Looking at the config.js in this repo, looks like I just have to throw the expire property to the storage block, so I did so.

  "storage": {
    "path": "./data","type": "file",
    "expire": 31536000
  },

Could the expire property be added to the README? I see that the different storing methods have a notion about the expire but it is not really described for the regular file storage option

@C0rn3j expire does not work with file storage currently. We don't have a separate store where the expiration would be placed - and currently don't serialize them into the stored file. Could be a great idea for an enhancement if people want similar.

expire does not work with file storage currently.

Could that be documented in the README?

We don't have a separate store where the expiration would be placed - and currently don't serialize them into the stored file. Could be a great idea for an enhancement if people want similar.

Would love to be able to set an expiration, whether it's at least max exp. on server side or perhaps even let have a shorter expiration on the client side. (my storage is limited)

For example - PrivateBin has a dropdown menu like this. Not saying that Hastebin should let client be able to set shorter expiration than the max, just throwing it out there as an idea. The clutter this adds to the otherwise very clean interface may not be worth it.

image

@C0rn3j

  • We could add it to the README but I think it's already fairly clear when each storage type describes which options it supports. I'm open to a PR that makes it more clear though
  • Have you considered using non-file storage to support expiration? It's definitely a feature I could add but it may be a bit before I have time and I haven't heard this request before.
  • The client side expiration selection is nice, but I prefer to keep the interface free of distractions like that. Maybe an idea for a fork if you're interested!

Have you considered using non-file storage to support expiration?

Yes, and while I could do that, it kinda kills the simplicity of the installation.

It's definitely a feature I could add but it may be a bit before I have time and I haven't heard this request before

I have time, better see it added later than never ^^

We could add it to the README but I think it's already fairly clear when each storage type describes which options it supports.

Am not sure about other people who are new to the project, but I myself was totally confused.

I'll re-title this Issue and see about a README PR.

@C0rn3j Thanks - I'll keep following this issue and watch for more upvotes - and eventually get this done!

This issue is stale because it has been open for 30 days with no activity.

When it will be added?

Btw is the expire working for amazon S3?

This issue is stale because it has been open for 30 days with no activity.

This issue was closed because it has been inactive for 14 days since being marked as stale.

It isnt stale