diff --git a/cmd/server/main.go b/cmd/server/main.go index bad7a2a..77542f5 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -125,7 +125,7 @@ func main() { go func() { srv := dnsx.New( - "127.0.0.1:7753", + ":53", dnsHandler, dnsx.NotifyStartedFunc(waitDNS.Done), ) @@ -168,7 +168,7 @@ func main() { go func() { srv := httpx.New( - "127.0.0.1:7780", + ":80", server.HTTPHandler( db, cfg.Domain, @@ -190,7 +190,7 @@ func main() { go func() { srv := httpx.New( - "127.0.0.1:7443", + ":443", server.HTTPHandler( db, cfg.Domain, @@ -213,7 +213,7 @@ func main() { go func() { // Pass TLS config to be able to handle "STARTTLS" command. srv := smtpx.New( - "127.0.0.1:7725", + ":25", smtpx.ListenerWrapper(server.SMTPListenerWrapper(1<<20, time.Second*5)), smtpx.Messages(smtpx.Msg{Greet: cfg.Domain, Ehlo: cfg.Domain}), smtpx.OnClose(func(e *smtpx.Event) { @@ -234,7 +234,7 @@ func main() { go func() { // Pass TLS config to be able to handle "STARTTLS" command. srv := ftpx.New( - "127.0.0.1:7721", + ":21", ftpx.ListenerWrapper(server.SMTPListenerWrapper(1<<20, time.Second*5)), ftpx.Messages(ftpx.Msg{Greet: fmt.Sprintf("%s Server ready", cfg.Domain)}), ftpx.OnClose(func(e *ftpx.Event) { diff --git a/config.toml b/config.toml deleted file mode 100644 index dba337d..0000000 --- a/config.toml +++ /dev/null @@ -1,8 +0,0 @@ -[context] -server = 'test' - -[servers] -[servers.test] -token = '04a752d6c759f59978755f554bffa08c' -url = 'https://sonar.test:31337' -insecure = true diff --git a/internal/modules/api/api.go b/internal/modules/api/api.go index 6a55af4..21df7b2 100644 --- a/internal/modules/api/api.go +++ b/internal/modules/api/api.go @@ -34,7 +34,7 @@ func New(cfg *Config, db *database.DB, log logger.StdLogger, func (api *API) Start() error { srv := http.Server{ - Addr: fmt.Sprintf("127.0.0.1:%d", api.cfg.Port), + Addr: fmt.Sprintf(":%d", api.cfg.Port), Handler: api.Router(), TLSConfig: api.tls, } diff --git a/internal/templates/content.go b/internal/templates/content.go index 485d7bf..21e926d 100644 --- a/internal/templates/content.go +++ b/internal/templates/content.go @@ -129,23 +129,6 @@ const ( ) var notificationHeader = `[{{ .Payload.Name }}] {{ .Event.Protocol.String | upper }} from {{ .Event.RemoteAddr }} {{ .Event.ReceivedAt.Format "on 02 Jan 2006 at 15:04:05 MST" }}` -var notificationBody = ` -{{- if eq .Event.Protocol.String "http" -}} -Request: -

-{{ printf "%s" .Event.R }}
-
- -Response: -

-{{ printf "%s" .Event.W }}
-
-{{- else if eq .Event.Protocol.String "dns" -}} -

+var notificationBody = `
 {{ printf "%s" .Event.RW }}
-
-{{- else -}} -

-{{ printf "%s" .Event.RW }}
-
-{{- end -}}` +
` diff --git a/server.toml b/server.toml deleted file mode 100644 index 21c1bc1..0000000 --- a/server.toml +++ /dev/null @@ -1,6 +0,0 @@ -ip = "127.0.0.1" -domain = "sonar.test" - -[db] -dsn = "postgres://db:db@localhost:5432/db_test?sslmode=disable" -migrations = "internal/database/migrations"