403 #20

Closed
opened 2024-02-24 10:28:41 +00:00 by Gryzor · 16 comments

Hello!

Just installed the Unraid container. Opening the homepage from my Unraid UI I get a 403... any ideas?

Thanks!

Hello! Just installed the Unraid container. Opening the homepage from my Unraid UI I get a 403... any ideas? Thanks!
Owner

Could you attach a screenshot (or paste it here) of the docker container logs? Click the container icon then -> logs

Could you attach a screenshot (or paste it here) of the docker container logs? Click the container icon then -> logs
Author

Sure, here you go!

Sure, here you go!
Owner

It seems to be a permission issue. Could you set the permissions of the upload directory to 777?

watch this for an example

It seems to be a permission issue. Could you set the permissions of the upload directory to 777? [watch this for an example](https://cdn.fascinated.cc/wXnUqUSU.mp4)
Author

It seems to be a permission issue. Could you set the permissions of the upload directory to 777?

watch this for an example

That didn't help. It's currently at 777 with nobody as owner, still getting 403s... 😐

> It seems to be a permission issue. Could you set the permissions of the upload directory to 777? > > [watch this for an example](https://cdn.fascinated.cc/wXnUqUSU.mp4) That didn't help. It's currently at 777 with nobody as owner, still getting 403s... 😐
Owner

Are you able to upload files using ShareX? I believe the error is because nginx isn't allowed to show the contents of the directory. If you add a index.html file to the root upload location it should load fine.

I just pushed an update that will add a default index.html. If you update it should show you this page :)

Are you able to upload files using ShareX? I believe the error is because nginx isn't allowed to show the contents of the directory. If you add a index.html file to the root upload location it should load fine. I just pushed an update that will add a default index.html. If you update it should show you [this](https://cdn.fascinated.cc/Sua78PYZ.png) page :)
Author

Yesss now I see the uploaded page!

As for uploading screenshots now, I wasn't able to though I was getting the URL back as described in the guide. Let me try again...

Nope, still not uploading. The ShareX icon has changed to a blue rectangle with '99' in it, nothing in the directory.

Here's what I'm getting when testing the uploader from the app:

Response text:
{ "status": 200, "data": { "link": "https:\/\/example.com\/image.png" } }

URL syntax:
http://10.0.0.100/{json:url}

Result:
http://10.0.0.100/
(that's my NAS).

[EDIT] after several minutes I got an error popup. Can't find where ShareX shows its log, but the message referenced an error 500...

[EDIT 2] Found it:

2024-02-26 10:59:59.742 - Error:
Error message:
The remote server returned an error: (500) Internal Server Error.

Request URL:
http://10.0.0.100/upload.php

Status code:
(500) Internal Server Error

Headers:
Connection: close
Content-Length: 170
Content-Type: text/html
Date: Mon, 26 Feb 2024 09:00:00 GMT
Server: nginx

Response text:

<html> <head></head>

500 Internal Server Error


nginx </html>

Stack trace:
at System.Net.HttpWebRequest.GetResponse()
at ShareX.UploadersLib.Uploader.SendRequestFile(String url, Stream data, String fileName, String fileFormName, Dictionary`2 args, NameValueCollection headers, CookieCollection cookies, HttpMethod method, String contentType, String relatedData)
2024-02-26 10:59:59.745 - Upload failed. Retrying upload.
2024-02-26 11:02:19.886 - Error:

Yesss now I see the uploaded page! As for uploading screenshots now, I wasn't able to though I was getting the URL back as described in the guide. Let me try again... Nope, still not uploading. The ShareX icon has changed to a blue rectangle with '99' in it, nothing in the directory. Here's what I'm getting when testing the uploader from the app: Response text: `{ "status": 200, "data": { "link": "https:\/\/example.com\/image.png" } }` URL syntax: `http://10.0.0.100/{json:url}` Result: `http://10.0.0.100/` (that's my NAS). [EDIT] after several minutes I got an error popup. Can't find where ShareX shows its log, but the message referenced an error 500... [EDIT 2] Found it: > 2024-02-26 10:59:59.742 - Error: > Error message: > The remote server returned an error: (500) Internal Server Error. > > Request URL: > http://10.0.0.100/upload.php > > Status code: > (500) Internal Server Error > > Headers: > Connection: close > Content-Length: 170 > Content-Type: text/html > Date: Mon, 26 Feb 2024 09:00:00 GMT > Server: nginx > > Response text: > <html> > <head><title>500 Internal Server Error</title></head> > <body> > <center><h1>500 Internal Server Error</h1></center> > <hr><center>nginx</center> > </body> > </html> > > > Stack trace: > at System.Net.HttpWebRequest.GetResponse() > at ShareX.UploadersLib.Uploader.SendRequestFile(String url, Stream data, String fileName, String fileFormName, Dictionary`2 args, NameValueCollection headers, CookieCollection cookies, HttpMethod method, String contentType, String relatedData) > 2024-02-26 10:59:59.745 - Upload failed. Retrying upload. > 2024-02-26 11:02:19.886 - Error: >
Owner

There should be some kind of error in the container log, if you could provide that i'll be able to know why :)
also, make sure you updated the YOUR_DOMAIN part in ShareX

There should be some kind of error in the container log, if you could provide that i'll be able to know why :) also, make sure you updated the `YOUR_DOMAIN` part in ShareX
Author

I'm attaching the container log; also, my ShareX custom destination setting. Hope it helps!

I'm attaching the container log; also, my ShareX custom destination setting. Hope it helps!
Owner

Is the container logs after you have uploaded a file/image? also, please set a upload key as that could be causing issues

Is the container logs after you have uploaded a file/image? also, please set a upload key as that could be causing issues
Author

Yes, that's after I tried to upload one (I think).

Buuuut yeah, I haven't set a key though I did set one when installing the docker - couldn't find a place to put it, until you mentioned it and I looked at the picture for the hundredth time 😁 I'll try and report back.

Yes, that's after I tried to upload one (I think). Buuuut yeah, I haven't set a key though I did set one when installing the docker - couldn't find a place to put it, until you mentioned it and I looked at the picture for the hundredth time 😁 I'll try and report back.
Owner

Yes, that's after I tried to upload one (I think).

There should have been a Nginx log, so I don't think so, can you try again and see if there is any extra logs?

> Yes, that's after I tried to upload one (I think). There should have been a Nginx log, so I don't think so, can you try again and see if there is any extra logs?
Author

No, that was all, really.

Let me try again. Restarted container, trying to upload a shot as I'm typing this, indeed no image in the destination directory.

Log:
Checking if upload script exists in /var/www/html
Upload script was found, ignoring copy.
Checking if default index.html exists in /var/www/html
Upload script was found, ignoring copy.
Setting permissions for upload script
Setting max upload size to 500M
Starting PHP & Nginx
Checking if upload script exists in /var/www/html
Upload script was found, ignoring copy.
Checking if default index.html exists in /var/www/html
Upload script was found, ignoring copy.
Setting permissions for upload script
Setting max upload size to 500M
Starting PHP & Nginx

(obviously appended to older log). That's all.

Regarding the secret, I've set it in the container config, however I cannot find the specific secret in the php file. Where should it be? (for the time being I set it as "set me" in ShareX to see if it gives me something back).

No, that was all, really. Let me try again. Restarted container, trying to upload a shot as I'm typing this, indeed no image in the destination directory. Log: Checking if upload script exists in /var/www/html Upload script was found, ignoring copy. Checking if default index.html exists in /var/www/html Upload script was found, ignoring copy. Setting permissions for upload script Setting max upload size to 500M Starting PHP & Nginx Checking if upload script exists in /var/www/html Upload script was found, ignoring copy. Checking if default index.html exists in /var/www/html Upload script was found, ignoring copy. Setting permissions for upload script Setting max upload size to 500M Starting PHP & Nginx (obviously appended to older log). That's all. Regarding the secret, I've set it in the container config, however I cannot find the specific secret in the php file. Where should it be? (for the time being I set it as "set me" in ShareX to see if it gives me something back).
Owner

You don't need to edit the php file, just the ones in the Unraid. Are you sure you are using the correct port? There should be some kind of logs in the container, I'm not sure why you aren't getting any

Accessing the website I get logs:

Upload script was found, ignoring copy.
Checking if default index.html exists in /var/www/html
Upload script was found, ignoring copy.
Setting permissions for upload script
Setting max upload size to 500M
Starting PHP & Nginx
[28/Feb/2024:18:30:00 +0000] "GET / HTTP/1.1" 200 449 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0"
[28/Feb/2024:18:30:01 +0000] "GET /favicon.ico HTTP/1.1" 200 4286 "http://10.0.0.136:8087/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0"```
You don't need to edit the php file, just the ones in the Unraid. Are you sure you are using the correct port? There should be some kind of logs in the container, I'm not sure why you aren't getting any Accessing the website I get logs: ```Checking if upload script exists in /var/www/html Upload script was found, ignoring copy. Checking if default index.html exists in /var/www/html Upload script was found, ignoring copy. Setting permissions for upload script Setting max upload size to 500M Starting PHP & Nginx [28/Feb/2024:18:30:00 +0000] "GET / HTTP/1.1" 200 449 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0" [28/Feb/2024:18:30:01 +0000] "GET /favicon.ico HTTP/1.1" 200 4286 "http://10.0.0.136:8087/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:123.0) Gecko/20100101 Firefox/123.0"```
Author

I mean... I do see the landing page, so I guess the port is correct?

Anyhow, tomorrow I'll try from scratch and let you know! (It's night here, I'm in Europe).

I mean... I do see the landing page, so I guess the port is correct? Anyhow, tomorrow I'll try from scratch and let you know! (It's night here, I'm in Europe).
Author

Sooo ok, I removed both the container and ShareX because I wasn't feeling lucky, installed everything anew, now it works fine :)

No idea what went wrong, and I apologise for taking your time. Thanks for your efforts (and the container, naturally!). :)

Sooo ok, I removed both the container and ShareX because I wasn't feeling lucky, installed everything anew, now it works fine :) No idea what went wrong, and I apologise for taking your time. Thanks for your efforts (and the container, naturally!). :)
Owner

no worries! I'm glad you got it all working:)

no worries! I'm glad you got it all working:)
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Fascinated/sharex-php-uploader#20
No description provided.