Browse Source

PROXY: Remove command, I don't think it's that useful

tags/v0.2.0
Daniel Oaks 7 years ago
parent
commit
43e28e2fef
8 changed files with 10 additions and 55 deletions
  1. 1
    0
      CHANGELOG.md
  2. 0
    8
      README.md
  3. 1
    2
      irc/client.go
  4. 0
    5
      irc/commands.go
  5. 8
    9
      irc/config.go
  6. 0
    7
      irc/help.go
  7. 0
    19
      irc/server.go
  8. 0
    5
      oragono.yaml

+ 1
- 0
CHANGELOG.md View File

@@ -20,6 +20,7 @@ Improved compatibility, more features, etc.
20 20
 
21 21
 ### Removed
22 22
 * Removed channel persistence with the `+P` mode (not too useful as currently implemented, to be replaced later).
23
+* Removed the `PROXY` command (breaks our TLS user mode, and our integrated support for TLS should be fine).
23 24
 
24 25
 ### Fixed
25 26
 

+ 0
- 8
README.md View File

@@ -25,14 +25,6 @@ This project adheres to [Semantic Versioning](http://semver.org/). For the purpo
25 25
 * client accounts and SASL
26 26
 * IRCv3 support
27 27
 
28
-### What about TLS/SSL?
29
-
30
-There is inbuilt TLS support using the Go TLS implementation. However,
31
-[stunnel](https://www.stunnel.org/index.html) version 4.56 with haproxy's
32
-[PROXY protocol](http://haproxy.1wt.eu/download/1.5/doc/proxy-protocol.txt)
33
-may also be used. This will allow the server to get the client's original
34
-addresses for hostname lookups.
35
-
36 28
 ## Installation
37 29
 
38 30
 ```sh

+ 1
- 2
irc/client.go View File

@@ -126,8 +126,7 @@ func (client *Client) run() {
126 126
 	var line string
127 127
 	var msg ircmsg.IrcMessage
128 128
 
129
-	// Set the hostname for this client. The client may later send a PROXY
130
-	// command from stunnel that sets the hostname to something more accurate.
129
+	// Set the hostname for this client
131 130
 	client.hostname = AddrLookupHostname(client.socket.conn.RemoteAddr())
132 131
 
133 132
 	//TODO(dan): Make this a socketreactor from ircbnc

+ 0
- 5
irc/commands.go View File

@@ -146,11 +146,6 @@ var Commands = map[string]Command{
146 146
 		handler:   privmsgHandler,
147 147
 		minParams: 2,
148 148
 	},
149
-	"PROXY": {
150
-		handler:      proxyHandler,
151
-		usablePreReg: true,
152
-		minParams:    5,
153
-	},
154 149
 	"SANICK": {
155 150
 		handler:   sanickHandler,
156 151
 		minParams: 2,

+ 8
- 9
irc/config.go View File

@@ -72,15 +72,14 @@ type Config struct {
72 72
 
73 73
 	Server struct {
74 74
 		PassConfig
75
-		Password         string
76
-		Name             string
77
-		Listen           []string
78
-		Wslisten         string                      `yaml:"ws-listen"`
79
-		TLSListeners     map[string]*TLSListenConfig `yaml:"tls-listeners"`
80
-		CheckIdent       bool                        `yaml:"check-ident"`
81
-		Log              string
82
-		MOTD             string
83
-		ProxyAllowedFrom []string `yaml:"proxy-allowed-from"`
75
+		Password     string
76
+		Name         string
77
+		Listen       []string
78
+		Wslisten     string                      `yaml:"ws-listen"`
79
+		TLSListeners map[string]*TLSListenConfig `yaml:"tls-listeners"`
80
+		CheckIdent   bool                        `yaml:"check-ident"`
81
+		Log          string
82
+		MOTD         string
84 83
 	}
85 84
 
86 85
 	Datastore struct {

+ 0
- 7
irc/help.go View File

@@ -187,13 +187,6 @@ Replies to a PING. Used to check link connectivity.`,
187 187
 		text: `PRIVMSG <target>{,<target>} <text to be sent>
188 188
         
189 189
 Sends the text to the given targets as a PRIVMSG.`,
190
-	},
191
-	"proxy": {
192
-		oper: true, // not really, but it's restricted anyways
193
-		text: `PROXY TCP4/6 <sourceip> <destip> <sourceport> <destport>
194
-        
195
-Used by haproxy's PROXY protocol, to allow for alternate TLS support:
196
-http://www.haproxy.org/download/1.7/doc/proxy-protocol.txt`,
197 190
 	},
198 191
 	"sanick": {
199 192
 		oper: true,

+ 0
- 19
irc/server.go View File

@@ -51,7 +51,6 @@ type Server struct {
51 51
 	passwords           *PasswordManager
52 52
 	accountRegistration *AccountRegistration
53 53
 	signals             chan os.Signal
54
-	proxyAllowedFrom    []string
55 54
 	whoWas              *WhoWasList
56 55
 	isupport            *ISupportList
57 56
 	checkIdent          bool
@@ -97,7 +96,6 @@ func NewServer(config *Config) *Server {
97 96
 		newConns:         make(chan clientConn),
98 97
 		operators:        config.Operators(),
99 98
 		signals:          make(chan os.Signal, len(SERVER_SIGNALS)),
100
-		proxyAllowedFrom: config.Server.ProxyAllowedFrom,
101 99
 		whoWas:           NewWhoWasList(config.Limits.WhowasEntries),
102 100
 		checkIdent:       config.Server.CheckIdent,
103 101
 	}
@@ -416,23 +414,6 @@ func passHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
416 414
 	return false
417 415
 }
418 416
 
419
-// PROXY TCP4/6 SOURCEIP DESTIP SOURCEPORT DESTPORT
420
-// http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt
421
-func proxyHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
422
-	clientAddress := IPString(client.socket.conn.RemoteAddr())
423
-	clientHostname := client.hostname
424
-
425
-	for _, address := range server.proxyAllowedFrom {
426
-		if clientHostname == address || clientAddress == address {
427
-			client.hostname = LookupHostname(msg.Params[1])
428
-			return false
429
-		}
430
-	}
431
-
432
-	client.Quit("PROXY command is not usable from your address")
433
-	return true
434
-}
435
-
436 417
 // USER <username> * 0 <realname>
437 418
 func userHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
438 419
 	if client.registered {

+ 0
- 5
oragono.yaml View File

@@ -41,11 +41,6 @@ server:
41 41
     # if you change the motd, you should move it to ircd.motd
42 42
     motd: oragono.motd
43 43
 
44
-    # addresses/hostnames the PROXY command can be used from
45
-    proxy-allowed-from:
46
-        - "localhost"
47
-        - "127.0.0.1"
48
-
49 44
 # account/channel registration
50 45
 registration:
51 46
     # account registration

Loading…
Cancel
Save