Login Failed!
+ {/if} + + +diff --git a/fclauncher/Admin.go b/fclauncher/Admin.go
index fcec963..52d926a 100644
--- a/fclauncher/Admin.go
+++ b/fclauncher/Admin.go
@@ -1,6 +1,8 @@
package main
import (
+ "fmt"
+
"golang.org/x/crypto/ssh"
)
@@ -9,16 +11,17 @@ type Admin struct {
}
func sftpConnect(conf *ssh.ClientConfig) (ssh.Conn, error) {
- return ssh.Dial("tcp", "gitea.piwalker.net:22", conf)
+ return ssh.Dial("tcp", "gitea-svr.piwalker.net:22", conf)
}
func sftpAuth(username string, password string) (*ssh.ClientConfig, error) {
+ key, _, _, _, err := ssh.ParseAuthorizedKey([]byte("gitea-svr.piwalker.net ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILkyh7MDvubWw4OzTFbvsUz7gOmOzBq77i5Q86STKqja"));
config := &ssh.ClientConfig{
User: username,
Auth: []ssh.AuthMethod{
ssh.Password(password),
},
- HostKeyCallback: ssh.InsecureIgnoreHostKey(),
+ HostKeyCallback: ssh.FixedHostKey(key),
}
conn, err := sftpConnect(config)
@@ -29,9 +32,10 @@ func sftpAuth(username string, password string) (*ssh.ClientConfig, error) {
return config, nil
}
-func (a *Admin)adminAuth(username string, password string) bool {
+func (a *Admin) AdminAuth(username string, password string) bool {
conf, err := sftpAuth(username, password)
if err != nil {
+ fmt.Println("SFTP error: ", err)
a.conf = nil
return false
}
diff --git a/fclauncher/frontend/src/AdminLogin.svelte b/fclauncher/frontend/src/AdminLogin.svelte
new file mode 100644
index 0000000..cf9616d
--- /dev/null
+++ b/fclauncher/frontend/src/AdminLogin.svelte
@@ -0,0 +1,51 @@
+
+ Login Failed!Admin
+