ShaneIsrael / fireshare

Self host your media and share with unique links

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discord integration broken

Mahh0 opened this issue · comments

commented

I'm trying to setup FireShare to share videos through discord using discord auto-embed (like YouTube) but it doesn't work (I've opened my port 80)

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
Auto-embed working

Screenshots
image
As you can see it's stuck at 0:00/0:00. The preview works.

Desktop (please complete the following information):
I tried from my phone, from discord windows app and discord web

Additional context
I tried with small MP4 (46mb) and MOV file

image

I tested this just now on the latest version and it is working as intended for me on Discord. Either it is an issue with discord or an issue with your video file itself or potentially your reverse proxy setup around Fireshare. Make sure your videos are h264 encoded.

All I can say is that it is not an issue with Fireshare.

commented

I don't understand... I tried with my own file and also a downloaded youtube video that I just converted to H264 using handbrake but it's still not working ..
I don't have a reverse proxy setup.
The container is run on a raspberry pi, can't that be because of this ?

Fireshare needs to be web accessible for your links in discord to work. They might still work for you if your running fireshare locally but anybody you send the clips too is not going to be able to play them unless your fireshare instance is web accessible under a domain name.

commented

it is web accessible, we can see it with the thumbnail showing ..

Docker-compose
version: "3"
services:
fireshare:
container_name: fireshare
image: shaneisrael/fireshare:latest
ports:
- "8080:80"
volumes:
- /srv/fireshare/data:/data
- /srv/fireshare/processed:/processed
- /srv/fireshare/videos:/videos
environment:
- ADMIN_USERNAME=admin
- ADMIN_PASSWORD=hidden
- SECRET_KEY=hidden
- MINUTES_BETWEEN_VIDEO_SCANS=5
- PUID=1012
- PGID=1012

Router (8080 IN / 80 OUT)
image

The web server is accessible from the outside using my DDNS. When going on the website, the video is playable but not using discord integration (from my home network AND from outside)

I've tried running the container on a windows computer to eliminate a raspberry pi problem, but I still have the same issue

I'm not sure what to say then. It's not an issue in Fireshare as every single one of my videos plays in discord just fine. You click play and you might have to wait 2-3 seconds but the video does end up playing.

You can test this yourself. Paste this that I'm about to link you into your discord server and it should play no problem. This specific video is very large in file size, but it will play so long as your download speed is decent.

https://v.fireshare.net/w/396cbfca399a9888b423deb3e6f4481e

Also make sure you are posting the "share" links in your discord server. They should be .../w/ NOT .../#/w/. Links with the # in them will not play in discord or other apps.

You can get the share link by clicking on any of the share links in fireshare.
image
image

But if you are copying the link directly from the browser url bar you are getting the .../#/w/ link which will not work.

commented

That's what I'm doing, I'm having http://mydomain/w/20d04ff5ebbaafa5a29ab3fb4810

There is something I'm missing but I can't find what..

commented

Did you try my link? Does my link work in your discord server?

commented

Yes, it works with your link. I tried on several servers and double checked my account settings.

I thought it might come from discord which could block HTTP but your link works with HTTP and HTTPS

Your link works in the browser but not in discord. And it could be because its not behind https, not sure though since I have no idea how discord handles that.

In the case of mine, I have my reverse proxy set up to forward all http traffic to https. So even if you put it discord as http, it will be forwarded to https.

I would try to get yours setup behind https which you could do by using letsencrypt to get yourself an ssl certificate.

commented

Just tested with HTTPS on my windows docker desktop environment and it's working ! It looks like it was the issue...
Tysm for the help, I will now have fun with fireshare

I added the following in /etc/nginx/nginx.conf

listen 443 ssl default_server;
listen [::]:443 ssl default_server;

And then ran the following command to create the certficiate and update nginx conf :

certbot --nginx -d maho.ddns.net

I selected an option to redirect http to https so that makes http access also work

Now I need to find a definitive solution, I don't really know how docker and nginx works but if my container is restarted, or updated I will loose everything ..

So maybe I can set the cerbot and the nginx file and my host os and specify them as files in the docker-compose ? Or maybe update the docker file ?

You can create a volume map with docker which will map a directory on your machine into the docker container. Then any files saved to that location in the docker container will exist on your machine so that if you reset the docker container you don't lose those files. (i.e the nginx conf files and letsencrypt certs).

Personally, if you want a minimal setup that "just works" I would use Nginx Proxy Manager.

https://nginxproxymanager.com/guide/#quick-setup

Has a very simple docker setup with a volume map so that your configs are not lost. Provides a very nice and intuitive user interface to create your proxy host, and will create yours ssl certificate via letsencrypt for you.

commented

Can you give me an example of configuration please ?

If I understand, fireshare is configured to work only with HTTP and HTTPS is between nginx proxy manager and user ? Sorry but i don't understand well reverse proxy

Just as a side note;
If you're running FireShare behind a Reverse proxy and your Domain is protected by Cloudflare. ENSURE CLOUDFLARE CACHING IS DISABLED FOR THE SUBDOMAIN. This has caused me so many hours of wasted time. Especially when troubleshooting Discord not Embedding things properly. This could likely help if you're instance set up behind CF

@Mahh0 yes you are correct.

Fireshare by itself uses only http, but you have https setup between nginx (i.e nginxproxymanager) and your end user. Nginx then forwards that decrypted traffic from the end user on https to your fireshare container listening on http.

This is fine because nginx and fireshare should be running on the same machine. You want the traffic from outside your machine/server to be encrypted.

I am going to consider this issue resolved.