summaryrefslogtreecommitdiffstats
path: root/modules/doctor/authorizedkeys.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/doctor/authorizedkeys.go')
-rw-r--r--modules/doctor/authorizedkeys.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/doctor/authorizedkeys.go b/modules/doctor/authorizedkeys.go
index d9bc70bb77..1a9b60e248 100644
--- a/modules/doctor/authorizedkeys.go
+++ b/modules/doctor/authorizedkeys.go
@@ -12,7 +12,7 @@ import (
"path/filepath"
"strings"
- "code.gitea.io/gitea/models"
+ asymkey_model "code.gitea.io/gitea/models/asymkey"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
)
@@ -32,7 +32,7 @@ func checkAuthorizedKeys(logger log.Logger, autofix bool) error {
return fmt.Errorf("Unable to open authorized_keys file. ERROR: %v", err)
}
logger.Warn("Unable to open authorized_keys. (ERROR: %v). Attempting to rewrite...", err)
- if err = models.RewriteAllPublicKeys(); err != nil {
+ if err = asymkey_model.RewriteAllPublicKeys(); err != nil {
logger.Critical("Unable to rewrite authorized_keys file. ERROR: %v", err)
return fmt.Errorf("Unable to rewrite authorized_keys file. ERROR: %v", err)
}
@@ -53,7 +53,7 @@ func checkAuthorizedKeys(logger log.Logger, autofix bool) error {
// now we regenerate and check if there are any lines missing
regenerated := &bytes.Buffer{}
- if err := models.RegeneratePublicKeys(regenerated); err != nil {
+ if err := asymkey_model.RegeneratePublicKeys(regenerated); err != nil {
logger.Critical("Unable to regenerate authorized_keys file. ERROR: %v", err)
return fmt.Errorf("Unable to regenerate authorized_keys file. ERROR: %v", err)
}
@@ -75,7 +75,7 @@ func checkAuthorizedKeys(logger log.Logger, autofix bool) error {
return fmt.Errorf(`authorized_keys is out of date and should be regenerated with "gitea admin regenerate keys" or "gitea doctor --run authorized_keys --fix"`)
}
logger.Warn("authorized_keys is out of date. Attempting rewrite...")
- err = models.RewriteAllPublicKeys()
+ err = asymkey_model.RewriteAllPublicKeys()
if err != nil {
logger.Critical("Unable to rewrite authorized_keys file. ERROR: %v", err)
return fmt.Errorf("Unable to rewrite authorized_keys file. ERROR: %v", err)