AndrewPaglusch / FlashPaper

One-time encrypted password/secret sharing
MIT License
374 stars 60 forks source link

Cloudflare Tunnel Access Flashpaper? #112

Closed piptravels closed 1 year ago

piptravels commented 1 year ago

I installed Flashpaper on my homelab server and it comes up locally, however when I add it to my Cloudflare zero trust tunnel 'http' with :8080 and path /flashpaper (and without) I hear a tiny electronic laughter as it doesn't come up. It seems to be redirecting to http from my public hostname sub-domain link. Any help would be most grateful as I love the program 5

AndrewPaglusch commented 1 year ago

Hey @piptravels, thanks for opening this issue. I'm really happy to hear that you like FlashPaper.

If I am understanding your issue correctly, I think I may have a solution. Please give the base_url setting a try. It was implemented to help with situations exactily like this. Here's some more info about how it works.

If that doesn't help resolve the issue, let me know and we'll troubleshoot further.

xHyperElectric commented 1 year ago

I'm using FlashPaper inside of TrueNAS Scale and attempting to use Cloudflare tunnels to access flashpaper with my domain name. I entered: "base_url: https://flashpaper.mydomain.com" and entered the proper stuff on Cloudflare. However, I'm not able to connect through my domain. Similar issue to piptravels. I can access flashpaper locally, however only with HTTP as I don't have a reverse proxy.

AndrewPaglusch commented 1 year ago

@piptravels @xHyperElectric Can you both please post your FlashPaper config, CloudFlare config, and any other relevant config or information? I would like to try to reproduce the issue on my end.

xHyperElectric commented 1 year ago

I'm using the default config on TrueNAS scale (truecharts) with the only change being the base URL. The default config equates to:

      SITE_TITLE: "FlashPaper :: Self-Destructing Message"
      RETURN_FULL_URL: "true"
      BASE_URL: "" # https://mydomain.com/flashpaper
      MAX_SECRET_LENGTH: "3000"
      ANNOUNCEMENT: ""
      MESSAGES_ERROR_SECRET_TOO_LONG: "Input length too long"
      MESSAGES_SUBMIT_SECRET_HEADER: "Create A Self-Destructing Message"
      MESSAGES_SUBMIT_SECRET_SUBHEADER: ""
      MESSAGES_SUBMIT_SECRET_BUTTON: "Encrypt Message"
      MESSAGES_VIEW_CODE_HEADER: "Self-Destructing URL"
      MESSAGES_VIEW_CODE_SUBHEADER: "Share this URL via email, chat, or another messaging service. It will self-destruct after being viewed once."
      MESSAGES_CONFIRM_VIEW_SECRET_HEADER: "View this secret?"
      MESSAGES_CONFIRM_VIEW_SECRET_BUTTON: "View Secret"
      MESSAGES_VIEW_SECRET_HEADER: "Self-Destructing Message"
      MESSAGES_VIEW_SECRET_SUBHEADER: "This message has been destroyed"
      PRUNE_ENABLED: "true"
      PRUNE_MIN_DAYS: 365
      PRUNE_MAX_DAYS: 730

And my base URL is "base_url: https://flashpaper.mydomain.com/"

I have cloudflared running as another TrueNAS Scale chart. Cloudflare is able to create tunnels with all of my other applications the same way, but for some reason, I cannot get it to connect to flashpaper. Cloudflare setup: cloudflare (the "flashpaper.ix-flashpaper.svc.cluster.local:8544" is the local DNS name of the flashpaper instance inside of TrueNAS and should be correct)

I'm unsure what else I could provide. I could hop in a Discord call with you to help you troubleshoot if necessary.

piptravels commented 1 year ago

I was able to access it once I added the Base_url thanks so much for your reply.

xHyperElectric commented 1 year ago

For some reason, it works now after changing nothing. Must've taken Cloudflare time to update.

AndrewPaglusch commented 1 year ago

Thanks for the updates. It sounds like you've both resolved the issue. I'll go ahead and close this. Feel free to reply if the issue comes back.