2022-10-17 16:32:31 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2022-12-14 21:03:47 +08:00
|
|
|
"fmt"
|
2023-01-04 22:31:51 +08:00
|
|
|
"os"
|
|
|
|
|
2024-12-31 10:32:47 +08:00
|
|
|
_ "net/http/pprof"
|
|
|
|
|
2022-12-14 21:03:47 +08:00
|
|
|
"github.com/1Panel-dev/1Panel/cmd/server/cmd"
|
2022-12-14 19:39:32 +08:00
|
|
|
_ "github.com/1Panel-dev/1Panel/cmd/server/docs"
|
2022-10-17 16:32:31 +08:00
|
|
|
)
|
|
|
|
|
2022-12-14 19:39:32 +08:00
|
|
|
// @title 1Panel
|
|
|
|
// @version 1.0
|
2024-12-06 16:57:20 +08:00
|
|
|
// @description Top-Rated Web-based Linux Server Management Tool
|
2022-12-14 19:39:32 +08:00
|
|
|
// @termsOfService http://swagger.io/terms/
|
2024-12-06 16:57:20 +08:00
|
|
|
// @license.name GPL-3.0
|
|
|
|
// @license.url https://www.gnu.org/licenses/gpl-3.0.html
|
2022-12-14 19:39:32 +08:00
|
|
|
// @BasePath /api/v1
|
2024-11-21 22:09:00 +08:00
|
|
|
// @schemes http https
|
|
|
|
|
2024-12-09 17:57:34 +08:00
|
|
|
// @securityDefinitions.apikey ApiKeyAuth
|
2024-12-16 22:16:10 +08:00
|
|
|
// @description Custom Token Format, Format: md5('1panel' + API-Key + UnixTimestamp).
|
2024-11-21 22:09:00 +08:00
|
|
|
// @description ```
|
2024-11-30 19:44:50 +08:00
|
|
|
// @description eg:
|
2025-01-13 23:10:04 +08:00
|
|
|
// @description curl -X GET "http://localhost:4004/api/v1/dashboard/current" \
|
2024-11-21 22:09:00 +08:00
|
|
|
// @description -H "1Panel-Token: <1panel_token>" \
|
|
|
|
// @description -H "1Panel-Timestamp: <current_unix_timestamp>"
|
|
|
|
// @description ```
|
2024-12-16 22:16:10 +08:00
|
|
|
// @description - `1Panel-Token` is the key for the panel API Key.
|
2024-11-21 22:09:00 +08:00
|
|
|
// @type apiKey
|
2024-12-31 10:32:47 +08:00
|
|
|
// @in header
|
2024-11-21 22:09:00 +08:00
|
|
|
// @name 1Panel-Token
|
2024-12-09 17:57:34 +08:00
|
|
|
|
2024-11-21 22:09:00 +08:00
|
|
|
// @securityDefinitions.apikey Timestamp
|
|
|
|
// @type apiKey
|
|
|
|
// @in header
|
|
|
|
// @name 1Panel-Timestamp
|
2024-11-30 19:44:50 +08:00
|
|
|
// @description - `1Panel-Timestamp` is the Unix timestamp of the current time in seconds.
|
2022-12-14 19:39:32 +08:00
|
|
|
|
2023-01-05 11:57:03 +08:00
|
|
|
//go:generate swag init -o ./docs -g main.go -d ../../backend -g ../cmd/server/main.go
|
2022-10-17 16:32:31 +08:00
|
|
|
func main() {
|
2022-12-14 21:03:47 +08:00
|
|
|
if err := cmd.RootCmd.Execute(); err != nil {
|
|
|
|
fmt.Fprintln(os.Stderr, err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2022-10-17 16:32:31 +08:00
|
|
|
}
|