1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-02-08 01:20:07 +08:00
1Panel/core/cmd/server/main.go

46 lines
1.2 KiB
Go
Raw Normal View History

package main
import (
2024-07-23 14:48:05 +08:00
"fmt"
"os"
2024-07-22 16:14:59 +08:00
_ "net/http/pprof"
2023-01-04 22:31:51 +08:00
2024-12-17 20:48:10 +08:00
"github.com/1Panel-dev/1Panel/core/cmd/server/cmd"
_ "github.com/1Panel-dev/1Panel/core/cmd/server/docs"
)
2022-12-14 19:39:32 +08:00
// @title 1Panel
2025-01-21 18:32:14 +08:00
// @version 1.0
// @description Open Source Linux Panel
2022-12-14 19:39:32 +08:00
// @termsOfService http://swagger.io/terms/
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
2025-01-21 18:32:14 +08:00
// @BasePath /api/v1
// @schemes http https
// @securityDefinitions.apikey ApiKeyAuth
// @description Custom Token Format, Format: md5('1panel' + API-Key + UnixTimestamp).
// @description ```
// @description eg:
// @description curl -X GET "http://localhost:4004/api/v1/resource" \
// @description -H "1Panel-Token: <1panel_token>" \
// @description -H "1Panel-Timestamp: <current_unix_timestamp>"
// @description ```
// @description - `1Panel-Token` is the key for the panel API Key.
// @type apiKey
// @in Header
// @name 1Panel-Token
// @securityDefinitions.apikey Timestamp
// @type apiKey
// @in header
// @name 1Panel-Timestamp
// @description - `1Panel-Timestamp` is the Unix timestamp of the current time in seconds.
2022-12-14 19:39:32 +08:00
func main() {
2024-07-23 14:48:05 +08:00
if err := cmd.RootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}