🚚 Rename management APIs

This commit is contained in:
LittleSheep 2023-12-13 19:52:56 +08:00
parent fb24f44e22
commit 8f1ac85148
11 changed files with 42 additions and 42 deletions

View File

@ -74,7 +74,7 @@ rds cli with this command.
```shell
rds connect <id> <url> <password>
# ID will allow you find this server in after commands.
# URL is to your roadsign server administration api.
# URL is to your roadsign server sideload api.
# Password is your roadsign server credential.
# ======================================================================
# !WARNING! All these things will storage in your $HOME/.roadsignrc.yaml

View File

@ -7,8 +7,8 @@ import (
"syscall"
roadsign "code.smartsheep.studio/goatworks/roadsign/pkg"
"code.smartsheep.studio/goatworks/roadsign/pkg/administration"
"code.smartsheep.studio/goatworks/roadsign/pkg/hypertext"
"code.smartsheep.studio/goatworks/roadsign/pkg/sideload"
"code.smartsheep.studio/goatworks/roadsign/pkg/sign"
"github.com/google/uuid"
"github.com/rs/zerolog"
@ -65,13 +65,13 @@ func main() {
viper.GetString("hypertext.certificate.key"),
)
// Init administration server
// Init sideload server
hypertext.RunServer(
administration.InitAdministration(),
viper.GetStringSlice("hypertext.administration_ports"),
viper.GetStringSlice("hypertext.administration_secured_ports"),
viper.GetString("hypertext.certificate.administration_pem"),
viper.GetString("hypertext.certificate.administration_key"),
sideload.InitSideload(),
viper.GetStringSlice("hypertext.sideload_ports"),
viper.GetStringSlice("hypertext.sideload_secured_ports"),
viper.GetString("hypertext.certificate.sideload_pem"),
viper.GetString("hypertext.certificate.sideload_key"),
)
log.Info().Msgf("RoadSign v%s is started...", roadsign.AppVersion)

View File

@ -1,4 +1,4 @@
package administration
package sideload
import (
roadsign "code.smartsheep.studio/goatworks/roadsign/pkg"

View File

@ -1,4 +1,4 @@
package administration
package sideload
import (
"context"

View File

@ -1,4 +1,4 @@
package administration
package sideload
import (
"fmt"
@ -11,21 +11,21 @@ import (
"github.com/spf13/viper"
)
func InitAdministration() *fiber.App {
func InitSideload() *fiber.App {
app := fiber.New(fiber.Config{
AppName: "RoadSign Administration",
ServerHeader: fmt.Sprintf("RoadSign Administration v%s", roadsign.AppVersion),
AppName: "RoadSign Sideload",
ServerHeader: fmt.Sprintf("RoadSign Sideload v%s", roadsign.AppVersion),
DisableStartupMessage: true,
EnableIPValidation: true,
EnablePrintRoutes: viper.GetBool("debug.print_routes"),
TrustedProxies: viper.GetStringSlice("security.administration_trusted_proxies"),
TrustedProxies: viper.GetStringSlice("security.sideload_trusted_proxies"),
BodyLimit: viper.GetInt("hypertext.limitation.max_body_size"),
})
if viper.GetBool("performance.request_logging") {
app.Use(logger.New(logger.Config{
Output: log.Logger,
Format: "[Administration] [${time}] ${status} - ${latency} ${method} ${path}\n",
Format: "[Sideload] [${time}] ${status} - ${latency} ${method} ${path}\n",
}))
}

View File

@ -1,4 +1,4 @@
package administration
package sideload
import (
"fmt"

View File

@ -1,12 +1,12 @@
debug:
print_routes: true
hypertext:
administration_ports:
sideload_ports:
- :81
administration_secured_ports: []
sideload_secured_ports: []
certificate:
administration_key: ./cert.key
administration_pem: ./cert.pem
sideload_key: ./cert.key
sideload_pem: ./cert.pem
key: ./cert.key
pem: ./cert.pem
limitation:
@ -22,6 +22,6 @@ performance:
network_timeout: 3000
prefork: false
security:
administration_trusted_proxies:
sideload_trusted_proxies:
- localhost
credential: e81f43f32d934271af6322e5376f5f59

View File

@ -1,11 +1,11 @@
debug:
print_routes: false
hypertext:
administration_ports: [":81"]
administration_secured_ports: []
sideload_ports: [":81"]
sideload_secured_ports: []
certificate:
administration_key: ./cert.key
administration_pem: ./cert.pem
sideload_key: ./cert.key
sideload_pem: ./cert.pem
key: ./cert.key
pem: ./cert.pem
limitation:
@ -21,6 +21,6 @@ performance:
network_timeout: 3000
prefork: false
security:
administration_trusted_proxies:
sideload_trusted_proxies:
- localhost
credential: e81f43f32d934271af6322e5376f5f59

View File

@ -1,11 +1,11 @@
debug:
print_routes: false
hypertext:
administration_ports: [":81"]
administration_secured_ports: []
sideload_ports: [":81"]
sideload_secured_ports: []
certificate:
administration_key: ./cert.key
administration_pem: ./cert.pem
sideload_key: ./cert.key
sideload_pem: ./cert.pem
key: ./cert.key
pem: ./cert.pem
limitation:
@ -21,6 +21,6 @@ performance:
network_timeout: 3000
prefork: false
security:
administration_trusted_proxies:
sideload_trusted_proxies:
- localhost
credential: e81f43f32d934271af6322e5376f5f59

View File

@ -1,11 +1,11 @@
debug:
print_routes: false
hypertext:
administration_ports: [":81"]
administration_secured_ports: []
sideload_ports: [":81"]
sideload_secured_ports: []
certificate:
administration_key: ./cert.key
administration_pem: ./cert.pem
sideload_key: ./cert.key
sideload_pem: ./cert.pem
key: ./cert.key
pem: ./cert.pem
limitation:
@ -21,6 +21,6 @@ performance:
network_timeout: 3000
prefork: true
security:
administration_trusted_proxies:
sideload_trusted_proxies:
- localhost
credential: e81f43f32d934271af6322e5376f5f59

View File

@ -1,11 +1,11 @@
debug:
print_routes: false
hypertext:
administration_ports: [":81"]
administration_secured_ports: []
sideload_ports: [":81"]
sideload_secured_ports: []
certificate:
administration_key: ./cert.key
administration_pem: ./cert.pem
sideload_key: ./cert.key
sideload_pem: ./cert.pem
key: ./cert.key
pem: ./cert.pem
limitation:
@ -21,6 +21,6 @@ performance:
network_timeout: 3000
prefork: false
security:
administration_trusted_proxies:
sideload_trusted_proxies:
- localhost
credential: e81f43f32d934271af6322e5376f5f59