Remove separate root path config (#2943)

This commit is contained in:
qwerty287 2023-12-13 15:51:18 +01:00 committed by GitHub
parent 4974d4cffe
commit 360b41f961
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 27 deletions

View file

@ -45,11 +45,6 @@ var flags = append([]cli.Flag{
Name: "server-webhook-host", Name: "server-webhook-host",
Usage: "server fully qualified url for forge's Webhooks (<scheme>://<host>[/<prefixpath>])", Usage: "server fully qualified url for forge's Webhooks (<scheme>://<host>[/<prefixpath>])",
}, },
&cli.StringFlag{
EnvVars: []string{"WOODPECKER_ROOT_PATH", "WOODPECKER_ROOT_URL"},
Name: "root-path",
Usage: "server url root (used for statics loading when having a url path prefix)",
},
&cli.StringFlag{ &cli.StringFlag{
EnvVars: []string{"WOODPECKER_SERVER_ADDR"}, EnvVars: []string{"WOODPECKER_SERVER_ADDR"},
Name: "server-addr", Name: "server-addr",

View file

@ -347,13 +347,8 @@ func setupEvilGlobals(c *cli.Context, v store.Store, f forge.Forge) {
server.Config.Server.StatusContext = c.String("status-context") server.Config.Server.StatusContext = c.String("status-context")
server.Config.Server.StatusContextFormat = c.String("status-context-format") server.Config.Server.StatusContextFormat = c.String("status-context-format")
server.Config.Server.SessionExpires = c.Duration("session-expires") server.Config.Server.SessionExpires = c.Duration("session-expires")
rootPath := c.String("root-path") u, _ := url.Parse(server.Config.Server.Host)
if !c.IsSet("root-path") { rootPath := strings.TrimSuffix(u.Path, "/")
// Extract RootPath from Host...
u, _ := url.Parse(server.Config.Server.Host)
rootPath = u.Path
}
rootPath = strings.TrimSuffix(rootPath, "/")
if rootPath != "" && !strings.HasPrefix(rootPath, "/") { if rootPath != "" && !strings.HasPrefix(rootPath, "/") {
rootPath = "/" + rootPath rootPath = "/" + rootPath
} }

View file

@ -3,10 +3,10 @@
A Woodpecker deployment consists of two parts: A Woodpecker deployment consists of two parts:
- A server which is the heart of Woodpecker and ships the web interface. - A server which is the heart of Woodpecker and ships the web interface.
- Next to one server you can deploy any number of agents which will run the pipelines. - Next to one server, you can deploy any number of agents which will run the pipelines.
Each agent is able to process one pipeline step by default. Each agent is able to process one pipeline step by default.
If you have 4 agents installed and connected to the Woodpecker server, your system will process 4 workflows in parallel. If you have four agents installed and connected to the Woodpecker server, your system will process four workflows in parallel.
:::tip :::tip
You can add more agents to increase the number of parallel workflows or set the agent's `WOODPECKER_MAX_WORKFLOWS=1` environment variable to increase the number of parallel workflows for that agent. You can add more agents to increase the number of parallel workflows or set the agent's `WOODPECKER_MAX_WORKFLOWS=1` environment variable to increase the number of parallel workflows for that agent.
@ -61,7 +61,7 @@ A [Prometheus endpoint](../90-prometheus.md) is exposed.
See the [proxy guide](../70-proxy.md) if you want to see a setup behind Apache, Nginx, Caddy or ngrok. See the [proxy guide](../70-proxy.md) if you want to see a setup behind Apache, Nginx, Caddy or ngrok.
In the case you need to use Woodpecker with a URL path prefix (like: <https://example.org/woodpecker/>), you can use the option [`WOODPECKER_ROOT_PATH`](../10-server-config.md#woodpecker_root_path). In the case you need to use Woodpecker with a URL path prefix (like: <https://example.org/woodpecker/>), add the root path to [`WOODPECKER_HOST`](../10-server-config.md#woodpecker_host).
## Third-party installation methods ## Third-party installation methods

View file

@ -573,14 +573,6 @@ Specify a configuration service endpoint, see [Configuration Extension](./100-ex
Specify how many seconds before timeout when fetching the Woodpecker configuration from a Forge Specify how many seconds before timeout when fetching the Woodpecker configuration from a Forge
### `WOODPECKER_ROOT_PATH`
> Default: extracted from `WOODPECKER_HOST`
Server URL path prefix (used for statics loading when having a url path prefix), should start with `/`
Example: `WOODPECKER_ROOT_PATH=/woodpecker`
### `WOODPECKER_ENABLE_SWAGGER` ### `WOODPECKER_ENABLE_SWAGGER`
> Default: true > Default: true

View file

@ -4,7 +4,7 @@ Some versions need some changes to the server configuration or the pipeline conf
## `next` ## `next`
No breaking changes yet - Removed `WOODPECKER_ROOT_PATH` and `WOODPECKER_ROOT_URL` config variables. Use `WOODPECKER_HOST` with a path instead
## 2.0.0 ## 2.0.0

View file

@ -71,9 +71,6 @@ var Config = struct {
CustomCSSFile string CustomCSSFile string
CustomJsFile string CustomJsFile string
EnableSwagger bool EnableSwagger bool
// Open bool
// Orgs map[string]struct{}
// Admins map[string]struct{}
} }
Prometheus struct { Prometheus struct {
AuthToken string AuthToken string