txAdmin icon indicating copy to clipboard operation
txAdmin copied to clipboard

[Feature]: Set proxy mode true/false

Open ablax opened this issue 4 years ago • 8 comments

Scope

Web

Feature Description

Set proxy mode true/false

Use Case

If someone want's to put txadmin behind proxy (cloudflare for example) they should still be able to get admins ip.

Proposed Solution

Add Convar

Additional Info

No response

ablax avatar Dec 20 '21 07:12 ablax

This is not possible, this is also how Tor works... Basically you can't get the admins IP... You can reverse proxy txAdmin on your own server, so you can view the admins IP in your proxy's log. (on my server I use nginx to do exactly what you want to do) If that what I am saying here is not true then please correct me

Comet1903 avatar Dec 20 '21 18:12 Comet1903

We are not talking about Tor here. When you run txadmin on your VPS, and an admin logs in, it will show the admin's IP in txadmin log. But having in mind that I do use nginx reverse proxy (just like you said) the txadmn no longer receives admin's IP, but instead it displays 127.0.0.1 (loopback address) because of the local proxy, and if you set it to add an header for forwarded-for address (just like cloudflare adds as well) and you set app.proxy to true koa automatically knows to use the header instead the IP making the request.

ablax avatar Dec 20 '21 19:12 ablax

Im pretty certain if you use cloudflare, or i hhave in the past, the authentic origin ip is stored as a header sent by cloudflare, which is the origin IP of the person making the request, and wont tell you cloudflares IP, PHPBB use this for there forum admin logs.

Rosw3lluk avatar Jan 02 '22 09:01 Rosw3lluk

Yes the IP is stored as a header from the proxy providers. And the purpose of this is to be able to get that IP, otherwise, txAdmin would be using Cloudflare's IP.

ablax avatar Jan 04 '22 07:01 ablax

txAdmin should/could just use X-RealIP / X-Forwarded-For, if either of those are set.

Doxylamin avatar Jan 23 '22 18:01 Doxylamin

txAdmin should/could just use X-RealIP / X-Forwarded-For, if either of those are set.

Pretty much it would be the same as enabling proxy mode. There is no difference.

ablax avatar Jan 23 '22 21:01 ablax

Except there would be no need for such proxy mode and/or manual changes, as it would be detected automatically.

Doxylamin avatar Jan 24 '22 09:01 Doxylamin

If you enable proxy mode (you can just do it in the code without var, it's disabled on purpose) it will also detect it automatically and will work as you described it. That's the whole purpose of it

ablax avatar Jan 24 '22 09:01 ablax