Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: introduce LastActiveTime in actuator (#4958)

ecmadao0084a23a7932
diff --git a/backend/api/auth/config.go b/backend/api/auth/config.go
index 976ce45ef9..1238fc8b59 100644
--- a/backend/api/auth/config.go
+++ b/backend/api/auth/config.go
@@ -1,6 +1,7 @@
package auth
var authenticationAllowlistMethods = map[string]bool{
+ "/bytebase.v1.ActuatorService/GetActuatorInfo": true,
"/bytebase.v1.AuthService/Login": true,
"/bytebase.v1.AuthService/Logout": true,
"/bytebase.v1.AuthService/CreateUser": true,
diff --git a/backend/api/v1/actuator_service.go b/backend/api/v1/actuator_service.go
index d402182c8f..9f814d3ca3 100644
--- a/backend/api/v1/actuator_service.go
+++ b/backend/api/v1/actuator_service.go
@@ -2,9 +2,11 @@ package v1
import (
"context"
+ "time"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
+ "google.golang.org/protobuf/types/known/timestamppb"
"github.com/bytebase/bytebase/backend/component/config"
api "github.com/bytebase/bytebase/backend/legacyapi"
@@ -52,6 +54,7 @@ func (s *ActuatorService) getServerInfo(ctx context.Context) (*v1pb.ActuatorInfo
NeedAdminSetup: count == 0,
ExternalUrl: setting.ExternalUrl,
DisallowSignup: setting.DisallowSignup,
+ LastActiveTime: timestamppb.New(time.Unix(s.profile.LastActiveTs, 0)),
}
return &serverInfo, nil
diff --git a/backend/bin/server/cmd/profile.go b/backend/bin/server/cmd/profile.go
index 4e785ac80c..c9c867dbc7 100644
--- a/backend/bin/server/cmd/profile.go
+++ b/backend/bin/server/cmd/profile.go
@@ -1,6 +1,8 @@
package cmd
import (
+ "time"
+
"github.com/bytebase/bytebase/backend/common"
"github.com/bytebase/bytebase/backend/component/config"
api "github.com/bytebase/bytebase/backend/legacyapi"
@@ -33,5 +35,6 @@ func getBaseProfile(dataDir string) config.Profile {
BackupBucket: flags.backupBucket,
BackupCredentialFile: flags.backupCredential,
FeishuAPIURL: feishu.APIPath,
+ LastActiveTs: time.Now().Unix(),
}
}
diff --git a/backend/component/config/profile.go b/backend/component/config/profile.go
index a8b92af17a..002fefc4ab 100644
--- a/backend/component/config/profile.go
+++ b/backend/component/config/profile.go
@@ -29,7 +29,7 @@ type Profile struct {
// - Requests other than GET will be rejected
// - Any operations involving mutation will not start (e.g. Background schema syncer, task scheduler)
Readonly bool
- // When we are running in SaaS mode, some features are only controlled by use.
+ // When we are running in SaaS mode, some features are not allowed to edit by users.
SaaS bool
// DataDir is the directory stores the data including Bytebase's own database, backups, etc.
DataDir string
@@ -68,6 +68,9 @@ type Profile struct {
// Test only flag to skip generating onboarding data.
TestOnlySkipOnboardingData bool
+
+ // LastActiveTs is the service last active timestamp, any API calls will refresh this value.
+ LastActiveTs int64
}
// UseEmbedDB returns whether to use embedDB.
diff --git a/backend/server/acl.go b/backend/server/acl.go
index 3c0a682d65..58ed6ca065 100644
--- a/backend/server/acl.go
+++ b/backend/server/acl.go
@@ -166,8 +166,8 @@ func aclMiddleware(s *Server, pathPrefix string, ce *casbin.Enforcer, next echo.
path := strings.TrimPrefix(c.Request().URL.Path, pathPrefix)
- // Skips auth, actuator
- if common.HasPrefixes(path, "/auth", "/actuator", "/oauth") {
+ // Skips auth
+ if common.HasPrefixes(path, "/auth", "/oauth") {
return next(c)
}
diff --git a/backend/server/server.go b/backend/server/server.go
index 1244fa3afb..71d98c1c1d 100644
--- a/backend/server/server.go
+++ b/backend/server/server.go
@@ -316,6 +316,17 @@ func NewServer(ctx context.Context, profile config.Profile) (*Server, error) {
XFrameOptions: "DENY",
}))
+ e.Use(func(next echo.HandlerFunc) echo.HandlerFunc {
+ return func(c echo.Context) error {
+ defer func() {
+ if !common.HasPrefixes(c.Request().URL.Path, "/healthz", "/v1/actuator") {
+ s.profile.LastActiveTs = time.Now().Unix()
+ }
+ }()
+ return next(c)
+ }
+ })
+
embedFrontend(e)
s.e = e
diff --git a/frontend/src/types/proto/v1/actuator_service.ts b/frontend/src/types/proto/v1/actuator_service.ts
index 5ad50a7e04..676f0985c6 100644
--- a/frontend/src/types/proto/v1/actuator_service.ts
+++ b/frontend/src/types/proto/v1/actuator_service.ts
@@ -1,6 +1,7 @@
/* eslint-disable */
import type { CallContext, CallOptions } from "nice-grpc-common";
import * as _m0 from "protobufjs/minimal";
+import { Timestamp } from "../google/protobuf/timestamp";
export const protobufPackage = "bytebase.v1";
@@ -12,16 +13,28 @@ export interface GetActuatorInfoRequest {
* Actuator concept is similar to the Spring Boot Actuator.
*/
export interface ActuatorInfo {
+ /** version is the bytebase's server version */
version: string;
+ /** git_commit is the git commit hash of the build */
gitCommit: string;
+ /** readonly flag means if the Bytebase is running in readonly mode. */
readonly: boolean;
+ /** saas flag means if the Bytebase is running in SaaS mode, some features are not allowed to edit by users. */
saas: boolean;
+ /** demo_name specifies the demo name, empty string means no demo. */
demoName: string;
+ /** host is the Bytebase instance host. */
host: string;
+ /** port is the Bytebase instance port. */
port: string;
+ /** external_url is the URL where user or webhook callback visits Bytebase. */
externalUrl: string;
+ /** need_admin_setup flag means the Bytebase instance doesn't have any end users. */
needAdminSetup: boolean;
+ /** disallow_signup is the flag to disable self-service signup. */
disallowSignup: boolean;
+ /** last_active_time is the service last active time in UTC Time Format, any API calls will refresh this value. */
+ lastActiveTime?: Date;
}
function createBaseGetActuatorInfoRequest(): GetActuatorInfoRequest {
@@ -75,6 +88,7 @@ function createBaseActuatorInfo(): ActuatorInfo {
externalUrl: "",
needAdminSetup: false,
disallowSignup: false,
+ lastActiveTime: undefined,
};
}
@@ -110,6 +124,9 @@ export const ActuatorInfo = {
if (message.disallowSignup === true) {
writer.uint32(80).bool(message.disallowSignup);
}
+ if (message.lastActiveTime !== undefined) {
+ Timestamp.encode(toTimestamp(message.lastActiveTime), writer.uint32(90).fork()).ldelim();
+ }
return writer;
},
@@ -150,6 +167,9 @@ export const ActuatorInfo = {
case 10:
message.disallowSignup = reader.bool();
break;
+ case 11:
+ message.lastActiveTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
+ break;
default:
reader.skipType(tag & 7);
break;
@@ -170,6 +190,7 @@ export const ActuatorInfo = {
externalUrl: isSet(object.externalUrl) ? String(object.externalUrl) : "",
needAdminSetup: isSet(object.needAdminSetup) ? Boolean(object.needAdminSetup) : false,
disallowSignup: isSet(object.disallowSignup) ? Boolean(object.disallowSignup) : false,
+ lastActiveTime: isSet(object.lastActiveTime) ? fromJsonTimestamp(object.lastActiveTime) : undefined,
};
},
@@ -185,6 +206,7 @@ export const ActuatorInfo = {
message.externalUrl !== undefined && (obj.externalUrl = message.externalUrl);
message.needAdminSetup !== undefined && (obj.needAdminSetup = message.needAdminSetup);
message.disallowSignup !== undefined && (obj.disallowSignup = message.disallowSignup);
+ message.lastActiveTime !== undefined && (obj.lastActiveTime = message.lastActiveTime.toISOString());
return obj;
},
@@ -200,6 +222,7 @@ export const ActuatorInfo = {
message.externalUrl = object.externalUrl ?? "";
message.needAdminSetup = object.needAdminSetup ?? false;
message.disallowSignup = object.disallowSignup ?? false;
+ message.lastActiveTime = object.lastActiveTime ?? undefined;
return message;
},
};
@@ -241,6 +264,28 @@ export type DeepPartial<T> = T extends Builtin ? T
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
: Partial<T>;
+function toTimestamp(date: Date): Timestamp {
+ const seconds = date.getTime() / 1_000;
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
+ return { seconds, nanos };
+}
+
+function fromTimestamp(t: Timestamp): Date {
+ let millis = t.seconds * 1_000;
+ millis += t.nanos / 1_000_000;
+ return new Date(millis);
+}
+
+function fromJsonTimestamp(o: any): Date {
+ if (o instanceof Date) {
+ return o;
+ } else if (typeof o === "string") {
+ return new Date(o);
+ } else {
+ return fromTimestamp(Timestamp.fromJSON(o));
+ }
+}
+
function isSet(value: any): boolean {
return value !== null && value !== undefined;
}
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index bd0dca5b37..a62c93bc07 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -257,16 +257,17 @@ Actuator concept is similar to the Spring Boot Actuator.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| version | [string](#string) | | |
-| git_commit | [string](#string) | | |
-| readonly | [bool](#bool) | | |
-| saas | [bool](#bool) | | |
-| demo_name | [string](#string) | | |
-| host | [string](#string) | | |
-| port | [string](#string) | | |
-| external_url | [string](#string) | | |
-| need_admin_setup | [bool](#bool) | | |
-| disallow_signup | [bool](#bool) | | |
+| version | [string](#string) | | version is the bytebase&#39;s server version |
+| git_commit | [string](#string) | | git_commit is the git commit hash of the build |
+| readonly | [bool](#bool) | | readonly flag means if the Bytebase is running in readonly mode. |
+| saas | [bool](#bool) | | saas flag means if the Bytebase is running in SaaS mode, some features are not allowed to edit by users. |
+| demo_name | [string](#string) | | demo_name specifies the demo name, empty string means no demo. |
+| host | [string](#string) | | host is the Bytebase instance host. |
+| port | [string](#string) | | port is the Bytebase instance port. |
+| external_url | [string](#string) | | external_url is the URL where user or webhook callback visits Bytebase. |
+| need_admin_setup | [bool](#bool) | | need_admin_setup flag means the Bytebase instance doesn&#39;t have any end users. |
+| disallow_signup | [bool](#bool) | | disallow_signup is the flag to disable self-service signup. |
+| last_active_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | last_active_time is the service last active time in UTC Time Format, any API calls will refresh this value. |
diff --git a/proto/generated-go/v1/actuator_service.pb.go b/proto/generated-go/v1/actuator_service.pb.go
index 9b344c4e98..cdd1f48ee4 100644
--- a/proto/generated-go/v1/actuator_service.pb.go
+++ b/proto/generated-go/v1/actuator_service.pb.go
@@ -11,6 +11,7 @@ import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "google.golang.org/protobuf/types/known/emptypb"
+ timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect"
sync "sync"
)
@@ -67,16 +68,28 @@ type ActuatorInfo struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
- GitCommit string `protobuf:"bytes,2,opt,name=git_commit,json=gitCommit,proto3" json:"git_commit,omitempty"`
- Readonly bool `protobuf:"varint,3,opt,name=readonly,proto3" json:"readonly,omitempty"`
- Saas bool `protobuf:"varint,4,opt,name=saas,proto3" json:"saas,omitempty"`
- DemoName string `protobuf:"bytes,5,opt,name=demo_name,json=demoName,proto3" json:"demo_name,omitempty"`
- Host string `protobuf:"bytes,6,opt,name=host,proto3" json:"host,omitempty"`
- Port string `protobuf:"bytes,7,opt,name=port,proto3" json:"port,omitempty"`
- ExternalUrl string `protobuf:"bytes,8,opt,name=external_url,json=externalUrl,proto3" json:"external_url,omitempty"`
- NeedAdminSetup bool `protobuf:"varint,9,opt,name=need_admin_setup,json=needAdminSetup,proto3" json:"need_admin_setup,omitempty"`
- DisallowSignup bool `protobuf:"varint,10,opt,name=disallow_signup,json=disallowSignup,proto3" json:"disallow_signup,omitempty"`
+ // version is the bytebase's server version
+ Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
+ // git_commit is the git commit hash of the build
+ GitCommit string `protobuf:"bytes,2,opt,name=git_commit,json=gitCommit,proto3" json:"git_commit,omitempty"`
+ // readonly flag means if the Bytebase is running in readonly mode.
+ Readonly bool `protobuf:"varint,3,opt,name=readonly,proto3" json:"readonly,omitempty"`
+ // saas flag means if the Bytebase is running in SaaS mode, some features are not allowed to edit by users.
+ Saas bool `protobuf:"varint,4,opt,name=saas,proto3" json:"saas,omitempty"`
+ // demo_name specifies the demo name, empty string means no demo.
+ DemoName string `protobuf:"bytes,5,opt,name=demo_name,json=demoName,proto3" json:"demo_name,omitempty"`
+ // host is the Bytebase instance host.
+ Host string `protobuf:"bytes,6,opt,name=host,proto3" json:"host,omitempty"`
+ // port is the Bytebase instance port.
+ Port string `protobuf:"bytes,7,opt,name=port,proto3" json:"port,omitempty"`
+ // external_url is the URL where user or webhook callback visits Bytebase.
+ ExternalUrl string `protobuf:"bytes,8,opt,name=external_url,json=externalUrl,proto3" json:"external_url,omitempty"`
+ // need_admin_setup flag means the Bytebase instance doesn't have any end users.
+ NeedAdminSetup bool `protobuf:"varint,9,opt,name=need_admin_setup,json=needAdminSetup,proto3" json:"need_admin_setup,omitempty"`
+ // disallow_signup is the flag to disable self-service signup.
+ DisallowSignup bool `protobuf:"varint,10,opt,name=disallow_signup,json=disallowSignup,proto3" json:"disallow_signup,omitempty"`
+ // last_active_time is the service last active time in UTC Time Format, any API calls will refresh this value.
+ LastActiveTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=last_active_time,json=lastActiveTime,proto3" json:"last_active_time,omitempty"`
}
func (x *ActuatorInfo) Reset() {
@@ -181,6 +194,13 @@ func (x *ActuatorInfo) GetDisallowSignup() bool {
return false
}
+func (x *ActuatorInfo) GetLastActiveTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.LastActiveTime
+ }
+ return nil
+}
+
var File_v1_actuator_service_proto protoreflect.FileDescriptor
var file_v1_actuator_service_proto_rawDesc = []byte{
@@ -193,42 +213,49 @@ var file_v1_actuator_service_proto_rawDesc = []byte{
0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c,
0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
- 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x18, 0x0a,
- 0x16, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f,
- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xe8, 0x02, 0x0a, 0x0c, 0x41, 0x63, 0x74, 0x75,
- 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73,
- 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52,
- 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x69, 0x74, 0x5f,
- 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41,
- 0x01, 0x03, 0x52, 0x09, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x20, 0x0a,
- 0x08, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x42,
- 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x12,
- 0x18, 0x0a, 0x04, 0x73, 0x61, 0x61, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x42, 0x04, 0xe2,
- 0x41, 0x01, 0x03, 0x52, 0x04, 0x73, 0x61, 0x61, 0x73, 0x12, 0x21, 0x0a, 0x09, 0x64, 0x65, 0x6d,
- 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41,
- 0x01, 0x03, 0x52, 0x08, 0x64, 0x65, 0x6d, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x04,
- 0x68, 0x6f, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03,
- 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x07,
- 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74,
- 0x12, 0x27, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x75, 0x72, 0x6c,
- 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0b, 0x65, 0x78,
- 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x55, 0x72, 0x6c, 0x12, 0x2e, 0x0a, 0x10, 0x6e, 0x65, 0x65,
- 0x64, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x74, 0x75, 0x70, 0x18, 0x09, 0x20,
- 0x01, 0x28, 0x08, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0e, 0x6e, 0x65, 0x65, 0x64, 0x41,
- 0x64, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x75, 0x70, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73,
- 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x18, 0x0a, 0x20, 0x01,
- 0x28, 0x08, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x53, 0x69, 0x67, 0x6e,
- 0x75, 0x70, 0x32, 0x82, 0x01, 0x0a, 0x0f, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x53,
- 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6f, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74,
- 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x75, 0x61,
- 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x74,
- 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x1c, 0xda, 0x41, 0x00, 0x82, 0xd3,
- 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x74, 0x75, 0x61, 0x74,
- 0x6f, 0x72, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72,
- 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x33,
+ 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74,
+ 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x18,
+ 0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66,
+ 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xba, 0x03, 0x0a, 0x0c, 0x41, 0x63, 0x74,
+ 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1e, 0x0a, 0x07, 0x76, 0x65, 0x72,
+ 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03,
+ 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x69, 0x74,
+ 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2,
+ 0x41, 0x01, 0x03, 0x52, 0x09, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x20,
+ 0x0a, 0x08, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08,
+ 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79,
+ 0x12, 0x18, 0x0a, 0x04, 0x73, 0x61, 0x61, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x42, 0x04,
+ 0xe2, 0x41, 0x01, 0x03, 0x52, 0x04, 0x73, 0x61, 0x61, 0x73, 0x12, 0x21, 0x0a, 0x09, 0x64, 0x65,
+ 0x6d, 0x6f, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2,
+ 0x41, 0x01, 0x03, 0x52, 0x08, 0x64, 0x65, 0x6d, 0x6f, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a,
+ 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01,
+ 0x03, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18,
+ 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x04, 0x70, 0x6f, 0x72,
+ 0x74, 0x12, 0x27, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x75, 0x72,
+ 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0b, 0x65,
+ 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x55, 0x72, 0x6c, 0x12, 0x2e, 0x0a, 0x10, 0x6e, 0x65,
+ 0x65, 0x64, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x73, 0x65, 0x74, 0x75, 0x70, 0x18, 0x09,
+ 0x20, 0x01, 0x28, 0x08, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0e, 0x6e, 0x65, 0x65, 0x64,
+ 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x75, 0x70, 0x12, 0x2d, 0x0a, 0x0f, 0x64, 0x69,
+ 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x18, 0x0a, 0x20,
+ 0x01, 0x28, 0x08, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x6c,
+ 0x6c, 0x6f, 0x77, 0x53, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x12, 0x4a, 0x0a, 0x10, 0x6c, 0x61, 0x73,
+ 0x74, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42,
+ 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76,
+ 0x65, 0x54, 0x69, 0x6d, 0x65, 0x32, 0x82, 0x01, 0x0a, 0x0f, 0x41, 0x63, 0x74, 0x75, 0x61, 0x74,
+ 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6f, 0x0a, 0x0f, 0x47, 0x65, 0x74,
+ 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63,
+ 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x41, 0x63, 0x74, 0x75, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x1c, 0xda, 0x41,
+ 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x74,
+ 0x75, 0x61, 0x74, 0x6f, 0x72, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -247,15 +274,17 @@ var file_v1_actuator_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_v1_actuator_service_proto_goTypes = []interface{}{
(*GetActuatorInfoRequest)(nil), // 0: bytebase.v1.GetActuatorInfoRequest
(*ActuatorInfo)(nil), // 1: bytebase.v1.ActuatorInfo
+ (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp
}
var file_v1_actuator_service_proto_depIdxs = []int32{
- 0, // 0: bytebase.v1.ActuatorService.GetActuatorInfo:input_type -> bytebase.v1.GetActuatorInfoRequest
- 1, // 1: bytebase.v1.ActuatorService.GetActuatorInfo:output_type -> bytebase.v1.ActuatorInfo
- 1, // [1:2] is the sub-list for method output_type
- 0, // [0:1] is the sub-list for method input_type
- 0, // [0:0] is the sub-list for extension type_name
- 0, // [0:0] is the sub-list for extension extendee
- 0, // [0:0] is the sub-list for field type_name
+ 2, // 0: bytebase.v1.ActuatorInfo.last_active_time:type_name -> google.protobuf.Timestamp
+ 0, // 1: bytebase.v1.ActuatorService.GetActuatorInfo:input_type -> bytebase.v1.GetActuatorInfoRequest
+ 1, // 2: bytebase.v1.ActuatorService.GetActuatorInfo:output_type -> bytebase.v1.ActuatorInfo
+ 2, // [2:3] is the sub-list for method output_type
+ 1, // [1:2] is the sub-list for method input_type
+ 1, // [1:1] is the sub-list for extension type_name
+ 1, // [1:1] is the sub-list for extension extendee
+ 0, // [0:1] is the sub-list for field type_name
}
func init() { file_v1_actuator_service_proto_init() }
diff --git a/proto/v1/actuator_service.proto b/proto/v1/actuator_service.proto
index 9b7d312a9a..464e9e015c 100644
--- a/proto/v1/actuator_service.proto
+++ b/proto/v1/actuator_service.proto
@@ -6,6 +6,7 @@ import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/protobuf/empty.proto";
+import "google/protobuf/timestamp.proto";
option go_package = "generated-go/v1";
@@ -24,23 +25,36 @@ message GetActuatorInfoRequest {
// ServerInfo is the API message for server info.
// Actuator concept is similar to the Spring Boot Actuator.
message ActuatorInfo {
+ // version is the bytebase's server version
string version = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
+ // git_commit is the git commit hash of the build
string git_commit = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
+ // readonly flag means if the Bytebase is running in readonly mode.
bool readonly = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
+ // saas flag means if the Bytebase is running in SaaS mode, some features are not allowed to edit by users.
bool saas = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
+ // demo_name specifies the demo name, empty string means no demo.
string demo_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
+ // host is the Bytebase instance host.
string host = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
+ // port is the Bytebase instance port.
string port = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
+ // external_url is the URL where user or webhook callback visits Bytebase.
string external_url = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
+ // need_admin_setup flag means the Bytebase instance doesn't have any end users.
bool need_admin_setup = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
- bool disallow_signup = 10;
-}
\ No newline at end of file
+ // disallow_signup is the flag to disable self-service signup.
+ bool disallow_signup = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // last_active_time is the service last active time in UTC Time Format, any API calls will refresh this value.
+ google.protobuf.Timestamp last_active_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
+}