mirror of
https://github.com/thomiceli/opengist.git
synced 2024-12-22 20:42:40 +00:00
Fix ssh error login (#292)
This commit is contained in:
parent
38892d8a4a
commit
7d113e026e
2 changed files with 3 additions and 3 deletions
2
Makefile
2
Makefile
|
@ -38,7 +38,7 @@ build_dev_docker:
|
||||||
docker build -t $(BINARY_NAME)-dev:latest --target dev .
|
docker build -t $(BINARY_NAME)-dev:latest --target dev .
|
||||||
|
|
||||||
run_dev_docker:
|
run_dev_docker:
|
||||||
docker run -v .:/opengist -p 6157:6157 -p 16157:16157 -v $(HOME)/.opengist-dev:/root/.opengist --rm $(BINARY_NAME)-dev:latest
|
docker run -v .:/opengist -p 6157:6157 -p 16157:16157 -p 2222:2222 -v $(HOME)/.opengist-dev:/root/.opengist --rm $(BINARY_NAME)-dev:latest
|
||||||
|
|
||||||
watch_frontend:
|
watch_frontend:
|
||||||
@echo "Building frontend assets..."
|
@echo "Building frontend assets..."
|
||||||
|
|
|
@ -25,8 +25,8 @@ func Start() {
|
||||||
PublicKeyCallback: func(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error) {
|
PublicKeyCallback: func(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error) {
|
||||||
strKey := strings.TrimSpace(string(ssh.MarshalAuthorizedKey(key)))
|
strKey := strings.TrimSpace(string(ssh.MarshalAuthorizedKey(key)))
|
||||||
exists, err := db.SSHKeyDoesExists(strKey)
|
exists, err := db.SSHKeyDoesExists(strKey)
|
||||||
if !exists {
|
if !exists || err != nil {
|
||||||
if !errors.Is(err, gorm.ErrRecordNotFound) {
|
if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue