2022-10-17 08:32:31 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2022-12-14 13:03:47 +00:00
|
|
|
"fmt"
|
2023-01-04 14:31:51 +00:00
|
|
|
"os"
|
|
|
|
|
2022-12-14 13:03:47 +00:00
|
|
|
"github.com/1Panel-dev/1Panel/cmd/server/cmd"
|
2022-12-14 11:39:32 +00:00
|
|
|
_ "github.com/1Panel-dev/1Panel/cmd/server/docs"
|
2023-02-17 08:21:13 +00:00
|
|
|
_ "net/http/pprof"
|
2022-10-17 08:32:31 +00:00
|
|
|
)
|
|
|
|
|
2022-12-14 11:39:32 +00:00
|
|
|
// @title 1Panel
|
|
|
|
// @version 1.0
|
2024-11-30 11:44:50 +00:00
|
|
|
// @description Open Source Linux Panel
|
2022-12-14 11:39:32 +00:00
|
|
|
// @termsOfService http://swagger.io/terms/
|
|
|
|
// @license.name Apache 2.0
|
|
|
|
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
|
|
|
|
// @BasePath /api/v1
|
2024-11-21 14:09:00 +00:00
|
|
|
// @schemes http https
|
|
|
|
|
|
|
|
// @securityDefinitions.apikey CustomToken
|
2024-11-30 11:44:50 +00:00
|
|
|
// @description Custom Token Format, Format: md5('1panel' + 1Panel-Token + 1Panel-Timestamp).
|
2024-11-21 14:09:00 +00:00
|
|
|
// @description ```
|
2024-11-30 11:44:50 +00:00
|
|
|
// @description eg:
|
2024-11-21 14:09:00 +00:00
|
|
|
// @description curl -X GET "http://localhost:4004/api/v1/resource" \
|
|
|
|
// @description -H "1Panel-Token: <1panel_token>" \
|
|
|
|
// @description -H "1Panel-Timestamp: <current_unix_timestamp>"
|
|
|
|
// @description ```
|
2024-11-30 11:44:50 +00:00
|
|
|
// @description - `1Panel-Token` is the key for the panel API interface.
|
2024-11-21 14:09:00 +00:00
|
|
|
// @type apiKey
|
|
|
|
// @in Header
|
|
|
|
// @name 1Panel-Token
|
|
|
|
// @securityDefinitions.apikey Timestamp
|
|
|
|
// @type apiKey
|
|
|
|
// @in header
|
|
|
|
// @name 1Panel-Timestamp
|
2024-11-30 11:44:50 +00:00
|
|
|
// @description - `1Panel-Timestamp` is the Unix timestamp of the current time in seconds.
|
2022-12-14 11:39:32 +00:00
|
|
|
|
2023-01-05 03:57:03 +00:00
|
|
|
//go:generate swag init -o ./docs -g main.go -d ../../backend -g ../cmd/server/main.go
|
2022-10-17 08:32:31 +00:00
|
|
|
func main() {
|
2022-12-14 13:03:47 +00:00
|
|
|
if err := cmd.RootCmd.Execute(); err != nil {
|
|
|
|
fmt.Fprintln(os.Stderr, err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2022-10-17 08:32:31 +00:00
|
|
|
}
|