Code Monkey home page Code Monkey logo

Comments (23)

A7U avatar A7U commented on May 20, 2024 1

Mhm, the response is in JSON. If you need beta testers I might be available. Msg me on discord: A7U#2459 or on Telegram: @A7Ubn

from sharry.

A7U avatar A7U commented on May 20, 2024 1

[email protected]

from sharry.

Pfuenzle avatar Pfuenzle commented on May 20, 2024 1

Seems like this issue has stalled a bit, so I did some testing
I tried to config your posted a few comments ago, and image, file and text uploads are working as intended, except the return URL. When sharing a image/file with sharry, it normaly copies the URL of the share to clipboard, when using your config it only returns "https://<url>/app/upload/"
This is caused by a missing $ at the end of $json:id$,
so the working config is
{ "Version": "1.3.1", "DestinationType": "ImageUploader, TextUploader, FileUploader", "RequestMethod": "POST", "RequestURL": "https://your.sharry/api/v2/alias/upload", "Body": "MultipartFormData", "Headers": { "Sharry-Alias": "some-alias-id" }, "FileFormName": "file[]", "URL": "https://your.sharry/app/upload/$json:id$" }

I have some questions though, when creating a share with sharry, its default settings are 30 views, same validity time as the alies and it is unpublished.
Would it be possible to either set the publish status and views in the upload request or during the creation of the alias?
I mostly share files with friends that dont have an account, so setting my default for sharry to publish (and possibly views >30) would be great.

Also, from what I read in the docs, you can display an image in the description with "![image]({{filename.filename.url}})" Is it possible to give a description parameter when using an alias, so pictures can be instantly displayed when opening a shared URL?

Another "issue" (although I dont know if it is a limitation by sharry or sharex) is, that when selecting multiple files to be uploaded, a new share for every file is created, instead of one with all files in them.
Thanks`

from sharry.

eikek avatar eikek commented on May 20, 2024

Thanks for your input! I have to admit I don't know what sharex is... Do you mean this windows screenshot tool ShareX?

from sharry.

A7U avatar A7U commented on May 20, 2024

Yea indeed.

from sharry.

eikek avatar eikek commented on May 20, 2024

Ok, thanks! I certainly would like to support this, but I first have to see how it works. From a first quick look it seems that people can define their "custom uploads" via a JSON file. So it would be a documentation update in sharry with an example for ShareX, I guess(?). Since I don't have Windows I'm not sure how to go about it.

from sharry.

eikek avatar eikek commented on May 20, 2024

I may completely miss the point here…IIUC, there is a sxcu file necessary, that defines where and how sharex does the upload request. Since sharry is not available globally, users would need to create their own files. Maybe it is already possible using an alias url and the alias/upload endpoint. I came up with this, but cannot fiddle with it, so maybe one with windows and sharex could give it a try:

{
  "Version": "1.3.1",
  "DestinationType": "ImageUploader, TextUploader, FileUploader",
  "RequestMethod": "POST",
  "RequestURL": "https://your.sharry/api/v2/alias/upload",
  "Body": "MultipartFormData",
  "Headers": {
    "Sharry-Alias": "some-alias-id"
  },
  "FileFormName": "file[]",
  "URL": "https://your.sharry/app/upload/$json:id"
}

You would need to create an alias page and add the id into the headers section.

from sharry.

A7U avatar A7U commented on May 20, 2024

Hmm, I'll see what I can do tomorrow on my PC. Thanks for trying btw

from sharry.

eikek avatar eikek commented on May 20, 2024

You're welcome. Thank you, too for trying; and no need to hurry.

from sharry.

A7U avatar A7U commented on May 20, 2024

Sorry for the late reply. I've downloaded release but can't find /api/v2/alias/upload or /app/upload

from sharry.

eikek avatar eikek commented on May 20, 2024

No worries! Just take as much time as you want! The /api/v2/alias/upload would be the endpoint to upload a file without logging in. But it requires to create a so called "alias page". You need to signup and login and then you find in the menu a link where you can create alias pages. This essentially creates some kind of api key. This key is required to upload files to yourself. I tried it with my installation:

$ curl -F file=@IMG_7777.JPG -H 'Sharry-Alias: G...id' https://box.daheim.site/api/v2/alias/upload
{"success":true,"message":"Share created.","id":"some-share-id-yNSpaAvXb7h"}

I thought that this could be used to upload files from sharex. I hope this makes sense?

from sharry.

A7U avatar A7U commented on May 20, 2024

Mhm this does make sense. But I'm still unsure how I can install sharry on my site.

from sharry.

eikek avatar eikek commented on May 20, 2024

Ah sorry, I assumed (without reason) you had it running already. If you use docker, it would be the easiest way I think. Or download the zip and start the script in bin. Here are some instructions.

But I can also send you the credentials to my site if you don't want to bother with this?

from sharry.

A7U avatar A7U commented on May 20, 2024

Really sorry for the late reply once again, yes can you please provide me with the credentials? Since I'm really, really busy working on projects. Thanks once again

from sharry.

eikek avatar eikek commented on May 20, 2024

No need to be sorry! It's not urgent or anything. Just do it (if you want) whenever you have time and thank you for that! I don't know how to transfer the credentials, since I'm not on telegram or discord. I tried with telegram, but I couldn't figure out how to add your username – it always wants me to add phonenumbers…. Maybe via mail? You can mail me at "eikek [at] posteo.de" and I can mail you an account on my site that you could use to try things out.

from sharry.

A7U avatar A7U commented on May 20, 2024

Can't find anything related to sharex

from sharry.

eikek avatar eikek commented on May 20, 2024

I'm not sure if I understand. What did you expect to find and where did you look? I'm sorry that I'm not of any help with sharex. My thoughts were like this:

  • log in and create a "alias page". this allows anyone (who knows that link) to upload files; i.e. there is no login necessary
  • try to configure sharex that it uploads to this url (the url will be presented to you)

I hoped that maybe the config in this comment could work. There you'd need to replace the some-alias-id with the real alias id that has been generated for you.

Maybe you could try this config and playwith it? Not sure if that makes sense ….

from sharry.

A7U avatar A7U commented on May 20, 2024

Oh I see, okay I'll try that when I have time

from sharry.

eikek avatar eikek commented on May 20, 2024

@Pfuenzle Thank you very much. I think this is good info to put somewhere in the docs.

To your questions: In summary, I think they are a valid new issue :)

  1. Most settings can be given with the upload request (fyi some pointers here unfortunately, the meta structure is not properly generated by the openapi tools, here is the plain text description). You need to add a part of type application/json and name meta to contain this data: maxviews, validity, description and password is currently possible. However, publishing is not possible yet. It would currently require a second request. I think it's a good idea to be able to define all of this for each alias.
  2. This is possible currently only with the upload request as described above.
  3. That seems to me a sharex thing, but not sure: one post request creates a new share. if sharex sends all files in one request, than there should be one share with all files in them.

from sharry.

eikek avatar eikek commented on May 20, 2024

@Pfuenzle I'm just thinking about to allow uploads via aliases to be published immediately as you asked for. But I think I forgot (sorry) or don't understand the use case. Why do you need this? If you share files with friends, you don't use the alias uploads but the normal upload, since you have an account. The alias pages are for uploads where you are the receiver. So I can't see why it is then desired to have it published automatically - you'd still need to login to find out the share url anyways.

Edit: so to think further, I'm thinking about to even remove the validity setting for an alias, too.

from sharry.

eikek avatar eikek commented on May 20, 2024

I added the snippet that has been confirmed to work to the docs. Think this can be closed then. For the other concerns, it would be nice to have separate issues to discuss it. thanks!

from sharry.

Jafner avatar Jafner commented on May 20, 2024

Has something changed that might cause this configuration to stop working?
Unless I've inputted something wrong, I seem to be getting 403 errors when simply trying to push an upload to the /api/v2/alias/upload path.

image

Do I need to add some kind of authentication headers?

from sharry.

Jafner avatar Jafner commented on May 20, 2024

I'm a fool. I put Sharry-Alias under form data, not the headers section.
Using the "Import from clipboard" feature worked for me.

from sharry.

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.