Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Set proxy mode true/false #535

Open
ablax opened this issue Dec 20, 2021 · 8 comments
Open

[Feature]: Set proxy mode true/false #535

ablax opened this issue Dec 20, 2021 · 8 comments
Labels
enhancement New feature or request

Comments

@ablax
Copy link

ablax commented Dec 20, 2021

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 ablax added the enhancement New feature or request label Dec 20, 2021
@Comet1903
Copy link
Contributor

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

@ablax
Copy link
Author

ablax commented Dec 20, 2021

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.

@Rosw3lluk
Copy link

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.

@ablax
Copy link
Author

ablax commented Jan 4, 2022

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.

@Doxylamin
Copy link

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

@ablax
Copy link
Author

ablax commented Jan 23, 2022

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.

@Doxylamin
Copy link

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

@ablax
Copy link
Author

ablax commented Jan 24, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants