psitransfer icon indicating copy to clipboard operation
psitransfer copied to clipboard

Question - Make auto generated share URLs shorter?

Open jamess60 opened this issue 1 year ago • 8 comments

Hi all

My instance has very low volumes of traffic/users, but I quite often use it to move files in/out of vms and remote sessions that I cant always copy paste into.

Is there a way to make the auto generated urls shorter for convenience? Even 2 characters would suffice for my needs

jamess60 avatar Jul 07 '23 16:07 jamess60

hey james,

you may use an bucked id ( ?sid=ab)

I think the code that generate the random id is

function getSid() { // support setting an explicit SID by location search param const match = document.location.search.match(/sid=([^&]+)/); if (match) { return match[1]; } else { return md5(uuid()).toString().substr(0, 12); } }

As you can see it`s a hardcoded length.

Maytrok avatar Jul 18 '23 14:07 Maytrok

Hi @Maytrok - Thanks for sharing! I see you linked pull #283 - does this mean there is now an ENV for this?

jamess60 avatar Aug 10 '23 19:08 jamess60

I see this was added to the readme! Closing issue :) PSITRANSFER_RANDOM_DOWNLOAD_SID_LENGTH

jamess60 avatar Aug 15 '23 11:08 jamess60

@Maytrok

Reopening as I only just found the time to test...

Looks like the #283 merge has conflicts - did it ever go ahead? I cant see a reference to sid length in the config.js and adding this env to docker compose does nothing

jamess60 avatar Apr 12 '24 18:04 jamess60

Bump - any news on this?

jamess60 avatar Jun 20 '24 08:06 jamess60

@jamess60 the repo owner seems to not care about my PRs and merge other prs that create a merge conflict with mine. i`ve resolve the conflict now, but i don't have small hopes that the pr will be merged. If you really want that feature, you should be able to clone my forked repo and switch to the 'env-to-shorten-download-url' branch. Note: Ive not tested the docker version

Maytrok avatar Jul 05 '24 21:07 Maytrok

Hi @Maytrok

My bad - I honestly thought you were the repo owner given the lack of activity from anyone else! Shame that the project seems to be lacking maintainers as its an awesome bit of software. Thank you for your efforts!

If/When I ever find time, I might be able to help dockerise your fork...

jamess60 avatar Jul 25 '24 12:07 jamess60

I apologize but I really do not have the time anymore to manage all the requests and do much review stuff. Feel free to fork my work and add your features

psi-4ward avatar Jul 26 '24 08:07 psi-4ward