Compare commits
46 Commits
refactor/r
...
1.0.0
Author | SHA1 | Date | |
---|---|---|---|
99e4a64b5a | |||
498eb05514 | |||
8a5cc34bb4 | |||
006a22cd7b | |||
2cfc9cd7fa | |||
2125239d42 | |||
70e5e5eddf | |||
f22affc05c | |||
dd36e2ab1a | |||
ae12eb2a15 | |||
f66f144f2e | |||
632d37caf5 | |||
28d3a3fa06 | |||
232ded4cd4 | |||
e158cb8819 | |||
90e7b03975 | |||
9a2192aa43 | |||
283a646eb4 | |||
17322108ff | |||
64272e786b | |||
6607e1dc5e | |||
d2710d1718 | |||
7b544f370d | |||
09c4800143 | |||
ef10fab47d | |||
11cf35cf0d | |||
28fd5aca8b | |||
e55077c7e9 | |||
910a9849f7 | |||
2860542e44 | |||
302491741f | |||
72d23c35f5 | |||
1cebff59e1 | |||
74d8b3848f | |||
7a3c489797 | |||
440851a305 | |||
61d30315ec | |||
450250c419 | |||
97df54a315 | |||
e8c39f38cc | |||
1ab4c5984e | |||
da90d12a3a | |||
bfce13fc74 | |||
4bdddf72e9 | |||
b906edc022 | |||
7ad17d9417 |
@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"type": "go",
|
|
||||||
"name": "Run RoadSign",
|
|
||||||
"goExecPath": "C:\\Tools\\Scoop\\shims\\go.exe",
|
|
||||||
"buildParams": ["code.smartsheep.studio/goatworks/roadsign/pkg/cmd"],
|
|
||||||
},
|
|
||||||
|
|
||||||
]
|
|
||||||
}
|
|
@ -2,27 +2,27 @@ name: release-nightly
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [master]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-docker:
|
build-image:
|
||||||
runs-on: edge
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
|
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
|
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
|
||||||
push: true
|
push: true
|
||||||
tags: xsheep2010/roadsign:nightly
|
file: ./Dockerfile
|
||||||
|
tags: xsheep2010/roadsign:delta
|
7
.gitignore
vendored
7
.gitignore
vendored
@ -1,2 +1,5 @@
|
|||||||
/config
|
/letsencrypt
|
||||||
/letsencrypt
|
/certs
|
||||||
|
/dist
|
||||||
|
|
||||||
|
.DS_Store
|
7
.idea/RoadSign.iml
generated
7
.idea/RoadSign.iml
generated
@ -1,9 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module type="WEB_MODULE" version="4">
|
<module type="WEB_MODULE" version="4">
|
||||||
|
<component name="FacetManager">
|
||||||
|
<facet type="Python" name="Python facet">
|
||||||
|
<configuration sdkName="Python 3.9" />
|
||||||
|
</facet>
|
||||||
|
</component>
|
||||||
<component name="Go" enabled="true" />
|
<component name="Go" enabled="true" />
|
||||||
<component name="NewModuleRootManager">
|
<component name="NewModuleRootManager">
|
||||||
<content url="file://$MODULE_DIR$" />
|
<content url="file://$MODULE_DIR$" />
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="Python 3.9 interpreter library" level="application" />
|
||||||
|
<orderEntry type="library" name="daisyui" level="application" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
7
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
7
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="DuplicatedCode" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||||
|
<inspection_tool class="ExceptionCaughtLocallyJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
|
</profile>
|
||||||
|
</component>
|
6
.idea/jsLibraryMappings.xml
generated
Normal file
6
.idea/jsLibraryMappings.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="JavaScriptLibraryMappings">
|
||||||
|
<file url="PROJECT" libraries="{daisyui}" />
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/misc.xml
generated
Normal file
6
.idea/misc.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Black">
|
||||||
|
<option name="sdkName" value="Python 3.9" />
|
||||||
|
</component>
|
||||||
|
</project>
|
16
.vscode/launch.json
vendored
16
.vscode/launch.json
vendored
@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
// Use IntelliSense to learn about possible attributes.
|
|
||||||
// Hover to view descriptions of existing attributes.
|
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "Run RoadSign",
|
|
||||||
"type": "go",
|
|
||||||
"request": "launch",
|
|
||||||
"mode": "auto",
|
|
||||||
"program": "${workspaceFolder}/pkg/cmd/main.go",
|
|
||||||
"cwd": "${workspaceFolder}"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,19 +1,15 @@
|
|||||||
# Building Backend
|
# Building Backend
|
||||||
FROM golang:alpine as roadsign-server
|
FROM golang:alpine as roadsign-server
|
||||||
|
|
||||||
RUN apk add nodejs npm
|
|
||||||
|
|
||||||
WORKDIR /source
|
WORKDIR /source
|
||||||
COPY . .
|
COPY . .
|
||||||
WORKDIR /source/pkg/sideload/view
|
|
||||||
RUN npm install
|
|
||||||
RUN npm run build
|
|
||||||
WORKDIR /source
|
|
||||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildvcs -o /dist ./pkg/cmd/server/main.go
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildvcs -o /dist ./pkg/cmd/server/main.go
|
||||||
|
|
||||||
# Runtime
|
# Runtime
|
||||||
FROM golang:alpine
|
FROM golang:alpine
|
||||||
|
|
||||||
|
RUN apk add zip
|
||||||
|
|
||||||
COPY --from=roadsign-server /dist /roadsign/server
|
COPY --from=roadsign-server /dist /roadsign/server
|
||||||
|
|
||||||
EXPOSE 81
|
EXPOSE 81
|
||||||
|
39
README.md
39
README.md
@ -1,23 +1,30 @@
|
|||||||
# 🚦 RoadSign
|
# 🚦 RoadSign
|
||||||
|
|
||||||
A blazing fast reverse proxy with a lot of shining features.
|
A blazing fast http server with a lot of shining features.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
1. Reverse proxy
|
1. Reverse proxy
|
||||||
2. Static file hosting
|
2. WebSocket Support
|
||||||
3. ~~Analytics and Metrics~~
|
3. Static File Hosting
|
||||||
4. Integrate with CI/CD
|
4. Low Configuration
|
||||||
5. Webhook integration
|
5. Analytics and Metrics
|
||||||
6. ~~Web management panel~~
|
6. Integrate with CI/CD
|
||||||
7. One-liner CLI
|
7. One-liner CLI
|
||||||
8. **Blazing fast ⚡**
|
8. Open-source and free
|
||||||
|
9. **Blazing fast ⚡**
|
||||||
|
|
||||||
> Deleted item means under construction, check out our roadmap!
|
But, as we said, this isn't a reverse proxy. It's a http server.
|
||||||
|
So we didn't recommend you directly use it as a gateway to users, because it doesn't support all the features of http.
|
||||||
|
For example like doesn't support multiple site HTTPS, HTTP/2.0, HTTP/3 and Server-Side Events.
|
||||||
|
|
||||||
|
You can use RoadSign behind a reverse proxy like caddy, and let it handle the HTTP/2.0, HTTP/3 and all the other
|
||||||
|
cutting-edge stuff.
|
||||||
|
|
||||||
### How fast is it?
|
### How fast is it?
|
||||||
|
|
||||||
We use roadsign and nginx to host a same static file, and test them with [go-wrk](https://github.com/tsliwowicz/go-wrk).
|
We use roadsign and nginx to host the same static file
|
||||||
|
and test them with [go-wrk](https://github.com/tsliwowicz/go-wrk).
|
||||||
Here's the result:
|
Here's the result:
|
||||||
|
|
||||||
| **Software** | Total Requests | Requests per Seconds | Transfer per Seconds | Avg Time | Fastest Time | Slowest Time | Errors Count |
|
| **Software** | Total Requests | Requests per Seconds | Transfer per Seconds | Avg Time | Fastest Time | Slowest Time | Errors Count |
|
||||||
@ -42,7 +49,7 @@ We strongly recommend you install RoadSign via docker compose.
|
|||||||
version: "3"
|
version: "3"
|
||||||
services:
|
services:
|
||||||
roadsign:
|
roadsign:
|
||||||
image: code.smartsheep.studio/goatworks/roadsign:nightly
|
image: xsheep2010/roadsign:nightly
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- "./certs:/certs" # Optional, use for storage certificates
|
- "./certs:/certs" # Optional, use for storage certificates
|
||||||
@ -55,25 +62,25 @@ services:
|
|||||||
- "81:81"
|
- "81:81"
|
||||||
```
|
```
|
||||||
|
|
||||||
After that, you can manage your roadsign instance with RoadSign CLI aka. RDS CLI.
|
After that, you can manage your roadsign instance with RoadSign CLI aka. RDC.
|
||||||
To install it, run this command. (Make sure you have golang toolchain on your computer)
|
To install it, run this command. (Make sure you have golang toolchain on your computer)
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
go install -buildvcs code.smartsheep.studio/goatworks/roadsign/pkg/cmd/rds@latest
|
go install git.solsynth.dev/goatworks/roadsign/pkg/cmd/rdc@latest
|
||||||
# Tips: Add `buildvsc` flag to provide more detail compatibility check.
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
To use roadsign, you need to add a configuration for it. Create a file locally.
|
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/configuration/index.html) to
|
Name whatever you like. And follow our [documentation](https://wiki.smartsheep.studio/roadsign/configuration/index.html)
|
||||||
|
to
|
||||||
write it.
|
write it.
|
||||||
|
|
||||||
After configure, you need sync your config to remote server. Before that, add a connection between roadsign server and
|
After configure, you need sync your config to remote server. Before that, add a connection between roadsign server and
|
||||||
rds cli with this command.
|
rds cli with this command.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
rds connect <id> <url> <password>
|
rdc connect <id> <url> <password>
|
||||||
# ID will allow you find this server in after commands.
|
# ID will allow you find this server in after commands.
|
||||||
# URL is to your roadsign server sideload api.
|
# URL is to your roadsign server sideload api.
|
||||||
# Password is your roadsign server credential.
|
# Password is your roadsign server credential.
|
||||||
@ -85,7 +92,7 @@ rds connect <id> <url> <password>
|
|||||||
Then, sync your local config to remote.
|
Then, sync your local config to remote.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
rds sync <server id> <site id> <config file>
|
rdc sync <server id> <region id> <config file>
|
||||||
# Server ID is your server added by last command.
|
# 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.
|
# Site ID is your new site id or old site id if you need update it.
|
||||||
# Config File is your local config file path.
|
# Config File is your local config file path.
|
||||||
|
177
cli/.gitignore
vendored
Normal file
177
cli/.gitignore
vendored
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
|
||||||
|
logs
|
||||||
|
_.log
|
||||||
|
npm-debug.log_
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
.pnpm-debug.log*
|
||||||
|
|
||||||
|
# Caches
|
||||||
|
|
||||||
|
.cache
|
||||||
|
|
||||||
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
|
|
||||||
|
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
||||||
|
|
||||||
|
# Runtime data
|
||||||
|
|
||||||
|
pids
|
||||||
|
_.pid
|
||||||
|
_.seed
|
||||||
|
*.pid.lock
|
||||||
|
|
||||||
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||||
|
|
||||||
|
lib-cov
|
||||||
|
|
||||||
|
# Coverage directory used by tools like istanbul
|
||||||
|
|
||||||
|
coverage
|
||||||
|
*.lcov
|
||||||
|
|
||||||
|
# nyc test coverage
|
||||||
|
|
||||||
|
.nyc_output
|
||||||
|
|
||||||
|
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||||
|
|
||||||
|
.grunt
|
||||||
|
|
||||||
|
# Bower dependency directory (https://bower.io/)
|
||||||
|
|
||||||
|
bower_components
|
||||||
|
|
||||||
|
# node-waf configuration
|
||||||
|
|
||||||
|
.lock-wscript
|
||||||
|
|
||||||
|
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||||
|
|
||||||
|
build/Release
|
||||||
|
|
||||||
|
# Dependency directories
|
||||||
|
|
||||||
|
node_modules/
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# Snowpack dependency directory (https://snowpack.dev/)
|
||||||
|
|
||||||
|
web_modules/
|
||||||
|
|
||||||
|
# TypeScript cache
|
||||||
|
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# Optional npm cache directory
|
||||||
|
|
||||||
|
.npm
|
||||||
|
|
||||||
|
# Optional eslint cache
|
||||||
|
|
||||||
|
.eslintcache
|
||||||
|
|
||||||
|
# Optional stylelint cache
|
||||||
|
|
||||||
|
.stylelintcache
|
||||||
|
|
||||||
|
# Microbundle cache
|
||||||
|
|
||||||
|
.rpt2_cache/
|
||||||
|
.rts2_cache_cjs/
|
||||||
|
.rts2_cache_es/
|
||||||
|
.rts2_cache_umd/
|
||||||
|
|
||||||
|
# Optional REPL history
|
||||||
|
|
||||||
|
.node_repl_history
|
||||||
|
|
||||||
|
# Output of 'npm pack'
|
||||||
|
|
||||||
|
*.tgz
|
||||||
|
|
||||||
|
# Yarn Integrity file
|
||||||
|
|
||||||
|
.yarn-integrity
|
||||||
|
|
||||||
|
# dotenv environment variable files
|
||||||
|
|
||||||
|
.env
|
||||||
|
.env.development.local
|
||||||
|
.env.test.local
|
||||||
|
.env.production.local
|
||||||
|
.env.local
|
||||||
|
|
||||||
|
# parcel-bundler cache (https://parceljs.org/)
|
||||||
|
|
||||||
|
.parcel-cache
|
||||||
|
|
||||||
|
# Next.js build output
|
||||||
|
|
||||||
|
.next
|
||||||
|
out
|
||||||
|
|
||||||
|
# Nuxt.js build / generate output
|
||||||
|
|
||||||
|
.nuxt
|
||||||
|
dist
|
||||||
|
|
||||||
|
# Gatsby files
|
||||||
|
|
||||||
|
# Comment in the public line in if your project uses Gatsby and not Next.js
|
||||||
|
|
||||||
|
# https://nextjs.org/blog/next-9-1#public-directory-support
|
||||||
|
|
||||||
|
# public
|
||||||
|
|
||||||
|
# vuepress build output
|
||||||
|
|
||||||
|
.vuepress/dist
|
||||||
|
|
||||||
|
# vuepress v2.x temp and cache directory
|
||||||
|
|
||||||
|
.temp
|
||||||
|
|
||||||
|
# Docusaurus cache and generated files
|
||||||
|
|
||||||
|
.docusaurus
|
||||||
|
|
||||||
|
# Serverless directories
|
||||||
|
|
||||||
|
.serverless/
|
||||||
|
|
||||||
|
# FuseBox cache
|
||||||
|
|
||||||
|
.fusebox/
|
||||||
|
|
||||||
|
# DynamoDB Local files
|
||||||
|
|
||||||
|
.dynamodb/
|
||||||
|
|
||||||
|
# TernJS port file
|
||||||
|
|
||||||
|
.tern-port
|
||||||
|
|
||||||
|
# Stores VSCode versions used for testing VSCode extensions
|
||||||
|
|
||||||
|
.vscode-test
|
||||||
|
|
||||||
|
# yarn v2
|
||||||
|
|
||||||
|
.yarn/cache
|
||||||
|
.yarn/unplugged
|
||||||
|
.yarn/build-state.yml
|
||||||
|
.yarn/install-state.gz
|
||||||
|
.pnp.*
|
||||||
|
|
||||||
|
# IntelliJ based IDEs
|
||||||
|
.idea
|
||||||
|
|
||||||
|
# Finder (MacOS) folder config
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
/test/static-files
|
13
cli/.roadsignrc
Normal file
13
cli/.roadsignrc
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"sync": {
|
||||||
|
"region": "static-files",
|
||||||
|
"configPath": "test/static-files.toml"
|
||||||
|
},
|
||||||
|
"deployments": [
|
||||||
|
{
|
||||||
|
"path": "test/static-files",
|
||||||
|
"region": "static-files",
|
||||||
|
"site": "static-files-des"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
3
cli/README.md
Normal file
3
cli/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# RoadSign CLI
|
||||||
|
|
||||||
|
RoadSign CLI is a command-line interface (CLI) tool that allows you to manage your RoadSign servers and applications.
|
BIN
cli/bun.lockb
Executable file
BIN
cli/bun.lockb
Executable file
Binary file not shown.
42
cli/index.ts
Executable file
42
cli/index.ts
Executable file
@ -0,0 +1,42 @@
|
|||||||
|
import { Builtins, Cli } from "clipanion"
|
||||||
|
import figlet from "figlet"
|
||||||
|
import chalk from "chalk"
|
||||||
|
|
||||||
|
import { LoginCommand } from "./src/cmd/login.ts"
|
||||||
|
import { LogoutCommand } from "./src/cmd/logout.ts"
|
||||||
|
import { ListServerCommand } from "./src/cmd/list.ts"
|
||||||
|
import { StatusCommand } from "./src/cmd/status.ts"
|
||||||
|
import { InfoCommand } from "./src/cmd/info.ts"
|
||||||
|
import { ProcessCommand } from "./src/cmd/process-info.ts"
|
||||||
|
import { DeployCommand } from "./src/cmd/deploy.ts"
|
||||||
|
import { SyncCommand } from "./src/cmd/sync.ts"
|
||||||
|
import { ReloadCommand } from "./src/cmd/reload.ts"
|
||||||
|
|
||||||
|
const [node, app, ...args] = process.argv
|
||||||
|
|
||||||
|
const ENABLE_STARTUP_ASCII_ART = false
|
||||||
|
|
||||||
|
if (process.env["ENABLE_STARTUP_ASCII_ART"] || ENABLE_STARTUP_ASCII_ART) {
|
||||||
|
console.log(
|
||||||
|
chalk.yellow(figlet.textSync("RoadSign CLI", { horizontalLayout: "default", verticalLayout: "default" }))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const cli = new Cli({
|
||||||
|
binaryLabel: `RoadSign CLI`,
|
||||||
|
binaryName: `${node} ${app}`,
|
||||||
|
binaryVersion: `1.0.0`
|
||||||
|
})
|
||||||
|
|
||||||
|
cli.register(Builtins.VersionCommand)
|
||||||
|
cli.register(Builtins.HelpCommand)
|
||||||
|
cli.register(LoginCommand)
|
||||||
|
cli.register(LogoutCommand)
|
||||||
|
cli.register(ListServerCommand)
|
||||||
|
cli.register(StatusCommand)
|
||||||
|
cli.register(InfoCommand)
|
||||||
|
cli.register(ProcessCommand)
|
||||||
|
cli.register(DeployCommand)
|
||||||
|
cli.register(SyncCommand)
|
||||||
|
cli.register(ReloadCommand)
|
||||||
|
cli.runExit(args)
|
36
cli/package.json
Normal file
36
cli/package.json
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"name": "roadsign-cli",
|
||||||
|
"module": "index.ts",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"repository": "https://github.com/solsynth/roadsign",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"build": "rimraf dist && rollup -c rollup.config.js"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"rdcli": "./dist/index.cjs"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@rollup/plugin-commonjs": "^28.0.0",
|
||||||
|
"@rollup/plugin-json": "^6.1.0",
|
||||||
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
||||||
|
"@rollup/plugin-typescript": "^12.1.0",
|
||||||
|
"@types/bun": "latest",
|
||||||
|
"@types/cli-progress": "^3.11.6",
|
||||||
|
"@types/figlet": "^1.5.8",
|
||||||
|
"rimraf": "^6.0.1",
|
||||||
|
"rollup": "^4.24.0",
|
||||||
|
"rollup-plugin-typescript2": "^0.36.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"typescript": "^5.6.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"chalk": "^5.3.0",
|
||||||
|
"cli-progress": "^3.12.0",
|
||||||
|
"cli-table3": "^0.6.5",
|
||||||
|
"clipanion": "^4.0.0-rc.4",
|
||||||
|
"figlet": "^1.7.0",
|
||||||
|
"ora": "^8.1.0"
|
||||||
|
}
|
||||||
|
}
|
22
cli/rollup.config.js
Normal file
22
cli/rollup.config.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import resolve from "@rollup/plugin-node-resolve"
|
||||||
|
import commonjs from "@rollup/plugin-commonjs"
|
||||||
|
import typescript from "@rollup/plugin-typescript"
|
||||||
|
import json from "@rollup/plugin-json"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
input: "index.ts",
|
||||||
|
output: {
|
||||||
|
banner: "#!/usr/bin/env node",
|
||||||
|
file: "dist/index.cjs",
|
||||||
|
format: "cjs",
|
||||||
|
inlineDynamicImports: true,
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
resolve(),
|
||||||
|
commonjs(),
|
||||||
|
json(),
|
||||||
|
typescript({
|
||||||
|
tsconfig: "./tsconfig.json"
|
||||||
|
})
|
||||||
|
],
|
||||||
|
}
|
113
cli/src/cmd/deploy.ts
Normal file
113
cli/src/cmd/deploy.ts
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
import { RsConfig } from "../utils/config.ts"
|
||||||
|
import { Command, Option, type Usage } from "clipanion"
|
||||||
|
import chalk from "chalk"
|
||||||
|
import ora from "ora"
|
||||||
|
import * as fs from "node:fs"
|
||||||
|
import * as child_process from "node:child_process"
|
||||||
|
import * as path from "node:path"
|
||||||
|
import { createAuthHeader } from "../utils/auth.ts"
|
||||||
|
import { RsLocalConfig } from "../utils/config-local.ts"
|
||||||
|
|
||||||
|
export class DeployCommand extends Command {
|
||||||
|
static paths = [[`deploy`]]
|
||||||
|
static usage: Usage = {
|
||||||
|
category: `Building`,
|
||||||
|
description: `Deploying App / Static Site onto RoadSign`,
|
||||||
|
details: `Deploying an application or hosting a static site via RoadSign, you need preconfigured the RoadSign, or sync the configurations via sync command.`,
|
||||||
|
examples: [
|
||||||
|
["Deploying to RoadSign", `deploy <server> <region> <site> <file / directory>`],
|
||||||
|
["Deploying to RoadSign with .roadsignrc file", `deploy <server>`]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
server = Option.String({ required: true })
|
||||||
|
region = Option.String({ required: false })
|
||||||
|
site = Option.String({ required: false })
|
||||||
|
input = Option.String({ required: false })
|
||||||
|
|
||||||
|
async deploy(serverLabel: string, region: string, site: string, input: string) {
|
||||||
|
const cfg = await RsConfig.getInstance()
|
||||||
|
const server = cfg.config.servers.find(item => item.label === serverLabel)
|
||||||
|
if (server == null) {
|
||||||
|
this.context.stdout.write(chalk.red(`Server with label ${chalk.bold(this.server)} was not found.\n`))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fs.existsSync(input)) {
|
||||||
|
this.context.stdout.write(chalk.red(`Input file ${chalk.bold(this.input)} was not found.\n`))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let isDirectory = false
|
||||||
|
if (fs.statSync(input).isDirectory()) {
|
||||||
|
input = path.join(input, "*")
|
||||||
|
|
||||||
|
const compressPrefStart = performance.now()
|
||||||
|
const compressSpinner = ora(`Compressing ${chalk.bold(input)}...`).start()
|
||||||
|
const destName = `${Date.now()}-roadsign-archive.zip`
|
||||||
|
child_process.execSync(`zip -rj ${destName} ${input}`)
|
||||||
|
const compressPrefTook = performance.now() - compressPrefStart
|
||||||
|
compressSpinner.succeed(`Compressing completed in ${(compressPrefTook / 1000).toFixed(2)}s 🎉`)
|
||||||
|
input = destName
|
||||||
|
isDirectory = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const destBreadcrumb = [region, site].join(" ➜ ")
|
||||||
|
const spinner = ora(`Deploying ${chalk.bold(destBreadcrumb)} to ${chalk.bold(this.server)}...`).start()
|
||||||
|
|
||||||
|
const prefStart = performance.now()
|
||||||
|
|
||||||
|
try {
|
||||||
|
const payload = new FormData()
|
||||||
|
payload.set("attachments", await fs.openAsBlob(input), isDirectory ? "dist.zip" : path.basename(input))
|
||||||
|
const res = await fetch(`${server.url}/webhooks/publish/${region}/${site}?mimetype=application/zip`, {
|
||||||
|
method: "PUT",
|
||||||
|
body: payload,
|
||||||
|
headers: {
|
||||||
|
Authorization: createAuthHeader(server.credential)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (res.status !== 200) {
|
||||||
|
throw new Error(await res.text())
|
||||||
|
}
|
||||||
|
const prefTook = performance.now() - prefStart
|
||||||
|
spinner.succeed(`Deploying completed in ${(prefTook / 1000).toFixed(2)}s 🎉`)
|
||||||
|
} catch (e) {
|
||||||
|
this.context.stdout.write(`Failed to deploy to remote: ${e}\n`)
|
||||||
|
spinner.fail(`Server with label ${chalk.bold(this.server)} is not running! 😢`)
|
||||||
|
} finally {
|
||||||
|
if (isDirectory && input.endsWith(".zip")) {
|
||||||
|
fs.unlinkSync(input)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute() {
|
||||||
|
if (this.region && this.site && this.input) {
|
||||||
|
await this.deploy(this.server, this.region, this.site, this.input)
|
||||||
|
} else {
|
||||||
|
let localCfg: RsLocalConfig
|
||||||
|
try {
|
||||||
|
localCfg = await RsLocalConfig.getInstance()
|
||||||
|
} catch (e) {
|
||||||
|
this.context.stdout.write(chalk.red(`Unable to load .roadsignrc: ${e}\n`))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!localCfg.config.deployments) {
|
||||||
|
this.context.stdout.write(chalk.red(`No deployments found in .roadsignrc, exiting...\n`))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
let idx = 0
|
||||||
|
for (const deployment of localCfg.config.deployments ?? []) {
|
||||||
|
this.context.stdout.write(chalk.cyan(`Deploying ${idx + 1} out of ${localCfg.config.deployments.length} deployments...\n`))
|
||||||
|
await this.deploy(this.server, deployment.region, deployment.site, deployment.path)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.context.stdout.write(chalk.green(`All deployments has been deployed!\n`))
|
||||||
|
}
|
||||||
|
|
||||||
|
process.exit(0)
|
||||||
|
}
|
||||||
|
}
|
175
cli/src/cmd/info.ts
Normal file
175
cli/src/cmd/info.ts
Normal file
@ -0,0 +1,175 @@
|
|||||||
|
import { Command, Option, type Usage } from "clipanion"
|
||||||
|
import { RsConfig, type RsConfigServerData } from "../utils/config.ts"
|
||||||
|
import { createAuthHeader } from "../utils/auth.ts"
|
||||||
|
import chalk from "chalk"
|
||||||
|
import ora from "ora"
|
||||||
|
|
||||||
|
export class InfoCommand extends Command {
|
||||||
|
static paths = [[`info`], [`if`]]
|
||||||
|
static usage: Usage = {
|
||||||
|
category: `Networking`,
|
||||||
|
description: `Fetching the stats of RoadSign Server`,
|
||||||
|
details: `Fetching the configured things amount and other things of a connected server`,
|
||||||
|
examples: [["Fetch stats from labeled server", `info <label> [area]`]]
|
||||||
|
}
|
||||||
|
|
||||||
|
label = Option.String({ required: true })
|
||||||
|
area = Option.String({ required: false })
|
||||||
|
loop = Option.Boolean("--loop,--follow,-f", false, { description: "Keep updating the results" })
|
||||||
|
|
||||||
|
private static formatUptime(ms: number): string {
|
||||||
|
let seconds: number = Math.floor(ms / 1000)
|
||||||
|
let minutes: number = Math.floor(seconds / 60)
|
||||||
|
let hours: number = Math.floor(minutes / 60)
|
||||||
|
let days: number = Math.floor(hours / 24)
|
||||||
|
|
||||||
|
seconds = seconds % 60
|
||||||
|
minutes = minutes % 60
|
||||||
|
hours = hours % 24
|
||||||
|
|
||||||
|
const uptimeParts: string[] = []
|
||||||
|
|
||||||
|
if (days > 0) uptimeParts.push(`${days} day${days > 1 ? "s" : ""}`)
|
||||||
|
if (hours > 0) uptimeParts.push(`${hours} hour${hours > 1 ? "s" : ""}`)
|
||||||
|
if (minutes > 0) uptimeParts.push(`${minutes} minute${minutes > 1 ? "s" : ""}`)
|
||||||
|
if (seconds > 0 || uptimeParts.length === 0) uptimeParts.push(`${seconds} second${seconds > 1 ? "s" : ""}`)
|
||||||
|
|
||||||
|
return uptimeParts.join(", ")
|
||||||
|
}
|
||||||
|
|
||||||
|
async fetchOverview(server: RsConfigServerData) {
|
||||||
|
try {
|
||||||
|
const res = await fetch(`${server.url}/cgi/stats`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: createAuthHeader(server.credential)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (res.status !== 200) {
|
||||||
|
throw new Error(await res.text())
|
||||||
|
}
|
||||||
|
|
||||||
|
const data: any = await res.json()
|
||||||
|
this.context.stdout.write('\n')
|
||||||
|
this.context.stdout.write(`\nServer stats of ${chalk.bold(this.label)}\n`)
|
||||||
|
this.context.stdout.write(` • Uptime: ${chalk.bold(InfoCommand.formatUptime(data["uptime"]))}\n`)
|
||||||
|
this.context.stdout.write(` • Traffic since last startup: ${chalk.bold(data["traffic"]["total"])}\n`)
|
||||||
|
this.context.stdout.write(` • Unique clients since last startup: ${chalk.bold(data["traffic"]["unique_client"])}\n`)
|
||||||
|
this.context.stdout.write(`\nServer info of ${chalk.bold(this.label)}\n`)
|
||||||
|
this.context.stdout.write(` • Warden Applications: ${chalk.bold(data["applications"])}\n`)
|
||||||
|
this.context.stdout.write(` • Destinations: ${chalk.bold(data["destinations"])}\n`)
|
||||||
|
this.context.stdout.write(` • Locations: ${chalk.bold(data["locations"])}\n`)
|
||||||
|
this.context.stdout.write(` • Regions: ${chalk.bold(data["regions"])}\n`)
|
||||||
|
this.context.stdout.write('\n')
|
||||||
|
} catch (e) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async fetchTrace(server: RsConfigServerData) {
|
||||||
|
const res = await fetch(`${server.url}/cgi/traces`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: createAuthHeader(server.credential)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (res.status !== 200) {
|
||||||
|
throw new Error(await res.text())
|
||||||
|
}
|
||||||
|
|
||||||
|
const data: any = await res.json()
|
||||||
|
for (const trace of data) {
|
||||||
|
const ts = new Date(trace["timestamp"]).toLocaleString()
|
||||||
|
const path = [trace["region"], trace["location"], trace["destination"]].join(" ➜ ")
|
||||||
|
const uri = trace["uri"].split("?").length == 1 ? trace["uri"] : trace["uri"].split("?")[0] + ` ${chalk.grey(`w/ query parameters`)}`
|
||||||
|
this.context.stdout.write(`${chalk.bgGrey(`[${ts}]`)} ${chalk.bold(path)} ${chalk.cyan(trace["ip_address"])} ${uri}\n`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async fetchRegions(server: RsConfigServerData) {
|
||||||
|
const res = await fetch(`${server.url}/cgi/regions`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: createAuthHeader(server.credential)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (res.status !== 200) {
|
||||||
|
throw new Error(await res.text())
|
||||||
|
}
|
||||||
|
|
||||||
|
const data: any = await res.json()
|
||||||
|
this.context.stdout.write("\n\n")
|
||||||
|
for (const region of data) {
|
||||||
|
this.context.stdout.write(` • ${chalk.bgGrey('region#')}${chalk.bold(region.id)} ${chalk.gray(`(${region.locations.length} locations)`)}\n`)
|
||||||
|
for (const location of region.locations) {
|
||||||
|
this.context.stdout.write(` • ${chalk.bgGrey('location#')} ${chalk.bold(location.id)} ${chalk.gray(`(${location.destinations.length} destinations)`)}\n`)
|
||||||
|
for (const destination of location.destinations) {
|
||||||
|
this.context.stdout.write(` • ${chalk.bgGrey('destination#')}${chalk.bold(destination.id)}\n`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.context.stdout.write("\n")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute() {
|
||||||
|
const config = await RsConfig.getInstance()
|
||||||
|
|
||||||
|
const server = config.config.servers.find(item => item.label === this.label)
|
||||||
|
if (server == null) {
|
||||||
|
this.context.stdout.write(chalk.red(`Server with label ${chalk.bold(this.label)} was not found.\n`))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.area == null) {
|
||||||
|
this.area = "overview"
|
||||||
|
}
|
||||||
|
|
||||||
|
const spinner = ora(`Fetching stats from server ${this.label}...`).start()
|
||||||
|
const prefStart = performance.now()
|
||||||
|
|
||||||
|
switch (this.area) {
|
||||||
|
case "overview":
|
||||||
|
try {
|
||||||
|
await this.fetchOverview(server)
|
||||||
|
const prefTook = performance.now() - prefStart
|
||||||
|
spinner.succeed(`Fetching completed in ${(prefTook / 1000).toFixed(2)}s 🎉`)
|
||||||
|
} catch (e) {
|
||||||
|
spinner.fail(`Server with label ${chalk.bold(this.label)} is not running! 😢`)
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case "trace":
|
||||||
|
while (true) {
|
||||||
|
try {
|
||||||
|
await this.fetchTrace(server)
|
||||||
|
const prefTook = performance.now() - prefStart
|
||||||
|
if (!this.loop) {
|
||||||
|
spinner.succeed(`Fetching completed in ${(prefTook / 1000).toFixed(2)}s 🎉`)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
spinner.fail(`Server with label ${chalk.bold(this.label)} is not running! 😢`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.loop) {
|
||||||
|
break
|
||||||
|
} else {
|
||||||
|
spinner.text = "Updating..."
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 3000))
|
||||||
|
this.context.stdout.write("\x1Bc")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case "regions":
|
||||||
|
try {
|
||||||
|
await this.fetchRegions(server)
|
||||||
|
const prefTook = performance.now() - prefStart
|
||||||
|
spinner.succeed(`Fetching completed in ${(prefTook / 1000).toFixed(2)}s 🎉`)
|
||||||
|
} catch (e) {
|
||||||
|
spinner.fail(`Server with label ${chalk.bold(this.label)} is not running! 😢`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
spinner.fail(chalk.red(`Info area was not exists ${chalk.bold(this.area)}...`))
|
||||||
|
}
|
||||||
|
|
||||||
|
process.exit(0)
|
||||||
|
}
|
||||||
|
}
|
26
cli/src/cmd/list.ts
Normal file
26
cli/src/cmd/list.ts
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import { Command, type Usage } from "clipanion"
|
||||||
|
import { RsConfig } from "../utils/config.ts"
|
||||||
|
import chalk from "chalk"
|
||||||
|
|
||||||
|
export class ListServerCommand extends Command {
|
||||||
|
static paths = [[`list`], [`ls`]]
|
||||||
|
static usage: Usage = {
|
||||||
|
category: `Networking`,
|
||||||
|
description: `List all connected RoadSign Sideload Services`,
|
||||||
|
details: `Listing all servers that already saved in RoadSign CLI configuration file`,
|
||||||
|
examples: [["List all", `list`]]
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute() {
|
||||||
|
const config = await RsConfig.getInstance()
|
||||||
|
|
||||||
|
for (let idx = 0; idx < config.config.servers.length; idx++) {
|
||||||
|
const server = config.config.servers[idx]
|
||||||
|
this.context.stdout.write(`${idx + 1}. ${chalk.bold(server.label)} ${chalk.gray(`(${server.url})`)}\n`)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.context.stdout.write("\n" + chalk.cyan(`Connected ${config.config.servers.length} server(s) in total.`) + "\n")
|
||||||
|
|
||||||
|
process.exit(0)
|
||||||
|
}
|
||||||
|
}
|
55
cli/src/cmd/login.ts
Normal file
55
cli/src/cmd/login.ts
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
import { Command, Option, type Usage } from "clipanion"
|
||||||
|
import { createAuthHeader } from "../utils/auth.ts"
|
||||||
|
import { RsConfig } from "../utils/config.ts"
|
||||||
|
import ora, { oraPromise } from "ora"
|
||||||
|
|
||||||
|
export class LoginCommand extends Command {
|
||||||
|
static paths = [[`login`]]
|
||||||
|
static usage: Usage = {
|
||||||
|
category: `Networking`,
|
||||||
|
description: `Login to RoadSign Sideload Service`,
|
||||||
|
details: `Login to RoadSign Server`,
|
||||||
|
examples: [["Login with credentials", `login <label> <host> <password>`]]
|
||||||
|
}
|
||||||
|
|
||||||
|
label = Option.String({ required: true })
|
||||||
|
host = Option.String({ required: true })
|
||||||
|
credentials = Option.String({ required: true })
|
||||||
|
|
||||||
|
async execute() {
|
||||||
|
const config = await RsConfig.getInstance()
|
||||||
|
const spinner = ora(`Connecting to ${this.host}...`).start()
|
||||||
|
|
||||||
|
if (!this.host.includes(":")) {
|
||||||
|
this.host += ":81"
|
||||||
|
}
|
||||||
|
if (!this.host.startsWith("http")) {
|
||||||
|
this.host = "http://" + this.host
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const pingRes = await fetch(`${this.host}/cgi/metadata`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: createAuthHeader(this.credentials)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (pingRes.status !== 200) {
|
||||||
|
throw new Error(await pingRes.text())
|
||||||
|
} else {
|
||||||
|
const info: any = await pingRes.json()
|
||||||
|
spinner.succeed(`Connected to ${this.host}, remote version ${info["version"]}`)
|
||||||
|
|
||||||
|
config.config.servers.push({
|
||||||
|
label: this.label,
|
||||||
|
url: this.host,
|
||||||
|
credential: this.credentials
|
||||||
|
})
|
||||||
|
await oraPromise(config.writeConfig(), { text: "Saving changes..." })
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
spinner.fail(`Unable connect to remote: ${e}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
process.exit(0)
|
||||||
|
}
|
||||||
|
}
|
31
cli/src/cmd/logout.ts
Normal file
31
cli/src/cmd/logout.ts
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import { Command, Option, type Usage } from "clipanion"
|
||||||
|
import { RsConfig } from "../utils/config.ts"
|
||||||
|
import { oraPromise } from "ora"
|
||||||
|
import chalk from "chalk"
|
||||||
|
|
||||||
|
export class LogoutCommand extends Command {
|
||||||
|
static paths = [[`logout`]]
|
||||||
|
static usage: Usage = {
|
||||||
|
category: `Networking`,
|
||||||
|
description: `Logout from RoadSign Sideload Service`,
|
||||||
|
details: `Logout from RoadSign Server`,
|
||||||
|
examples: [["Logout with server label", `logout <label>`]]
|
||||||
|
}
|
||||||
|
|
||||||
|
label = Option.String({ required: true })
|
||||||
|
|
||||||
|
async execute() {
|
||||||
|
const config = await RsConfig.getInstance()
|
||||||
|
|
||||||
|
const server = config.config.servers.findIndex(item => item.label === this.label)
|
||||||
|
if (server === -1) {
|
||||||
|
this.context.stdout.write(chalk.red(`Server with label ${chalk.bold(this.label)} was not found.\n`))
|
||||||
|
} else {
|
||||||
|
config.config.servers.splice(server, 1)
|
||||||
|
this.context.stdout.write(chalk.green(`Server with label ${chalk.bold(this.label)} was successfully removed.\n`))
|
||||||
|
await oraPromise(config.writeConfig(), { text: "Saving changes..." })
|
||||||
|
}
|
||||||
|
|
||||||
|
process.exit(0)
|
||||||
|
}
|
||||||
|
}
|
146
cli/src/cmd/process-info.ts
Normal file
146
cli/src/cmd/process-info.ts
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
import { Command, Option, type Usage } from "clipanion"
|
||||||
|
import { RsConfig } from "../utils/config.ts"
|
||||||
|
import { createAuthHeader } from "../utils/auth.ts"
|
||||||
|
import Table from "cli-table3"
|
||||||
|
import chalk from "chalk"
|
||||||
|
import ora from "ora"
|
||||||
|
|
||||||
|
export class ProcessCommand extends Command {
|
||||||
|
static paths = [[`process`], [`ps`]]
|
||||||
|
static usage: Usage = {
|
||||||
|
category: `Networking`,
|
||||||
|
description: `Loading the application of RoadSign Server`,
|
||||||
|
details: `Fetching the configured things amount and other things of a connected server`,
|
||||||
|
examples: [
|
||||||
|
["Fetch app directory from labeled server", `ps <label>`],
|
||||||
|
["Fetch app logs from labeled server", `ps <label> <applicationId> logs`]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
label = Option.String({ required: true })
|
||||||
|
applicationId = Option.String({ required: false })
|
||||||
|
subcommand = Option.String({ required: false })
|
||||||
|
loop = Option.Boolean("--loop,--follow,-f", false, { description: "Keep updating the results" })
|
||||||
|
|
||||||
|
async execute() {
|
||||||
|
const config = await RsConfig.getInstance()
|
||||||
|
|
||||||
|
const server = config.config.servers.find(item => item.label === this.label)
|
||||||
|
if (server == null) {
|
||||||
|
this.context.stdout.write(chalk.red(`Server with label ${chalk.bold(this.label)} was not found.\n`))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const spinner = ora(`Fetching stats from server ${this.label}...`).start()
|
||||||
|
const prefStart = performance.now()
|
||||||
|
|
||||||
|
|
||||||
|
if (this.applicationId == null) {
|
||||||
|
try {
|
||||||
|
const res = await fetch(`${server.url}/cgi/applications`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: createAuthHeader(server.credential)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (res.status !== 200) {
|
||||||
|
throw new Error(await res.text())
|
||||||
|
}
|
||||||
|
const prefTook = performance.now() - prefStart
|
||||||
|
if (!this.loop) {
|
||||||
|
spinner.succeed(`Fetching completed in ${(prefTook / 1000).toFixed(2)}s 🎉`)
|
||||||
|
}
|
||||||
|
|
||||||
|
const table = new Table({
|
||||||
|
head: ["ID", "Status", "Command"],
|
||||||
|
colWidths: [20, 10, 48]
|
||||||
|
})
|
||||||
|
|
||||||
|
const statusMapping = ["Created", "Starting", "Started", "Exited", "Failed"]
|
||||||
|
|
||||||
|
const data: any = await res.json()
|
||||||
|
for (const app of data) {
|
||||||
|
table.push([app["id"], statusMapping[app["status"]], app["command"].join(" ")])
|
||||||
|
}
|
||||||
|
|
||||||
|
this.context.stdout.write(table.toString())
|
||||||
|
} catch (e) {
|
||||||
|
spinner.fail(`Server with label ${chalk.bold(this.label)} is not running! 😢`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
switch (this.subcommand) {
|
||||||
|
case "logs":
|
||||||
|
while (true) {
|
||||||
|
try {
|
||||||
|
const res = await fetch(`${server.url}/cgi/applications/${this.applicationId}/logs`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: createAuthHeader(server.credential)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (res.status === 404) {
|
||||||
|
spinner.fail(`App with id ${chalk.bold(this.applicationId)} was not found! 😢`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (res.status !== 200) {
|
||||||
|
throw new Error(await res.text())
|
||||||
|
}
|
||||||
|
const prefTook = performance.now() - prefStart
|
||||||
|
if (!this.loop) {
|
||||||
|
spinner.succeed(`Fetching completed in ${(prefTook / 1000).toFixed(2)}s 🎉`)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.context.stdout.write(await res.text())
|
||||||
|
} catch (e) {
|
||||||
|
spinner.fail(`Server with label ${chalk.bold(this.label)} is not running! 😢`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.loop) {
|
||||||
|
break
|
||||||
|
} else {
|
||||||
|
spinner.text = "Updating..."
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 3000))
|
||||||
|
this.context.stdout.write("\x1Bc")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case "start":
|
||||||
|
case "stop":
|
||||||
|
case "restart":
|
||||||
|
try {
|
||||||
|
const res = await fetch(`${server.url}/cgi/applications/${this.applicationId}/${this.subcommand}`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
Authorization: createAuthHeader(server.credential)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (res.status === 404) {
|
||||||
|
spinner.fail(`App with id ${chalk.bold(this.applicationId)} was not found! 😢`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (res.status === 500) {
|
||||||
|
this.context.stdout.write(chalk.red(`Server failed to perform action for application: ${await res.text()}\n`))
|
||||||
|
spinner.fail(`Failed to perform action ${chalk.bold(this.applicationId)}... 😢`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (res.status !== 200) {
|
||||||
|
throw new Error(await res.text())
|
||||||
|
}
|
||||||
|
const prefTook = performance.now() - prefStart
|
||||||
|
if (!this.loop) {
|
||||||
|
spinner.succeed(`Fetching completed in ${(prefTook / 1000).toFixed(2)}s 🎉`)
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
spinner.fail(`Server with label ${chalk.bold(this.label)} is not running! 😢`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
spinner.succeed(`Action for application ${chalk.bold(this.applicationId)} has been performed. 🎉`)
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
this.context.stdout.write(chalk.red(`Subcommand ${chalk.bold(this.subcommand)} was not found.\n`))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
process.exit(0)
|
||||||
|
}
|
||||||
|
}
|
53
cli/src/cmd/reload.ts
Normal file
53
cli/src/cmd/reload.ts
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
import { RsConfig } from "../utils/config.ts"
|
||||||
|
import { Command, Option, type Usage } from "clipanion"
|
||||||
|
import chalk from "chalk"
|
||||||
|
import ora from "ora"
|
||||||
|
import * as fs from "node:fs"
|
||||||
|
import { createAuthHeader } from "../utils/auth.ts"
|
||||||
|
import { RsLocalConfig } from "../utils/config-local.ts"
|
||||||
|
|
||||||
|
export class ReloadCommand extends Command {
|
||||||
|
static paths = [[`reload`]]
|
||||||
|
static usage: Usage = {
|
||||||
|
category: `Building`,
|
||||||
|
description: `Reload configuration on RoadSign`,
|
||||||
|
details: `Reload configuration on remote RoadSign to make changes applied.`,
|
||||||
|
examples: [
|
||||||
|
["Reload an connected server", `reload <server>`],
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
server = Option.String({ required: true })
|
||||||
|
|
||||||
|
async execute() {
|
||||||
|
const cfg = await RsConfig.getInstance()
|
||||||
|
const server = cfg.config.servers.find(item => item.label === this.server)
|
||||||
|
if (server == null) {
|
||||||
|
this.context.stdout.write(chalk.red(`Server with label ${chalk.bold(this.server)} was not found.\n`))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const spinner = ora(`Reloading server ${chalk.bold(this.server)}...`).start()
|
||||||
|
|
||||||
|
const prefStart = performance.now()
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res = await fetch(`${server.url}/cgi/reload`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
Authorization: createAuthHeader(server.credential)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (res.status !== 200) {
|
||||||
|
throw new Error(await res.text())
|
||||||
|
}
|
||||||
|
const prefTook = performance.now() - prefStart
|
||||||
|
spinner.succeed(`Reloading completed in ${(prefTook / 1000).toFixed(2)}s 🎉`)
|
||||||
|
} catch (e) {
|
||||||
|
this.context.stdout.write(`Failed to reload remote: ${e}\n`)
|
||||||
|
spinner.fail(`Server with label ${chalk.bold(this.server)} is not running! 😢`)
|
||||||
|
}
|
||||||
|
|
||||||
|
process.exit(0)
|
||||||
|
}
|
||||||
|
}
|
46
cli/src/cmd/status.ts
Normal file
46
cli/src/cmd/status.ts
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import { Command, Option, type Usage } from "clipanion"
|
||||||
|
import { RsConfig } from "../utils/config.ts"
|
||||||
|
import { createAuthHeader } from "../utils/auth.ts"
|
||||||
|
import chalk from "chalk"
|
||||||
|
import ora from "ora"
|
||||||
|
|
||||||
|
export class StatusCommand extends Command {
|
||||||
|
static paths = [[`status`]]
|
||||||
|
static usage: Usage = {
|
||||||
|
category: `Networking`,
|
||||||
|
description: `Check the status of RoadSign Sideload Service`,
|
||||||
|
details: `Check the running status of a connected server`,
|
||||||
|
examples: [["Check the status of labeled server", `status <label>`]]
|
||||||
|
}
|
||||||
|
|
||||||
|
label = Option.String({ required: true })
|
||||||
|
|
||||||
|
async execute() {
|
||||||
|
const config = await RsConfig.getInstance()
|
||||||
|
|
||||||
|
const server = config.config.servers.find(item => item.label === this.label)
|
||||||
|
if (server == null) {
|
||||||
|
this.context.stdout.write(chalk.red(`Server with label ${chalk.bold(this.label)} was not found.\n`))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const spinner = ora(`Checking status of ${this.label}...`).start()
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res = await fetch(`${server.url}/cgi/metadata`, {
|
||||||
|
headers: {
|
||||||
|
Authorization: createAuthHeader(server.credential)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (res.status !== 200) {
|
||||||
|
throw new Error(await res.text())
|
||||||
|
}
|
||||||
|
spinner.succeed(`Server with label ${chalk.bold(this.label)} is up and running! 🎉`)
|
||||||
|
} catch (e) {
|
||||||
|
spinner.fail(`Server with label ${chalk.bold(this.label)} is not running! 😢`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
process.exit(0)
|
||||||
|
}
|
||||||
|
}
|
87
cli/src/cmd/sync.ts
Normal file
87
cli/src/cmd/sync.ts
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
import { RsConfig } from "../utils/config.ts"
|
||||||
|
import { Command, Option, type Usage } from "clipanion"
|
||||||
|
import chalk from "chalk"
|
||||||
|
import ora from "ora"
|
||||||
|
import * as fs from "node:fs"
|
||||||
|
import { createAuthHeader } from "../utils/auth.ts"
|
||||||
|
import { RsLocalConfig } from "../utils/config-local.ts"
|
||||||
|
|
||||||
|
export class SyncCommand extends Command {
|
||||||
|
static paths = [[`sync`]]
|
||||||
|
static usage: Usage = {
|
||||||
|
category: `Building`,
|
||||||
|
description: `Sync configuration to RoadSign over Sideload`,
|
||||||
|
details: `Update remote RoadSign configuration with local ones.`,
|
||||||
|
examples: [
|
||||||
|
["Sync to RoadSign", `sync <server> <region> <file>`],
|
||||||
|
["Sync to RoadSign with .roadsignrc file", `sync <server>`]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
server = Option.String({ required: true })
|
||||||
|
region = Option.String({ required: false })
|
||||||
|
input = Option.String({ required: false })
|
||||||
|
|
||||||
|
async sync(serverLabel: string, region: string, input: string) {
|
||||||
|
const cfg = await RsConfig.getInstance()
|
||||||
|
const server = cfg.config.servers.find(item => item.label === serverLabel)
|
||||||
|
if (server == null) {
|
||||||
|
this.context.stdout.write(chalk.red(`Server with label ${chalk.bold(this.server)} was not found.\n`))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fs.existsSync(input)) {
|
||||||
|
this.context.stdout.write(chalk.red(`Input file ${chalk.bold(this.input)} was not found.\n`))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!fs.statSync(input).isFile()) {
|
||||||
|
this.context.stdout.write(chalk.red(`Input file ${chalk.bold(this.input)} is not a file.\n`))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const spinner = ora(`Syncing ${chalk.bold(region)} to ${chalk.bold(this.server)}...`).start()
|
||||||
|
|
||||||
|
const prefStart = performance.now()
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res = await fetch(`${server.url}/webhooks/sync/${region}`, {
|
||||||
|
method: "PUT",
|
||||||
|
body: fs.readFileSync(input, "utf8"),
|
||||||
|
headers: {
|
||||||
|
Authorization: createAuthHeader(server.credential)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (res.status !== 200) {
|
||||||
|
throw new Error(await res.text())
|
||||||
|
}
|
||||||
|
const prefTook = performance.now() - prefStart
|
||||||
|
spinner.succeed(`Syncing completed in ${(prefTook / 1000).toFixed(2)}s 🎉`)
|
||||||
|
} catch (e) {
|
||||||
|
this.context.stdout.write(`Failed to sync to remote: ${e}\n`)
|
||||||
|
spinner.fail(`Server with label ${chalk.bold(this.server)} is not running! 😢`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute() {
|
||||||
|
if (this.region && this.input) {
|
||||||
|
await this.sync(this.server, this.region, this.input)
|
||||||
|
} else {
|
||||||
|
let localCfg: RsLocalConfig
|
||||||
|
try {
|
||||||
|
localCfg = await RsLocalConfig.getInstance()
|
||||||
|
} catch (e) {
|
||||||
|
this.context.stdout.write(chalk.red(`Unable to load .roadsignrc: ${e}\n`))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!localCfg.config.sync) {
|
||||||
|
this.context.stdout.write(chalk.red(`No sync configuration found in .roadsignrc, exiting...\n`))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
await this.sync(this.server, localCfg.config.sync.region, localCfg.config.sync.configPath)
|
||||||
|
}
|
||||||
|
|
||||||
|
process.exit(0)
|
||||||
|
}
|
||||||
|
}
|
4
cli/src/utils/auth.ts
Normal file
4
cli/src/utils/auth.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export function createAuthHeader(password: string, username: string = "RoadSign CLI") {
|
||||||
|
const credentials = Buffer.from(`${username}:${password}`).toString("base64")
|
||||||
|
return `Basic ${credentials}`
|
||||||
|
}
|
60
cli/src/utils/config-local.ts
Normal file
60
cli/src/utils/config-local.ts
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
import * as path from "node:path"
|
||||||
|
import * as fs from "node:fs"
|
||||||
|
|
||||||
|
interface RsLocalConfigData {
|
||||||
|
sync?: RsLocalConfigSyncData
|
||||||
|
deployments?: RsLocalConfigDeploymentData[]
|
||||||
|
}
|
||||||
|
|
||||||
|
interface RsLocalConfigSyncData {
|
||||||
|
configPath: string
|
||||||
|
region: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface RsLocalConfigDeploymentData {
|
||||||
|
path: string
|
||||||
|
region: string
|
||||||
|
site: string
|
||||||
|
autoBuild?: RsLocalConfigDeploymentAutoBuildData
|
||||||
|
}
|
||||||
|
|
||||||
|
interface RsLocalConfigDeploymentAutoBuildData {
|
||||||
|
command: string
|
||||||
|
environment?: string[]
|
||||||
|
}
|
||||||
|
|
||||||
|
class RsLocalConfig {
|
||||||
|
private static instance: RsLocalConfig
|
||||||
|
|
||||||
|
public config: RsLocalConfigData = {}
|
||||||
|
|
||||||
|
private constructor() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async getInstance(): Promise<RsLocalConfig> {
|
||||||
|
if (!RsLocalConfig.instance) {
|
||||||
|
RsLocalConfig.instance = new RsLocalConfig()
|
||||||
|
await RsLocalConfig.instance.readConfig()
|
||||||
|
}
|
||||||
|
return RsLocalConfig.instance
|
||||||
|
}
|
||||||
|
|
||||||
|
public async readConfig() {
|
||||||
|
const basepath = process.cwd()
|
||||||
|
const filepath = path.join(basepath, ".roadsignrc")
|
||||||
|
if (!fs.existsSync(filepath)) {
|
||||||
|
throw new Error(`.roadsignrc file was not found at ${filepath}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = fs.readFileSync(filepath, "utf8")
|
||||||
|
this.config = JSON.parse(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
public async writeConfig() {
|
||||||
|
const basepath = process.cwd()
|
||||||
|
const filepath = path.join(basepath, ".roadsignrc")
|
||||||
|
fs.writeFileSync(filepath, JSON.stringify(this.config))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export { RsLocalConfig, type RsLocalConfigData }
|
51
cli/src/utils/config.ts
Normal file
51
cli/src/utils/config.ts
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import * as os from "node:os"
|
||||||
|
import * as path from "node:path"
|
||||||
|
import * as fs from "node:fs"
|
||||||
|
|
||||||
|
interface RsConfigData {
|
||||||
|
servers: RsConfigServerData[]
|
||||||
|
}
|
||||||
|
|
||||||
|
interface RsConfigServerData {
|
||||||
|
label: string
|
||||||
|
url: string
|
||||||
|
credential: string
|
||||||
|
}
|
||||||
|
|
||||||
|
class RsConfig {
|
||||||
|
private static instance: RsConfig
|
||||||
|
|
||||||
|
public config: RsConfigData = {
|
||||||
|
servers: []
|
||||||
|
}
|
||||||
|
|
||||||
|
private constructor() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async getInstance(): Promise<RsConfig> {
|
||||||
|
if (!RsConfig.instance) {
|
||||||
|
RsConfig.instance = new RsConfig()
|
||||||
|
await RsConfig.instance.readConfig()
|
||||||
|
}
|
||||||
|
return RsConfig.instance
|
||||||
|
}
|
||||||
|
|
||||||
|
public async readConfig() {
|
||||||
|
const basepath = os.homedir()
|
||||||
|
const filepath = path.join(basepath, ".roadsignrc")
|
||||||
|
if (!fs.existsSync(filepath)) {
|
||||||
|
fs.writeFileSync(filepath, JSON.stringify(this.config))
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = fs.readFileSync(filepath, "utf8")
|
||||||
|
this.config = JSON.parse(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
public async writeConfig() {
|
||||||
|
const basepath = os.homedir()
|
||||||
|
const filepath = path.join(basepath, ".roadsignrc")
|
||||||
|
fs.writeFileSync(filepath, JSON.stringify(this.config))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export { RsConfig, type RsConfigData, type RsConfigServerData }
|
9
cli/test/static-files.toml
Normal file
9
cli/test/static-files.toml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
id = "static-files-num2"
|
||||||
|
|
||||||
|
[[locations]]
|
||||||
|
id = "static-files-loc-num2"
|
||||||
|
hosts = ["127.0.0.1:8000"]
|
||||||
|
paths = ["/"]
|
||||||
|
[[locations.destinations]]
|
||||||
|
id = "static-files-des-num2"
|
||||||
|
uri = "files://../data/static-files"
|
12
cli/test/static-files/index.html
Normal file
12
cli/test/static-files/index.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>Hello, World!</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Hello, there!</p>
|
||||||
|
<p>Here's the newer version of static files hosted by roadsign!</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
27
cli/tsconfig.json
Normal file
27
cli/tsconfig.json
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"lib": ["ESNext"],
|
||||||
|
"target": "ESNext",
|
||||||
|
"module": "NodeNext",
|
||||||
|
"allowJs": true,
|
||||||
|
|
||||||
|
// Bundler mode
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"moduleResolution": "NodeNext",
|
||||||
|
"allowImportingTsExtensions": true,
|
||||||
|
"verbatimModuleSyntax": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
|
||||||
|
// Best practices
|
||||||
|
"strict": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
|
||||||
|
// Some stricter flags (disabled by default)
|
||||||
|
"noUnusedLocals": false,
|
||||||
|
"noUnusedParameters": false,
|
||||||
|
"noPropertyAccessFromIndexSignature": false,
|
||||||
|
"useUnknownInCatchVariables": false,
|
||||||
|
}
|
||||||
|
}
|
32
config/example.toml
Normal file
32
config/example.toml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
id = "example-region"
|
||||||
|
|
||||||
|
# [[locations]]
|
||||||
|
# id = "example-websocket"
|
||||||
|
# host = ["localhost:8000"]
|
||||||
|
# path = ["/ws"]
|
||||||
|
# [[locations.destinations]]
|
||||||
|
# id = "example-websocket-destination"
|
||||||
|
# uri = "http://localhost:8765"
|
||||||
|
|
||||||
|
# [[locations]]
|
||||||
|
# id = "example-warden"
|
||||||
|
# host = ["localhost:4321"]
|
||||||
|
# path = ["/"]
|
||||||
|
# [[locations.destinations]]
|
||||||
|
# id = "example-warden-destination"
|
||||||
|
# uri = "http://localhost:4321"
|
||||||
|
|
||||||
|
# [[applications]]
|
||||||
|
# id = "example-warden-app"
|
||||||
|
# workdir = "test/data/warden"
|
||||||
|
# command = ["node", "dist/server/entry.mjs"]
|
||||||
|
# environment = ["PUBLIC_CMS=https://smartsheep.studio"]
|
||||||
|
|
||||||
|
[[locations]]
|
||||||
|
id = "example"
|
||||||
|
host = ["localhost:8000"]
|
||||||
|
path = ["/"]
|
||||||
|
[[locations.destinations]]
|
||||||
|
id = "example-destination"
|
||||||
|
uri = "https://example.com"
|
||||||
|
helmet = { x_frame_options = "SAMEORIGIN" }
|
35
go.mod
35
go.mod
@ -1,46 +1,52 @@
|
|||||||
module code.smartsheep.studio/goatworks/roadsign
|
module git.solsynth.dev/goatworks/roadsign
|
||||||
|
|
||||||
go 1.21.4
|
go 1.21.4
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/gofiber/fiber/v2 v2.51.0
|
github.com/fasthttp/websocket v1.5.7
|
||||||
github.com/google/uuid v1.4.0
|
github.com/gofiber/fiber/v2 v2.52.5
|
||||||
|
github.com/gofiber/template/html/v2 v2.1.0
|
||||||
|
github.com/google/uuid v1.6.0
|
||||||
|
github.com/json-iterator/go v1.1.12
|
||||||
github.com/rs/zerolog v1.31.0
|
github.com/rs/zerolog v1.31.0
|
||||||
github.com/samber/lo v1.38.1
|
github.com/samber/lo v1.38.1
|
||||||
github.com/saracen/fastzip v0.1.11
|
github.com/saracen/fastzip v0.1.11
|
||||||
github.com/spf13/viper v1.17.0
|
github.com/spf13/viper v1.17.0
|
||||||
github.com/urfave/cli/v2 v2.26.0
|
github.com/urfave/cli/v2 v2.26.0
|
||||||
github.com/valyala/fasthttp v1.50.0
|
github.com/valyala/fasthttp v1.56.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
|
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/gofiber/template v1.8.2 // indirect
|
||||||
|
github.com/gofiber/utils v1.1.0 // indirect
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||||
github.com/saracen/zipextra v0.0.0-20220303013732-0187cb0159ea // indirect
|
github.com/saracen/zipextra v0.0.0-20220303013732-0187cb0159ea // indirect
|
||||||
|
github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect
|
||||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
|
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
|
||||||
golang.org/x/sync v0.5.0 // indirect
|
golang.org/x/net v0.29.0 // indirect
|
||||||
|
golang.org/x/sync v0.8.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/andybalholm/brotli v1.0.5 // indirect
|
github.com/andybalholm/brotli v1.1.0 // indirect
|
||||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||||
github.com/klauspost/compress v1.17.4 // indirect
|
github.com/klauspost/compress v1.17.10 // indirect
|
||||||
github.com/magiconair/properties v1.8.7 // indirect
|
github.com/magiconair/properties v1.8.7 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
github.com/mattn/go-runewidth v0.0.15 // indirect
|
github.com/mattn/go-runewidth v0.0.16 // indirect
|
||||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
github.com/pelletier/go-toml/v2 v2.1.1
|
||||||
github.com/philhofer/fwd v1.1.2 // indirect
|
github.com/philhofer/fwd v1.1.2 // indirect
|
||||||
github.com/rivo/uniseg v0.2.0 // indirect
|
github.com/rivo/uniseg v0.4.7 // indirect
|
||||||
github.com/sagikazarmark/locafero v0.3.0 // indirect
|
github.com/sagikazarmark/locafero v0.3.0 // indirect
|
||||||
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
||||||
github.com/sourcegraph/conc v0.3.0 // indirect
|
github.com/sourcegraph/conc v0.3.0 // indirect
|
||||||
github.com/spf13/afero v1.10.0 // indirect
|
github.com/spf13/afero v1.11.0 // indirect
|
||||||
github.com/spf13/cast v1.5.1 // indirect
|
github.com/spf13/cast v1.5.1 // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/subosito/gotenv v1.6.0 // indirect
|
github.com/subosito/gotenv v1.6.0 // indirect
|
||||||
@ -50,9 +56,8 @@ require (
|
|||||||
go.uber.org/atomic v1.9.0 // indirect
|
go.uber.org/atomic v1.9.0 // indirect
|
||||||
go.uber.org/multierr v1.9.0 // indirect
|
go.uber.org/multierr v1.9.0 // indirect
|
||||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
|
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
|
||||||
golang.org/x/sys v0.15.0 // indirect
|
golang.org/x/sys v0.25.0 // indirect
|
||||||
golang.org/x/text v0.13.0 // indirect
|
golang.org/x/text v0.18.0 // indirect
|
||||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0
|
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
475
go.sum
475
go.sum
@ -1,53 +1,5 @@
|
|||||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
|
||||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
|
||||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
|
||||||
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
|
|
||||||
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
|
||||||
cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
|
||||||
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
|
|
||||||
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
|
|
||||||
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
|
|
||||||
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
|
|
||||||
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
|
|
||||||
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
|
|
||||||
cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
|
|
||||||
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
|
|
||||||
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
|
|
||||||
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
|
|
||||||
cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
|
|
||||||
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
|
|
||||||
cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY=
|
|
||||||
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
|
||||||
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
|
|
||||||
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
|
|
||||||
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
|
|
||||||
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
|
|
||||||
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
|
|
||||||
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
|
||||||
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
|
|
||||||
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
|
||||||
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
|
|
||||||
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
|
|
||||||
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
|
|
||||||
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
|
|
||||||
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
|
|
||||||
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
|
|
||||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
|
||||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
|
||||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
|
||||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
|
||||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
|
||||||
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
|
|
||||||
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
|
||||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
|
||||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
|
||||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
|
||||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
|
||||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
|
||||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
|
||||||
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
|
||||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
|
||||||
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
|
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||||
@ -55,100 +7,34 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
|
|||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
github.com/fasthttp/websocket v1.5.7 h1:0a6o2OfeATvtGgoMKleURhLT6JqWPg7fYfWnH4KHau4=
|
||||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
github.com/fasthttp/websocket v1.5.7/go.mod h1:bC4fxSono9czeXHQUVKxsC0sNjbm7lPJR04GDFqClfU=
|
||||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
|
||||||
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
|
|
||||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
|
||||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
|
||||||
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
|
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
|
||||||
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||||
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
|
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
|
||||||
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
|
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
|
||||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
|
||||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
|
||||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
|
||||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||||
github.com/gofiber/fiber/v2 v2.51.0 h1:JNACcZy5e2tGApWB2QrRpenTWn0fq0hkFm6k0C86gKQ=
|
github.com/gofiber/fiber/v2 v2.52.5 h1:tWoP1MJQjGEe4GB5TUGOi7P2E0ZMMRx5ZTG4rT+yGMo=
|
||||||
github.com/gofiber/fiber/v2 v2.51.0/go.mod h1:xaQRZQJGqnKOQnbQw+ltvku3/h8QxvNi8o6JiJ7Ll0U=
|
github.com/gofiber/fiber/v2 v2.52.5/go.mod h1:KEOE+cXMhXG0zHc9d8+E38hoX+ZN7bhOtgeF2oT6jrQ=
|
||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
github.com/gofiber/template v1.8.2 h1:PIv9s/7Uq6m+Fm2MDNd20pAFFKt5wWs7ZBd8iV9pWwk=
|
||||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
github.com/gofiber/template v1.8.2/go.mod h1:bs/2n0pSNPOkRa5VJ8zTIvedcI/lEYxzV3+YPXdBvq8=
|
||||||
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
github.com/gofiber/template/html/v2 v2.1.0 h1:FjwzqhhdJpnhyCvav60Z1ytnBqOUr5sGO/aTeob9/ng=
|
||||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
github.com/gofiber/template/html/v2 v2.1.0/go.mod h1:txXsRQN/G7Fr2cqGfr6zhVHgreCfpsBS+9+DJyrddJc=
|
||||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
github.com/gofiber/utils v1.1.0 h1:vdEBpn7AzIUJRhe+CiTOJdUcTg4Q9RK+pEa0KPbLdrM=
|
||||||
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
github.com/gofiber/utils v1.1.0/go.mod h1:poZpsnhBykfnY1Mc0KeEa6mSHrS3dV0+oBWyeQmb2e0=
|
||||||
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
|
|
||||||
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
|
||||||
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
|
||||||
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
|
||||||
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
|
|
||||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
|
||||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
|
||||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
|
||||||
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
|
||||||
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
|
||||||
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
|
|
||||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
|
||||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
|
||||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
|
||||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
|
||||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
|
||||||
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
|
||||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
|
||||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
|
||||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
|
||||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
|
||||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
|
||||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
|
||||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
|
||||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
|
||||||
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
|
||||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
|
||||||
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
|
||||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
|
||||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
|
||||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
|
||||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
|
||||||
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
|
||||||
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
|
||||||
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
|
||||||
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
|
||||||
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
|
||||||
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
|
||||||
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
|
||||||
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
|
||||||
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
|
||||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
|
||||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
|
||||||
github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=
|
|
||||||
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
|
||||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
|
||||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
|
||||||
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
|
|
||||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
|
||||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
|
||||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
|
||||||
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
|
||||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
github.com/klauspost/compress v1.17.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0=
|
||||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
|
||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
|
||||||
github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
|
|
||||||
github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
|
|
||||||
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
|
||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
|
||||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
|
||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
|
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
|
||||||
@ -159,8 +45,8 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/
|
|||||||
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||||
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
|
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
|
||||||
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
@ -168,19 +54,17 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w
|
|||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||||
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
|
github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI=
|
||||||
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
||||||
github.com/philhofer/fwd v1.1.2 h1:bnDivRJ1EWPjUIRXV5KfORO897HTbpFAQddBdE8t7Gw=
|
github.com/philhofer/fwd v1.1.2 h1:bnDivRJ1EWPjUIRXV5KfORO897HTbpFAQddBdE8t7Gw=
|
||||||
github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2tUTP0=
|
github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2tUTP0=
|
||||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
|
||||||
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
|
|
||||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
|
||||||
|
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||||
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
||||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||||
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
||||||
@ -198,10 +82,12 @@ github.com/saracen/fastzip v0.1.11 h1:NnExbTEJbya7148cov09BCxwfur9tQ5BQ1QyQH6Xle
|
|||||||
github.com/saracen/fastzip v0.1.11/go.mod h1:/lN5BiU451/OZMS+hfhVsSDj/RNrxYmO9EYxCtMrFrY=
|
github.com/saracen/fastzip v0.1.11/go.mod h1:/lN5BiU451/OZMS+hfhVsSDj/RNrxYmO9EYxCtMrFrY=
|
||||||
github.com/saracen/zipextra v0.0.0-20220303013732-0187cb0159ea h1:8czYLkvzZRE+AElIQeDffQdgR+CC3wKEFILYU/1PeX4=
|
github.com/saracen/zipextra v0.0.0-20220303013732-0187cb0159ea h1:8czYLkvzZRE+AElIQeDffQdgR+CC3wKEFILYU/1PeX4=
|
||||||
github.com/saracen/zipextra v0.0.0-20220303013732-0187cb0159ea/go.mod h1:hnzuad9d2wdd3z8fC6UouHQK5qZxqv3F/E6MMzXc7q0=
|
github.com/saracen/zipextra v0.0.0-20220303013732-0187cb0159ea/go.mod h1:hnzuad9d2wdd3z8fC6UouHQK5qZxqv3F/E6MMzXc7q0=
|
||||||
|
github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee h1:8Iv5m6xEo1NR1AvpV+7XmhI4r39LGNzwUL4YpMuL5vk=
|
||||||
|
github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee/go.mod h1:qwtSXrKuJh/zsFQ12yEE89xfCrGKK63Rr7ctU/uCo4g=
|
||||||
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
|
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
|
||||||
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
|
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
|
||||||
github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY=
|
github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
|
||||||
github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
|
github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
|
||||||
github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA=
|
github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA=
|
||||||
github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48=
|
github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
@ -212,9 +98,6 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
|||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
|
||||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
|
||||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||||
@ -227,163 +110,36 @@ github.com/urfave/cli/v2 v2.26.0 h1:3f3AMg3HpThFNT4I++TKOejZO8yU55t3JnnSr4S4QEI=
|
|||||||
github.com/urfave/cli/v2 v2.26.0/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
|
github.com/urfave/cli/v2 v2.26.0/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
|
||||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||||
github.com/valyala/fasthttp v1.50.0 h1:H7fweIlBm0rXLs2q0XbalvJ6r0CUPFWK3/bB4N13e9M=
|
github.com/valyala/fasthttp v1.56.0 h1:bEZdJev/6LCBlpdORfrLu/WOZXXxvrUQSiyniuaoW8U=
|
||||||
github.com/valyala/fasthttp v1.50.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA=
|
github.com/valyala/fasthttp v1.56.0/go.mod h1:sReBt3XZVnudxuLOx4J/fMrJVorWRiWY2koQKgABiVI=
|
||||||
github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8=
|
github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8=
|
||||||
github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
|
github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
|
||||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
|
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
|
||||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
|
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
|
||||||
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
|
||||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
|
||||||
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
|
||||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
|
||||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
|
||||||
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
|
||||||
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
|
||||||
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
|
||||||
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
|
||||||
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
|
|
||||||
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
|
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
|
||||||
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||||
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
|
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
|
||||||
go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=
|
go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
|
||||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
|
||||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
|
||||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
|
||||||
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
|
||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
|
||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
|
||||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
|
||||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
|
||||||
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
|
|
||||||
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
|
|
||||||
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
|
||||||
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
|
||||||
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
|
||||||
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
|
|
||||||
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
|
|
||||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
|
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
|
||||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
|
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
|
||||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
|
||||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
|
||||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
|
||||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
|
||||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
|
||||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
|
||||||
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
|
||||||
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
|
||||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
|
||||||
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
|
|
||||||
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
|
||||||
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
|
||||||
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
|
||||||
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
|
||||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
|
||||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
|
||||||
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
|
||||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
|
||||||
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
|
||||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
|
||||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
|
||||||
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
|
||||||
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
|
||||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||||
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
|
||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
|
||||||
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
|
||||||
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
|
||||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
|
||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
|
||||||
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
|
||||||
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
|
||||||
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
|
||||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
|
||||||
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
|
||||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
|
||||||
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
|
||||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
|
||||||
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
|
||||||
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
|
||||||
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
|
||||||
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
|
||||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
|
||||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
|
||||||
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
|
||||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
|
||||||
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
|
||||||
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
|
||||||
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
|
||||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||||
golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
|
golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
|
||||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
|
||||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
|
||||||
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
|
||||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
|
||||||
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
|
||||||
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
|
||||||
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
|
||||||
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
|
||||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
|
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||||
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
@ -392,186 +148,27 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
|
||||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
|
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
|
||||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
|
||||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
|
||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
|
||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||||
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||||
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
|
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
|
||||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
|
||||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
|
||||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
|
||||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
|
||||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
|
||||||
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
|
||||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
|
||||||
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
|
||||||
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
|
||||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
|
||||||
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
|
||||||
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
|
||||||
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
|
||||||
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
|
||||||
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
|
||||||
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
|
||||||
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
|
||||||
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
|
||||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
|
||||||
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
|
||||||
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
|
||||||
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
|
||||||
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
|
||||||
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
|
||||||
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
|
||||||
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
|
||||||
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
|
||||||
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
|
||||||
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
|
||||||
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
|
||||||
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
|
||||||
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
|
||||||
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
|
||||||
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
|
||||||
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
|
||||||
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
|
||||||
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
|
||||||
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
|
||||||
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
|
||||||
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
|
||||||
golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
|
|
||||||
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
|
||||||
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
|
||||||
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
|
||||||
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
|
||||||
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
|
||||||
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
|
||||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||||
golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ=
|
golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ=
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
|
||||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
|
||||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
|
||||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
|
||||||
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
|
||||||
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
|
||||||
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
|
||||||
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
|
||||||
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
|
||||||
google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
|
||||||
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
|
||||||
google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
|
||||||
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
|
||||||
google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
|
||||||
google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
|
||||||
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
|
||||||
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
|
|
||||||
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
|
|
||||||
google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
|
|
||||||
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
|
|
||||||
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
|
|
||||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
|
||||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
|
||||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
|
||||||
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
|
||||||
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
|
||||||
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
|
||||||
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
|
||||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
|
||||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
|
||||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
|
||||||
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
|
||||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
|
||||||
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
|
||||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
|
||||||
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
|
|
||||||
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
|
||||||
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
|
||||||
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
|
||||||
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
|
||||||
google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
|
||||||
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
|
||||||
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
|
|
||||||
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
|
||||||
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
|
||||||
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
|
||||||
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
|
||||||
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
|
||||||
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
|
||||||
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
|
||||||
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
|
||||||
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
|
|
||||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
|
||||||
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
|
|
||||||
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
|
||||||
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
|
||||||
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
|
||||||
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
|
||||||
google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
|
||||||
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
|
||||||
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
|
||||||
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
|
||||||
google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
|
||||||
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
|
||||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
|
||||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
|
||||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
|
||||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
|
||||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
|
||||||
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
|
||||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
|
||||||
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
|
||||||
google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
|
|
||||||
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
|
|
||||||
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
|
||||||
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
|
||||||
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
|
||||||
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
|
||||||
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
|
|
||||||
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
|
||||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
|
||||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
|
||||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
|
||||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
|
||||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
|
||||||
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
|
||||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
|
||||||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
|
||||||
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
|
|
||||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
|
||||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
|
||||||
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
|
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
|
||||||
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|
||||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
|
||||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
|
||||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
|
||||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
|
||||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
|
||||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
|
||||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
|
||||||
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
|
||||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
|
||||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
|
||||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
|
||||||
|
661
license
Normal file
661
license
Normal file
@ -0,0 +1,661 @@
|
|||||||
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 19 November 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU Affero General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works, specifically designed to ensure
|
||||||
|
cooperation with the community in the case of network server software.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
our General Public Licenses are intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
Developers that use our General Public Licenses protect your rights
|
||||||
|
with two steps: (1) assert copyright on the software, and (2) offer
|
||||||
|
you this License which gives you legal permission to copy, distribute
|
||||||
|
and/or modify the software.
|
||||||
|
|
||||||
|
A secondary benefit of defending all users' freedom is that
|
||||||
|
improvements made in alternate versions of the program, if they
|
||||||
|
receive widespread use, become available for other developers to
|
||||||
|
incorporate. Many developers of free software are heartened and
|
||||||
|
encouraged by the resulting cooperation. However, in the case of
|
||||||
|
software used on network servers, this result may fail to come about.
|
||||||
|
The GNU General Public License permits making a modified version and
|
||||||
|
letting the public access it on a server without ever releasing its
|
||||||
|
source code to the public.
|
||||||
|
|
||||||
|
The GNU Affero General Public License is designed specifically to
|
||||||
|
ensure that, in such cases, the modified source code becomes available
|
||||||
|
to the community. It requires the operator of a network server to
|
||||||
|
provide the source code of the modified version running there to the
|
||||||
|
users of that server. Therefore, public use of a modified version, on
|
||||||
|
a publicly accessible server, gives the public access to the source
|
||||||
|
code of the modified version.
|
||||||
|
|
||||||
|
An older license, called the Affero General Public License and
|
||||||
|
published by Affero, was designed to accomplish similar goals. This is
|
||||||
|
a different license, not a version of the Affero GPL, but Affero has
|
||||||
|
released a new version of the Affero GPL which permits relicensing under
|
||||||
|
this license.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, if you modify the
|
||||||
|
Program, your modified version must prominently offer all users
|
||||||
|
interacting with it remotely through a computer network (if your version
|
||||||
|
supports such interaction) an opportunity to receive the Corresponding
|
||||||
|
Source of your version by providing access to the Corresponding Source
|
||||||
|
from a network server at no charge, through some standard or customary
|
||||||
|
means of facilitating copying of software. This Corresponding Source
|
||||||
|
shall include the Corresponding Source for any work covered by version 3
|
||||||
|
of the GNU General Public License that is incorporated pursuant to the
|
||||||
|
following paragraph.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the work with which it is combined will remain governed by version
|
||||||
|
3 of the GNU General Public License.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU Affero General Public License from time to time. Such new versions
|
||||||
|
will be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU Affero General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU Affero General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU Affero General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If your software can interact with users remotely through a computer
|
||||||
|
network, you should also make sure that it provides a way for users to
|
||||||
|
get its source. For example, if your program is a web application, its
|
||||||
|
interface could display a "Source" link that leads users to an archive
|
||||||
|
of the code. There are many ways you could offer source, and different
|
||||||
|
solutions will be better for different programs; see section 13 for the
|
||||||
|
specific requirements.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
@ -1,89 +0,0 @@
|
|||||||
package conn
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
|
||||||
"github.com/samber/lo"
|
|
||||||
"github.com/spf13/viper"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
var CliCommands = []*cli.Command{
|
|
||||||
{
|
|
||||||
Name: "list",
|
|
||||||
Aliases: []string{"ls"},
|
|
||||||
Description: "List all connected remote server",
|
|
||||||
Action: func(ctx *cli.Context) error {
|
|
||||||
var servers []CliConnection
|
|
||||||
raw, _ := json.Marshal(viper.Get("servers"))
|
|
||||||
_ = json.Unmarshal(raw, &servers)
|
|
||||||
|
|
||||||
log.Info().Msgf("There are %d server(s) connected in total.", len(servers))
|
|
||||||
for idx, server := range servers {
|
|
||||||
log.Info().Msgf("%d) %s: %s", idx+1, server.ID, server.Url)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: "connect",
|
|
||||||
Aliases: []string{"add"},
|
|
||||||
Description: "Connect and save configuration of remote server",
|
|
||||||
ArgsUsage: "<id> <server url> <credential>",
|
|
||||||
Action: func(ctx *cli.Context) error {
|
|
||||||
if ctx.Args().Len() < 3 {
|
|
||||||
return fmt.Errorf("must have three arguments: <id> <server url> <credential>")
|
|
||||||
}
|
|
||||||
|
|
||||||
c := CliConnection{
|
|
||||||
ID: ctx.Args().Get(0),
|
|
||||||
Url: ctx.Args().Get(1),
|
|
||||||
Credential: ctx.Args().Get(2),
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := c.CheckConnectivity(); err != nil {
|
|
||||||
return fmt.Errorf("couldn't connect server: %s", err.Error())
|
|
||||||
} else {
|
|
||||||
var servers []CliConnection
|
|
||||||
raw, _ := json.Marshal(viper.Get("servers"))
|
|
||||||
_ = json.Unmarshal(raw, &servers)
|
|
||||||
viper.Set("servers", append(servers, c))
|
|
||||||
|
|
||||||
if err := viper.WriteConfig(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
log.Info().Msg("Successfully connected a new remote server, enter \"rds ls\" to get more info.")
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: "disconnect",
|
|
||||||
Aliases: []string{"remove"},
|
|
||||||
Description: "Remove a remote server configuration",
|
|
||||||
ArgsUsage: "<id>",
|
|
||||||
Action: func(ctx *cli.Context) error {
|
|
||||||
if ctx.Args().Len() < 1 {
|
|
||||||
return fmt.Errorf("must have more one arguments: <server url>")
|
|
||||||
}
|
|
||||||
|
|
||||||
var servers []CliConnection
|
|
||||||
raw, _ := json.Marshal(viper.Get("servers"))
|
|
||||||
_ = json.Unmarshal(raw, &servers)
|
|
||||||
viper.Set("servers", lo.Filter(servers, func(item CliConnection, idx int) bool {
|
|
||||||
return item.ID != ctx.Args().Get(0)
|
|
||||||
}))
|
|
||||||
|
|
||||||
if err := viper.WriteConfig(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
log.Info().Msg("Successfully disconnected a remote server, enter \"rds ls\" to get more info.")
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
package conn
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
roadsign "code.smartsheep.studio/goatworks/roadsign/pkg"
|
|
||||||
"github.com/gofiber/fiber/v2"
|
|
||||||
"github.com/rs/zerolog/log"
|
|
||||||
)
|
|
||||||
|
|
||||||
type CliConnection struct {
|
|
||||||
ID string `json:"id"`
|
|
||||||
Url string `json:"url"`
|
|
||||||
Credential string `json:"credential"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (v CliConnection) CheckConnectivity() error {
|
|
||||||
client := fiber.Get(v.Url + "/cgi/connectivity")
|
|
||||||
client.BasicAuth("RoadSign CLI", v.Credential)
|
|
||||||
|
|
||||||
if status, data, err := client.Bytes(); len(err) > 0 {
|
|
||||||
return fmt.Errorf("couldn't connect to server: %q", err)
|
|
||||||
} else if status != 200 {
|
|
||||||
return fmt.Errorf("server rejected request, may cause by invalid credential")
|
|
||||||
} else {
|
|
||||||
var resp fiber.Map
|
|
||||||
if err := json.Unmarshal(data, &resp); err != nil {
|
|
||||||
return err
|
|
||||||
} else if resp["server"] != "RoadSign" {
|
|
||||||
return fmt.Errorf("remote server isn't roadsign")
|
|
||||||
} else if resp["version"] != roadsign.AppVersion {
|
|
||||||
if strings.Contains(roadsign.AppVersion, "#") {
|
|
||||||
return fmt.Errorf("remote server version mismatch client version, update or downgrade client required")
|
|
||||||
} else {
|
|
||||||
log.Warn().Msg("RoadSign CLI didn't complied with vcs information, compatibility was disabled. To enable it, reinstall cli with -buildvcs flag.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
package conn
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
|
|
||||||
"github.com/samber/lo"
|
|
||||||
"github.com/spf13/viper"
|
|
||||||
)
|
|
||||||
|
|
||||||
func GetConnection(id string) (CliConnection, bool) {
|
|
||||||
var servers []CliConnection
|
|
||||||
raw, _ := json.Marshal(viper.Get("servers"))
|
|
||||||
_ = json.Unmarshal(raw, &servers)
|
|
||||||
return lo.Find(servers, func(item CliConnection) bool {
|
|
||||||
return item.ID == id
|
|
||||||
})
|
|
||||||
}
|
|
@ -1,101 +0,0 @@
|
|||||||
package deploy
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
jsoniter "github.com/json-iterator/go"
|
|
||||||
"io"
|
|
||||||
"os"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"code.smartsheep.studio/goatworks/roadsign/pkg/cmd/rds/conn"
|
|
||||||
"code.smartsheep.studio/goatworks/roadsign/pkg/sign"
|
|
||||||
"github.com/gofiber/fiber/v2"
|
|
||||||
"github.com/rs/zerolog/log"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
"gopkg.in/yaml.v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
var DeployCommands = []*cli.Command{
|
|
||||||
{
|
|
||||||
Name: "deploy",
|
|
||||||
Aliases: []string{"dp"},
|
|
||||||
ArgsUsage: "<server> <site> <upstream> [path]",
|
|
||||||
Action: func(ctx *cli.Context) error {
|
|
||||||
if ctx.Args().Len() < 4 {
|
|
||||||
return fmt.Errorf("must have four arguments: <server> <site> <upstream> <path>")
|
|
||||||
}
|
|
||||||
|
|
||||||
if !strings.HasSuffix(ctx.Args().Get(3), ".zip") {
|
|
||||||
return fmt.Errorf("input file must be a zip file and ends with .zip")
|
|
||||||
}
|
|
||||||
|
|
||||||
server, ok := conn.GetConnection(ctx.Args().Get(0))
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("server was not found, use \"rds connect\" add one first")
|
|
||||||
} else if err := server.CheckConnectivity(); err != nil {
|
|
||||||
return fmt.Errorf("couldn't connect server: %s", err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send request
|
|
||||||
log.Info().Msg("Now publishing to remote server...")
|
|
||||||
|
|
||||||
url := fmt.Sprintf("/webhooks/publish/%s/%s?mimetype=%s", ctx.Args().Get(1), ctx.Args().Get(2), "application/zip")
|
|
||||||
client := fiber.Put(server.Url+url).
|
|
||||||
SendFile(ctx.Args().Get(3), "attachments").
|
|
||||||
MultipartForm(nil).
|
|
||||||
BasicAuth("RoadSign CLI", server.Credential)
|
|
||||||
|
|
||||||
if status, data, err := client.Bytes(); len(err) > 0 {
|
|
||||||
return fmt.Errorf("failed to publish to remote: %q", err)
|
|
||||||
} else if status != 200 {
|
|
||||||
return fmt.Errorf("server rejected request, status code %d, response %s", status, string(data))
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Info().Msg("Well done! Your site is successfully published! 🎉")
|
|
||||||
|
|
||||||
return nil
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: "sync",
|
|
||||||
Aliases: []string{"sc"},
|
|
||||||
ArgsUsage: "<server> <site> <configuration path>",
|
|
||||||
Action: func(ctx *cli.Context) error {
|
|
||||||
if ctx.Args().Len() < 3 {
|
|
||||||
return fmt.Errorf("must have three arguments: <server> <site> <configuration path>")
|
|
||||||
}
|
|
||||||
|
|
||||||
server, ok := conn.GetConnection(ctx.Args().Get(0))
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("server was not found, use \"rds connect\" add one first")
|
|
||||||
} else if err := server.CheckConnectivity(); err != nil {
|
|
||||||
return fmt.Errorf("couldn't connect server: %s", err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
var site sign.SiteConfig
|
|
||||||
if file, err := os.Open(ctx.Args().Get(2)); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
raw, _ := io.ReadAll(file)
|
|
||||||
yaml.Unmarshal(raw, &site)
|
|
||||||
}
|
|
||||||
|
|
||||||
url := fmt.Sprintf("/webhooks/sync/%s", ctx.Args().Get(1))
|
|
||||||
client := fiber.Put(server.Url+url).
|
|
||||||
JSONEncoder(jsoniter.ConfigCompatibleWithStandardLibrary.Marshal).
|
|
||||||
JSONDecoder(jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal).
|
|
||||||
JSON(site).
|
|
||||||
BasicAuth("RoadSign CLI", server.Credential)
|
|
||||||
|
|
||||||
if status, data, err := client.Bytes(); len(err) > 0 {
|
|
||||||
return fmt.Errorf("failed to sync to remote: %q", err)
|
|
||||||
} else if status != 200 {
|
|
||||||
return fmt.Errorf("server rejected request, status code %d, response %s", status, string(data))
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Info().Msg("Well done! Your site configuration is up-to-date! 🎉")
|
|
||||||
|
|
||||||
return nil
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
|
|
||||||
roadsign "code.smartsheep.studio/goatworks/roadsign/pkg"
|
|
||||||
"code.smartsheep.studio/goatworks/roadsign/pkg/cmd/rds/conn"
|
|
||||||
"code.smartsheep.studio/goatworks/roadsign/pkg/cmd/rds/deploy"
|
|
||||||
"github.com/rs/zerolog"
|
|
||||||
"github.com/rs/zerolog/log"
|
|
||||||
"github.com/spf13/viper"
|
|
||||||
"github.com/urfave/cli/v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
|
|
||||||
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stdout})
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
// Configure settings
|
|
||||||
viper.AddConfigPath("$HOME")
|
|
||||||
viper.SetConfigName(".roadsignrc")
|
|
||||||
viper.SetConfigType("yaml")
|
|
||||||
|
|
||||||
// Load settings
|
|
||||||
if err := viper.ReadInConfig(); err != nil {
|
|
||||||
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
|
|
||||||
viper.SafeWriteConfig()
|
|
||||||
viper.ReadInConfig()
|
|
||||||
} else {
|
|
||||||
log.Panic().Err(err).Msg("An error occurred when loading settings.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Configure CLI
|
|
||||||
app := &cli.App{
|
|
||||||
Name: "RoadSign CLI",
|
|
||||||
Version: roadsign.AppVersion,
|
|
||||||
Suggest: true,
|
|
||||||
Commands: append(append([]*cli.Command{}, conn.CliCommands...), deploy.DeployCommands...),
|
|
||||||
}
|
|
||||||
|
|
||||||
// Run CLI
|
|
||||||
if err := app.Run(os.Args); err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("An error occurred when running cli.")
|
|
||||||
}
|
|
||||||
}
|
|
@ -6,10 +6,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
roadsign "code.smartsheep.studio/goatworks/roadsign/pkg"
|
roadsign "git.solsynth.dev/goatworks/roadsign/pkg"
|
||||||
"code.smartsheep.studio/goatworks/roadsign/pkg/hypertext"
|
"git.solsynth.dev/goatworks/roadsign/pkg/hypertext"
|
||||||
"code.smartsheep.studio/goatworks/roadsign/pkg/sideload"
|
"git.solsynth.dev/goatworks/roadsign/pkg/navi"
|
||||||
"code.smartsheep.studio/goatworks/roadsign/pkg/sign"
|
"git.solsynth.dev/goatworks/roadsign/pkg/sideload"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/rs/zerolog"
|
"github.com/rs/zerolog"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
@ -25,8 +25,9 @@ func main() {
|
|||||||
// Configure settings
|
// Configure settings
|
||||||
viper.AddConfigPath(".")
|
viper.AddConfigPath(".")
|
||||||
viper.AddConfigPath("..")
|
viper.AddConfigPath("..")
|
||||||
|
viper.AddConfigPath("/")
|
||||||
viper.SetConfigName("settings")
|
viper.SetConfigName("settings")
|
||||||
viper.SetConfigType("yaml")
|
viper.SetConfigType("toml")
|
||||||
|
|
||||||
// Load settings
|
// Load settings
|
||||||
if err := viper.ReadInConfig(); err != nil {
|
if err := viper.ReadInConfig(); err != nil {
|
||||||
@ -43,37 +44,28 @@ func main() {
|
|||||||
log.Warn().Msgf("RoadSign auto generated api credential is %s", credential)
|
log.Warn().Msgf("RoadSign auto generated api credential is %s", credential)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load & init sign
|
// Load & init navigator
|
||||||
if err := sign.ReadInConfig(viper.GetString("paths.configs")); err != nil {
|
if err := navi.ReadInConfig(viper.GetString("paths.configs")); err != nil {
|
||||||
log.Panic().Err(err).Msg("An error occurred when loading configurations.")
|
log.Panic().Err(err).Msg("An error occurred when loading configurations.")
|
||||||
} else {
|
} else {
|
||||||
log.Info().Int("count", len(sign.App.Sites)).Msg("All configuration has been loaded.")
|
log.Info().Int("count", len(navi.R.Regions)).Msg("All configuration has been loaded.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Preheat processes
|
// Init warden
|
||||||
go func() {
|
navi.InitializeWarden(navi.R.Regions)
|
||||||
log.Info().Msg("Preheating processes...")
|
|
||||||
sign.App.PreheatProcesses(func(total int, success int) {
|
|
||||||
log.Info().Int("requested", total).Int("succeed", success).Msgf("Preheat processes completed!")
|
|
||||||
})
|
|
||||||
}()
|
|
||||||
|
|
||||||
// Init hypertext server
|
// Init hypertext server
|
||||||
hypertext.RunServer(
|
hypertext.RunServer(
|
||||||
hypertext.InitServer(),
|
hypertext.InitServer(),
|
||||||
viper.GetStringSlice("hypertext.ports"),
|
viper.GetStringSlice("hypertext.ports"),
|
||||||
viper.GetStringSlice("hypertext.secured_ports"),
|
viper.GetStringSlice("hypertext.secured_ports"),
|
||||||
viper.GetString("hypertext.certificate.pem"),
|
|
||||||
viper.GetString("hypertext.certificate.key"),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Init sideload server
|
// Init sideload server
|
||||||
hypertext.RunServer(
|
hypertext.RunServer(
|
||||||
sideload.InitSideload(),
|
sideload.InitSideload(),
|
||||||
viper.GetStringSlice("hypertext.sideload_ports"),
|
viper.GetStringSlice("sideload.ports"),
|
||||||
viper.GetStringSlice("hypertext.sideload_secured_ports"),
|
[]string{},
|
||||||
viper.GetString("hypertext.certificate.sideload_pem"),
|
|
||||||
viper.GetString("hypertext.certificate.sideload_key"),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
log.Info().Msgf("RoadSign v%s is started...", roadsign.AppVersion)
|
log.Info().Msgf("RoadSign v%s is started...", roadsign.AppVersion)
|
||||||
|
@ -1,111 +1,138 @@
|
|||||||
package hypertext
|
package hypertext
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"math/rand"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
"code.smartsheep.studio/goatworks/roadsign/pkg/sign"
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
|
"git.solsynth.dev/goatworks/roadsign/pkg/navi"
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"github.com/samber/lo"
|
"github.com/samber/lo"
|
||||||
)
|
)
|
||||||
|
|
||||||
func UseProxies(app *fiber.App) {
|
func ProxiesHandler(ctx *fiber.Ctx) error {
|
||||||
app.All("/*", func(ctx *fiber.Ctx) error {
|
host := ctx.Hostname()
|
||||||
host := ctx.Hostname()
|
path := ctx.Path()
|
||||||
path := ctx.Path()
|
queries := ctx.Queries()
|
||||||
queries := ctx.Queries()
|
headers := ctx.GetReqHeaders()
|
||||||
headers := ctx.GetReqHeaders()
|
|
||||||
|
|
||||||
// Filtering sites
|
// Filtering sites
|
||||||
for _, site := range sign.App.Sites {
|
for _, region := range navi.R.Regions {
|
||||||
// Matching rules
|
// Matching rules
|
||||||
for _, rule := range site.Rules {
|
for _, location := range region.Locations {
|
||||||
if !lo.Contains(rule.Host, host) {
|
if !lo.Contains(location.Hosts, host) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if !func() bool {
|
if !func() bool {
|
||||||
flag := false
|
flag := false
|
||||||
for _, pattern := range rule.Path {
|
for _, pattern := range location.Paths {
|
||||||
if ok, _ := regexp.MatchString(pattern, path); ok {
|
if ok, _ := regexp.MatchString(pattern, path); ok {
|
||||||
flag = true
|
flag = true
|
||||||
break
|
break
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return flag
|
|
||||||
}() {
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
|
return flag
|
||||||
|
}() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// Filter query strings
|
// Filter query strings
|
||||||
flag := true
|
flag := true
|
||||||
for rk, rv := range rule.Queries {
|
for rk, rv := range location.Queries {
|
||||||
for ik, iv := range queries {
|
for ik, iv := range queries {
|
||||||
if rk != ik && rv != iv {
|
if rk != ik && rv != iv {
|
||||||
flag = false
|
flag = false
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !flag {
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !flag {
|
if !flag {
|
||||||
continue
|
break
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if !flag {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// Filter headers
|
// Filter headers
|
||||||
for rk, rv := range rule.Headers {
|
for rk, rv := range location.Headers {
|
||||||
for ik, iv := range headers {
|
for ik, iv := range headers {
|
||||||
if rk == ik {
|
if rk == ik {
|
||||||
for _, ov := range iv {
|
for _, ov := range iv {
|
||||||
if !lo.Contains(rv, ov) {
|
if !lo.Contains(rv, ov) {
|
||||||
flag = false
|
flag = false
|
||||||
break
|
break
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !flag {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if !flag {
|
if !flag {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !flag {
|
if !flag {
|
||||||
continue
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
// Passing all the rules means the site is what we are looking for.
|
|
||||||
// Let us respond to our client!
|
|
||||||
return makeResponse(ctx, site)
|
|
||||||
}
|
}
|
||||||
}
|
if !flag {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// There is no site available for this request.
|
idx := rand.Intn(len(location.Destinations))
|
||||||
// Just ignore it and give our client a not found status.
|
dest := location.Destinations[idx]
|
||||||
// Do not care about the user experience, we can do it in custom error handler.
|
|
||||||
return fiber.ErrNotFound
|
// Passing all the rules means the site is what we are looking for.
|
||||||
})
|
// Let us respond to our client!
|
||||||
|
return makeResponse(ctx, region, &location, &dest)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// There is no site available for this request.
|
||||||
|
// Just ignore it and give our client a not found status.
|
||||||
|
// Do not care about the user experience, we can do it in custom error handler.
|
||||||
|
return fiber.ErrNotFound
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeResponse(ctx *fiber.Ctx, site *sign.SiteConfig) error {
|
func makeResponse(c *fiber.Ctx, region *navi.Region, location *navi.Location, dest *navi.Destination) error {
|
||||||
|
uri := c.Request().URI().String()
|
||||||
|
|
||||||
// Modify request
|
// Modify request
|
||||||
for _, transformer := range site.Transformers {
|
for _, transformer := range dest.Transformers {
|
||||||
if err := transformer.TransformRequest(ctx); err != nil {
|
if err := transformer.TransformRequest(c); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Forward
|
// Forward
|
||||||
err := sign.App.Forward(ctx, site)
|
err := navi.R.Forward(c, dest)
|
||||||
|
|
||||||
// Modify response
|
// Modify response
|
||||||
for _, transformer := range site.Transformers {
|
for _, transformer := range dest.Transformers {
|
||||||
if err := transformer.TransformResponse(ctx); err != nil {
|
if err := transformer.TransformResponse(c); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Collect trace
|
||||||
|
if viper.GetBool("telemetry.capture_traces") {
|
||||||
|
var message string
|
||||||
|
if err != nil {
|
||||||
|
message = err.Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
go navi.R.Metrics.AddTrace(navi.RoadTrace{
|
||||||
|
Region: region.ID,
|
||||||
|
Location: location.ID,
|
||||||
|
Destination: dest.ID,
|
||||||
|
Uri: uri,
|
||||||
|
IpAddress: c.IP(),
|
||||||
|
UserAgent: c.Get(fiber.HeaderUserAgent),
|
||||||
|
Error: navi.RoadTraceError{
|
||||||
|
IsNull: err == nil,
|
||||||
|
Message: message,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -1,30 +1,53 @@
|
|||||||
package hypertext
|
package hypertext
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/tls"
|
||||||
|
"git.solsynth.dev/goatworks/roadsign/pkg/hypertext/status"
|
||||||
jsoniter "github.com/json-iterator/go"
|
jsoniter "github.com/json-iterator/go"
|
||||||
|
"net"
|
||||||
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"github.com/gofiber/fiber/v2/middleware/limiter"
|
"github.com/gofiber/fiber/v2/middleware/limiter"
|
||||||
"github.com/gofiber/fiber/v2/middleware/logger"
|
"github.com/gofiber/fiber/v2/middleware/logger"
|
||||||
|
"github.com/gofiber/template/html/v2"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
|
|
||||||
func InitServer() *fiber.App {
|
func InitServer() *fiber.App {
|
||||||
|
views := html.NewFileSystem(http.FS(status.FS), ".gohtml")
|
||||||
app := fiber.New(fiber.Config{
|
app := fiber.New(fiber.Config{
|
||||||
|
ViewsLayout: "views/index",
|
||||||
AppName: "RoadSign",
|
AppName: "RoadSign",
|
||||||
ServerHeader: "RoadSign",
|
ServerHeader: "RoadSign",
|
||||||
DisableStartupMessage: true,
|
DisableStartupMessage: true,
|
||||||
EnableIPValidation: true,
|
EnableIPValidation: true,
|
||||||
|
Views: views,
|
||||||
|
ErrorHandler: status.StatusPageHandler,
|
||||||
JSONDecoder: jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal,
|
JSONDecoder: jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal,
|
||||||
JSONEncoder: jsoniter.ConfigCompatibleWithStandardLibrary.Marshal,
|
JSONEncoder: jsoniter.ConfigCompatibleWithStandardLibrary.Marshal,
|
||||||
|
ProxyHeader: fiber.HeaderXForwardedFor,
|
||||||
Prefork: viper.GetBool("performance.prefork"),
|
Prefork: viper.GetBool("performance.prefork"),
|
||||||
BodyLimit: viper.GetInt("hypertext.limitation.max_body_size"),
|
BodyLimit: viper.GetInt("hypertext.limitation.max_body_size"),
|
||||||
})
|
})
|
||||||
|
|
||||||
if viper.GetBool("performance.request_logging") {
|
if viper.GetBool("hypertext.force_https") {
|
||||||
|
app.Use(func(c *fiber.Ctx) error {
|
||||||
|
if !c.Secure() {
|
||||||
|
return c.Redirect(
|
||||||
|
strings.Replace(c.Request().URI().String(), "http", "https", 1),
|
||||||
|
fiber.StatusMovedPermanently,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.Next()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if viper.GetBool("telemetry.request_logging") {
|
||||||
app.Use(logger.New(logger.Config{
|
app.Use(logger.New(logger.Config{
|
||||||
Output: log.Logger,
|
Output: log.Logger,
|
||||||
Format: "[Proxies] [${time}] ${status} - ${latency} ${method} ${path}\n",
|
Format: "[Proxies] [${time}] ${status} - ${latency} ${method} ${path}\n",
|
||||||
@ -35,19 +58,48 @@ func InitServer() *fiber.App {
|
|||||||
app.Use(limiter.New(limiter.Config{
|
app.Use(limiter.New(limiter.Config{
|
||||||
Max: viper.GetInt("hypertext.limitation.max_qps"),
|
Max: viper.GetInt("hypertext.limitation.max_qps"),
|
||||||
Expiration: 1 * time.Second,
|
Expiration: 1 * time.Second,
|
||||||
|
LimitReached: func(c *fiber.Ctx) error {
|
||||||
|
return fiber.ErrTooManyRequests
|
||||||
|
},
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
UseProxies(app)
|
app.All("/*", ProxiesHandler)
|
||||||
|
|
||||||
return app
|
return app
|
||||||
}
|
}
|
||||||
|
|
||||||
func RunServer(app *fiber.App, ports []string, securedPorts []string, pem string, key string) {
|
type CertificateConfig struct {
|
||||||
|
Key string `json:"key"`
|
||||||
|
Pem string `json:"pem"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func RunServer(app *fiber.App, ports []string, securedPorts []string) {
|
||||||
|
var certs []CertificateConfig
|
||||||
|
raw, _ := jsoniter.Marshal(viper.Get("hypertext.certificate"))
|
||||||
|
_ = jsoniter.Unmarshal(raw, &certs)
|
||||||
|
|
||||||
|
tlsCfg := &tls.Config{
|
||||||
|
MinVersion: tls.VersionTLS12,
|
||||||
|
Certificates: []tls.Certificate{},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, info := range certs {
|
||||||
|
cert, err := tls.LoadX509KeyPair(info.Pem, info.Key)
|
||||||
|
if err != nil {
|
||||||
|
log.Error().Err(err).
|
||||||
|
Str("pem", info.Pem).
|
||||||
|
Str("key", info.Key).
|
||||||
|
Msg("An error occurred when loading certificate.")
|
||||||
|
} else {
|
||||||
|
tlsCfg.Certificates = append(tlsCfg.Certificates, cert)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for _, port := range ports {
|
for _, port := range ports {
|
||||||
port := port
|
port := port
|
||||||
go func() {
|
go func() {
|
||||||
if viper.GetBool("hypertext.certificate.redirect") {
|
if viper.GetBool("hypertext.redirect_to_https") {
|
||||||
redirector := fiber.New(fiber.Config{
|
redirector := fiber.New(fiber.Config{
|
||||||
AppName: "RoadSign",
|
AppName: "RoadSign",
|
||||||
ServerHeader: "RoadSign",
|
ServerHeader: "RoadSign",
|
||||||
@ -58,22 +110,30 @@ func RunServer(app *fiber.App, ports []string, securedPorts []string, pem string
|
|||||||
return c.Redirect(strings.ReplaceAll(string(c.Request().URI().FullURI()), "http", "https"))
|
return c.Redirect(strings.ReplaceAll(string(c.Request().URI().FullURI()), "http", "https"))
|
||||||
})
|
})
|
||||||
if err := redirector.Listen(port); err != nil {
|
if err := redirector.Listen(port); err != nil {
|
||||||
log.Panic().Err(err).Msg("An error occurred when listening hypertext common ports.")
|
log.Panic().Err(err).Msg("An error occurred when listening hypertext non-tls ports.")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if err := app.Listen(port); err != nil {
|
if err := app.Listen(port); err != nil {
|
||||||
log.Panic().Err(err).Msg("An error occurred when listening hypertext common ports.")
|
log.Panic().Err(err).Msg("An error occurred when listening hypertext non-tls ports.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
log.Info().Msgf("Listening for %s... http://0.0.0.0%s", app.Config().AppName, port)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, port := range securedPorts {
|
for _, port := range securedPorts {
|
||||||
port := port
|
port := port
|
||||||
go func() {
|
go func() {
|
||||||
if err := app.ListenTLS(port, pem, key); err != nil {
|
listener, err := net.Listen("tcp", port)
|
||||||
|
if err != nil {
|
||||||
|
log.Panic().Err(err).Msg("An error occurred when listening hypertext tls ports.")
|
||||||
|
}
|
||||||
|
if err := app.Listener(tls.NewListener(listener, tlsCfg)); err != nil {
|
||||||
log.Panic().Err(err).Msg("An error occurred when listening hypertext tls ports.")
|
log.Panic().Err(err).Msg("An error occurred when listening hypertext tls ports.")
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
log.Info().Msgf("Listening for %s... https://0.0.0.0%s", app.Config().AppName, port)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
6
pkg/hypertext/status/embed.go
Normal file
6
pkg/hypertext/status/embed.go
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
package status
|
||||||
|
|
||||||
|
import "embed"
|
||||||
|
|
||||||
|
//go:embed all:views
|
||||||
|
var FS embed.FS
|
56
pkg/hypertext/status/serve.go
Normal file
56
pkg/hypertext/status/serve.go
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
package status
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
roadsign "git.solsynth.dev/goatworks/roadsign/pkg"
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ErrorPayload struct {
|
||||||
|
Title string `json:"title"`
|
||||||
|
Message string `json:"message"`
|
||||||
|
Version string `json:"version"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func StatusPageHandler(c *fiber.Ctx, err error) error {
|
||||||
|
var reqErr *fiber.Error
|
||||||
|
var status = fiber.StatusInternalServerError
|
||||||
|
if errors.As(err, &reqErr) {
|
||||||
|
status = reqErr.Code
|
||||||
|
}
|
||||||
|
|
||||||
|
c.Status(status)
|
||||||
|
|
||||||
|
payload := ErrorPayload{
|
||||||
|
Version: roadsign.AppVersion,
|
||||||
|
}
|
||||||
|
|
||||||
|
switch status {
|
||||||
|
case fiber.StatusNotFound:
|
||||||
|
payload.Title = "Not Found"
|
||||||
|
payload.Message = fmt.Sprintf("no resource for \"%s\"", c.OriginalURL())
|
||||||
|
return c.Render("views/not-found", payload)
|
||||||
|
case fiber.StatusTooManyRequests:
|
||||||
|
payload.Title = "Request Too Fast"
|
||||||
|
payload.Message = fmt.Sprintf("you have sent over %d request(s) in a second", viper.GetInt("hypertext.limitation.max_qps"))
|
||||||
|
return c.Render("views/too-many-requests", payload)
|
||||||
|
case fiber.StatusRequestEntityTooLarge:
|
||||||
|
payload.Title = "Request Too Large"
|
||||||
|
payload.Message = fmt.Sprintf("you have sent a request over %d bytes", viper.GetInt("hypertext.limitation.max_body_size"))
|
||||||
|
return c.Render("views/request-too-large", payload)
|
||||||
|
case fiber.StatusBadGateway:
|
||||||
|
payload.Title = "Backend Down"
|
||||||
|
payload.Message = fmt.Sprintf("all destnations configured to handle your request are down: %s", err.Error())
|
||||||
|
return c.Render("views/bad-gateway", payload)
|
||||||
|
case fiber.StatusGatewayTimeout:
|
||||||
|
payload.Title = "Backend Took Too Long To Response"
|
||||||
|
payload.Message = fmt.Sprintf("the destnation took too long to response your request: %s", err.Error())
|
||||||
|
return c.Render("views/gateway-timeout", payload)
|
||||||
|
default:
|
||||||
|
payload.Title = "Oops"
|
||||||
|
payload.Message = err.Error()
|
||||||
|
return c.Render("views/fallback", payload)
|
||||||
|
}
|
||||||
|
}
|
6
pkg/hypertext/status/views/bad-gateway.gohtml
Normal file
6
pkg/hypertext/status/views/bad-gateway.gohtml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<h1 class="text-2xl font-bold">502</h1>
|
||||||
|
<h2 class="text-lg">No one is standing...</h2>
|
||||||
|
|
||||||
|
<div class="mt-3 mx-auto p-5 w-[360px] max-w-screen bg-neutral text-neutral-content rounded">
|
||||||
|
<code class="capitalize">{{ .Message }}</code>
|
||||||
|
</div>
|
6
pkg/hypertext/status/views/fallback.gohtml
Normal file
6
pkg/hypertext/status/views/fallback.gohtml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<h1 class="text-2xl font-bold">Oops</h1>
|
||||||
|
<h2 class="text-lg">Something went wrong...</h2>
|
||||||
|
|
||||||
|
<div class="mt-3 mx-auto p-5 w-[360px] max-w-screen bg-neutral text-neutral-content rounded">
|
||||||
|
<code class="capitalize">{{ .Message }}</code>
|
||||||
|
</div>
|
6
pkg/hypertext/status/views/gateway-timeout.gohtml
Normal file
6
pkg/hypertext/status/views/gateway-timeout.gohtml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<h1 class="text-2xl font-bold">504</h1>
|
||||||
|
<h2 class="text-lg">Looks like the server in the back fell asleep</h2>
|
||||||
|
|
||||||
|
<div class="mt-3 mx-auto p-5 w-[360px] max-w-screen bg-neutral text-neutral-content rounded">
|
||||||
|
<code class="capitalize">{{ .Message }}</code>
|
||||||
|
</div>
|
83
pkg/hypertext/status/views/index.gohtml
Normal file
83
pkg/hypertext/status/views/index.gohtml
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/daisyui@4.6.1/dist/full.min.css" rel="stylesheet" type="text/css" />
|
||||||
|
<script src="https://cdn.tailwindcss.com"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
tailwind.config = {
|
||||||
|
daisyui: {
|
||||||
|
themes: [
|
||||||
|
{
|
||||||
|
light: {
|
||||||
|
primary: "#4750a3",
|
||||||
|
secondary: "#93c5fd",
|
||||||
|
accent: "#0f766e",
|
||||||
|
info: "#67e8f9",
|
||||||
|
success: "#15803d",
|
||||||
|
warning: "#f97316",
|
||||||
|
error: "#dc2626",
|
||||||
|
neutral: "#2B3440",
|
||||||
|
"secondary-content": "oklch(98.71% 0.0106 342.55)",
|
||||||
|
"neutral-content": "#D7DDE4",
|
||||||
|
"base-100": "oklch(100% 0 0)",
|
||||||
|
"base-200": "#F2F2F2",
|
||||||
|
"base-300": "#E5E6E6",
|
||||||
|
"base-content": "#1f2937",
|
||||||
|
"color-scheme": "light",
|
||||||
|
"--rounded-box": "0",
|
||||||
|
"--rounded-btn": "0",
|
||||||
|
"--rounded-badge": "0",
|
||||||
|
"--tab-radius": "0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
dark: {
|
||||||
|
primary: "#4750a3",
|
||||||
|
secondary: "#93c5fd",
|
||||||
|
accent: "#0f766e",
|
||||||
|
info: "#67e8f9",
|
||||||
|
success: "#15803d",
|
||||||
|
warning: "#f97316",
|
||||||
|
error: "#dc2626",
|
||||||
|
neutral: "#2a323c",
|
||||||
|
"neutral-content": "#A6ADBB",
|
||||||
|
"base-100": "#1d232a",
|
||||||
|
"base-200": "#191e24",
|
||||||
|
"base-300": "#15191e",
|
||||||
|
"base-content": "#A6ADBB",
|
||||||
|
"color-scheme": "dark",
|
||||||
|
"--rounded-box": "0",
|
||||||
|
"--rounded-btn": "0",
|
||||||
|
"--rounded-badge": "0",
|
||||||
|
"--tab-radius": "0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<title>{{ .Title }} | RoadSign</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main class="w-full h-screen flex justify-center items-center">
|
||||||
|
<div class="text-center">
|
||||||
|
{{embed}}
|
||||||
|
|
||||||
|
<footer class="mt-3 text-sm">
|
||||||
|
<p>
|
||||||
|
Powered by
|
||||||
|
<a href="https://wiki.smartsheep.studio/roadsign/index.html" target="_blank" class="link link-primary">
|
||||||
|
RoadSign
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
<p class="text-xs">v{{ .Version }}</p>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
6
pkg/hypertext/status/views/not-found.gohtml
Normal file
6
pkg/hypertext/status/views/not-found.gohtml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<h1 class="text-2xl font-bold">404</h1>
|
||||||
|
<h2 class="text-lg">Not Found</h2>
|
||||||
|
|
||||||
|
<div class="mt-3 mx-auto p-5 w-[360px] max-w-screen bg-neutral text-neutral-content rounded">
|
||||||
|
<code class="capitalize">{{ .Message }}</code>
|
||||||
|
</div>
|
6
pkg/hypertext/status/views/request-too-large.gohtml
Normal file
6
pkg/hypertext/status/views/request-too-large.gohtml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<h1 class="text-2xl font-bold">413</h1>
|
||||||
|
<h2 class="text-lg">Auh, you are too big.</h2>
|
||||||
|
|
||||||
|
<div class="mt-3 mx-auto p-5 w-[360px] max-w-screen bg-neutral text-neutral-content rounded">
|
||||||
|
<code class="capitalize">{{ .Message }}</code>
|
||||||
|
</div>
|
6
pkg/hypertext/status/views/too-many-requests.gohtml
Normal file
6
pkg/hypertext/status/views/too-many-requests.gohtml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<h1 class="text-2xl font-bold">429</h1>
|
||||||
|
<h2 class="text-lg">Stop it, you just to fast!</h2>
|
||||||
|
|
||||||
|
<div class="mt-3 mx-auto p-5 w-[360px] max-w-screen bg-neutral text-neutral-content rounded">
|
||||||
|
<code class="capitalize">{{ .Message }}</code>
|
||||||
|
</div>
|
@ -14,4 +14,4 @@ func init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var AppVersion = "1.2.1"
|
var AppVersion = "2.1.0"
|
||||||
|
58
pkg/navi/config.go
Normal file
58
pkg/navi/config.go
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
package navi
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/pelletier/go-toml/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
var R *RoadApp
|
||||||
|
|
||||||
|
func ReadInConfig(root string) error {
|
||||||
|
instance := &RoadApp{
|
||||||
|
Regions: make([]*Region, 0),
|
||||||
|
Metrics: &RoadMetrics{
|
||||||
|
Traces: make([]RoadTrace, 0),
|
||||||
|
Traffic: make(map[string]int64),
|
||||||
|
TrafficFrom: make(map[string]int64),
|
||||||
|
TotalTraffic: 0,
|
||||||
|
StartupAt: time.Now(),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := filepath.Walk(root, func(fp string, info os.FileInfo, _ error) error {
|
||||||
|
var region Region
|
||||||
|
if info.IsDir() {
|
||||||
|
return nil
|
||||||
|
} else if !strings.HasSuffix(info.Name(), ".toml") {
|
||||||
|
return nil
|
||||||
|
} else if file, err := os.OpenFile(fp, os.O_RDONLY, 0755); err != nil {
|
||||||
|
return err
|
||||||
|
} else if data, err := io.ReadAll(file); err != nil {
|
||||||
|
return err
|
||||||
|
} else if err := toml.Unmarshal(data, ®ion); err != nil {
|
||||||
|
return err
|
||||||
|
} else {
|
||||||
|
defer file.Close()
|
||||||
|
|
||||||
|
if region.Disabled {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
instance.Regions = append(instance.Regions, ®ion)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hot swap
|
||||||
|
R = instance
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
89
pkg/navi/helmet.go
Normal file
89
pkg/navi/helmet.go
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
package navi
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
type HelmetConfig struct {
|
||||||
|
XSSProtection string `json:"xss_protection" toml:"xss_protection"`
|
||||||
|
ContentTypeNosniff string `json:"content_type_nosniff" toml:"content_type_nosniff"`
|
||||||
|
XFrameOptions string `json:"x_frame_options" toml:"x_frame_options"`
|
||||||
|
HSTSMaxAge int `json:"hsts_max_age" toml:"hsts_max_age"`
|
||||||
|
HSTSExcludeSubdomains bool `json:"hsts_exclude_subdomains" toml:"hsts_exclude_subdomains"`
|
||||||
|
ContentSecurityPolicy string `json:"content_security_policy" toml:"content_security_policy"`
|
||||||
|
CSPReportOnly bool `json:"csp_report_only" toml:"csp_report_only"`
|
||||||
|
HSTSPreloadEnabled bool `json:"hsts_preload_enabled" toml:"hsts_preload_enabled"`
|
||||||
|
ReferrerPolicy string `json:"referrer_policy" toml:"referrer_policy"`
|
||||||
|
PermissionPolicy string `json:"permission_policy" toml:"permission_policy"`
|
||||||
|
CrossOriginEmbedderPolicy string `json:"cross_origin_embedder_policy" toml:"cross_origin_embedder_policy"`
|
||||||
|
CrossOriginOpenerPolicy string `json:"cross_origin_opener_policy" toml:"cross_origin_opener_policy"`
|
||||||
|
CrossOriginResourcePolicy string `json:"cross_origin_resource_policy" toml:"cross_origin_resource_policy"`
|
||||||
|
OriginAgentCluster string `json:"origin_agent_cluster" toml:"origin_agent_cluster"`
|
||||||
|
XDNSPrefetchControl string `json:"xdns_prefetch_control" toml:"xdns_prefetch_control"`
|
||||||
|
XDownloadOptions string `json:"x_download_options" toml:"x_download_options"`
|
||||||
|
XPermittedCrossDomain string `json:"x_permitted_cross_domain" toml:"x_permitted_cross_domain"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cfg HelmetConfig) Apply(c *fiber.Ctx) {
|
||||||
|
// Apply other headers
|
||||||
|
if cfg.XSSProtection != "" {
|
||||||
|
c.Set(fiber.HeaderXXSSProtection, cfg.XSSProtection)
|
||||||
|
}
|
||||||
|
if cfg.ContentTypeNosniff != "" {
|
||||||
|
c.Set(fiber.HeaderXContentTypeOptions, cfg.ContentTypeNosniff)
|
||||||
|
}
|
||||||
|
if cfg.XFrameOptions != "" {
|
||||||
|
c.Set(fiber.HeaderXFrameOptions, cfg.XFrameOptions)
|
||||||
|
}
|
||||||
|
if cfg.CrossOriginEmbedderPolicy != "" {
|
||||||
|
c.Set("Cross-Origin-Embedder-Policy", cfg.CrossOriginEmbedderPolicy)
|
||||||
|
}
|
||||||
|
if cfg.CrossOriginOpenerPolicy != "" {
|
||||||
|
c.Set("Cross-Origin-Opener-Policy", cfg.CrossOriginOpenerPolicy)
|
||||||
|
}
|
||||||
|
if cfg.CrossOriginResourcePolicy != "" {
|
||||||
|
c.Set("Cross-Origin-Resource-Policy", cfg.CrossOriginResourcePolicy)
|
||||||
|
}
|
||||||
|
if cfg.OriginAgentCluster != "" {
|
||||||
|
c.Set("Origin-Agent-Cluster", cfg.OriginAgentCluster)
|
||||||
|
}
|
||||||
|
if cfg.ReferrerPolicy != "" {
|
||||||
|
c.Set("Referrer-Policy", cfg.ReferrerPolicy)
|
||||||
|
}
|
||||||
|
if cfg.XDNSPrefetchControl != "" {
|
||||||
|
c.Set("X-DNS-Prefetch-Control", cfg.XDNSPrefetchControl)
|
||||||
|
}
|
||||||
|
if cfg.XDownloadOptions != "" {
|
||||||
|
c.Set("X-Download-Options", cfg.XDownloadOptions)
|
||||||
|
}
|
||||||
|
if cfg.XPermittedCrossDomain != "" {
|
||||||
|
c.Set("X-Permitted-Cross-Domain-Policies", cfg.XPermittedCrossDomain)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handle HSTS headers
|
||||||
|
if c.Protocol() == "https" && cfg.HSTSMaxAge != 0 {
|
||||||
|
subdomains := ""
|
||||||
|
if !cfg.HSTSExcludeSubdomains {
|
||||||
|
subdomains = "; includeSubDomains"
|
||||||
|
}
|
||||||
|
if cfg.HSTSPreloadEnabled {
|
||||||
|
subdomains = fmt.Sprintf("%s; preload", subdomains)
|
||||||
|
}
|
||||||
|
c.Set(fiber.HeaderStrictTransportSecurity, fmt.Sprintf("max-age=%d%s", cfg.HSTSMaxAge, subdomains))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handle Content-Security-Policy headers
|
||||||
|
if cfg.ContentSecurityPolicy != "" {
|
||||||
|
if cfg.CSPReportOnly {
|
||||||
|
c.Set(fiber.HeaderContentSecurityPolicyReportOnly, cfg.ContentSecurityPolicy)
|
||||||
|
} else {
|
||||||
|
c.Set(fiber.HeaderContentSecurityPolicy, cfg.ContentSecurityPolicy)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handle Permissions-Policy headers
|
||||||
|
if cfg.PermissionPolicy != "" {
|
||||||
|
c.Set(fiber.HeaderPermissionsPolicy, cfg.PermissionPolicy)
|
||||||
|
}
|
||||||
|
}
|
59
pkg/navi/metrics.go
Normal file
59
pkg/navi/metrics.go
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
package navi
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
type RoadMetrics struct {
|
||||||
|
Traces []RoadTrace `json:"-"`
|
||||||
|
|
||||||
|
Traffic map[string]int64 `json:"traffic"`
|
||||||
|
TrafficFrom map[string]int64 `json:"traffic_from"`
|
||||||
|
TotalTraffic int64 `json:"total_traffic"`
|
||||||
|
StartupAt time.Time `json:"startup_at"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type RoadTrace struct {
|
||||||
|
Timestamp time.Time `json:"timestamp"`
|
||||||
|
Region string `json:"region"`
|
||||||
|
Location string `json:"location"`
|
||||||
|
Destination string `json:"destination"`
|
||||||
|
Uri string `json:"uri"`
|
||||||
|
IpAddress string `json:"ip_address"`
|
||||||
|
UserAgent string `json:"user_agent"`
|
||||||
|
Error RoadTraceError `json:"error"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type RoadTraceError struct {
|
||||||
|
IsNull bool `json:"is_null"`
|
||||||
|
Message string `json:"message"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *RoadMetrics) AddTrace(trace RoadTrace) {
|
||||||
|
v.TotalTraffic++
|
||||||
|
trace.Timestamp = time.Now()
|
||||||
|
if _, ok := v.Traffic[trace.Region]; !ok {
|
||||||
|
v.Traffic[trace.Region] = 0
|
||||||
|
} else {
|
||||||
|
v.Traffic[trace.Region]++
|
||||||
|
}
|
||||||
|
if _, ok := v.TrafficFrom[trace.IpAddress]; !ok {
|
||||||
|
v.TrafficFrom[trace.IpAddress] = 0
|
||||||
|
} else {
|
||||||
|
v.TrafficFrom[trace.IpAddress]++
|
||||||
|
}
|
||||||
|
|
||||||
|
v.Traces = append(v.Traces, trace)
|
||||||
|
|
||||||
|
// Garbage recycle
|
||||||
|
if len(v.Traffic) > viper.GetInt("performance.traces_limit") {
|
||||||
|
v.Traffic = make(map[string]int64)
|
||||||
|
}
|
||||||
|
if len(v.TrafficFrom) > viper.GetInt("performance.traces_limit") {
|
||||||
|
v.TrafficFrom = make(map[string]int64)
|
||||||
|
}
|
||||||
|
if len(v.Traces) > viper.GetInt("performance.traces_limit") {
|
||||||
|
v.Traces = v.Traces[1:]
|
||||||
|
}
|
||||||
|
}
|
@ -1,33 +1,107 @@
|
|||||||
package sign
|
package navi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/fasthttp/websocket"
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/gofiber/fiber/v2/middleware/proxy"
|
||||||
|
"github.com/gofiber/fiber/v2/utils"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/samber/lo"
|
||||||
|
"github.com/valyala/fasthttp"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"net/http"
|
"net/http"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gofiber/fiber/v2"
|
|
||||||
"github.com/gofiber/fiber/v2/middleware/proxy"
|
|
||||||
"github.com/gofiber/fiber/v2/utils"
|
|
||||||
"github.com/samber/lo"
|
|
||||||
"github.com/spf13/viper"
|
|
||||||
"github.com/valyala/fasthttp"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func makeHypertextResponse(c *fiber.Ctx, upstream *UpstreamInstance) error {
|
func makeUnifiedResponse(c *fiber.Ctx, dest *Destination) error {
|
||||||
timeout := time.Duration(viper.GetInt64("performance.network_timeout")) * time.Millisecond
|
if websocket.FastHTTPIsWebSocketUpgrade(c.Context()) {
|
||||||
return proxy.Do(c, upstream.MakeURI(c), &fasthttp.Client{
|
// Handle websocket
|
||||||
ReadTimeout: timeout,
|
return makeWebsocketResponse(c, dest)
|
||||||
WriteTimeout: timeout,
|
} else {
|
||||||
|
// TODO Impl SSE with https://github.com/gofiber/recipes/blob/master/sse/main.go
|
||||||
|
// Handle normal http request
|
||||||
|
return makeHypertextResponse(c, dest)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeHypertextResponse(c *fiber.Ctx, dest *Destination) error {
|
||||||
|
_, queries := dest.GetRawUri()
|
||||||
|
raw := lo.Ternary(len(queries.Get("timeout")) > 0, queries.Get("timeout"), "5000")
|
||||||
|
num, err := strconv.Atoi(raw)
|
||||||
|
if err != nil {
|
||||||
|
num = 5000
|
||||||
|
}
|
||||||
|
|
||||||
|
limit := time.Duration(num) * time.Millisecond
|
||||||
|
uri := dest.BuildUri(c)
|
||||||
|
return proxy.Do(c, uri, &fasthttp.Client{
|
||||||
|
ReadTimeout: limit,
|
||||||
|
WriteTimeout: limit,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeFileResponse(c *fiber.Ctx, upstream *UpstreamInstance) error {
|
var wsUpgrader = websocket.FastHTTPUpgrader{}
|
||||||
uri, queries := upstream.GetRawURI()
|
|
||||||
|
func makeWebsocketResponse(c *fiber.Ctx, dest *Destination) error {
|
||||||
|
uri := dest.MakeWebsocketUri(c)
|
||||||
|
|
||||||
|
// Upgrade connection
|
||||||
|
return wsUpgrader.Upgrade(c.Context(), func(conn *websocket.Conn) {
|
||||||
|
// Dial the destination
|
||||||
|
remote, _, err := websocket.DefaultDialer.Dial(uri, nil)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer remote.Close()
|
||||||
|
|
||||||
|
// Read messages from remote
|
||||||
|
disconnect := make(chan struct{})
|
||||||
|
signal := make(chan struct {
|
||||||
|
head int
|
||||||
|
data []byte
|
||||||
|
})
|
||||||
|
go func() {
|
||||||
|
defer close(disconnect)
|
||||||
|
for {
|
||||||
|
mode, message, err := remote.ReadMessage()
|
||||||
|
if err != nil {
|
||||||
|
log.Warn().Err(err).Msg("An error occurred during the websocket proxying...")
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
signal <- struct {
|
||||||
|
head int
|
||||||
|
data []byte
|
||||||
|
}{head: mode, data: message}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
// Relay the destination websocket to client
|
||||||
|
for {
|
||||||
|
select {
|
||||||
|
case <-disconnect:
|
||||||
|
case val := <-signal:
|
||||||
|
if err := conn.WriteMessage(val.head, val.data); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
if head, data, err := conn.ReadMessage(); err != nil {
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
remote.WriteMessage(head, data)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeFileResponse(c *fiber.Ctx, dest *Destination) error {
|
||||||
|
uri, queries := dest.GetRawUri()
|
||||||
root := http.Dir(uri)
|
root := http.Dir(uri)
|
||||||
|
|
||||||
method := c.Method()
|
method := c.Method()
|
57
pkg/navi/route.go
Normal file
57
pkg/navi/route.go
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
package navi
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
roadsign "git.solsynth.dev/goatworks/roadsign/pkg"
|
||||||
|
"git.solsynth.dev/goatworks/roadsign/pkg/navi/transformers"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
type RoadApp struct {
|
||||||
|
Regions []*Region `json:"regions"`
|
||||||
|
Metrics *RoadMetrics `json:"metrics"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *RoadApp) Forward(c *fiber.Ctx, dest *Destination) error {
|
||||||
|
// Add reserve proxy headers
|
||||||
|
ip := c.IP()
|
||||||
|
scheme := c.Protocol()
|
||||||
|
protocol := string(c.Request().Header.Protocol())
|
||||||
|
c.Request().Header.Set(fiber.HeaderXForwardedFor, ip)
|
||||||
|
c.Request().Header.Set(fiber.HeaderXForwardedHost, ip)
|
||||||
|
c.Request().Header.Set(fiber.HeaderXForwardedProto, scheme)
|
||||||
|
c.Request().Header.Set(
|
||||||
|
fiber.HeaderVia,
|
||||||
|
fmt.Sprintf("%s %s", protocol, viper.GetString("central")),
|
||||||
|
)
|
||||||
|
c.Request().Header.Set(
|
||||||
|
fiber.HeaderForwarded,
|
||||||
|
fmt.Sprintf("by=%s; for=%s; host=%s; proto=%s", c.IP(), c.IP(), c.Get(fiber.HeaderHost), scheme),
|
||||||
|
)
|
||||||
|
|
||||||
|
// Response body
|
||||||
|
var err error
|
||||||
|
switch dest.GetType() {
|
||||||
|
case DestinationHypertext:
|
||||||
|
err = makeUnifiedResponse(c, dest)
|
||||||
|
case DestinationStaticFile:
|
||||||
|
err = makeFileResponse(c, dest)
|
||||||
|
default:
|
||||||
|
err = fiber.ErrBadGateway
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply helmet
|
||||||
|
if dest.Helmet != nil {
|
||||||
|
dest.Helmet.Apply(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply watermark
|
||||||
|
c.Response().Header.Set(fiber.HeaderServer, "RoadSign")
|
||||||
|
c.Response().Header.Set(fiber.HeaderXPoweredBy, fmt.Sprintf("RoadSign %s", roadsign.AppVersion))
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
type RequestTransformerConfig = transformers.TransformerConfig
|
89
pkg/navi/struct.go
Normal file
89
pkg/navi/struct.go
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
package navi
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"net/url"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"git.solsynth.dev/goatworks/roadsign/pkg/navi/transformers"
|
||||||
|
"git.solsynth.dev/goatworks/roadsign/pkg/warden"
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/samber/lo"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Region struct {
|
||||||
|
ID string `json:"id" toml:"id"`
|
||||||
|
Disabled bool `json:"disabled" toml:"disabled"`
|
||||||
|
Locations []Location `json:"locations" toml:"locations"`
|
||||||
|
Applications []warden.Application `json:"applications" toml:"applications"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Location struct {
|
||||||
|
ID string `json:"id" toml:"id"`
|
||||||
|
Hosts []string `json:"hosts" toml:"hosts"`
|
||||||
|
Paths []string `json:"paths" toml:"paths"`
|
||||||
|
Queries map[string]string `json:"queries" toml:"queries"`
|
||||||
|
Headers map[string][]string `json:"headers" toml:"headers"`
|
||||||
|
Destinations []Destination `json:"destinations" toml:"destinations"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DestinationType = int8
|
||||||
|
|
||||||
|
const (
|
||||||
|
DestinationHypertext = DestinationType(iota)
|
||||||
|
DestinationStaticFile
|
||||||
|
DestinationUnknown
|
||||||
|
)
|
||||||
|
|
||||||
|
type Destination struct {
|
||||||
|
ID string `json:"id" toml:"id"`
|
||||||
|
Uri string `json:"uri" toml:"uri"`
|
||||||
|
Helmet *HelmetConfig `json:"helmet" toml:"helmet"`
|
||||||
|
Transformers []transformers.TransformerConfig `json:"transformers" toml:"transformers"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *Destination) GetProtocol() string {
|
||||||
|
return strings.SplitN(v.Uri, "://", 2)[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *Destination) GetType() DestinationType {
|
||||||
|
protocol := v.GetProtocol()
|
||||||
|
switch protocol {
|
||||||
|
case "http", "https":
|
||||||
|
return DestinationHypertext
|
||||||
|
case "file", "files":
|
||||||
|
return DestinationStaticFile
|
||||||
|
}
|
||||||
|
return DestinationUnknown
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *Destination) GetRawUri() (string, url.Values) {
|
||||||
|
uri := strings.SplitN(v.Uri, "://", 2)[1]
|
||||||
|
data := strings.SplitN(uri, "?", 2)
|
||||||
|
data = append(data, " ") // Make the data array least have two elements
|
||||||
|
qs, _ := url.ParseQuery(data[1])
|
||||||
|
|
||||||
|
return data[0], qs
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *Destination) BuildUri(ctx *fiber.Ctx) string {
|
||||||
|
var queries []string
|
||||||
|
for k, v := range ctx.Queries() {
|
||||||
|
parsed, _ := url.QueryUnescape(v)
|
||||||
|
value := url.QueryEscape(parsed)
|
||||||
|
queries = append(queries, fmt.Sprintf("%s=%s", k, value))
|
||||||
|
}
|
||||||
|
|
||||||
|
path := string(ctx.Request().URI().Path())
|
||||||
|
hash := string(ctx.Request().URI().Hash())
|
||||||
|
protocol := v.GetProtocol()
|
||||||
|
uri, _ := v.GetRawUri()
|
||||||
|
|
||||||
|
return protocol + "://" + uri + path +
|
||||||
|
lo.Ternary(len(queries) > 0, "?"+strings.Join(queries, "&"), "") +
|
||||||
|
lo.Ternary(len(hash) > 0, "#"+hash, "")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *Destination) MakeWebsocketUri(ctx *fiber.Ctx) string {
|
||||||
|
return strings.Replace(v.BuildUri(ctx), "http", "ws", 1)
|
||||||
|
}
|
@ -5,13 +5,13 @@ import (
|
|||||||
"github.com/valyala/fasthttp"
|
"github.com/valyala/fasthttp"
|
||||||
)
|
)
|
||||||
|
|
||||||
var CompressResponse = RequestTransformer{
|
var CompressResponse = Transformer{
|
||||||
ModifyResponse: func(options any, ctx *fiber.Ctx) error {
|
ModifyResponse: func(options any, ctx *fiber.Ctx) error {
|
||||||
opts := DeserializeOptions[struct {
|
opts := DeserializeOptions[struct {
|
||||||
Level int `json:"level" yaml:"level"`
|
Level int `json:"level" toml:"level"`
|
||||||
}](options)
|
}](options)
|
||||||
|
|
||||||
var fctx = func(c *fasthttp.RequestCtx) {}
|
fctx := func(c *fasthttp.RequestCtx) {}
|
||||||
var compressor fasthttp.RequestHandler
|
var compressor fasthttp.RequestHandler
|
||||||
switch opts.Level {
|
switch opts.Level {
|
||||||
// Best Speed Mode
|
// Best Speed Mode
|
@ -9,17 +9,17 @@ import (
|
|||||||
|
|
||||||
var json = jsoniter.ConfigCompatibleWithStandardLibrary
|
var json = jsoniter.ConfigCompatibleWithStandardLibrary
|
||||||
|
|
||||||
type RequestTransformer struct {
|
type Transformer struct {
|
||||||
ModifyRequest func(options any, ctx *fiber.Ctx) error
|
ModifyRequest func(options any, ctx *fiber.Ctx) error
|
||||||
ModifyResponse func(options any, ctx *fiber.Ctx) error
|
ModifyResponse func(options any, ctx *fiber.Ctx) error
|
||||||
}
|
}
|
||||||
|
|
||||||
type RequestTransformerConfig struct {
|
type TransformerConfig struct {
|
||||||
Type string `json:"type" yaml:"type"`
|
Type string `json:"type" toml:"type"`
|
||||||
Options any `json:"options" yaml:"options"`
|
Options any `json:"options" toml:"options"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *RequestTransformerConfig) TransformRequest(ctx *fiber.Ctx) error {
|
func (v *TransformerConfig) TransformRequest(ctx *fiber.Ctx) error {
|
||||||
for k, f := range Transformers {
|
for k, f := range Transformers {
|
||||||
if k == v.Type {
|
if k == v.Type {
|
||||||
if f.ModifyRequest != nil {
|
if f.ModifyRequest != nil {
|
||||||
@ -31,7 +31,7 @@ func (v *RequestTransformerConfig) TransformRequest(ctx *fiber.Ctx) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *RequestTransformerConfig) TransformResponse(ctx *fiber.Ctx) error {
|
func (v *TransformerConfig) TransformResponse(ctx *fiber.Ctx) error {
|
||||||
for k, f := range Transformers {
|
for k, f := range Transformers {
|
||||||
if k == v.Type {
|
if k == v.Type {
|
||||||
if f.ModifyResponse != nil {
|
if f.ModifyResponse != nil {
|
||||||
@ -55,7 +55,7 @@ func DeserializeOptions[T any](data any) T {
|
|||||||
// Map of Transformers
|
// Map of Transformers
|
||||||
// Every transformer need to be mapped here so that they can get work.
|
// Every transformer need to be mapped here so that they can get work.
|
||||||
|
|
||||||
var Transformers = map[string]RequestTransformer{
|
var Transformers = map[string]Transformer{
|
||||||
"replacePath": ReplacePath,
|
"replacePath": ReplacePath,
|
||||||
"compressResponse": CompressResponse,
|
"compressResponse": CompressResponse,
|
||||||
}
|
}
|
@ -1,18 +1,19 @@
|
|||||||
package transformers
|
package transformers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gofiber/fiber/v2"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ReplacePath = RequestTransformer{
|
var ReplacePath = Transformer{
|
||||||
ModifyRequest: func(options any, ctx *fiber.Ctx) error {
|
ModifyRequest: func(options any, ctx *fiber.Ctx) error {
|
||||||
opts := DeserializeOptions[struct {
|
opts := DeserializeOptions[struct {
|
||||||
Pattern string `json:"pattern" yaml:"pattern"`
|
Pattern string `json:"pattern" toml:"pattern"`
|
||||||
Value string `json:"value" yaml:"value"`
|
Value string `json:"value" toml:"value"`
|
||||||
Repl string `json:"repl" yaml:"repl"` // Use when complex mode(regexp) enabled
|
Repl string `json:"repl" toml:"repl"` // Use when complex mode(regexp) enabled
|
||||||
Complex bool `json:"complex" yaml:"complex"`
|
Complex bool `json:"complex" toml:"complex"`
|
||||||
}](options)
|
}](options)
|
||||||
path := string(ctx.Request().URI().Path())
|
path := string(ctx.Request().URI().Path())
|
||||||
if !opts.Complex {
|
if !opts.Complex {
|
19
pkg/navi/warden.go
Normal file
19
pkg/navi/warden.go
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package navi
|
||||||
|
|
||||||
|
import "git.solsynth.dev/goatworks/roadsign/pkg/warden"
|
||||||
|
|
||||||
|
func InitializeWarden(regions []*Region) {
|
||||||
|
pool := make([]*warden.AppInstance, 0)
|
||||||
|
|
||||||
|
for _, region := range regions {
|
||||||
|
for _, application := range region.Applications {
|
||||||
|
pool = append(pool, &warden.AppInstance{
|
||||||
|
Manifest: application,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hot swap
|
||||||
|
warden.InstancePool = pool
|
||||||
|
warden.StartPool()
|
||||||
|
}
|
73
pkg/sideload/applications.go
Normal file
73
pkg/sideload/applications.go
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
package sideload
|
||||||
|
|
||||||
|
import (
|
||||||
|
"git.solsynth.dev/goatworks/roadsign/pkg/navi"
|
||||||
|
"git.solsynth.dev/goatworks/roadsign/pkg/warden"
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/samber/lo"
|
||||||
|
)
|
||||||
|
|
||||||
|
func getApplications(c *fiber.Ctx) error {
|
||||||
|
applications := lo.FlatMap(navi.R.Regions, func(item *navi.Region, idx int) []warden.ApplicationInfo {
|
||||||
|
return lo.Map(item.Applications, func(item warden.Application, index int) warden.ApplicationInfo {
|
||||||
|
return warden.ApplicationInfo{
|
||||||
|
Application: item,
|
||||||
|
Status: warden.GetFromPool(item.ID).Status,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
return c.JSON(applications)
|
||||||
|
}
|
||||||
|
|
||||||
|
func getApplicationLogs(c *fiber.Ctx) error {
|
||||||
|
if instance, ok := lo.Find(warden.InstancePool, func(item *warden.AppInstance) bool {
|
||||||
|
return item.Manifest.ID == c.Params("id")
|
||||||
|
}); !ok {
|
||||||
|
return fiber.NewError(fiber.StatusNotFound)
|
||||||
|
} else {
|
||||||
|
return c.SendString(instance.Logs())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func letApplicationStart(c *fiber.Ctx) error {
|
||||||
|
if instance, ok := lo.Find(warden.InstancePool, func(item *warden.AppInstance) bool {
|
||||||
|
return item.Manifest.ID == c.Params("id")
|
||||||
|
}); !ok {
|
||||||
|
return fiber.NewError(fiber.StatusNotFound)
|
||||||
|
} else {
|
||||||
|
if err := instance.Wake(); err != nil {
|
||||||
|
return fiber.NewError(fiber.StatusInternalServerError, err.Error())
|
||||||
|
}
|
||||||
|
return c.SendStatus(fiber.StatusOK)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func letApplicationStop(c *fiber.Ctx) error {
|
||||||
|
if instance, ok := lo.Find(warden.InstancePool, func(item *warden.AppInstance) bool {
|
||||||
|
return item.Manifest.ID == c.Params("id")
|
||||||
|
}); !ok {
|
||||||
|
return fiber.NewError(fiber.StatusNotFound)
|
||||||
|
} else {
|
||||||
|
if err := instance.Stop(); err != nil {
|
||||||
|
return fiber.NewError(fiber.StatusInternalServerError, err.Error())
|
||||||
|
}
|
||||||
|
return c.SendStatus(fiber.StatusOK)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func letApplicationRestart(c *fiber.Ctx) error {
|
||||||
|
if instance, ok := lo.Find(warden.InstancePool, func(item *warden.AppInstance) bool {
|
||||||
|
return item.Manifest.ID == c.Params("id")
|
||||||
|
}); !ok {
|
||||||
|
return fiber.NewError(fiber.StatusNotFound)
|
||||||
|
} else {
|
||||||
|
if err := instance.Stop(); err != nil {
|
||||||
|
return fiber.NewError(fiber.StatusInternalServerError, err.Error())
|
||||||
|
}
|
||||||
|
if err := instance.Start(); err != nil {
|
||||||
|
return fiber.NewError(fiber.StatusInternalServerError, err.Error())
|
||||||
|
}
|
||||||
|
return c.SendStatus(fiber.StatusOK)
|
||||||
|
}
|
||||||
|
}
|
@ -1,11 +1,11 @@
|
|||||||
package sideload
|
package sideload
|
||||||
|
|
||||||
import (
|
import (
|
||||||
roadsign "code.smartsheep.studio/goatworks/roadsign/pkg"
|
roadsign "git.solsynth.dev/goatworks/roadsign/pkg"
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func responseConnectivity(c *fiber.Ctx) error {
|
func getMetadata(c *fiber.Ctx) error {
|
||||||
return c.Status(fiber.StatusOK).JSON(fiber.Map{
|
return c.Status(fiber.StatusOK).JSON(fiber.Map{
|
||||||
"server": "RoadSign",
|
"server": "RoadSign",
|
||||||
"version": roadsign.AppVersion,
|
"version": roadsign.AppVersion,
|
14
pkg/sideload/metrics.go
Normal file
14
pkg/sideload/metrics.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package sideload
|
||||||
|
|
||||||
|
import (
|
||||||
|
"git.solsynth.dev/goatworks/roadsign/pkg/navi"
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
func getTraffic(c *fiber.Ctx) error {
|
||||||
|
return c.JSON(navi.R.Metrics)
|
||||||
|
}
|
||||||
|
|
||||||
|
func getTraces(c *fiber.Ctx) error {
|
||||||
|
return c.JSON(navi.R.Metrics.Traces)
|
||||||
|
}
|
@ -1,29 +0,0 @@
|
|||||||
package sideload
|
|
||||||
|
|
||||||
import (
|
|
||||||
"code.smartsheep.studio/goatworks/roadsign/pkg/sign"
|
|
||||||
"github.com/gofiber/fiber/v2"
|
|
||||||
"github.com/samber/lo"
|
|
||||||
)
|
|
||||||
|
|
||||||
func getProcesses(c *fiber.Ctx) error {
|
|
||||||
processes := lo.FlatMap(sign.App.Sites, func(item *sign.SiteConfig, idx int) []*sign.ProcessInstance {
|
|
||||||
return item.Processes
|
|
||||||
})
|
|
||||||
|
|
||||||
return c.JSON(processes)
|
|
||||||
}
|
|
||||||
|
|
||||||
func getProcessLog(c *fiber.Ctx) error {
|
|
||||||
processes := lo.FlatMap(sign.App.Sites, func(item *sign.SiteConfig, idx int) []*sign.ProcessInstance {
|
|
||||||
return item.Processes
|
|
||||||
})
|
|
||||||
|
|
||||||
if target, ok := lo.Find(processes, func(item *sign.ProcessInstance) bool {
|
|
||||||
return item.ID == c.Params("id")
|
|
||||||
}); !ok {
|
|
||||||
return fiber.NewError(fiber.StatusNotFound)
|
|
||||||
} else {
|
|
||||||
return c.SendString(target.GetLogs())
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,10 +2,11 @@ package sideload
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"git.solsynth.dev/goatworks/roadsign/pkg/warden"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"code.smartsheep.studio/goatworks/roadsign/pkg/sign"
|
"git.solsynth.dev/goatworks/roadsign/pkg/navi"
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/samber/lo"
|
"github.com/samber/lo"
|
||||||
@ -14,23 +15,23 @@ import (
|
|||||||
|
|
||||||
func doPublish(c *fiber.Ctx) error {
|
func doPublish(c *fiber.Ctx) error {
|
||||||
var workdir string
|
var workdir string
|
||||||
var site *sign.SiteConfig
|
var destination *navi.Destination
|
||||||
var upstream *sign.UpstreamInstance
|
var application *warden.Application
|
||||||
var process *sign.ProcessInstance
|
for _, item := range navi.R.Regions {
|
||||||
for _, item := range sign.App.Sites {
|
|
||||||
if item.ID == c.Params("site") {
|
if item.ID == c.Params("site") {
|
||||||
site = item
|
for _, location := range item.Locations {
|
||||||
for _, stream := range item.Upstreams {
|
for _, dest := range location.Destinations {
|
||||||
if stream.ID == c.Params("slug") {
|
if dest.ID == c.Params("slug") {
|
||||||
upstream = stream
|
destination = &dest
|
||||||
workdir, _ = stream.GetRawURI()
|
workdir, _ = dest.GetRawUri()
|
||||||
break
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, proc := range item.Processes {
|
for _, app := range item.Applications {
|
||||||
if proc.ID == c.Params("slug") {
|
if app.ID == c.Params("slug") {
|
||||||
process = proc
|
application = &app
|
||||||
workdir = proc.Workdir
|
workdir = app.Workdir
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -38,14 +39,15 @@ func doPublish(c *fiber.Ctx) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if upstream == nil && process == nil {
|
var instance *warden.AppInstance
|
||||||
return fiber.ErrNotFound
|
if application != nil {
|
||||||
} else if upstream != nil && upstream.GetType() != sign.UpstreamTypeFile {
|
if instance = warden.GetFromPool(application.ID); instance != nil {
|
||||||
|
_ = instance.Stop()
|
||||||
|
}
|
||||||
|
} else if destination != nil && destination.GetType() != navi.DestinationStaticFile {
|
||||||
return fiber.ErrUnprocessableEntity
|
return fiber.ErrUnprocessableEntity
|
||||||
}
|
} else if destination == nil {
|
||||||
|
return fiber.ErrNotFound
|
||||||
for _, process := range site.Processes {
|
|
||||||
process.StopProcess()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.Query("overwrite", "yes") == "yes" {
|
if c.Query("overwrite", "yes") == "yes" {
|
||||||
@ -81,5 +83,9 @@ func doPublish(c *fiber.Ctx) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if instance != nil {
|
||||||
|
_ = instance.Wake()
|
||||||
|
}
|
||||||
|
|
||||||
return c.SendStatus(fiber.StatusOK)
|
return c.SendStatus(fiber.StatusOK)
|
||||||
}
|
}
|
||||||
|
84
pkg/sideload/regions.go
Normal file
84
pkg/sideload/regions.go
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
package sideload
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
|
"git.solsynth.dev/goatworks/roadsign/pkg/navi"
|
||||||
|
"git.solsynth.dev/goatworks/roadsign/pkg/warden"
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/pelletier/go-toml/v2"
|
||||||
|
"github.com/samber/lo"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
)
|
||||||
|
|
||||||
|
func getRegions(c *fiber.Ctx) error {
|
||||||
|
return c.JSON(navi.R.Regions)
|
||||||
|
}
|
||||||
|
|
||||||
|
func getRegionConfig(c *fiber.Ctx) error {
|
||||||
|
fp := filepath.Join(viper.GetString("paths.configs"), c.Params("id"))
|
||||||
|
|
||||||
|
var err error
|
||||||
|
var data []byte
|
||||||
|
if data, err = os.ReadFile(fp + ".toml"); err != nil {
|
||||||
|
return fiber.NewError(fiber.StatusNotFound, err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.Type("toml").SendString(string(data))
|
||||||
|
}
|
||||||
|
|
||||||
|
func doSync(c *fiber.Ctx) error {
|
||||||
|
req := string(c.Body())
|
||||||
|
|
||||||
|
id := c.Params("slug")
|
||||||
|
path := filepath.Join(viper.GetString("paths.configs"), fmt.Sprintf("%s.toml", id))
|
||||||
|
|
||||||
|
if file, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0755); err != nil {
|
||||||
|
return fiber.NewError(fiber.ErrInternalServerError.Code, err.Error())
|
||||||
|
} else {
|
||||||
|
var testOut map[string]any
|
||||||
|
if err := toml.Unmarshal([]byte(req), &testOut); err != nil {
|
||||||
|
return fiber.NewError(fiber.StatusBadRequest, fmt.Sprintf("invalid configuration: %v", err))
|
||||||
|
}
|
||||||
|
_, _ = file.Write([]byte(req))
|
||||||
|
defer file.Close()
|
||||||
|
}
|
||||||
|
|
||||||
|
var stopQueue, startQueue []*warden.AppInstance
|
||||||
|
// Getting things need to stop
|
||||||
|
if region, ok := lo.Find(navi.R.Regions, func(item *navi.Region) bool {
|
||||||
|
return item.ID == id
|
||||||
|
}); ok {
|
||||||
|
for _, application := range region.Applications {
|
||||||
|
if instance := warden.GetFromPool(application.ID); instance != nil {
|
||||||
|
stopQueue = append(stopQueue, instance)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reload
|
||||||
|
_ = navi.ReadInConfig(viper.GetString("paths.configs"))
|
||||||
|
|
||||||
|
// Getting things need to start
|
||||||
|
if region, ok := lo.Find(navi.R.Regions, func(item *navi.Region) bool {
|
||||||
|
return item.ID == id
|
||||||
|
}); ok {
|
||||||
|
for _, application := range region.Applications {
|
||||||
|
if instance := warden.GetFromPool(application.ID); instance != nil {
|
||||||
|
startQueue = append(startQueue, instance)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reboot
|
||||||
|
for _, instance := range stopQueue {
|
||||||
|
_ = instance.Stop()
|
||||||
|
}
|
||||||
|
for _, instance := range startQueue {
|
||||||
|
_ = instance.Start()
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.SendStatus(fiber.StatusOK)
|
||||||
|
}
|
18
pkg/sideload/reload.go
Normal file
18
pkg/sideload/reload.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package sideload
|
||||||
|
|
||||||
|
import (
|
||||||
|
"git.solsynth.dev/goatworks/roadsign/pkg/navi"
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
)
|
||||||
|
|
||||||
|
func doReload(c *fiber.Ctx) error {
|
||||||
|
if err := navi.ReadInConfig(viper.GetString("paths.configs")); err != nil {
|
||||||
|
return fiber.NewError(fiber.StatusInternalServerError, err.Error())
|
||||||
|
}
|
||||||
|
if c.QueryBool("warden", false) {
|
||||||
|
navi.InitializeWarden(navi.R.Regions)
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.SendStatus(fiber.StatusOK)
|
||||||
|
}
|
@ -1,16 +1,12 @@
|
|||||||
package sideload
|
package sideload
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.smartsheep.studio/goatworks/roadsign/pkg/sideload/view"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/gofiber/fiber/v2/middleware/filesystem"
|
roadsign "git.solsynth.dev/goatworks/roadsign/pkg"
|
||||||
jsoniter "github.com/json-iterator/go"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
roadsign "code.smartsheep.studio/goatworks/roadsign/pkg"
|
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"github.com/gofiber/fiber/v2/middleware/basicauth"
|
"github.com/gofiber/fiber/v2/middleware/basicauth"
|
||||||
"github.com/gofiber/fiber/v2/middleware/logger"
|
"github.com/gofiber/fiber/v2/middleware/logger"
|
||||||
|
jsoniter "github.com/json-iterator/go"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
@ -23,12 +19,13 @@ func InitSideload() *fiber.App {
|
|||||||
EnableIPValidation: true,
|
EnableIPValidation: true,
|
||||||
JSONDecoder: jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal,
|
JSONDecoder: jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal,
|
||||||
JSONEncoder: jsoniter.ConfigCompatibleWithStandardLibrary.Marshal,
|
JSONEncoder: jsoniter.ConfigCompatibleWithStandardLibrary.Marshal,
|
||||||
|
ProxyHeader: fiber.HeaderXForwardedFor,
|
||||||
EnablePrintRoutes: viper.GetBool("debug.print_routes"),
|
EnablePrintRoutes: viper.GetBool("debug.print_routes"),
|
||||||
TrustedProxies: viper.GetStringSlice("security.sideload_trusted_proxies"),
|
TrustedProxies: viper.GetStringSlice("sideload.trusted_proxies"),
|
||||||
BodyLimit: viper.GetInt("hypertext.limitation.max_body_size"),
|
BodyLimit: viper.GetInt("hypertext.limitation.max_body_size"),
|
||||||
})
|
})
|
||||||
|
|
||||||
if viper.GetBool("performance.request_logging") {
|
if viper.GetBool("telemetry.request_logging") {
|
||||||
app.Use(logger.New(logger.Config{
|
app.Use(logger.New(logger.Config{
|
||||||
Output: log.Logger,
|
Output: log.Logger,
|
||||||
Format: "[Sideload] [${time}] ${status} - ${latency} ${method} ${path}\n",
|
Format: "[Sideload] [${time}] ${status} - ${latency} ${method} ${path}\n",
|
||||||
@ -42,27 +39,27 @@ func InitSideload() *fiber.App {
|
|||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
|
||||||
app.Use("/", filesystem.New(filesystem.Config{
|
|
||||||
Root: http.FS(view.FS),
|
|
||||||
PathPrefix: "dist",
|
|
||||||
Index: "index.html",
|
|
||||||
NotFoundFile: "index.html",
|
|
||||||
}))
|
|
||||||
|
|
||||||
cgi := app.Group("/cgi").Name("CGI")
|
cgi := app.Group("/cgi").Name("CGI")
|
||||||
{
|
{
|
||||||
cgi.All("/connectivity", responseConnectivity)
|
cgi.Get("/metadata", getMetadata)
|
||||||
cgi.Get("/statistics", getStatistics)
|
cgi.Get("/traffic", getTraffic)
|
||||||
cgi.Get("/sites", getSites)
|
cgi.Get("/traces", getTraces)
|
||||||
cgi.Get("/sites/cfg/:id", getSiteConfig)
|
cgi.Get("/stats", getStats)
|
||||||
cgi.Get("/processes", getProcesses)
|
cgi.Get("/regions", getRegions)
|
||||||
cgi.Get("/processes/logs/:id", getProcessLog)
|
cgi.Get("/regions/cfg/:id", getRegionConfig)
|
||||||
|
cgi.Get("/applications", getApplications)
|
||||||
|
cgi.Get("/applications/:id/logs", getApplicationLogs)
|
||||||
|
cgi.Post("/applications/:id/start", letApplicationStart)
|
||||||
|
cgi.Post("/applications/:id/stop", letApplicationStop)
|
||||||
|
cgi.Post("/applications/:id/restart", letApplicationRestart)
|
||||||
|
|
||||||
|
cgi.Post("/reload", doReload)
|
||||||
}
|
}
|
||||||
|
|
||||||
webhooks := app.Group("/webhooks").Name("WebHooks")
|
webhooks := app.Group("/webhooks").Name("WebHooks")
|
||||||
{
|
{
|
||||||
webhooks.Put("/publish/:site/:slug", doPublish)
|
webhooks.Put("/publish/:site/:slug", doPublish)
|
||||||
webhooks.Put("/sync/:slug", doSyncSite)
|
webhooks.Put("/sync/:slug", doSync)
|
||||||
}
|
}
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
@ -1,63 +0,0 @@
|
|||||||
package sideload
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
"path/filepath"
|
|
||||||
|
|
||||||
"code.smartsheep.studio/goatworks/roadsign/pkg/sign"
|
|
||||||
"github.com/gofiber/fiber/v2"
|
|
||||||
"github.com/samber/lo"
|
|
||||||
"github.com/spf13/viper"
|
|
||||||
"gopkg.in/yaml.v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
func getSites(c *fiber.Ctx) error {
|
|
||||||
return c.JSON(sign.App.Sites)
|
|
||||||
}
|
|
||||||
|
|
||||||
func getSiteConfig(c *fiber.Ctx) error {
|
|
||||||
fp := filepath.Join(viper.GetString("paths.configs"), c.Params("id"))
|
|
||||||
|
|
||||||
var err error
|
|
||||||
var data []byte
|
|
||||||
if data, err = os.ReadFile(fp + ".yml"); err != nil {
|
|
||||||
if data, err = os.ReadFile(fp + ".yaml"); err != nil {
|
|
||||||
return fiber.NewError(fiber.StatusNotFound, err.Error())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return c.Type("yaml").SendString(string(data))
|
|
||||||
}
|
|
||||||
|
|
||||||
func doSyncSite(c *fiber.Ctx) error {
|
|
||||||
var req sign.SiteConfig
|
|
||||||
|
|
||||||
if err := c.BodyParser(&req); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
id := c.Params("slug")
|
|
||||||
path := filepath.Join(viper.GetString("paths.configs"), fmt.Sprintf("%s.yaml", id))
|
|
||||||
|
|
||||||
if file, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0755); err != nil {
|
|
||||||
return fiber.NewError(fiber.ErrInternalServerError.Code, err.Error())
|
|
||||||
} else {
|
|
||||||
raw, _ := yaml.Marshal(req)
|
|
||||||
file.Write(raw)
|
|
||||||
defer file.Close()
|
|
||||||
}
|
|
||||||
if site, ok := lo.Find(sign.App.Sites, func(item *sign.SiteConfig) bool {
|
|
||||||
return item.ID == id
|
|
||||||
}); ok {
|
|
||||||
for _, process := range site.Processes {
|
|
||||||
process.StopProcess()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reload
|
|
||||||
sign.ReadInConfig(viper.GetString("paths.configs"))
|
|
||||||
sign.App.PreheatProcesses()
|
|
||||||
|
|
||||||
return c.SendStatus(fiber.StatusOK)
|
|
||||||
}
|
|
@ -1,28 +1,33 @@
|
|||||||
package sideload
|
package sideload
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.smartsheep.studio/goatworks/roadsign/pkg/sign"
|
"git.solsynth.dev/goatworks/roadsign/pkg/navi"
|
||||||
|
"git.solsynth.dev/goatworks/roadsign/pkg/warden"
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"github.com/samber/lo"
|
"github.com/samber/lo"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func getStatistics(c *fiber.Ctx) error {
|
func getStats(c *fiber.Ctx) error {
|
||||||
upstreams := lo.FlatMap(sign.App.Sites, func(item *sign.SiteConfig, idx int) []*sign.UpstreamInstance {
|
locations := lo.FlatMap(navi.R.Regions, func(item *navi.Region, idx int) []navi.Location {
|
||||||
return item.Upstreams
|
return item.Locations
|
||||||
})
|
})
|
||||||
processes := lo.FlatMap(sign.App.Sites, func(item *sign.SiteConfig, idx int) []*sign.ProcessInstance {
|
destinations := lo.FlatMap(locations, func(item navi.Location, idx int) []navi.Destination {
|
||||||
return item.Processes
|
return item.Destinations
|
||||||
})
|
})
|
||||||
unhealthy := lo.FlatMap(sign.App.Sites, func(item *sign.SiteConfig, idx int) []*sign.ProcessInstance {
|
applications := lo.FlatMap(navi.R.Regions, func(item *navi.Region, idx int) []warden.Application {
|
||||||
return lo.Filter(item.Processes, func(item *sign.ProcessInstance, idx int) bool {
|
return item.Applications
|
||||||
return item.Status != sign.ProcessStarted
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return c.JSON(fiber.Map{
|
return c.JSON(fiber.Map{
|
||||||
"sites": len(sign.App.Sites),
|
"regions": len(navi.R.Regions),
|
||||||
"upstreams": len(upstreams),
|
"locations": len(locations),
|
||||||
"processes": len(processes),
|
"destinations": len(destinations),
|
||||||
"status": len(unhealthy) == 0,
|
"applications": len(applications),
|
||||||
|
"uptime": time.Since(navi.R.Metrics.StartupAt).Milliseconds(),
|
||||||
|
"traffic": fiber.Map{
|
||||||
|
"total": navi.R.Metrics.TotalTraffic,
|
||||||
|
"unique_client": len(navi.R.Metrics.TrafficFrom),
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
/dist
|
|
||||||
/node_modules
|
|
||||||
/*.lock
|
|
@ -1,15 +0,0 @@
|
|||||||
/* eslint-env node */
|
|
||||||
require('@rushstack/eslint-patch/modern-module-resolution')
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
root: true,
|
|
||||||
'extends': [
|
|
||||||
'plugin:vue/vue3-essential',
|
|
||||||
'eslint:recommended',
|
|
||||||
'@vue/eslint-config-typescript',
|
|
||||||
'@vue/eslint-config-prettier/skip-formatting'
|
|
||||||
],
|
|
||||||
parserOptions: {
|
|
||||||
ecmaVersion: 'latest'
|
|
||||||
}
|
|
||||||
}
|
|
30
pkg/sideload/view/.gitignore
vendored
30
pkg/sideload/view/.gitignore
vendored
@ -1,30 +0,0 @@
|
|||||||
# Logs
|
|
||||||
logs
|
|
||||||
*.log
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
pnpm-debug.log*
|
|
||||||
lerna-debug.log*
|
|
||||||
|
|
||||||
node_modules
|
|
||||||
.DS_Store
|
|
||||||
dist
|
|
||||||
dist-ssr
|
|
||||||
coverage
|
|
||||||
*.local
|
|
||||||
|
|
||||||
/cypress/videos/
|
|
||||||
/cypress/screenshots/
|
|
||||||
|
|
||||||
# Editor directories and files
|
|
||||||
.vscode/*
|
|
||||||
!.vscode/extensions.json
|
|
||||||
.idea
|
|
||||||
*.suo
|
|
||||||
*.ntvs*
|
|
||||||
*.njsproj
|
|
||||||
*.sln
|
|
||||||
*.sw?
|
|
||||||
|
|
||||||
*.tsbuildinfo
|
|
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://json.schemastore.org/prettierrc",
|
|
||||||
"semi": false,
|
|
||||||
"tabWidth": 2,
|
|
||||||
"singleQuote": false,
|
|
||||||
"printWidth": 120,
|
|
||||||
"trailingComma": "none"
|
|
||||||
}
|
|
8
pkg/sideload/view/.vscode/extensions.json
vendored
8
pkg/sideload/view/.vscode/extensions.json
vendored
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"recommendations": [
|
|
||||||
"Vue.volar",
|
|
||||||
"Vue.vscode-typescript-vue-plugin",
|
|
||||||
"dbaeumer.vscode-eslint",
|
|
||||||
"esbenp.prettier-vscode"
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
# @roadsign/sideload-ui
|
|
||||||
|
|
||||||
This template should help get you started developing with Vue 3 in Vite.
|
|
||||||
|
|
||||||
## Recommended IDE Setup
|
|
||||||
|
|
||||||
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
|
|
||||||
|
|
||||||
## Type Support for `.vue` Imports in TS
|
|
||||||
|
|
||||||
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
|
|
||||||
|
|
||||||
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
|
|
||||||
|
|
||||||
1. Disable the built-in TypeScript Extension
|
|
||||||
1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
|
|
||||||
2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
|
|
||||||
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
|
|
||||||
|
|
||||||
## Customize configuration
|
|
||||||
|
|
||||||
See [Vite Configuration Reference](https://vitejs.dev/config/).
|
|
||||||
|
|
||||||
## Project Setup
|
|
||||||
|
|
||||||
```sh
|
|
||||||
yarn
|
|
||||||
```
|
|
||||||
|
|
||||||
### Compile and Hot-Reload for Development
|
|
||||||
|
|
||||||
```sh
|
|
||||||
yarn dev
|
|
||||||
```
|
|
||||||
|
|
||||||
### Type-Check, Compile and Minify for Production
|
|
||||||
|
|
||||||
```sh
|
|
||||||
yarn build
|
|
||||||
```
|
|
||||||
|
|
||||||
### Lint with [ESLint](https://eslint.org/)
|
|
||||||
|
|
||||||
```sh
|
|
||||||
yarn lint
|
|
||||||
```
|
|
@ -1,6 +0,0 @@
|
|||||||
package view
|
|
||||||
|
|
||||||
import "embed"
|
|
||||||
|
|
||||||
//go:embed all:dist
|
|
||||||
var FS embed.FS
|
|
1
pkg/sideload/view/env.d.ts
vendored
1
pkg/sideload/view/env.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
/// <reference types="vite/client" />
|
|
@ -1,13 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<link rel="icon" href="/favicon.ico">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>RoadSign</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="app"></div>
|
|
||||||
<script type="module" src="/src/main.ts"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@roadsign/sideload-ui",
|
|
||||||
"version": "0.0.0",
|
|
||||||
"private": true,
|
|
||||||
"type": "module",
|
|
||||||
"scripts": {
|
|
||||||
"dev": "vite",
|
|
||||||
"build": "run-p type-check \"build-only {@}\" --",
|
|
||||||
"preview": "vite preview",
|
|
||||||
"build-only": "vite build",
|
|
||||||
"type-check": "vue-tsc --build --force",
|
|
||||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
||||||
"format": "prettier --write src/"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@guolao/vue-monaco-editor": "^1.4.1",
|
|
||||||
"highlight.js": "^11.9.0",
|
|
||||||
"js-yaml": "^4.1.0",
|
|
||||||
"pinia": "^2.1.7",
|
|
||||||
"vue": "^3.3.11",
|
|
||||||
"vue-router": "^4.2.5"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@rushstack/eslint-patch": "^1.3.3",
|
|
||||||
"@tsconfig/node18": "^18.2.2",
|
|
||||||
"@types/js-yaml": "^4.0.9",
|
|
||||||
"@types/node": "^18.19.3",
|
|
||||||
"@vicons/carbon": "^0.12.0",
|
|
||||||
"@vitejs/plugin-vue": "^4.5.2",
|
|
||||||
"@vue/eslint-config-prettier": "^8.0.0",
|
|
||||||
"@vue/eslint-config-typescript": "^12.0.0",
|
|
||||||
"@vue/tsconfig": "^0.5.0",
|
|
||||||
"eslint": "^8.49.0",
|
|
||||||
"eslint-plugin-vue": "^9.17.0",
|
|
||||||
"naive-ui": "^2.36.0",
|
|
||||||
"npm-run-all2": "^6.1.1",
|
|
||||||
"prettier": "^3.0.3",
|
|
||||||
"typescript": "~5.3.0",
|
|
||||||
"unocss": "^0.58.2",
|
|
||||||
"vfonts": "^0.0.3",
|
|
||||||
"vite": "^5.0.10",
|
|
||||||
"vue-tsc": "^1.8.25"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
@import "vfonts/IBMPlexSans.css";
|
|
||||||
@import "vfonts/IBMPlexMono.css";
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: #3f7ee8;
|
|
||||||
}
|
|
@ -1,135 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="flex gap-[4px]">
|
|
||||||
<n-button size="small" @click="publishing = true">
|
|
||||||
<template #icon>
|
|
||||||
<n-icon :component="CloudUpload" />
|
|
||||||
</template>
|
|
||||||
</n-button>
|
|
||||||
<n-button size="small" @click="editConfig()">
|
|
||||||
<template #icon>
|
|
||||||
<n-icon :component="Edit" />
|
|
||||||
</template>
|
|
||||||
</n-button>
|
|
||||||
|
|
||||||
<n-modal
|
|
||||||
v-model:show="publishing"
|
|
||||||
class="w-[720px]"
|
|
||||||
preset="card"
|
|
||||||
title="Publish Artifacts"
|
|
||||||
segmented
|
|
||||||
closable
|
|
||||||
>
|
|
||||||
We are sorry about this tool isn't completed yet. <br>
|
|
||||||
For now, you can use our <b>Wonderful Command Line Tool —— RDS</b> <br>
|
|
||||||
Learn more on our <a href="https://wiki.smartsheep.studio/roadsign/index.html" target="_blank">official wiki</a>.
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
Install it by this command below
|
|
||||||
<n-code code="go install code.smartsheep.studio/goatworks/roadsign/pkg/cmd/rds@latest" />
|
|
||||||
<br>
|
|
||||||
Then connect your rds client to this server
|
|
||||||
<n-code :code="`rds connect <name> ${host} <credentials>`" />
|
|
||||||
<br>
|
|
||||||
After that you can publish your stuff (You need to compress them to zip archive before publish)
|
|
||||||
<n-code :code="`rds deploy <name> ${props.id} <upstream id or process id>`" />
|
|
||||||
</n-modal>
|
|
||||||
|
|
||||||
<n-modal
|
|
||||||
v-model:show="editing"
|
|
||||||
class="w-[720px]"
|
|
||||||
content-style="padding: 0"
|
|
||||||
preset="card"
|
|
||||||
title="Edit Configuration"
|
|
||||||
segmented
|
|
||||||
closable
|
|
||||||
>
|
|
||||||
<div class="relative h-[540px]">
|
|
||||||
<vue-monaco-editor
|
|
||||||
v-model:value="config"
|
|
||||||
:options="{ automaticLayout: true, minimap: { enabled: false } }"
|
|
||||||
language="yaml"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div class="fab">
|
|
||||||
<n-tooltip placement="left">
|
|
||||||
<template #trigger>
|
|
||||||
<n-button
|
|
||||||
circle
|
|
||||||
type="primary"
|
|
||||||
size="large"
|
|
||||||
class="shadow-lg"
|
|
||||||
:loading="submitting"
|
|
||||||
@click="syncConfig()"
|
|
||||||
>
|
|
||||||
<template #icon>
|
|
||||||
<n-icon :component="Save" />
|
|
||||||
</template>
|
|
||||||
</n-button>
|
|
||||||
</template>
|
|
||||||
This operation will restart all processes related. Service may interrupted for some while.
|
|
||||||
</n-tooltip>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</n-modal>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { NButton, NCode, NIcon, NModal, NTooltip, useMessage } from "naive-ui"
|
|
||||||
import { CloudUpload, Edit, Save } from "@vicons/carbon"
|
|
||||||
import { ref } from "vue"
|
|
||||||
import { VueMonacoEditor } from "@guolao/vue-monaco-editor"
|
|
||||||
import * as yaml from "js-yaml"
|
|
||||||
|
|
||||||
const message = useMessage()
|
|
||||||
|
|
||||||
const props = defineProps<{ id: string, rules: any[], upstreams: any[], processes: any[] }>()
|
|
||||||
const emits = defineEmits(["reload"])
|
|
||||||
const host = location.protocol + "//" + location.host
|
|
||||||
|
|
||||||
const submitting = ref(false)
|
|
||||||
|
|
||||||
const publishing = ref(false)
|
|
||||||
const editing = ref(false)
|
|
||||||
|
|
||||||
const config = ref<string | undefined>(undefined)
|
|
||||||
|
|
||||||
async function editConfig() {
|
|
||||||
const resp = await fetch(`/cgi/sites/cfg/${props.id}`)
|
|
||||||
config.value = await resp.text()
|
|
||||||
editing.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
async function syncConfig() {
|
|
||||||
if (config.value == null) return
|
|
||||||
|
|
||||||
let content
|
|
||||||
try {
|
|
||||||
content = yaml.load(config.value)
|
|
||||||
} catch (e: any) {
|
|
||||||
message.warning(`Your configuration has some issue: ${e.message}`)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
submitting.value = true
|
|
||||||
const resp = await fetch(`/webhooks/sync/${props.id}`, {
|
|
||||||
method: "PUT",
|
|
||||||
headers: { "Content-Type": "application/json" },
|
|
||||||
body: JSON.stringify(content)
|
|
||||||
})
|
|
||||||
if (resp.status != 200) {
|
|
||||||
message.error(`Something went wrong... ${await resp.text()}`)
|
|
||||||
} else {
|
|
||||||
emits("reload")
|
|
||||||
}
|
|
||||||
submitting.value = false
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.fab {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 16px;
|
|
||||||
right: 24px;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,110 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<n-button circle size="small" type="primary" @click="creating = true">
|
|
||||||
<template #icon>
|
|
||||||
<n-icon :component="Add" />
|
|
||||||
</template>
|
|
||||||
</n-button>
|
|
||||||
|
|
||||||
<n-modal
|
|
||||||
v-model:show="creating"
|
|
||||||
class="w-[720px]"
|
|
||||||
content-style="padding: 0"
|
|
||||||
preset="card"
|
|
||||||
title="Create Site"
|
|
||||||
segmented
|
|
||||||
closable
|
|
||||||
>
|
|
||||||
<div class="py-4 px-5 border border-solid border-b border-[#eee]">
|
|
||||||
<n-input
|
|
||||||
v-model:value="data.id"
|
|
||||||
placeholder="Will be the file name of this file"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="relative mt-[4px] h-[540px]">
|
|
||||||
<vue-monaco-editor
|
|
||||||
v-model:value="data.content"
|
|
||||||
:options="{ automaticLayout: true, minimap: { enabled: false } }"
|
|
||||||
language="yaml"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div class="fab">
|
|
||||||
<n-tooltip placement="left">
|
|
||||||
<template #trigger>
|
|
||||||
<n-button
|
|
||||||
circle
|
|
||||||
type="primary"
|
|
||||||
size="large"
|
|
||||||
class="shadow-lg"
|
|
||||||
:loading="submitting"
|
|
||||||
@click="submit()"
|
|
||||||
>
|
|
||||||
<template #icon>
|
|
||||||
<n-icon :component="Checkmark" />
|
|
||||||
</template>
|
|
||||||
</n-button>
|
|
||||||
</template>
|
|
||||||
This operation will publish this site right away.
|
|
||||||
</n-tooltip>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</n-modal>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { NButton, NIcon, NInput, NModal, NTooltip, useMessage } from "naive-ui"
|
|
||||||
import { Add, Checkmark } from "@vicons/carbon"
|
|
||||||
import { VueMonacoEditor } from "@guolao/vue-monaco-editor"
|
|
||||||
import { ref } from "vue"
|
|
||||||
import * as yaml from "js-yaml"
|
|
||||||
|
|
||||||
const message = useMessage()
|
|
||||||
|
|
||||||
const emits = defineEmits(["reload"])
|
|
||||||
|
|
||||||
const submitting = ref(false)
|
|
||||||
const creating = ref(false)
|
|
||||||
|
|
||||||
const data = ref<any>({})
|
|
||||||
|
|
||||||
async function submit() {
|
|
||||||
let content
|
|
||||||
try {
|
|
||||||
content = yaml.load(data.value.content)
|
|
||||||
} catch (e: any) {
|
|
||||||
message.warning(`Your configuration has some issue: ${e.message}`)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
submitting.value = true
|
|
||||||
const resp = await fetch(`/webhooks/sync/${data.value.id}`, {
|
|
||||||
method: "PUT",
|
|
||||||
headers: { "Content-Type": "application/json" },
|
|
||||||
body: JSON.stringify(content)
|
|
||||||
})
|
|
||||||
if (resp.status != 200) {
|
|
||||||
message.error(`Something went wrong... ${await resp.text()}`)
|
|
||||||
} else {
|
|
||||||
reset()
|
|
||||||
emits("reload")
|
|
||||||
message.success("Your site has been created! 🎉")
|
|
||||||
creating.value = false
|
|
||||||
}
|
|
||||||
submitting.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
function reset() {
|
|
||||||
data.value.id = ""
|
|
||||||
data.value.content = ""
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.fab {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 16px;
|
|
||||||
right: 24px;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,36 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="flex flex-col gap-1">
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<div class="font-bold">Rules</div>
|
|
||||||
<n-code :hljs="hljs" :code="parseData(props.rules)" language="json" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<div class="font-bold">Upstreams</div>
|
|
||||||
<n-code :hljs="hljs" :code="parseData(props.upstreams)" language="json" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<div class="font-bold">Processes</div>
|
|
||||||
<n-code :hljs="hljs" :code="parseData(props.processes)" language="json" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { NCode } from "naive-ui"
|
|
||||||
import hljs from "highlight.js/lib/core"
|
|
||||||
import json from "highlight.js/lib/languages/json"
|
|
||||||
|
|
||||||
hljs.registerLanguage("json", json)
|
|
||||||
|
|
||||||
const props = defineProps<{ rules: any[], upstreams: any[], processes: any[] }>()
|
|
||||||
|
|
||||||
function parseData(data: any): string {
|
|
||||||
return JSON.stringify(data, null, 1)
|
|
||||||
.replace(/ +/g, " ")
|
|
||||||
.replace(/\n/g, "")
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,76 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<n-card title="Sites">
|
|
||||||
<template #header-extra>
|
|
||||||
<sites-table-add @reload="readSites()" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<n-data-table
|
|
||||||
:columns="columns"
|
|
||||||
:data="data"
|
|
||||||
:row-key="(row: any) => row.id"
|
|
||||||
/>
|
|
||||||
</n-card>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { NCard, NDataTable, NTag } from "naive-ui"
|
|
||||||
import { h, ref } from "vue"
|
|
||||||
import SitesTableExpand from "@/components/data/sites-table-expand.vue"
|
|
||||||
import SitesTableAction from "@/components/data/sites-table-action.vue"
|
|
||||||
import SitesTableAdd from "@/components/data/sites-table-add.vue"
|
|
||||||
|
|
||||||
const columns: any[] = [
|
|
||||||
{
|
|
||||||
type: "expand",
|
|
||||||
renderExpand(row: any) {
|
|
||||||
return h(SitesTableExpand, { ...row, class: "pl-[38px]" })
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "ID",
|
|
||||||
key: "id",
|
|
||||||
render(row: any) {
|
|
||||||
return h(NTag, { type: "info", bordered: false, size: "small" }, row?.id)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Rules",
|
|
||||||
key: "rules",
|
|
||||||
render(row: any) {
|
|
||||||
return row?.rules?.length ?? 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Upstreams",
|
|
||||||
key: "upstreams",
|
|
||||||
render(row: any) {
|
|
||||||
return row?.upstreams?.length ?? 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Processes",
|
|
||||||
key: "processes",
|
|
||||||
render(row: any) {
|
|
||||||
return row?.processes?.length ?? 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Actions",
|
|
||||||
key: "actions",
|
|
||||||
render(row: any) {
|
|
||||||
return h(SitesTableAction, { ...row, onReload: () => readSites() })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
const data = ref<any[]>([])
|
|
||||||
|
|
||||||
async function readSites() {
|
|
||||||
const resp = await fetch("/cgi/sites")
|
|
||||||
data.value = await resp.json()
|
|
||||||
}
|
|
||||||
|
|
||||||
readSites()
|
|
||||||
</script>
|
|
@ -1,60 +0,0 @@
|
|||||||
<template>
|
|
||||||
<n-layout>
|
|
||||||
<n-layout-header class="header py-[8px] px-[36px]" bordered>
|
|
||||||
<div class="flex items-center gap-2">
|
|
||||||
<router-link class="link" to="/">
|
|
||||||
RoadSign<i>!</i>
|
|
||||||
</router-link>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="nav-menu">
|
|
||||||
<div class="h-full flex items-center header-nav">
|
|
||||||
<n-menu v-model:value="key" :options="options" mode="horizontal" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</n-layout-header>
|
|
||||||
<n-layout-content class="h-[calc(100vh-70px)] container mx-auto" content-style="padding: 24px">
|
|
||||||
<router-view />
|
|
||||||
</n-layout-content>
|
|
||||||
</n-layout>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { type MenuOption, NIcon, NLayout, NLayoutContent, NLayoutHeader, NMenu } from "naive-ui"
|
|
||||||
import { type Component, h, ref } from "vue"
|
|
||||||
import { Dashboard } from "@vicons/carbon"
|
|
||||||
import { RouterLink, useRoute, useRouter } from "vue-router"
|
|
||||||
|
|
||||||
const route = useRoute()
|
|
||||||
const router = useRouter()
|
|
||||||
const key = ref(route.name?.toString())
|
|
||||||
|
|
||||||
router.afterEach((to) => {
|
|
||||||
key.value = to.name?.toString() ?? "index"
|
|
||||||
})
|
|
||||||
|
|
||||||
const options: MenuOption[] = [
|
|
||||||
{
|
|
||||||
label: () => h(RouterLink, { to: { name: "dashboard" } }, "Dashboard"),
|
|
||||||
icon: renderIcon(Dashboard),
|
|
||||||
key: "dashboard"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
function renderIcon(icon: Component) {
|
|
||||||
return () => h(NIcon, null, { default: () => h(icon) })
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.header {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr auto 1fr;
|
|
||||||
gap: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.link {
|
|
||||||
all: unset;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,16 +0,0 @@
|
|||||||
import "./assets/main.css"
|
|
||||||
|
|
||||||
import "virtual:uno.css"
|
|
||||||
|
|
||||||
import { createApp } from "vue"
|
|
||||||
import { createPinia } from "pinia"
|
|
||||||
|
|
||||||
import root from "./root.vue"
|
|
||||||
import router from "./router"
|
|
||||||
|
|
||||||
const app = createApp(root)
|
|
||||||
|
|
||||||
app.use(createPinia())
|
|
||||||
app.use(router)
|
|
||||||
|
|
||||||
app.mount("#app")
|
|
@ -1,9 +0,0 @@
|
|||||||
<template>
|
|
||||||
<n-message-provider>
|
|
||||||
<router-view />
|
|
||||||
</n-message-provider>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { NMessageProvider } from "naive-ui"
|
|
||||||
</script>
|
|
@ -1,21 +0,0 @@
|
|||||||
import { createRouter, createWebHistory } from "vue-router"
|
|
||||||
|
|
||||||
const router = createRouter({
|
|
||||||
history: createWebHistory(import.meta.env.BASE_URL),
|
|
||||||
routes: [
|
|
||||||
{
|
|
||||||
path: "/",
|
|
||||||
name: "layouts.main",
|
|
||||||
component: () => import("@/layouts/main.vue"),
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: "/",
|
|
||||||
name: "dashboard",
|
|
||||||
component: () => import("@/views/dashboard.vue")
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
]
|
|
||||||
})
|
|
||||||
|
|
||||||
export default router
|
|
@ -1,35 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="flex flex-col gap-2">
|
|
||||||
<div class="grid gap-2 grid-cols-2 lg:grid-cols-4">
|
|
||||||
<n-card embedded>
|
|
||||||
<n-statistic label="Status">{{ data?.status ? "Operational" : "Incident" }}</n-statistic>
|
|
||||||
</n-card>
|
|
||||||
<n-card embedded>
|
|
||||||
<n-statistic label="Sites">{{ data?.sites }}</n-statistic>
|
|
||||||
</n-card>
|
|
||||||
<n-card embedded>
|
|
||||||
<n-statistic label="Upstreams">{{ data?.upstreams }}</n-statistic>
|
|
||||||
</n-card>
|
|
||||||
<n-card embedded>
|
|
||||||
<n-statistic label="Processes">{{ data?.processes }}</n-statistic>
|
|
||||||
</n-card>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<sites-table />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { NCard, NStatistic } from "naive-ui"
|
|
||||||
import { ref } from "vue"
|
|
||||||
import SitesTable from "@/components/data/sites-table.vue"
|
|
||||||
|
|
||||||
const data = ref<any>({})
|
|
||||||
|
|
||||||
async function readStatistics() {
|
|
||||||
const resp = await fetch("/cgi/statistics")
|
|
||||||
data.value = await resp.json()
|
|
||||||
}
|
|
||||||
|
|
||||||
readStatistics()
|
|
||||||
</script>
|
|
@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
|
||||||
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
|
|
||||||
"exclude": ["src/**/__tests__/*"],
|
|
||||||
"compilerOptions": {
|
|
||||||
"composite": true,
|
|
||||||
"noEmit": true,
|
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
|
||||||
"@/*": ["./src/*"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"files": [],
|
|
||||||
"references": [
|
|
||||||
{
|
|
||||||
"path": "./tsconfig.node.json"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "./tsconfig.app.json"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "@tsconfig/node18/tsconfig.json",
|
|
||||||
"include": [
|
|
||||||
"vite.config.*",
|
|
||||||
"vitest.config.*",
|
|
||||||
"cypress.config.*",
|
|
||||||
"nightwatch.conf.*",
|
|
||||||
"playwright.config.*"
|
|
||||||
],
|
|
||||||
"compilerOptions": {
|
|
||||||
"composite": true,
|
|
||||||
"noEmit": true,
|
|
||||||
"module": "ESNext",
|
|
||||||
"moduleResolution": "Bundler",
|
|
||||||
"types": ["node"]
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
import { defineConfig, presetUno } from "unocss"
|
|
||||||
|
|
||||||
export default defineConfig({
|
|
||||||
presets: [presetUno({ preflight: false })]
|
|
||||||
})
|
|
@ -1,24 +0,0 @@
|
|||||||
import { fileURLToPath, URL } from "node:url"
|
|
||||||
|
|
||||||
import { defineConfig } from "vite"
|
|
||||||
import vue from "@vitejs/plugin-vue"
|
|
||||||
import unocss from "unocss/vite"
|
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
|
||||||
export default defineConfig({
|
|
||||||
plugins: [
|
|
||||||
vue(),
|
|
||||||
unocss()
|
|
||||||
],
|
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
"@": fileURLToPath(new URL("./src", import.meta.url))
|
|
||||||
}
|
|
||||||
},
|
|
||||||
server: {
|
|
||||||
proxy: {
|
|
||||||
"/webhooks": "http://127.0.0.1:81",
|
|
||||||
"/cgi": "http://127.0.0.1:81"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
@ -1,45 +0,0 @@
|
|||||||
package sign
|
|
||||||
|
|
||||||
import (
|
|
||||||
"io"
|
|
||||||
"os"
|
|
||||||
"path/filepath"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"gopkg.in/yaml.v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
var App *RoadApp
|
|
||||||
|
|
||||||
func ReadInConfig(root string) error {
|
|
||||||
instance := &RoadApp{
|
|
||||||
Sites: []*SiteConfig{},
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := filepath.Walk(root, func(fp string, info os.FileInfo, err error) error {
|
|
||||||
var site SiteConfig
|
|
||||||
if info.IsDir() {
|
|
||||||
return nil
|
|
||||||
} else if file, err := os.OpenFile(fp, os.O_RDONLY, 0755); err != nil {
|
|
||||||
return err
|
|
||||||
} else if data, err := io.ReadAll(file); err != nil {
|
|
||||||
return err
|
|
||||||
} else if err := yaml.Unmarshal(data, &site); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
defer file.Close()
|
|
||||||
|
|
||||||
// Extract file name as site id
|
|
||||||
site.ID = strings.SplitN(filepath.Base(fp), ".", 2)[0]
|
|
||||||
instance.Sites = append(instance.Sites, &site)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
App = instance
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user