Project

General

Profile

Actions

Feature #3266

closed

$HTTP["localip"]

Added by Anuskuss 4 months ago. Updated 4 months ago.

Status:
Invalid
Priority:
Low
Category:
-
Target version:
-
ASK QUESTIONS IN Forums:
No

Description

I want to use some logic involving the current IP of my server, specifically I wanna do
```
$HTTP["remoteip"] == $HTTP["localip"] {
```

Actions #1

Updated by gstrauss 4 months ago

  • Tracker changed from Bug to Feature
  • Status changed from New to Invalid
  • Priority changed from Normal to Low
  • Target version deleted (1.4.xx)

This is the lighttpd issue tracker for issues in lighttpd. It is not for user questions. It is not for people who fail to read before posting, i.e. you.

How to get support

In case my message was not abundantly clear: Do not post here again. Where should you post? Read the above. Do not post here.

Actions #2

Updated by Anuskuss 4 months ago

This was not a "user question" and I don't need "support". This was a feature request made with an example of how it could be used. I don't know why you're so overzealous to discredit a user for being "too dumb to read"?

Actions #3

Updated by gstrauss 4 months ago · Edited

You filed your "feature" request as a "bug".

You failed to acknowledge that a machine can (and often does) have multiple IPs, including 127.0.0.1, [::1], and then possibly multiple public-facing IPs.

You have still failed to read How to get support or failed to understand the links apply to you, specifically:

Are you asking an XY problem? https://xyproblem.info/ (external link)

and

A general guide to asking technical questions well can be found at http://catb.org/~esr/faqs/smart-questions.html (external link)

.


.

I don't know why you're so overzealous to discredit a user for being "too dumb to read"?

Q.E.D.

Actions #4

Updated by Anuskuss 4 months ago · Edited

You filed your "feature" request as a "bug".

I did not; I specifically selected "Feature". I created a new issue (https://redmine.lighttpd.net/issues/3267) and double-checked it and it again looks like a "Bug" to me. The issue is on your side and I think you're being unnecessarily condescending.

You failed to acknowledge that a machine can (and often does) have multiple IPs, including 127.0.0.1, [::1]

That could've been part of the discussion instead of an afterthought. I would've then suggested making it a list and comparing a value against that list, or with my own example $HTTP["remoteip"] == $HTTP["localip"] would translate into "192.168.0.2" in ["127.0.0.1","::1","192.168.0.2"] which would be true in this case. An alternative could be $HTTP["localip"] =~ $HTTP["remoteip"] which would translate into "127.0.0.1|::1|192.168.0.2" =~ "192.168.0.2" or in pseudo-code re.search('/192.168.0.2/','127.0.0.1|::1|192.168.0.2'). That's the point of a discussion. Stop being so miserable and act like a human please.

then possibly multiple public-facing IPs.

Now you're taking the piss. Who said anything about public IPs? It's pretty clear to me that $HTTP["localip"] refers to private network IP addresses (e.g. 192.168.0.0/16). If you want to be extra pendantic about it you could also include the the localhost (e.g. 127.0.0.1). This is all information that lighttpd already has because it knows on which IPs/interfaces to bind.

Are you asking an XY problem?

No, I am not.

Actions #5

Updated by gstrauss 4 months ago

In my initial response, I wrote:

In case my message was not abundantly clear: Do not post here again. Where should you post? Read the above. Do not post here.

Since you have failed reading comprehension multiple times, your account here has been locked. Please show yourself out and go away.

Actions #6

Updated by gstrauss 4 months ago

Those reading this should discount just about everything said by Anuskuss, since almost all of it is wrong or false.

Anuskuss did specify an XY problem (https://xyproblem.info/ (external link)) but did not recognize it, or that lighttpd could already do those things, though maybe not with Anuskuss' read-my-mind syntax.

Configuration: File Syntax contains an example using $HTTP["remoteip"] with a regex to match IPs.
(Unlike in the fabricated and somewhat nonsensical syntax from Anuskuss above, the regex example in Configuration: File Syntax shows a regex matching the full IP addresses.

For those with more specific needs, mod_magnet and a custom lua script allow matching an arbitrary list of IPs.

Actions

Also available in: Atom