Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
blylei committed Nov 25, 2023
1 parent ea43526 commit 72380bf
Show file tree
Hide file tree
Showing 153 changed files with 1,035 additions and 297 deletions.
30 changes: 18 additions & 12 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,31 @@ nfpms:

homepage: https://github.com/frabits/frabit

maintainer: Blylei <[email protected]>
maintainer: Frabit Labs

description: |-
The next-generation database automatic operation platform.
The next-gene database automatic platform
license: GPLv3

formats:
- deb
- rpm
contents:
- src: ./configs/frabit-server.yaml
dst: /etc/frabit-server/config.yml
type: 'config|noreplace'
- src: ./packages/frabit-server.service
dst: /etc/systemd/system/frabit-server.service
scripts:
postinstall: ./scripts/frabit-postinstall.sh
bindir: /usr/bin

# epoch: 2

# Section.

section: default
rpm:
# RPM specific scripts.
scripts:
summary: The next-generation database automatic operation platform
summary: The next-gene database automatic platform
group: Unspecified
compression: lzma

Expand All @@ -104,9 +109,9 @@ nfpms:
- frabit-agent
vendor: Frabit Inc.
homepage: https://github.com/frabits/frabit
maintainer: Blylei <[email protected]>
maintainer: Frabit Labs
description: |-
The next-generation database automatic operation platform
The next-gene database automatic platform
license: GPLv3
formats:
- deb
Expand All @@ -120,7 +125,7 @@ nfpms:

rpm:
scripts:
summary: The next-generation database automatic operation platform
summary: The next-gene database automatic platform
group: Database
compression: lzma

Expand All @@ -135,6 +140,7 @@ nfpms:
- some-package
signature:
type: origin

brews:
-
name: frabit
Expand All @@ -145,8 +151,8 @@ brews:
name: goreleaser
email: [email protected]
folder: Formula
homepage: https://www.frabit.tech/
description: "The next-generation database automatic operation platform"
homepage: https://www.frabit.tech
description: "The next-gene database automatic platform"

checksum:
name_template: 'checksum.txt'
Expand Down
45 changes: 45 additions & 0 deletions admin/cmd/admin/admin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.gnu.org/licenses/gpl-3.0.txt
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package admin

import (
"fmt"
"github.com/spf13/cobra"
)

// CmdAdmin represents the Admin command
var CmdAdmin = &cobra.Command{
Use: "reset-admin-password <new_password>",
Short: "Reset admin password at any time",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("standalone called")
},
}

var resetAdminPassword = &cobra.Command{
Use: "reset-admin-password <new_password>",
Short: "Reset admin password at any time",
Run: runResetAdminPassword,
}

func runResetAdminPassword(cmd *cobra.Command, args []string) {
fmt.Println("runResetAdminPassword called")
}

func init() {
CmdAdmin.AddCommand(resetAdminPassword)
CmdAdmin.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}
2 changes: 1 addition & 1 deletion admin/cmd/auth/auth.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
5 changes: 2 additions & 3 deletions admin/cmd/auth/login.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -17,8 +17,7 @@ package auth

import (
"fmt"

"github.com/frabits/frabit/common/version"
"github.com/frabits/frabit/pkg/common/version"

"github.com/spf13/cobra"
)
Expand Down
4 changes: 2 additions & 2 deletions admin/cmd/auth/logout.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,7 @@ package auth

import (
"fmt"
"github.com/frabits/frabit/common/version"
"github.com/frabits/frabit/pkg/common/version"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions admin/cmd/auth/status.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,7 @@ package auth

import (
"fmt"
"github.com/frabits/frabit/common/version"
"github.com/frabits/frabit/pkg/common/version"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/backup/backup.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/backup/clickhouse.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/backup/mongodb.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/backup/mysql.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/backup/redis.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/deploy/clickhouse.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/deploy/deploy.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/deploy/mongodb.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions admin/cmd/deploy/mysql.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,7 @@ package deploy

import (
"fmt"
"github.com/frabits/frabit/common/version"
"github.com/frabits/frabit/pkg/common/version"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/deploy/redis.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/plugin/plugin.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/restore/clickhouse.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/restore/mongodb.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/restore/mysql.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/restore/redis.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/restore/restore.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
8 changes: 5 additions & 3 deletions admin/cmd/root/root.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -22,16 +22,17 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"

"github.com/frabits/frabit/admin/cmd/admin"
"github.com/frabits/frabit/admin/cmd/auth"
"github.com/frabits/frabit/admin/cmd/backup"
"github.com/frabits/frabit/admin/cmd/deploy"
"github.com/frabits/frabit/admin/cmd/plugin"
"github.com/frabits/frabit/admin/cmd/restore"
"github.com/frabits/frabit/admin/cmd/upgrade"
"github.com/frabits/frabit/admin/cmd/version"
"github.com/frabits/frabit/common/cmdutil"
"github.com/frabits/frabit/common/config"
"github.com/frabits/frabit/pkg/client"
"github.com/frabits/frabit/pkg/common/cmdutil"
"github.com/frabits/frabit/pkg/common/config"
)

type rootOpt struct {
Expand Down Expand Up @@ -69,6 +70,7 @@ func init() {
rootCmd.AddCommand(restore.CmdRestore)
rootCmd.AddCommand(deploy.CmdDeploy)
rootCmd.AddCommand(upgrade.CmdUpgrade)
rootCmd.AddCommand(admin.ResetAdminPassword)
rootCmd.AddCommand(version.NewVersionCmd())
rootCmd.AddCommand(plugin.CmdPlugin)
rootCmd.AddCommand(auth.CmdAuth)
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/upgrade/clickhouse.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/upgrade/mongodb.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/upgrade/mysql.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion admin/cmd/upgrade/redis.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions admin/cmd/upgrade/upgrade.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,7 @@
package upgrade

import (
"github.com/frabits/frabit/common/cmdutil"
"github.com/frabits/frabit/pkg/common/cmdutil"
"github.com/spf13/cobra"
)

Expand Down
7 changes: 3 additions & 4 deletions admin/cmd/version/version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Frabit - The next-generation database automatic operation platform
// Copyright © 2022-2023 Blylei <[email protected]>
// Copyright © 2022-2023 Frabit Labs
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -17,9 +17,8 @@ package version

import (
"fmt"

"github.com/frabits/frabit/common/cmdutil"
"github.com/frabits/frabit/common/version"
"github.com/frabits/frabit/pkg/common/cmdutil"
"github.com/frabits/frabit/pkg/common/version"

"github.com/spf13/cobra"
)
Expand Down
Loading

0 comments on commit 72380bf

Please sign in to comment.