api: Add settings field to version
2 files changed, 15 insertions(+), 0 deletions(-)

M api/graph/schema.graphqls
M api/graph/schema.resolvers.go
M api/graph/schema.graphqls +8 -0
@@ 46,6 46,9 @@ type Version {
 
   "Optional features"
   features: Features!
+
+  "Config settings"
+  settings: Settings!
 }
 
 "Describes the status of optional features"

          
@@ 53,6 56,11 @@ type Features {
   artifacts: Boolean!
 }
 
+"Instance specific settings"
+type Settings {
+  sshUser: String!
+}
+
 enum AccessMode {
   "Read-only"
   RO

          
M api/graph/schema.resolvers.go +7 -0
@@ 493,6 493,10 @@ func (r *mutationResolver) DeleteWebhook
 }
 
 func (r *queryResolver) Version(ctx context.Context) (*model.Version, error) {
+	conf := config.ForContext(ctx)
+	sshUser, _ := conf.Get("git.sr.ht::dispatch", "/usr/bin/hgsrht-keys")
+	sshUser = strings.Split(sshUser, ":")[0]
+
 	return &model.Version{
 		Major:           0,
 		Minor:           0,

          
@@ 500,6 504,9 @@ func (r *queryResolver) Version(ctx cont
 		DeprecationDate: nil,
 
 		Features: &model.Features{},
+		Settings: &model.Settings{
+			SSHUser: sshUser,
+		},
 	}, nil
 }