cydrobolt / polr

:aerial_tramway: A modern, powerful, and robust URL shortener
https://polrproject.org
GNU General Public License v2.0
4.97k stars 890 forks source link

Running Polr with no public access #570

Open ifuchs opened 3 years ago

ifuchs commented 3 years ago

If I wish to run an instance of Polr that is restricted to logged in users, is it as simple as setting the public instance option to FALSE or is there more required?

DBX12 commented 3 years ago

It is sufficient to set said option to false. It shows the inputs but once you click "shorten" it says you need to log in. Of course you can ~use~ follow already shortened links.

Edit: changed ambiguous wording

ifuchs commented 3 years ago

Thank you. Am I correct that if my domain is my.domain then local files that were heretofore accessible as my.domain/filename must now be accessed at www.my.domain/filename? In order to continue using the original name for the local file (it is used in some shortcuts), could I create a shortened url for www.my.domain/filename?

DBX12 commented 3 years ago

I'm not sure if I understood you correctly. According to the setup guide, you have to point the document root of your website to the public folder of this project. So any files outside of the public folder would not be accessible at all. Inside the public folder, all requests are redirected to the index.php which handles all requests.

So long story short, I probably cannot access other files on your domain.

ifuchs commented 3 years ago

I guess I wasn’t being clear. I have files that are now accessible as https://my.domain/file And I would like to be able to continue accessing them with that URL. If I run polar and all short and domains begin with http://my.domain, then I presume that my files will be in accessible. First of all, is that correct? Second, is there a way around this by creating a shortcut to http://www.my.domain/file which would be accessible as http://my.domain/file as before?

On Mon, Oct 26, 2020 at 10:08 AM DBX12 notifications@github.com wrote:

I'm not sure if I understood you correctly. According to the setup guide, you have to point the document root of your website to the public folder of this project. So any files outside of the public folder would not be accessible at all. Inside the public folder, all requests are redirected to the index.php which handles all requests.

So long story short, I probably cannot access other files on your domain.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cydrobolt/polr/issues/570#issuecomment-716570108, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLDPSGYW4DCOMESQBSNQA3SMV7GFANCNFSM4S6WODJQ .

DBX12 commented 3 years ago

If you use an Apache2 webserver and the .htaccess can be parsed (that depends on your webserver settings), you can reach all files sitting i the public directory (so you have to move the files you want to access there). That is not the recommended approach as it might lead to conflicts with the shorturls, as you already figured. With the scenario I just described, you would only get the static file, the shorturl will not be accessible.

The best solution for your usecase would be having polr installed as a subdomain (e.g. http://s.my.domain/)

ifuchs commented 3 years ago

OK, thanks. Just to be clear, my idea of creating shortcuts for the http://www.my.domain/file to http://my.domain/File would not work?

On Mon, Oct 26, 2020 at 10:59 AM DBX12 notifications@github.com wrote:

If you use an Apache2 webserver and the .htaccess can be parsed (that depends on your webserver settings), you can reach all files sitting i the public directory (so you have to move the files you want to access there). That is not the recommended approach as it might lead to conflicts with the shorturls, as you already figured. With the scenario I just described, you would only get the static file, the shorturl will not be accessible.

The best solution for your usecase would be having polr installed as a subdomain (e.g. http://s.my.domain/)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cydrobolt/polr/issues/570#issuecomment-716603623, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLDPSGAURXV7I3WQEGFOVDSMWFEPANCNFSM4S6WODJQ .

DBX12 commented 3 years ago

Assuming http://www.my.domain hosts polr and http://my.domain/ hosts the actual file, and both are independent webspaces, that would work. However, it is basically living standard to have the hosts www.domain.tld and domain.tld interchangeable and redirecting to one (e.g. https://www.github.com redirects to https://github.com), I would propose to use a different subdomain.