Uses v2 configration schema

This commit is contained in:
2024-01-25 00:09:39 +08:00
parent 7ad17d9417
commit b906edc022
37 changed files with 542 additions and 437 deletions

View File

@@ -17,7 +17,7 @@ type CliConnection struct {
}
func (v CliConnection) CheckConnectivity() error {
client := fiber.Get(v.Url + "/cgi/connectivity")
client := fiber.Get(v.Url + "/cgi/metadata")
client.BasicAuth("RoadSign CLI", v.Credential)
if status, data, err := client.Bytes(); len(err) > 0 {

View File

@@ -11,9 +11,9 @@ import (
"code.smartsheep.studio/goatworks/roadsign/pkg/cmd/rds/conn"
"code.smartsheep.studio/goatworks/roadsign/pkg/navi"
"github.com/gofiber/fiber/v2"
"github.com/pelletier/go-toml/v2"
"github.com/rs/zerolog/log"
"github.com/urfave/cli/v2"
"gopkg.in/yaml.v2"
)
var DeployCommands = []*cli.Command{
@@ -78,7 +78,7 @@ var DeployCommands = []*cli.Command{
return err
} else {
raw, _ := io.ReadAll(file)
yaml.Unmarshal(raw, &site)
toml.Unmarshal(raw, &site)
}
url := fmt.Sprintf("/webhooks/sync/%s", ctx.Args().Get(1))

View File

@@ -21,7 +21,7 @@ func main() {
// Configure settings
viper.AddConfigPath("$HOME")
viper.SetConfigName(".roadsignrc")
viper.SetConfigType("yaml")
viper.SetConfigType("toml")
// Load settings
if err := viper.ReadInConfig(); err != nil {