Bump version to 1.0.21

This commit is contained in:
2026-07-09 15:18:05 -04:00
parent acd50ec9c0
commit 6c48031dd7
11 changed files with 726 additions and 2 deletions
+6
View File
@@ -95,3 +95,9 @@ type SSHKeyResponse struct {
type ErrorResponse struct {
Error string `json:"error"`
}
type SettingsInfoResponse struct {
Version string `json:"version"`
DataDir string `json:"data_dir"`
SSHPubKey string `json:"ssh_pub_key"`
}
+12
View File
@@ -2,6 +2,7 @@ package api
import (
"database/sql"
"encoding/json"
"log/slog"
"net/http"
"runtime/debug"
@@ -82,6 +83,17 @@ func NewServer(cfg *config.Config, db *sql.DB, engine *syncengine.Engine) *Serve
w.Write([]byte(pubKey))
})
r.With(auth.RequireAuth).Get("/settings/info", func(w http.ResponseWriter, r *http.Request) {
_, _, pubKey, _ := sshmanager.EnsureServerKey(cfg.SSHDir())
resp := SettingsInfoResponse{
Version: cfg.Version,
DataDir: cfg.DataDir,
SSHPubKey: pubKey,
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(resp)
})
r.With(auth.RequireAuth).Route("/ssh-keys", func(r chi.Router) {
r.Get("/", sshKeyHandler.List)
r.Post("/", sshKeyHandler.Create)
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+14
View File
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="/">
<title>SyncServer</title>
<script type="module" crossorigin src="./assets/index-BCf_AnPS.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-BA6Z4BXQ.css">
</head>
<body>
<div id="root"></div>
</body>
</html>