Comments (23)
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.
from sharry.
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
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.
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.
Yea indeed.
from sharry.
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.
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.
Hmm, I'll see what I can do tomorrow on my PC. Thanks for trying btw
from sharry.
You're welcome. Thank you, too for trying; and no need to hurry.
from sharry.
Sorry for the late reply. I've downloaded release but can't find /api/v2/alias/upload or /app/upload
from sharry.
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.
Mhm this does make sense. But I'm still unsure how I can install sharry on my site.
from sharry.
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.
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.
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.
Can't find anything related to sharex
from sharry.
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.
Oh I see, okay I'll try that when I have time
from sharry.
@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 :)
- 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 namemeta
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. - This is possible currently only with the upload request as described above.
- 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.
@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.
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.
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.
Do I need to add some kind of authentication headers?
from sharry.
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)
- Azure AD scope is duplicated. HOT 13
- Software version disclose in links HOT 2
- Document sending metadata via the REST API HOT 9
- [Feature Request] Support deployment behind a path
- Configuration of file upload limits HOT 3
- [Feature Request] Allow anonymous uploads to shares. HOT 1
- [FR] Allow expiration and deletion of unpublished shares HOT 4
- Responses contain `Content-Length` header and `Transfer-Encoding:chunked` headers HOT 21
- Allow to change schema when using postgresql
- s3 auth does not seem to support node / service account roles - access key and secret required HOT 3
- Problems with using Keycloak as OAuth provider HOT 6
- Azure AD Authentication doesn't work with java.net.ConnectException: Connection timed out HOT 6
- CORS blocked when uploading a file using Caddy reverse proxy. HOT 5
- nix: build sharry from source
- Error message : 106% percent over 100 HOT 6
- mp4 files are not playing in browser HOT 10
- Add ability to create admin accounts with all auth modules HOT 2
- Broken Nix installation guide HOT 1
- Sign-in with oauth (via Google) creates accounts even if signup is set to "invite" or "closed" HOT 4
- Site breaks in Chrome/Edge when `require-trusted-types-for` is enabled in CSP header HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharry.