68 Commits
Author SHA1 Message Date
Hanzo AI 06d1250a5d deps: luxfi/zapdb v4 → v1.0.0 (module path reset) 2026-04-11 00:05:22 -07:00
Hanzo AI ef6bf41739 add ZAP transport and /v1/pubsub/* HTTP management routes
ZAP (luxfi/zap) listener on port 9222 for binary RPC control plane
operations (create/delete/list streams, publish, health check).
HTTP management API on port 9280 wrapping NATS monitoring endpoints
and JetStream stream info. NATS client protocol on 4222 unchanged.
2026-04-09 18:29:12 -07:00
Neil TwiggandZach Kelling 1f289f30f0 Remove automaxprocs, as this is default Go behaviour since Go 1.25
Signed-off-by: Neil Twigg <neil@nats.io>
2026-02-22 00:55:09 -08:00
Neil Twigg 4df1ba44c7 Correct copyrights in .go files
Signed-off-by: Neil Twigg <neil@nats.io>
2025-06-04 10:18:55 +01:00
Neil Twigg d5461afd3a Correct copyrights in .go files
[ci skip]

Signed-off-by: Neil Twigg <neil@nats.io>
2025-02-06 11:22:06 +00:00
Waldemar QuevedoandGitHub 6191305c0d v2.11: Add digest to represent configuration state (#4325)
Makes the server generate a digest representing the expanded version of
the parsed configuration:

```
$ nats-server -c foo.conf -t
nats-server: configuration file configs/foo.conf is valid (sha256:e14d9fd914ee4a83c481c6bf97b44d7bc23d8f475f7f30af0c4e96ab4e5ad00c)
```

It can be inspected via `/varz`:

```
  "config_load_time": "2023-07-19T14:28:28.77128Z",
  "config_digest": "sha256:6a383afa5fa6e00262105fbf061cabf48db892d1aa677f491dbabe7894393413",
  "system_account": "$SYS"
```

And it is also logged at runtime making it possible to check whether the
reload had side effects:
```
[1935] 2023/07/19 02:57:29.245020 [INF] Using configuration file: configs/foo.conf (sha256:6a383afa5fa6e00262105fbf061cabf48db892d1aa677f491dbabe7894393413)
...
[1935] 2023/07/19 02:58:06.993874 [DBG] Trapped "hangup" signal
...
[1935] 2023/07/19 02:58:06.996113 [INF] Reloaded server configuration (sha256:6a383afa5fa6e00262105fbf061cabf48db892d1aa677f491dbabe7894393413)
...
[1935] 2023/07/19 02:58:32.895492 [INF] Reloaded server configuration (sha256:a622fb453f3464b041de668b82229aef155175824f3c3a6d126a33268d172987)
[1935] 2023/07/19 02:58:44.615983 [DBG] Trapped "hangup" signal
...
[1935] 2023/07/19 02:58:44.617870 [INF] Reloaded server configuration (sha256:6a383afa5fa6e00262105fbf061cabf48db892d1aa677f491dbabe7894393413)
```

 - [x] Reloader tests
 - [x] Monitoring test
 - [x] Build is green in Travis CI
- [X] You have certified that the contribution is your original work and
that you license the work to the project under the [Apache 2
license](https://github.com/nats-io/nats-server/blob/main/LICENSE)

---------

Signed-off-by: Waldemar Quevedo <wally@nats.io>
2024-11-28 09:38:50 -08:00
Alexander Kuleshov 6081ce2e09 Add missed angle bracket to the help output
As one was lost in the https://github.com/nats-io/nats-server/pull/3536

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
2024-10-04 15:28:49 +05:00
Derek Collison 027f2e42c8 Remove snapshot of cores and maxprocs
Signed-off-by: Derek Collison <derek@nats.io>
2023-03-17 15:09:50 -07:00
Derek Collison 2aeb5e2c5a Update snapshots to numCores and maxProcs after maxrocs.Set()
Signed-off-by: Derek Collison <derek@nats.io>
2023-01-20 11:30:43 -08:00
Byron Ruth d55ec395a3 Update --signal usage help
This includes `ldm` and `term`.

Signed-off-by: Byron Ruth <b@devel.io>
2022-12-06 06:45:00 -05:00
Ivan Kozlovic 1a278f9066 Adjust "nats-server -h" output
Related to PR #3527

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-10-10 11:21:22 -06:00
ariel-zilberandGitHub 8fd30ff5c3 Update main.go 2022-10-06 12:40:21 +03:00
ariel-zilberandGitHub 6ef5c520b2 Update main.go 2022-10-05 18:30:52 +03:00
ariel-zilberandGitHub 04a5c0be3c fix to bug #3522 - update usage guide message in main.go 2022-10-05 17:14:41 +03:00
Derek Collison 4edf957570 Don't fail if auto setting of maxprocs fails.
Signed-off-by: Derek Collison <derek@nats.io>
2022-08-25 15:21:13 -07:00
Derek Collison 28e846334c Allow maxprocs to debug log after start banner
Signed-off-by: Derek Collison <derek@nats.io>
2022-07-02 08:46:19 -07:00
Derek Collison c2de707ed6 AutoMaxProcs would default log output, this suppresses the logging.
Signed-off-by: Derek Collison <derek@nats.io>
2022-06-28 16:35:30 -07:00
Parham Alvani baf0506b78 feat: add automaxprocs 2022-06-25 19:59:04 +04:30
Derek Collison b43cb5b352 Added in ability to have account limits configured in server config.
Signed-off-by: Derek Collison <derek@nats.io>
2021-12-21 18:31:07 -08:00
R.I.Pienaar 0d391b02eb richer api errors proposal
Signed-off-by: R.I.Pienaar <rip@devco.net>
2021-05-26 08:04:50 +02:00
Derek Collison f0cdf89c61 JetStream Clustering WIP
Signed-off-by: Derek Collison <derek@nats.io>
2021-01-14 01:14:52 -08:00
Ivan Kozlovic c88ac568b3 Fixed no_advertise comment in nats-server -help
Resolves #1647

[ci skip]

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-10-26 10:41:57 -06:00
Ivan Kozlovic 0ce84a83c5 Added -cluster_name command line option
This is handy for client libraries that start the server as
external executable and pass command line arguments. Without
specifying the cluster name, routes can take time to establish
and cause some tests to fail.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-07-21 15:50:24 -06:00
Derek Collison bbdb61a4e1 Add ability to set storage directory
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:15:11 -07:00
Derek Collison dd116fcfd4 JetStream first pass basics.
This is the first checkin for JetStream. Has some rudimentary basics working.

TODO
1. Push vs pull mode for observables. (work queues)
2. Disk/File store, memory only for now.
3. clustering code - design shaping up well.
4. Finalize account import semantics.
5. Lots of other little things.

Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:06:29 -07:00
Guilherme Santos 25858cba0b Implement basePath for monitoring endpoints 2020-05-13 23:29:11 +02:00
Matthias Hanel 9539199b88 Fixed help text and variable naming
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-02 15:09:52 -05:00
Matthias Hanel 5fa9b654ce changing sys_trace to trace_verbose, adding -VV and -DVV flags
Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-02 14:27:58 -05:00
Matthias Hanel bf952a3807 Adding option to enable tracing the system account. (default: false)
Use sys_trace option in config file or --sys_trace on the command line

Signed-off-by: Matthias Hanel <mh@synadia.com>
2020-03-01 19:42:40 -05:00
Ivan Kozlovic a6874b2107 [FIXED] Server that is sent the lame duck mode signal does not exit
Resolves #1275

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2020-02-10 17:35:40 -07:00
Ivan Kozlovic bdf5cf63b3 Shutdown on Ctrl+C
Changed code on Windows to not use svc code if running in interactive
mode. The original code was running svc.debug.Run() which uses service
code (Execute()) but from the command line. We don't need that.

Also reduced salt on bcrypt password for a config file that started
to cause failures due to test taking too long to finish.

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-11-14 20:05:32 -07:00
Ivan Kozlovic ed1901c792 Update go.mod to satisfy v2 requirements
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-06-03 19:45:47 -06:00
Derek Collison acfe372d63 Changes for rename from gnatsd -> nats-server
Signed-off-by: Derek Collison <derek@nats.io>
2019-05-06 15:04:24 -07:00
Derek Collison f3f623565c fixes
Signed-off-by: Derek Collison <derek@nats.io>
2018-12-05 16:00:30 -08:00
Derek Collison 2d54fc3ee7 Account lookup failures, account and client limits, options reload.
Changed account lookup and validation failures to be more understandable by users.
Changed limits to be -1 for unlimited to match jwt pkg.

The limits changed exposed problems with options holding real objects causing issues with reload tests under race mode.
Longer term this code should be reworked such that options only hold config data, not real structs, etc.

Signed-off-by: Derek Collison <derek@nats.io>
2018-12-05 14:25:40 -08:00
Paulo Pires 67412b762c Support a path as argument to --signal
Signed-off-by: Paulo Pires <pjpires@gmail.com>
2018-12-05 16:46:48 +00:00
Derek Collison f4f3d3baf1 Updates for operator based configurations.
Added update to parse and load operator JWTs.
Changed to add in signing keys from operator JWT to list of trusted keys.
Added URL account resolver.
Added account claim updates by system messages.

Signed-off-by: Derek Collison <derek@nats.io>
2018-12-02 20:34:33 -08:00
Waldemar Quevedo df2364af26 Add -t pedantic config check to the server
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2018-09-11 16:06:53 -07:00
Ivan Kozlovic d98d51c8cc [FIXED] Possible cluster Authorization Error during config reload
When changing something in the cluster, such as Timeout and doing
a config reload, the route could be closed with an `Authorization
Error` report. Moreover, the route would not try to reconnect,
even if specified as an explicit route.

There were 2 issues:
- When checking if a solicited route is still valid, we need to
  check the Routes' URL against the URL that we try to connect
  to but not compare the pointers, but either do a reflect
  deep equal, or compare their String representation (this is
  what I do in the PR).
- We should check route authorization only if this is an accepted
  route, not an explicit one. The reason is that we a server
  explicitly connect to another server, it does not get the remote
  server's username and password. So the check would always fail.

Note: It is possible that a config reload even without any change
in the cluster triggers the code checking if routes are properly
authorized, and that happens if there is TLS specified. When
the reload code checks if config has changed, the TLSConfig
between the old and new seem to indicate a change, eventhough there
is apparently none. Another reload does not detect a change. I
suspect some internal state in TLSConfig that causes the
reflect.DeepEqual() to report a difference.

Note2: This commit also contains fixes to regex that staticcheck
would otherwise complain about (they did not have any special
character), and I have removed printing the usage on startup when
getting an error. The usage is still correctly printed if passing
a parameter that is unknown.

Resolves #719

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2018-08-15 18:20:29 -06:00
Derek Collison 00901acc78 Update license to Apache 2 2018-03-15 22:31:07 -07:00
Ivan Kozlovic acf4a31e4b Major updates + support for config reload of client/cluster advertise 2018-02-05 20:15:36 -07:00
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 684a2e4173 Update based on code review 2017-09-07 09:06:37 -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 99015c4117 Allow specifying service name for Windows signaling 2017-06-27 12:42:48 -05:00
Tyler Treat 82f92e0939 Refactor signalling and add tests 2017-06-27 11:25:34 -05:00
Tyler Treat 96ca09ee21 Add --signal flag 2017-06-26 10:50:23 -05:00
Tyler Treat 09550f0f09 Handle run errors 2017-06-23 13:56:32 -05:00
Tyler Treat 6708c6cdfd Implement gnatsd as a Windows service 2017-06-23 11:08:52 -05:00
Tyler Treat cc30af8ede Address code review feedback 2017-06-05 17:43:42 -05:00