From 711e71fac54af7cbf614f450cf2c988688c613db Mon Sep 17 00:00:00 2001 From: Emin Date: Tue, 19 Sep 2023 17:49:13 +0300 Subject: [PATCH] Logger, Validator initial progress, htmx initial progress --- .air.toml | 44 ++++++++++++++++++++++++++++++++++ .gitignore | 1 + favicon.ico | Bin 0 -> 36890 bytes go.mod | 21 ++++++++++------ go.sum | 47 +++++++++++++++++++++++------------- logger.go | 29 +++++++++++++++++++++++ main.go | 8 +++++-- server.go | 24 +++++++++++++------ templates/index.html | 48 +++++++++++++++++++++++++++---------- templates/index.html.zst | Bin 1080 -> 0 bytes transfer.go | 5 ++++ validate.go | 50 +++++++++++++++++++++++++++++++++++++++ 12 files changed, 232 insertions(+), 45 deletions(-) create mode 100644 .air.toml create mode 100644 .gitignore create mode 100644 favicon.ico create mode 100644 logger.go delete mode 100644 templates/index.html.zst create mode 100644 transfer.go create mode 100644 validate.go diff --git a/.air.toml b/.air.toml new file mode 100644 index 0000000..ad439e1 --- /dev/null +++ b/.air.toml @@ -0,0 +1,44 @@ +root = "." +testdata_dir = "testdata" +tmp_dir = "tmp" + +[build] + args_bin = [] + bin = "./tmp/main" + cmd = "go build -o ./tmp/main ." + delay = 0 + exclude_dir = ["assets", "tmp", "vendor", "testdata"] + exclude_file = [] + exclude_regex = ["_test.go"] + exclude_unchanged = false + follow_symlink = false + full_bin = "" + include_dir = [] + include_ext = ["go", "tpl", "tmpl", "html"] + include_file = [] + kill_delay = "0s" + log = "build-errors.log" + poll = false + poll_interval = 0 + rerun = false + rerun_delay = 500 + send_interrupt = false + stop_on_error = false + +[color] + app = "" + build = "yellow" + main = "magenta" + runner = "green" + watcher = "cyan" + +[log] + main_only = false + time = false + +[misc] + clean_on_exit = false + +[screen] + clear_on_rebuild = false + keep_scroll = true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a9a5aec --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +tmp diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000000000000000000000000000000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Details

-
+ +
-
-
-
-
+
+
@@ -50,26 +67,24 @@

Destination Details

-
-
-
-
@@ -82,6 +97,8 @@

Destination Details

Validate Credentials +
") + return + } + +} + +func validateCredentials(creds Credentials) error { + if creds.Server == "" { + return errors.New("Server cannot be empty") + } + if creds.Account == "" { + return errors.New("Account cannot be empty") + } + if creds.Password == "" { + return errors.New("Password cannot be empty") + } + + auth := smtp.PlainAuth("", creds.Account, creds.Password, creds.Server) + err := smtp.SendMail(creds.Server+":25", auth, creds.Account, []string{creds.Account}, []byte("test")) + if err != nil { + return errors.New("Invalid credentials") + } + + return nil +}