s
This commit is contained in:
+4
-4
@@ -277,10 +277,10 @@ message ACLDeleteRequest {
|
||||
// directly for inspection reads; it carries credentials when postgres, so the
|
||||
// manage port must stay localhost-only/trusted.
|
||||
message StatusResponse {
|
||||
string repo_root = 1; // -root (git repo root)
|
||||
string rpc_addr = 2; // -rpc listen ("" if n/a)
|
||||
string ssh_addr = 3; // -ssh listen ("" if disabled)
|
||||
string manage_addr = 4; // -manage listen ("" if disabled)
|
||||
string root = 1; // -root (git root)
|
||||
string rpc_addr = 2; // -rpc listen
|
||||
string ssh_addr = 3; // -ssh listen
|
||||
string manage_addr = 4; // -manage listen
|
||||
string auth_url = 5; // -auth RBAC center ("" if skip-auth)
|
||||
string db_uri = 6; // -db state DB URI
|
||||
bool skip_auth = 7; // -skip-auth
|
||||
|
||||
+3
-16
@@ -20,28 +20,15 @@ import (
|
||||
"simplegit/state"
|
||||
)
|
||||
|
||||
// Config carries the daemon's startup params. The server needs the git root to
|
||||
// open repos and the rest to answer the Status RPC (which also hands gitctl the
|
||||
// db_uri so it can connect directly for inspection reads).
|
||||
type Config struct {
|
||||
Root string
|
||||
RPCAddr string
|
||||
SSHAddr string
|
||||
ManageAddr string
|
||||
AuthURL string
|
||||
DBUri string
|
||||
SkipAuth bool
|
||||
}
|
||||
|
||||
type Server struct {
|
||||
gitRepoRoot string
|
||||
cfg Config
|
||||
cfg *common.Config
|
||||
startedAt time.Time
|
||||
middleware *MiddlewareClient
|
||||
mut state.IStateMut
|
||||
}
|
||||
|
||||
func NewServer(cfg Config, middleware *MiddlewareClient, mut state.IStateMut) *Server {
|
||||
func NewServer(cfg *common.Config, middleware *MiddlewareClient, mut state.IStateMut) *Server {
|
||||
return &Server{
|
||||
gitRepoRoot: cfg.Root,
|
||||
cfg: cfg,
|
||||
@@ -511,7 +498,7 @@ func (s *Server) ACLDelete(ctx context.Context, req *connect.Request[v1.ACLDelet
|
||||
|
||||
func (s *Server) Status(ctx context.Context, req *connect.Request[emptypb.Empty]) (*connect.Response[v1.StatusResponse], error) {
|
||||
return connect.NewResponse(&v1.StatusResponse{
|
||||
RepoRoot: s.gitRepoRoot,
|
||||
Root: s.cfg.Root,
|
||||
RpcAddr: s.cfg.RPCAddr,
|
||||
SshAddr: s.cfg.SSHAddr,
|
||||
ManageAddr: s.cfg.ManageAddr,
|
||||
|
||||
@@ -1472,10 +1472,10 @@ func (x *ACLDeleteRequest) GetAclId() int64 {
|
||||
// manage port must stay localhost-only/trusted.
|
||||
type StatusResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
RepoRoot string `protobuf:"bytes,1,opt,name=repo_root,json=repoRoot,proto3" json:"repo_root,omitempty"` // -root (git repo root)
|
||||
RpcAddr string `protobuf:"bytes,2,opt,name=rpc_addr,json=rpcAddr,proto3" json:"rpc_addr,omitempty"` // -rpc listen ("" if n/a)
|
||||
SshAddr string `protobuf:"bytes,3,opt,name=ssh_addr,json=sshAddr,proto3" json:"ssh_addr,omitempty"` // -ssh listen ("" if disabled)
|
||||
ManageAddr string `protobuf:"bytes,4,opt,name=manage_addr,json=manageAddr,proto3" json:"manage_addr,omitempty"` // -manage listen ("" if disabled)
|
||||
Root string `protobuf:"bytes,1,opt,name=root,proto3" json:"root,omitempty"` // -root (git root)
|
||||
RpcAddr string `protobuf:"bytes,2,opt,name=rpc_addr,json=rpcAddr,proto3" json:"rpc_addr,omitempty"` // -rpc listen
|
||||
SshAddr string `protobuf:"bytes,3,opt,name=ssh_addr,json=sshAddr,proto3" json:"ssh_addr,omitempty"` // -ssh listen
|
||||
ManageAddr string `protobuf:"bytes,4,opt,name=manage_addr,json=manageAddr,proto3" json:"manage_addr,omitempty"` // -manage listen
|
||||
AuthUrl string `protobuf:"bytes,5,opt,name=auth_url,json=authUrl,proto3" json:"auth_url,omitempty"` // -auth RBAC center ("" if skip-auth)
|
||||
DbUri string `protobuf:"bytes,6,opt,name=db_uri,json=dbUri,proto3" json:"db_uri,omitempty"` // -db state DB URI
|
||||
SkipAuth bool `protobuf:"varint,7,opt,name=skip_auth,json=skipAuth,proto3" json:"skip_auth,omitempty"` // -skip-auth
|
||||
@@ -1515,9 +1515,9 @@ func (*StatusResponse) Descriptor() ([]byte, []int) {
|
||||
return file_gitrpc_gitrpc_proto_rawDescGZIP(), []int{23}
|
||||
}
|
||||
|
||||
func (x *StatusResponse) GetRepoRoot() string {
|
||||
func (x *StatusResponse) GetRoot() string {
|
||||
if x != nil {
|
||||
return x.RepoRoot
|
||||
return x.Root
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@@ -3512,9 +3512,9 @@ const file_gitrpc_gitrpc_proto_rawDesc = "" +
|
||||
"\x03pat\x18\x02 \x01(\tR\x03pat\x12\x12\n" +
|
||||
"\x04perm\x18\x03 \x01(\tR\x04perm\")\n" +
|
||||
"\x10ACLDeleteRequest\x12\x15\n" +
|
||||
"\x06acl_id\x18\x01 \x01(\x03R\x05aclId\"\xb5\x02\n" +
|
||||
"\x0eStatusResponse\x12\x1b\n" +
|
||||
"\trepo_root\x18\x01 \x01(\tR\brepoRoot\x12\x19\n" +
|
||||
"\x06acl_id\x18\x01 \x01(\x03R\x05aclId\"\xac\x02\n" +
|
||||
"\x0eStatusResponse\x12\x12\n" +
|
||||
"\x04root\x18\x01 \x01(\tR\x04root\x12\x19\n" +
|
||||
"\brpc_addr\x18\x02 \x01(\tR\arpcAddr\x12\x19\n" +
|
||||
"\bssh_addr\x18\x03 \x01(\tR\asshAddr\x12\x1f\n" +
|
||||
"\vmanage_addr\x18\x04 \x01(\tR\n" +
|
||||
|
||||
Reference in New Issue
Block a user