Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Configuration refactoring (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
ortuman authored Dec 24, 2021
1 parent 17a2237 commit 9384c18
Show file tree
Hide file tree
Showing 38 changed files with 858 additions and 710 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ docker run --name=jackal \
Alternatively, and with the purpose of facilitating service mounting, you can make use of `docker-compose` as follows:

```sh
docker-compose -f dockerfiles/docker-compose.yml up
make dockerimage && docker-compose -f dockerfiles/docker-compose.yml up
```

This command will spin up a `jackal` server along with its dependencies on a docker network and start listening for incoming connections on port `5222`.
Expand Down
123 changes: 0 additions & 123 deletions cmd/jackal/config.go

This file was deleted.

130 changes: 0 additions & 130 deletions cmd/jackal/listener.go

This file was deleted.

5 changes: 4 additions & 1 deletion cmd/jackal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ package main
import (
"log"
"os"

"github.com/ortuman/jackal/pkg/jackal"
)

func main() {
if err := run(os.Stdout, os.Args); err != nil {
j := jackal.New(os.Stdout, os.Args)
if err := j.Run(); err != nil {
log.Fatal(err)
}
}
18 changes: 7 additions & 11 deletions config/docker-compose.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@ cluster:
endpoints:
- 'http://etcd:2379'

listeners:
- type: c2s
port: 5222
req_timeout: 60s
transport: socket
sasl:
mechanisms:
- scram_sha_1
- scram_sha_256
- scram_sha_512
- scram_sha3_512
c2s:
listeners:
- port: 5222
req_timeout: 60s
transport: socket
sasl:
mechanisms: [scram_sha_1, scram_sha_256, scram_sha_512, scram_sha3_512]
78 changes: 38 additions & 40 deletions config/example.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,49 +56,44 @@ shapers:
limit: 65536
burst: 32768

listeners:
- type: c2s
port: 5222
req_timeout: 60s
transport: socket
sasl:
mechanisms: [scram_sha_1, scram_sha_256, scram_sha_512, scram_sha3_512]

# Authentication gateway
# (proto: https://github.com/jackal-xmpp/jackal-proto/blob/master/jackal/proto/authenticator/v1/authenticator.proto)
external:
address: 127.0.0.1:4567
is_secure: false

- type: c2s
port: 5223
direct_tls: true
req_timeout: 60s
transport: socket
sasl:
mechanisms: [scram_sha_1, scram_sha_256, scram_sha_512, scram_sha3_512]

- type: s2s
port: 5269
req_timeout: 60s
max_stanza_size: 131072

- type: s2s
port: 5270
direct_tls: true
c2s:
listeners:
- port: 5222
req_timeout: 60s
transport: socket
sasl:
mechanisms: [scram_sha_1, scram_sha_256, scram_sha_512, scram_sha3_512]

# Authentication gateway
# (proto: https://github.com/jackal-xmpp/jackal-proto/blob/master/jackal/proto/authenticator/v1/authenticator.proto)
external:
address: 127.0.0.1:4567
is_secure: false

- port: 5223
direct_tls: true
req_timeout: 60s
transport: socket
sasl:
mechanisms: [scram_sha_1, scram_sha_256, scram_sha_512, scram_sha3_512]

s2s:
listeners:
- port: 5269
req_timeout: 60s
max_stanza_size: 131072

- port: 5270
direct_tls: true
req_timeout: 60s
max_stanza_size: 131072

out:
dialback_secret: s3cr3tf0rd14lb4ck
dial_timeout: 5s
req_timeout: 60s
max_stanza_size: 131072

- type: component
port: 5275
secret: hqcUrfHtgE73FktcXwfrP

s2s_out:
dialback_secret: s3cr3tf0rd14lb4ck
dial_timeout: 5s
req_timeout: 60s
max_stanza_size: 131072

modules:
# enabled:
# - roster
Expand Down Expand Up @@ -128,4 +123,7 @@ modules:
# timeout_action: kill

components:
listeners:
- port: 5275
secret: hqcUrfHtgE73FktcXwfrP

Loading

0 comments on commit 9384c18

Please sign in to comment.