Compare commits
3 Commits
85b0cc0c91
...
ed2b65355c
Author | SHA1 | Date | |
---|---|---|---|
ed2b65355c | |||
6905c60d82 | |||
4dc2729024 |
65
README.md
65
README.md
@ -10,7 +10,8 @@ A blazing fast reverse proxy with a lot of shining features.
|
|||||||
4. Integrate with CI/CD
|
4. Integrate with CI/CD
|
||||||
5. Webhook integration
|
5. Webhook integration
|
||||||
6. ~~Web management panel~~
|
6. ~~Web management panel~~
|
||||||
7. **Blazing fast ⚡**
|
7. One-liner CLI
|
||||||
|
8. **Blazing fast ⚡**
|
||||||
|
|
||||||
> Deleted item means under construction, check out our roadmap!
|
> Deleted item means under construction, check out our roadmap!
|
||||||
|
|
||||||
@ -27,6 +28,66 @@ Here's the result:
|
|||||||
|
|
||||||
As result, roadsign undoubtedly is the fastest one.
|
As result, roadsign undoubtedly is the fastest one.
|
||||||
|
|
||||||
It can be found that the prefork feature makes RoadSign more stable in concurrency. We can see this from the **Slowest Time**. At the same time, the **Fastest Time** is affected because reusing ports requires some extra steps to handle load balancing. Enable this feature at your own discretion depending on your use case.
|
It can be found that the prefork feature makes RoadSign more stable in concurrency. We can see this from the **Slowest
|
||||||
|
Time**. At the same time, the **Fastest Time** is affected because reusing ports requires some extra steps to handle
|
||||||
|
load balancing. Enable this feature at your own discretion depending on your use case.
|
||||||
|
|
||||||
More details can be found at benchmark's [README.md](./test/README.md)
|
More details can be found at benchmark's [README.md](./test/README.md)
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
We strongly recommend you install RoadSign via docker compose.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
roadsign:
|
||||||
|
image: code.smartsheep.studio/goatworks/roadsign:nightly
|
||||||
|
restart: always
|
||||||
|
volumes:
|
||||||
|
- "./certs:/certs" # Optional, use for storage certificates
|
||||||
|
- "./config:/config"
|
||||||
|
- "./wwwroot:/wwwroot" # Optional, use for storage web apps
|
||||||
|
- "./settings.yml:/settings.yml"
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
- "443:443"
|
||||||
|
- "81:81"
|
||||||
|
```
|
||||||
|
|
||||||
|
After that, you can manage your roadsign instance with RoadSign CLI aka. RDS CLI.
|
||||||
|
To install it, run this command. (Make sure you have golang toolchain on your computer)
|
||||||
|
|
||||||
|
```shell
|
||||||
|
go install code.smartsheep.studio/goatworks/roadsign/pkg/cmd/rds@latest
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
To use roadsign, you need to add a configuration for it. Create a file locally.
|
||||||
|
Name whatever you like. And follow our [documentation](https://wiki.smartsheep.studio/roadsign/02-configuration.html) to
|
||||||
|
write it.
|
||||||
|
|
||||||
|
After configure, you need sync your config to remote server. Before that, add a connection between roadsign server and
|
||||||
|
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.
|
||||||
|
# Password is your roadsign server credential.
|
||||||
|
# ======================================================================
|
||||||
|
# !WARNING! All these things will storage in your $HOME/.roadsignrc.yaml
|
||||||
|
# ======================================================================
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, sync your local config to remote.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
rds sync <server id> <site id> <config file>
|
||||||
|
# Server ID is your server added by last command.
|
||||||
|
# Site ID is your new site id or old site id if you need update it.
|
||||||
|
# Config File is your local config file path.
|
||||||
|
```
|
||||||
|
|
||||||
|
After a few seconds, your website is ready!
|
@ -30,19 +30,16 @@ func doSyncSite(c *fiber.Ctx) error {
|
|||||||
defer file.Close()
|
defer file.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
pushed := false
|
if site, ok := lo.Find(sign.App.Sites, func(item *sign.SiteConfig) bool {
|
||||||
sign.App.Sites = lo.Map(sign.App.Sites, func(item *sign.SiteConfig, idx int) *sign.SiteConfig {
|
return item.ID == id
|
||||||
if item.ID == id {
|
}); ok {
|
||||||
pushed = true
|
for _, process := range site.Processes {
|
||||||
return &req
|
process.StopProcess()
|
||||||
} else {
|
}
|
||||||
return item
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
if !pushed {
|
// Reload
|
||||||
sign.App.Sites = append(sign.App.Sites, &req)
|
sign.ReadInConfig(viper.GetString("paths.configs"))
|
||||||
}
|
|
||||||
|
|
||||||
return c.SendStatus(fiber.StatusOK)
|
return c.SendStatus(fiber.StatusOK)
|
||||||
}
|
}
|
||||||
|
@ -43,18 +43,3 @@ func ReadInConfig(root string) error {
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SaveInConfig(root string, cfg *AppConfig) error {
|
|
||||||
for _, site := range cfg.Sites {
|
|
||||||
data, _ := yaml.Marshal(site)
|
|
||||||
|
|
||||||
fp := filepath.Join(root, site.ID)
|
|
||||||
if file, err := os.OpenFile(fp, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0755); err != nil {
|
|
||||||
return err
|
|
||||||
} else if _, err := file.Write(data); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
@ -5,4 +5,4 @@ rules:
|
|||||||
upstreams:
|
upstreams:
|
||||||
- id: example
|
- id: example
|
||||||
name: Benchmarking Data
|
name: Benchmarking Data
|
||||||
uri: files://../data/.spa
|
uri: files://../data/spa
|
||||||
|
Loading…
x
Reference in New Issue
Block a user