Rename ProjectConfigurator, restructure Projects workspace, retire MediaCollection naming

- Rename MediaConfig -> ProjectConfigurator throughout; drop the Parameters
  tab/page; rename the Mounts tab to Projects and restructure it into three
  sections: Central services, Main services, Third-party services
- Add a self-describe contract (GET /api/info returning name/tabs/mountTypes)
  and a server-side discovery proxy (POST /api/discover-service) so adding a
  main service only requires a URL
- Add ProjectConfigurator HA: multiple instances now sync their settings with
  each other (GET /api/settings/export, POST /api/settings/sync, a periodic
  background puller), last-write-wins per key by updated_at
- Add a generic, project-agnostic file-storage API on CarrierNode
  (GET/POST/DELETE /api/mount/{project}/{type}[/*]) driven by the same
  configured_mounts data the Projects workspace already writes, usable by any
  registered project, not just the media family
- Add last_login_at tracking to the shared auth Store/User (schema, queries,
  UpdateLastLogin) and surface it through the shared web-ui ManagedUser type
  and UserManagement component
- Retire the "MediaCollection" name: Go module -> repos.gfranz.ch/Gabriel20xx/shared/media-backend,
  binary -> mediabackend, session cookie default -> "session", media-webui
  merged into webui, media-shared-assets renamed to legacy-assets and pruned
  to the one file MediaDesktop still uses

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Gabriel20xxandClaude Sonnet 5 committed 2026-09-04 15:02:16 +02:00
1 parent 07cf3308da
commit ee59571552
126 files changed
+2880 -8542

No files matched your search

+4 -4
View File
@@ -1,4 +1,4 @@
// Package auth is the media-collection family's /auth/... and /api/auth/...
// Package auth is the shared media-backend family's /auth/... and /api/auth/...
// handlers, proxied to AuthGuard.
//
// AuthGuard migration
@@ -15,7 +15,7 @@
// resolved through this module's own `repos.gfranz.ch/Gabriel20xx/shared/backend`
// dependency - same module that already provided `sharedauth`). This
// service's own /auth/... and /api/auth/... URL paths and JSON response
// shapes are UNCHANGED - the frontend (media-webui) was not touched - only
// shapes are UNCHANGED - the frontend (webui) was not touched - only
// what backs them changed. This mirrors the migration
// Original/GameStream/backend/cmd/gamestreamd/auth.go and
// Forks/Bitmagnet/backend/internal/auth/service.go already did; read either
@@ -44,7 +44,7 @@
// the bearer token on its server-to-server calls to AuthGuard
// (sessionToken/CurrentUser below). This service mints no session token of
// its own any more. The pre-migration SESSION_COOKIE name (configurable,
// default "mediacollection_session") is retained only as something Logout
// default "session") is retained only as something Logout
// additionally clears, so a browser that still holds one from before this
// migration doesn't keep sending a now-meaningless cookie forever.
//
@@ -78,7 +78,7 @@
// username/email/password via AuthGuard today; see UpdateMe.
// - The `bio`/`avatarUrl` fields the pre-migration User type carried are
// dropped entirely: AuthGuard has no such concept, and grepping the
// frontend (media-webui) confirms neither field was ever actually read
// frontend (webui) confirms neither field was ever actually read
// or set by any UI - they were dead weight even before this migration.
//
// Auth-disabled mode (AUTHGUARD_URL unset)
@@ -11,7 +11,7 @@ import (
"github.com/jackc/pgx/v5/pgxpool"
"mediacollection/internal/database"
"repos.gfranz.ch/Gabriel20xx/shared/media-backend/internal/database"
)
// testPool returns a connection pool against a real (throwaway) Postgres
@@ -129,7 +129,7 @@ func newRequest(method, target string, body string) *http.Request {
}
func TestCurrentUserDisabledModeReturnsLocalSuperadmin(t *testing.T) {
svc := New(nil, "mediacollection_session", false, "")
svc := New(nil, "session", false, "")
user, err := svc.CurrentUser(httptest.NewRequest(http.MethodGet, "/", nil))
if err != nil {
t.Fatalf("CurrentUser() error = %v", err)
@@ -143,7 +143,7 @@ func TestSignupLoginLogoutProxyToAuthGuard(t *testing.T) {
pool := testPool(t)
guard := newFakeAuthGuard()
defer guard.close()
svc := New(pool, "mediacollection_session", false, guard.server.URL)
svc := New(pool, "session", false, guard.server.URL)
ctx := context.Background()
// Signup
@@ -207,7 +207,7 @@ func TestSecondProjectSetupIsRejectedWhenAuthGuardAlreadyHasAnAccount(t *testing
guard.hasAccount = true // simulate a different project (or AuthGuard's own web UI) having already created one
guard.username, guard.email, guard.role, guard.password = "existing", "existing@example.com", "superadmin", "hunter2!!"
svc := New(pool, "mediacollection_session", false, guard.server.URL)
svc := New(pool, "session", false, guard.server.URL)
req := newRequest(http.MethodPost, "/auth/signup", `{"email":"new@example.com","username":"new","password":"correct horse battery staple"}`)
rec := httptest.NewRecorder()
svc.Signup(rec, req)
@@ -223,7 +223,7 @@ func TestSecondProjectSetupIsRejectedWhenAuthGuardAlreadyHasAnAccount(t *testing
func TestLoginRequiredToggleIsIndependentOfAuthGuard(t *testing.T) {
pool := testPool(t)
svc := New(pool, "mediacollection_session", false, "")
svc := New(pool, "session", false, "")
required, err := svc.LoginRequired(context.Background())
if err != nil || !required {