Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove separate root path config #2943

Merged
merged 3 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions cmd/server/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ var flags = append([]cli.Flag{
Name: "server-webhook-host",
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{
EnvVars: []string{"WOODPECKER_SERVER_ADDR"},
Name: "server-addr",
Expand Down
9 changes: 2 additions & 7 deletions cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.StatusContextFormat = c.String("status-context-format")
server.Config.Server.SessionExpires = c.Duration("session-expires")
rootPath := c.String("root-path")
if !c.IsSet("root-path") {
// Extract RootPath from Host...
u, _ := url.Parse(server.Config.Server.Host)
rootPath = u.Path
}
rootPath = strings.TrimSuffix(rootPath, "/")
u, _ := url.Parse(server.Config.Server.Host)
rootPath := strings.TrimSuffix(u.Path, "/")
if rootPath != "" && !strings.HasPrefix(rootPath, "/") {
rootPath = "/" + rootPath
}
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/30-administration/00-deployment/00-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
A Woodpecker deployment consists of two parts:

- 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.
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
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.
Expand Down Expand Up @@ -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.

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

Expand Down
8 changes: 0 additions & 8 deletions docs/docs/30-administration/10-server-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

### `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`

> Default: true
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/91-migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Some versions need some changes to the server configuration or the pipeline conf

## `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

Expand Down
3 changes: 0 additions & 3 deletions server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ var Config = struct {
CustomCSSFile string
CustomJsFile string
EnableSwagger bool
// Open bool
// Orgs map[string]struct{}
// Admins map[string]struct{}
}
Prometheus struct {
AuthToken string
Expand Down
Loading