Skip to content

Commit

Permalink
Fix ports (#168)
Browse files Browse the repository at this point in the history
Remove test files & unfinished changes
  • Loading branch information
nt0xa authored Jun 18, 2024
1 parent 3c0bb6f commit e65b958
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 39 deletions.
10 changes: 5 additions & 5 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func main() {

go func() {
srv := dnsx.New(
"127.0.0.1:7753",
":53",
dnsHandler,
dnsx.NotifyStartedFunc(waitDNS.Done),
)
Expand Down Expand Up @@ -168,7 +168,7 @@ func main() {

go func() {
srv := httpx.New(
"127.0.0.1:7780",
":80",
server.HTTPHandler(
db,
cfg.Domain,
Expand All @@ -190,7 +190,7 @@ func main() {

go func() {
srv := httpx.New(
"127.0.0.1:7443",
":443",
server.HTTPHandler(
db,
cfg.Domain,
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down
8 changes: 0 additions & 8 deletions config.toml

This file was deleted.

2 changes: 1 addition & 1 deletion internal/modules/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
21 changes: 2 additions & 19 deletions internal/templates/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,23 +129,6 @@ const (
)

var notificationHeader = `<bold>[{{ .Payload.Name }}]</bold> {{ .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" -}}
<i>Request:</i>
<pre><code class="language-http">
{{ printf "%s" .Event.R }}
</code></pre>
<i>Response:</i>
<pre><code class="language-http">
{{ printf "%s" .Event.W }}
</code></pre>
{{- else if eq .Event.Protocol.String "dns" -}}
<pre><code class="language-dns-zone">
var notificationBody = `<pre>
{{ printf "%s" .Event.RW }}
</code></pre>
{{- else -}}
<pre><code class="language-log">
{{ printf "%s" .Event.RW }}
</code></pre>
{{- end -}}`
</pre>`
6 changes: 0 additions & 6 deletions server.toml

This file was deleted.

0 comments on commit e65b958

Please sign in to comment.