diff --git a/fileserver/option/option.go b/fileserver/option/option.go index 76be20f..9c7ba0b 100644 --- a/fileserver/option/option.go +++ b/fileserver/option/option.go @@ -46,8 +46,6 @@ var ( // notification server EnableNotification bool NotificationURL string - // notification options - PrivateKey string // GROUP options GroupTableName string @@ -107,11 +105,6 @@ func LoadFileServerOptions(centralDir string) { if EnableNotification { var notifServer string var notifPort uint32 - if section, err := config.GetSection("notification"); err == nil { - if key, err := section.GetKey("jwt_private_key"); err == nil { - PrivateKey = key.String() - } - } if section, err := config.GetSection("notification"); err == nil { if key, err := section.GetKey("host"); err == nil { notifServer = key.String() diff --git a/fileserver/sync_api.go b/fileserver/sync_api.go index 54b36ad..c1ef70b 100644 --- a/fileserver/sync_api.go +++ b/fileserver/sync_api.go @@ -771,7 +771,7 @@ func genJWTToken(repoID, user string) (string, error) { } token := jwt.NewWithClaims(jwt.GetSigningMethod("HS256"), &claims) - tokenString, err := token.SignedString([]byte(option.PrivateKey)) + tokenString, err := token.SignedString([]byte(seahubPK)) if err != nil { err := fmt.Errorf("failed to gen jwt token for repo %s", repoID) return "", err diff --git a/server/seafile-session.c b/server/seafile-session.c index 362ea30..d0f7440 100644 --- a/server/seafile-session.c +++ b/server/seafile-session.c @@ -204,10 +204,7 @@ seafile_session_new(const char *central_config_dir, "notification", "port", NULL); - notif_server_private_key = g_key_file_get_string (config, - "notification", "jwt_private_key", - NULL); - session->notif_server_private_key = notif_server_private_key; + session->notif_server_private_key = g_strdup (private_key); } if (load_database_config (session) < 0) {