1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2024-12-14 12:37:31 +00:00
ctrl/doc/nats-server-relay-configuration
2021-12-07 10:42:11 +01:00
..
README.md updated relay doc 2021-12-07 10:42:11 +01:00

Relay configuration

Example config where we allow ship1 to send a message to ship2 relayed via central.

port: 4222

authorization: {
    users = [
        {
            # central
            nkey: <central key here>
            permissions: {
                publish: {
                    allow: [">","errorCentral.>"]
                }
                subscribe: {
                    allow: [">","errorCentral.>"]
                }
            }
        }
        {
            # ship1
            nkey: <ship1 key here>
            permissions: {
                publish: {
                        allow: ["central.>","errorCentral.>","ship1.>","ship2.central.REQRelay.EventACK"]
                        # deny: ["*.REQRelay.>"]
                }
                subscribe: {
                        allow: ["central.>","ship1.>","errorCentral.REQErrorLog.EventACK.reply","*.central.REQRelay.EventACK.reply"]
                }
            }
        }
        {
            # ship2
            nkey: <ship2 key here>
            permissions: {
                publish: {
                        allow: ["central.>","errorCentral.>","ship2.>"]
                }
                subscribe: {
                        allow: ["central.>","ship2.>","errorCentral.REQErrorLog.EventACK.reply"]
                }
            }
        }
    ]
}