Allow multiple listenAddresses (fixes #52)

This commit is contained in:
Jakob Borg committed 2014-02-05 23:17:17 +01:00
1 parent 2297e29502
commit 3cb7b8f22b
4 files changed
+51 -19

No files matched your search

+1 -1
View File
@@ -3,4 +3,4 @@ package auto
import "github.com/cratonica/embed"
var Resources embed.PackedResourceMap = embed.PackedResourceMap{0x1f, 0x8b, 0x8, 0x0, 0x0, 0x9, 0x6e, 0x88, 0x2, 0xff, 0xec, 0xbd, 0x6b, 0x8c, 0x24, 0x59, 0x97, 0x18, 0x54, 0xdf, 0x7a, 0x97, 0xb5, 0x73, 0x9f, 0xb0, 0xc0, 0xee, 0x22, 0xb, 0xb2, 0x62, 0xea, 0xcb, 0x89, 0xe8, 0x8c, 0xca, 0xaa, 0xea, 0x99, 0xef, 0x15, 0x51, 0xd1, 0xb9, 0xd5, 0xd5, 0xd5, 0xaf, 0xe9, 0xaa, 0xea, 0xa9, 0xaa, 0xee, 0xe9, 0x99, 0xac, 0x9c, 0xd9, 0x1b, 0x8f, 0x7c, 0x4c, 0x46, 0x46, 0x66, 0x47, 0x64, 0xd6, 0xa3, 0x2b, 0x13, 0xfe, 0x60, 0x81, 0x41, 0xb6, 0x10, 0x48, 0xb0, 0x5a, 0x59, 0x2, 0x56, 0x96, 0x8c, 0x84, 0x85, 0xb5, 0xd2, 0x8a, 0xa7, 0x8d, 0x25, 0x4, 0x8, 0xd6, 0x1f, 0x12, 0x12, 0xfe, 0x63, 0xcb, 0x18, 0xc, 0x58, 0x60, 0xb4, 0xc2, 0xc8, 0x5a, 0x4, 0xec, 0x9a, 0x15, 0xe7, 0x9c, 0xfb, 0x88, 0x1b, 0x99, 0x51, 0xd5, 0xdd, 0xf3, 0xcd, 0xb7, 0xeb, 0x85, 0xae, 0x99, 0xdb, 0x19, 0x71, 0xe3, 0xc6, 0xbd, 0x37, 0xce, 0x3d, 0xf7, 0xdc, 0xf3, 0xba, 0xe7, 0xfe, 0xcc, 0xca, 0xca, 0x4a, 0xa3, 0x9f, 0x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x5b, 0x30, 0xb6, 0xf3, 0xc5, 0xac, 0xea, 0x7a, 0x75, 0x12, 0x59, 0xaf, 0xf9, 0x9, 0x97, 0xb7, 0x7d, 0x37, 0x79, 0x9d, 0xa6, 0xf5, 0x52, 0x97, 0xb6, 0x3c, 0x19, 0x9f, 0x95, 0x6, 0xa3, 0x3d, 0x1c, 0x57, 0xcd, 0x13, 0x7f, 0x5c, 0xed, 0x45, 0xd5, 0x5e, 0xc2, 0xdd, 0x2a, 0x8f, 0x57, 0xLine truncated
+34 -14
View File
@@ -27,20 +27,20 @@ type NodeConfiguration struct {
}
type OptionsConfiguration struct {
ListenAddress string `xml:"listenAddress" default:":22000" ini:"listen-address"`
ReadOnly bool `xml:"readOnly" ini:"read-only"`
AllowDelete bool `xml:"allowDelete" default:"true" ini:"allow-delete"`
FollowSymlinks bool `xml:"followSymlinks" default:"true" ini:"follow-symlinks"`
GUIEnabled bool `xml:"guiEnabled" default:"true" ini:"gui-enabled"`
GUIAddress string `xml:"guiAddress" default:"127.0.0.1:8080" ini:"gui-address"`
GlobalAnnServer string `xml:"globalAnnounceServer" default:"syncthing.nym.se:22025" ini:"global-announce-server"`
GlobalAnnEnabled bool `xml:"globalAnnounceEnabled" default:"true" ini:"global-announce-enabled"`
LocalAnnEnabled bool `xml:"localAnnounceEnabled" default:"true" ini:"local-announce-enabled"`
ParallelRequests int `xml:"parallelRequests" default:"16" ini:"parallel-requests"`
MaxSendKbps int `xml:"maxSendKbps" ini:"max-send-kbps"`
RescanIntervalS int `xml:"rescanIntervalS" default:"60" ini:"rescan-interval"`
ReconnectIntervalS int `xml:"reconnectionIntervalS" default:"60" ini:"reconnection-interval"`
MaxChangeKbps int `xml:"maxChangeKbps" default:"1000" ini:"max-change-bw"`
ListenAddress []string `xml:"listenAddress" default:":22000" ini:"listen-address"`
ReadOnly bool `xml:"readOnly" ini:"read-only"`
AllowDelete bool `xml:"allowDelete" default:"true" ini:"allow-delete"`
FollowSymlinks bool `xml:"followSymlinks" default:"true" ini:"follow-symlinks"`
GUIEnabled bool `xml:"guiEnabled" default:"true" ini:"gui-enabled"`
GUIAddress string `xml:"guiAddress" default:"127.0.0.1:8080" ini:"gui-address"`
GlobalAnnServer string `xml:"globalAnnounceServer" default:"syncthing.nym.se:22025" ini:"global-announce-server"`
GlobalAnnEnabled bool `xml:"globalAnnounceEnabled" default:"true" ini:"global-announce-enabled"`
LocalAnnEnabled bool `xml:"localAnnounceEnabled" default:"true" ini:"local-announce-enabled"`
ParallelRequests int `xml:"parallelRequests" default:"16" ini:"parallel-requests"`
MaxSendKbps int `xml:"maxSendKbps" ini:"max-send-kbps"`
RescanIntervalS int `xml:"rescanIntervalS" default:"60" ini:"rescan-interval"`
ReconnectIntervalS int `xml:"reconnectionIntervalS" default:"60" ini:"reconnection-interval"`
MaxChangeKbps int `xml:"maxChangeKbps" default:"1000" ini:"max-change-bw"`
}
func setDefaults(data interface{}) error {
@@ -57,6 +57,11 @@ func setDefaults(data interface{}) error {
case string:
f.SetString(v)
case []string:
rv := reflect.MakeSlice(reflect.TypeOf([]string{}), 1, 1)
rv.Index(0).SetString(v)
f.Set(rv)
case int:
i, err := strconv.ParseInt(v, 10, 64)
if err != nil {
@@ -121,6 +126,20 @@ func writeConfigXML(wr io.Writer, cfg Configuration) error {
return err
}
func uniqueStrings(ss []string) []string {
var m = make(map[string]bool, len(ss))
for _, s := range ss {
m[s] = true
}
var us = make([]string, 0, len(m))
for k := range m {
us = append(us, k)
}
return us
}
func readConfigXML(rd io.Reader) (Configuration, error) {
var cfg Configuration
@@ -132,5 +151,6 @@ func readConfigXML(rd io.Reader) (Configuration, error) {
err = xml.NewDecoder(rd).Decode(&cfg)
}
cfg.Options.ListenAddress = uniqueStrings(cfg.Options.ListenAddress)
return cfg, err
}
+3 -1
View File
@@ -11,7 +11,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
// Strings before bools look better
$scope.settings = [
{id: 'ListenAddress', descr:"Sync Protocol Listen Address", type: 'string', restart: true},
{id: 'ListenStr', descr:"Sync Protocol Listen Addresses", type: 'string', restart: true},
{id: 'GUIAddress', descr: "GUI Listen Address", type: 'string', restart: true},
{id: 'MaxSendKbps', descr: "Outgoing Rate Limit (KBps)", type: 'string', restart: true},
{id: 'RescanIntervalS', descr: "Rescan Interval (s)", type: 'string', restart: true},
@@ -49,6 +49,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
$http.get("/rest/config").success(function (data) {
$scope.config = data;
$scope.config.Options.ListenStr = $scope.config.Options.ListenAddress.join(", ")
var nodes = $scope.config.Repositories[0].Nodes;
nodes = nodes.filter(function (x) { return x.NodeID != $scope.myID; });
@@ -170,6 +171,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
};
$scope.saveSettings = function () {
$scope.config.Options.ListenAddress = $scope.config.Options.ListenStr.split(',').map(function (x) { return x.trim(); });
$http.post('/rest/config', JSON.stringify($scope.config), {headers: {'Content-Type': 'application/json'}});
$('#settingsTable').collapse('hide');
};
+13 -3
View File
@@ -208,13 +208,16 @@ func main() {
if verbose {
infoln("Listening for incoming connections")
}
go listen(myID, cfg.Options.ListenAddress, m, tlsCfg)
for _, addr := range cfg.Options.ListenAddress {
go listen(myID, addr, m, tlsCfg)
}
// Routine to connect out to configured nodes
if verbose {
infoln("Attempting to connect to other nodes")
}
go connect(myID, cfg.Options.ListenAddress, m, tlsCfg)
disc := discovery(cfg.Options.ListenAddress[0])
go connect(myID, disc, m, tlsCfg)
// Routine to pull blocks from other nodes to synchronize the local
// repository. Does not run when we are in read only (publish only) mode.
@@ -318,6 +321,9 @@ func printStatsLoop(m *model.Model) {
}
func listen(myID string, addr string, m *model.Model, tlsCfg *tls.Config) {
if strings.Contains(trace, "connect") {
debugln("NET: Listening on", addr)
}
l, err := tls.Listen("tcp", addr, tlsCfg)
fatalErr(err)
@@ -369,7 +375,7 @@ listen:
}
}
func connect(myID string, addr string, m *model.Model, tlsCfg *tls.Config) {
func discovery(addr string) *discover.Discoverer {
_, portstr, err := net.SplitHostPort(addr)
fatalErr(err)
port, _ := strconv.Atoi(portstr)
@@ -392,6 +398,10 @@ func connect(myID string, addr string, m *model.Model, tlsCfg *tls.Config) {
warnf("No discovery possible (%v)", err)
}
return disc
}
func connect(myID string, disc *discover.Discoverer, m *model.Model, tlsCfg *tls.Config) {
connOpts := map[string]string{
"clientId": "syncthing",
"clientVersion": Version,