Commit Graph

121 Commits

Author SHA1 Message Date
Ivan Kozlovic
8b4a02dd9a Pass functions to ConfigureOptions to print version, help, tls help
This will allow NATS Streaming to provide its own version of what
should be printed when various flags are set.

Related to #578
2017-09-08 09:59:04 -06:00
Ivan Kozlovic
6ba9269cda Added error check for fs.Parse() call
This is just for tests since from main.go, the FlagSet is set
with ExitOnError so Parse() would call os.Exit(2).
Regardless, I wanted to add error checking and a test for that.

Related to #578
2017-09-07 10:37:46 -06:00
Ivan Kozlovic
379a14b8cc [FIXED] Override from command line not always working
There were some cases where override would not work. Any command
line parameter that would be set to the type default value (false
for boolean, "" for string, etc) would not be taken into account.

I moved all the flags parsing and options configuration into
a new function, which may help reduce code duplication in
NATS Streaming.

The other advantage of moving this in a function is that it
can now be unit tested.

I am also removing call to `RemoveSelfReference()` which attempted
to remove a route to self, which has been already solved at runtime
with detecting and ignoring a route to self.

This function would be invoked only when routes were defined in
the configuration file, not in the command line parameter.

Removing this call also solves an user issue (#577)

Resolves #574
Resolves #577
2017-09-06 17:31:53 -06:00
Tyler Treat
ca1b3485cb Fix "error opening file" errors in tests for Windows
This sort of just punts on the problem by not creating log files in the
tests, but it seemed like the simplest solution.
2017-07-10 12:21:01 -05:00
Peter Miron
5724da1c27 Merge pull request #512 from nats-io/random_port_extended
Random port extended
2017-06-14 08:08:45 -04:00
Peter Miron
c655c2939e added additional opts tests to increase coverage. 2017-06-12 18:28:53 -04:00
Derek Collison
482b6a9e46 Merge pull request #507 from nats-io/fix_opts_copy
Fix Options Clone
2017-06-09 06:55:36 -07:00
Ivan Kozlovic
923735ac74 Updated test to suppress stdout output
The parsing of write_deadline may produce a warning to stdout
since there is no logger set at this stage.
Updated the test to suppress stdout to not polute the tests output.
2017-06-08 19:40:06 +02:00
Tyler Treat
5d36a7797e Fix Options Clone
Ensure Options.Clone() only initializes Users and Routes when the
Options it's cloning has them initialized.
2017-06-07 16:54:40 -05:00
Tyler Treat
cc30af8ede Address code review feedback 2017-06-05 17:43:42 -05:00
Tyler Treat
9902c3da84 First pass at implementing config reload 2017-05-30 16:18:36 -05:00
Ivan Kozlovic
3b6dc5eb2f Changed write_deadline configuration type
Changing from being the number of seconds to a time.Duration.
For backward compatibility, the configuration with the number
of seconds is still accepted but an error message is printed
asking the user to convert to duration.

Resolves #487
2017-05-06 14:20:01 -06:00
Derek Collison
45d523e800 Fixups for auth always being checked now 2017-04-20 13:26:59 -07:00
Ivan Kozlovic
0cf8455a3a [ADDED] Support for token in configuration file
So far, it was only possible to use token from the command line.

Resolves #464
2017-03-30 11:23:07 -06:00
Ivan Kozlovic
27bfed541c Fixed errors found by staticcheck
Staticcheck has probably been updated and is finding new errors.
They have been fixed.

Also, moved the run of staticcheck before running the test suite,
so if it fails, it fails sooner ;-).
2017-01-24 19:34:17 -07:00
Ivan Kozlovic
95d0152449 [ADDED] Make Write deadline configurable
We use a hardcoded value of 2 seconds for Write deadline when
writing data to client's socket.
This PR makes that value configurable.

Question is should we push the setting down to the client's object
to avoid indirection such as client.srv.opts.WriteDeadline?
2017-01-18 20:33:44 -07:00
Colin Sullivan
b133cda3cd Add curve preference option to configuration files.
* Add a preference to specify and order the curve preferences
* Add details tls help
* Deprecate old 1.4 cipher suite code
2016-12-27 15:41:48 -07:00
Ivan Kozlovic
d3555053d0 Change option/parameter name 2016-12-22 14:59:27 -07:00
Ivan Kozlovic
a8dfaeae3d [ADDED] Ability to configure number of connect retries for implicit routes
When a server is told to connect to a server (with auto-discovery),
it tries to connect once. There have been a report where that
connection fails, but would probably succeed if tried again (#408).
This new parameter allows to configure the number of times a failed
implicit connect should be tried.

Resolves #408
2016-12-20 18:37:23 -07:00
Derek Collison
8fbacaaea1 Cleanup for cluster opts 2016-12-02 14:29:22 -08:00
Waldemar Quevedo
2a8aa96af4 Remove "max_pending_size" option
Previous implementations of the server checked the pending data size
being currently buffered for a client to detect slow consumers,
though this does not apply to latest version of the server so removing
it as a config option to avoid confusion as it is not implemented.
2016-11-22 20:07:39 -08:00
Volodymyr Khoroz
a35d98eebe [#370] Treat ping interval from config as seconds (there is no point in smaller granularity). 2016-11-16 00:31:38 +02:00
Volodymyr Khoroz
a98b51a5ca [#370] Ability to configure ping_interval and ping_max (with tests) 2016-11-16 00:31:38 +02:00
Waldemar Quevedo
e46b187230 Enables using the same listen from server as was specified via -a
in the cmd line for the monitoring server as well.
2016-08-17 23:08:37 -07:00
Ivan Kozlovic
82dbb3a5ab [ADDED] Option to not advertise to clients cluster's IPs
By default, a server is now sending to its clients the client URLs
of all servers in the cluster. This allows clients to be able
to reconnect to any server in the cluster even if those clients
were not configured with the list of servers in the cluster.

However, there may be cases where it would make sense to disable
this feature. This now can be done with this option/command line
parameter.

Resolves #322
2016-08-12 19:24:12 -06:00
Ivan Kozlovic
5185f10fed [FIXED] Route/Cluster override
If the server was started with a cluster section in a configuration
file and one would want to override the routes (using `-routes`) the
server would complain that you need to use `-cluster`. Adding
an override of cluster would not work, server would still complain.
Trying to override simply the cluster listen info (without override
of routes) would also not work.
2016-08-04 13:20:25 -06:00
Derek Collison
67ed61c837 fixups for PR comments 2016-06-17 09:59:39 -07:00
Derek Collison
7730fac9e2 Authorization enforcement and performance tweaks 2016-06-16 17:07:25 -07:00
Derek Collison
449aa6e8ef Finalized opts parser for subject authorization 2016-06-16 13:49:26 -07:00
Derek Collison
1d74a0dea3 First pass authorization parser 2016-06-16 10:10:52 -07:00
Derek Collison
46a9e6f0bc First pass at multi-user support 2016-05-13 12:27:57 -07:00
Derek Collison
9e73c1db76 Enable listen address parsing for client, cluster and http, enforce http hosts as separate 2016-05-12 16:47:01 -07:00
Derek Collison
1ebf896980 Fixup for default options 2016-05-03 16:51:23 -07:00
Derek Collison
b3388db53f Enable dynamic write buffers for client connections 2016-04-15 18:16:13 -07:00
Derek Collison
433d62ec0a Parse IPs and raw strings in arrays properly 2016-04-07 08:36:57 -07:00
Derek Collison
f23f55518c gosimple fixes 2016-03-31 07:28:40 -07:00
Ivan Kozlovic
9b25a379b8 Increase TLS timeout in config files
We would get failures on Travis, I would think because of small TLS timeout. Increase (or set) the TLS timeout to 2 seconds in most configuration files. Update tests that relied on the original value.
2015-12-08 15:20:20 -07:00
Ivan Kozlovic
1851ffa162 Temporary fix for Travis issues on new GCE 2015-12-07 18:22:53 -07:00
Colin Sullivan
bb286ba424 Merge branch 'master' into tls_add_cipher 2015-11-23 10:55:43 -07:00
Colin Sullivan
790578f3f4 Add negative tests for cipher_suite configurations. 2015-11-22 17:21:22 -07:00
Derek Collison
647213b1d7 TLS timeout handling for routes 2015-11-22 15:07:44 -08:00
Derek Collison
3b64567f00 tls flags, proper timeouts 2015-11-22 14:43:16 -08:00
Derek Collison
055f1dccb3 Allow test to use correct default ciphers 2015-11-22 08:34:06 -08:00
Colin Sullivan
936259e0d6 Removed the requirement for cipher_suites configuration in TLS and added default ciphers. 2015-11-21 21:15:35 -07:00
Colin Sullivan
0ff1b55fa9 Require cipher suites to be specified in the configuration.
* Configuration requires a cipher suite
* Removed default cipher suites
* Added help to assist with TLS configuration and list available cipher suites.
2015-11-20 16:00:25 -07:00
Colin Sullivan
0675a8fd1f Update test to include expanded cipher suite. 2015-11-19 16:22:57 -07:00
Derek Collison
ec258ac18d Moved certs and changed to simple hostname 2015-11-05 15:35:50 -08:00
Derek Collison
eb46d7b05b Comment ciphers from test too 2015-10-23 08:47:13 -07:00
Derek Collison
b75c7b1522 comment out 1.5 only ciphers for now. 2015-10-23 08:43:03 -07:00
Derek Collison
749d4f89cc First pass at client TLS support 2015-10-22 03:30:27 +02:00