Bump version to 1.0.21
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
BINARY=syncserver
|
BINARY=syncserver
|
||||||
VERSION?=1.0.20
|
VERSION?=1.0.21
|
||||||
GO?=go
|
GO?=go
|
||||||
LDFLAGS=-s -w -X main.version=$(VERSION) -X main.commit=$(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
LDFLAGS=-s -w -X main.version=$(VERSION) -X main.commit=$(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
||||||
BUILD_FLAGS=CGO_ENABLED=0
|
BUILD_FLAGS=CGO_ENABLED=0
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import (
|
|||||||
"github.com/syncserver/internal/syncengine"
|
"github.com/syncserver/internal/syncengine"
|
||||||
)
|
)
|
||||||
|
|
||||||
var version = "1.0.20"
|
var version = "1.0.21"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
cfgPath := flag.String("config", "", "Path to config.yaml")
|
cfgPath := flag.String("config", "", "Path to config.yaml")
|
||||||
|
|||||||
@@ -95,3 +95,9 @@ type SSHKeyResponse struct {
|
|||||||
type ErrorResponse struct {
|
type ErrorResponse struct {
|
||||||
Error string `json:"error"`
|
Error string `json:"error"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SettingsInfoResponse struct {
|
||||||
|
Version string `json:"version"`
|
||||||
|
DataDir string `json:"data_dir"`
|
||||||
|
SSHPubKey string `json:"ssh_pub_key"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package api
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
"encoding/json"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"net/http"
|
"net/http"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
@@ -82,6 +83,17 @@ func NewServer(cfg *config.Config, db *sql.DB, engine *syncengine.Engine) *Serve
|
|||||||
w.Write([]byte(pubKey))
|
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.With(auth.RequireAuth).Route("/ssh-keys", func(r chi.Router) {
|
||||||
r.Get("/", sshKeyHandler.List)
|
r.Get("/", sshKeyHandler.List)
|
||||||
r.Post("/", sshKeyHandler.Create)
|
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
+335
File diff suppressed because one or more lines are too long
+335
File diff suppressed because one or more lines are too long
Vendored
+14
@@ -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>
|
||||||
@@ -25,6 +25,7 @@ import { ErrorBoundary } from './components/ErrorBoundary';
|
|||||||
import { Spinner } from './components/ui/Spinner';
|
import { Spinner } from './components/ui/Spinner';
|
||||||
import { Button } from './components/ui/Button';
|
import { Button } from './components/ui/Button';
|
||||||
import { cn } from './lib/utils';
|
import { cn } from './lib/utils';
|
||||||
|
import { api, SettingsInfo } from './api/client';
|
||||||
import Login from './pages/Login';
|
import Login from './pages/Login';
|
||||||
import Dashboard from './pages/Dashboard';
|
import Dashboard from './pages/Dashboard';
|
||||||
import Machines from './pages/Machines';
|
import Machines from './pages/Machines';
|
||||||
@@ -62,8 +63,15 @@ function ProtectedRoute({ children }: { children: JSX.Element }) {
|
|||||||
|
|
||||||
function NavBar() {
|
function NavBar() {
|
||||||
const [mobileOpen, setMobileOpen] = useState(false);
|
const [mobileOpen, setMobileOpen] = useState(false);
|
||||||
|
const [version, setVersion] = useState<string | null>(null);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
api<SettingsInfo>('/api/settings/info')
|
||||||
|
.then(info => setVersion(info.version))
|
||||||
|
.catch(() => {});
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleLogout = async () => {
|
const handleLogout = async () => {
|
||||||
try {
|
try {
|
||||||
await fetch('/api/auth/logout', { method: 'POST', credentials: 'include' });
|
await fetch('/api/auth/logout', { method: 'POST', credentials: 'include' });
|
||||||
@@ -86,6 +94,12 @@ function NavBar() {
|
|||||||
<span className="hidden sm:inline">SyncServer</span>
|
<span className="hidden sm:inline">SyncServer</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
{version && (
|
||||||
|
<span className="hidden lg:inline-flex items-center rounded-card bg-surface-raised px-2 py-0.5 text-xs font-mono text-fg-muted border border-border">
|
||||||
|
v{version}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
|
||||||
<nav className="hidden md:flex items-center gap-0.5 flex-1">
|
<nav className="hidden md:flex items-center gap-0.5 flex-1">
|
||||||
{navItems.map(item => {
|
{navItems.map(item => {
|
||||||
const Icon = item.icon;
|
const Icon = item.icon;
|
||||||
|
|||||||
@@ -102,3 +102,9 @@ export interface SSHKey {
|
|||||||
has_private_key: boolean;
|
has_private_key: boolean;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface SettingsInfo {
|
||||||
|
version: string;
|
||||||
|
data_dir: string;
|
||||||
|
ssh_pub_key: string;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user