2021-03-16 19:22:06 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
|
2022-06-11 21:17:43 +00:00
|
|
|
_ "github.com/joho/godotenv/autoload"
|
2021-12-03 01:12:51 +00:00
|
|
|
"github.com/urfave/cli/v2"
|
2021-12-05 13:45:17 +00:00
|
|
|
|
2021-12-03 01:12:51 +00:00
|
|
|
"codeberg.org/codeberg/pages/cmd"
|
2023-02-10 03:33:28 +00:00
|
|
|
"codeberg.org/codeberg/pages/server/version"
|
2021-03-16 19:22:06 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2021-12-03 01:12:51 +00:00
|
|
|
app := cli.NewApp()
|
|
|
|
app.Name = "pages-server"
|
2023-02-10 03:33:28 +00:00
|
|
|
app.Version = version.Version
|
2021-12-03 01:12:51 +00:00
|
|
|
app.Usage = "pages server"
|
|
|
|
app.Action = cmd.Serve
|
2023-02-10 03:00:14 +00:00
|
|
|
app.Flags = cmd.ServerFlags
|
2021-12-03 01:12:51 +00:00
|
|
|
app.Commands = []*cli.Command{
|
|
|
|
cmd.Certs,
|
2021-11-20 20:10:46 +00:00
|
|
|
}
|
2021-11-20 14:54:52 +00:00
|
|
|
|
2021-12-03 01:12:51 +00:00
|
|
|
if err := app.Run(os.Args); err != nil {
|
|
|
|
_, _ = fmt.Fprintln(os.Stderr, err)
|
|
|
|
os.Exit(1)
|
2021-03-16 19:22:06 +00:00
|
|
|
}
|
|
|
|
}
|