1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-24 10:07:21 +02:00

Add prettier (#2600)

This commit is contained in:
Anbraten 2023-10-24 14:42:05 +02:00 committed by GitHub
parent 69917c1a0d
commit 66a5ba4e4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
71 changed files with 399 additions and 322 deletions

View File

@ -8,47 +8,37 @@ service: github
# Changelog groups and which labeled PRs to add to each group # Changelog groups and which labeled PRs to add to each group
groups: groups:
- - name: BREAKING
name: BREAKING
labels: labels:
- breaking - breaking
- - name: FEATURES
name: FEATURES
labels: labels:
- feature - feature
- - name: SECURITY
name: SECURITY
labels: labels:
- security - security
- - name: BUGFIXES
name: BUGFIXES
labels: labels:
- bug - bug
- - name: ENHANCEMENTS
name: ENHANCEMENTS
labels: labels:
- enhancement - enhancement
- refactor - refactor
- ui - ui
- - name: TESTING
name: TESTING
labels: labels:
- tests - tests
- - name: TRANSLATION
name: TRANSLATION
labels: labels:
- kind/translation - kind/translation
- - name: BUILD
name: BUILD
labels: labels:
- kind/build - kind/build
- kind/lint - kind/lint
- - name: DOCUMENTATION
name: DOCUMENTATION
labels: labels:
- documentation - documentation
- - name: MISC
name: MISC
default: true default: true
# regex indicating which labels to skip for the changelog # regex indicating which labels to skip for the changelog

View File

@ -4,7 +4,7 @@ linters-settings:
misspell: misspell:
locale: US locale: US
gofumpt: gofumpt:
lang-version: "1.21" lang-version: '1.21'
extra-rules: true extra-rules: true
forbidigo: forbidigo:
forbid: forbid:
@ -48,6 +48,6 @@ issues:
- revive - revive
# let cli use print and panic # let cli use print and panic
- path: "cmd/*|cli/*" - path: 'cmd/*|cli/*'
linters: linters:
- forbidigo - forbidigo

7
.prettierignore Normal file
View File

@ -0,0 +1,7 @@
pnpm-lock.yaml
build/
docs/versioned_docs/
docs/.docusaurus/
dist/
web/components.d.ts
CHANGELOG.md

8
.prettierrc Normal file
View File

@ -0,0 +1,8 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 2,
"endOfLine": "lf"
}

19
.vscode/launch.json vendored
View File

@ -3,11 +3,7 @@
"compounds": [ "compounds": [
{ {
"name": "Woodpecker CI", "name": "Woodpecker CI",
"configurations": [ "configurations": ["Woodpecker UI", "Woodpecker server", "Woodpecker agent"],
"Woodpecker UI",
"Woodpecker server",
"Woodpecker agent"
],
"stopAll": true "stopAll": true
} }
], ],
@ -43,17 +39,10 @@
"type": "node", "type": "node",
"request": "launch", "request": "launch",
"runtimeExecutable": "pnpm", "runtimeExecutable": "pnpm",
"runtimeArgs": [ "runtimeArgs": ["start"],
"start",
],
"cwd": "${workspaceFolder}/web", "cwd": "${workspaceFolder}/web",
"resolveSourceMapLocations": [ "resolveSourceMapLocations": ["${workspaceFolder}/web/**", "!**/node_modules/**"],
"${workspaceFolder}/web/**", "skipFiles": ["<node_internals>/**"]
"!**/node_modules/**"
],
"skipFiles": [
"<node_internals>/**"
]
} }
] ]
} }

14
.vscode/settings.json vendored
View File

@ -7,17 +7,9 @@
"vendor/": true "vendor/": true
}, },
"go.lintTool": "golangci-lint", "go.lintTool": "golangci-lint",
"go.lintFlags": [ "go.lintFlags": ["--fast"],
"--fast" "eslint.workingDirectories": ["./web"],
],
"eslint.workingDirectories": [
"./web"
],
"prettier.configPath": "./web/.prettierrc.js", "prettier.configPath": "./web/.prettierrc.js",
"prettier.ignorePath": "./web/.prettierignore", "prettier.ignorePath": "./web/.prettierignore",
"cSpell.words": [ "cSpell.words": ["Curr", "doublestar", "multierr"]
"Curr",
"doublestar",
"multierr"
]
} }

View File

@ -21,8 +21,7 @@ variables:
- &build_args 'CI_COMMIT_SHA=${CI_COMMIT_SHA},CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH},CI_COMMIT_TAG=${CI_COMMIT_TAG}' - &build_args 'CI_COMMIT_SHA=${CI_COMMIT_SHA},CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH},CI_COMMIT_TAG=${CI_COMMIT_TAG}'
# vars used on push / tag events only # vars used on push / tag events only
- publish_logins: &publish_logins - publish_logins: &publish_logins # Default DockerHub login
# Default DockerHub login
- registry: https://index.docker.io/v1/ - registry: https://index.docker.io/v1/
username: woodpeckerbot username: woodpeckerbot
password: password:
@ -35,19 +34,17 @@ variables:
- &publish_repos_server 'woodpeckerci/woodpecker-server,quay.io/woodpeckerci/woodpecker-server' - &publish_repos_server 'woodpeckerci/woodpecker-server,quay.io/woodpeckerci/woodpecker-server'
- &publish_repos_agent 'woodpeckerci/woodpecker-agent,quay.io/woodpeckerci/woodpecker-agent' - &publish_repos_agent 'woodpeckerci/woodpecker-agent,quay.io/woodpeckerci/woodpecker-agent'
- &publish_repos_cli 'woodpeckerci/woodpecker-cli,quay.io/woodpeckerci/woodpecker-cli' - &publish_repos_cli 'woodpeckerci/woodpecker-cli,quay.io/woodpeckerci/woodpecker-cli'
- path: &when_path - path: &when_path # web source code
# web source code - 'web/**'
- "web/**"
# api source code # api source code
- "server/api/**" - 'server/api/**'
# go source code # go source code
- "**/*.go" - '**/*.go'
- "go.*" - 'go.*'
# schema changes # schema changes
- "pipeline/schema/**" - 'pipeline/schema/**'
# Dockerfile changes # Dockerfile changes
- "docker/**" - 'docker/**'
steps: steps:
vendor: vendor:
@ -185,7 +182,7 @@ steps:
repo: *publish_repos_server repo: *publish_repos_server
dockerfile: docker/Dockerfile.server.multiarch dockerfile: docker/Dockerfile.server.multiarch
platforms: *platforms_server platforms: *platforms_server
tag: [next, "next-${CI_COMMIT_SHA:0:10}"] tag: [next, 'next-${CI_COMMIT_SHA:0:10}']
logins: *publish_logins logins: *publish_logins
when: when:
branch: ${CI_REPO_DEFAULT_BRANCH} branch: ${CI_REPO_DEFAULT_BRANCH}
@ -199,7 +196,7 @@ steps:
repo: *publish_repos_server repo: *publish_repos_server
dockerfile: docker/Dockerfile.server.alpine.multiarch dockerfile: docker/Dockerfile.server.alpine.multiarch
platforms: *platforms_alpine platforms: *platforms_alpine
tag: [next-alpine, "next-${CI_COMMIT_SHA:0:10}-alpine"] tag: [next-alpine, 'next-${CI_COMMIT_SHA:0:10}-alpine']
logins: *publish_logins logins: *publish_logins
when: when:
branch: ${CI_REPO_DEFAULT_BRANCH} branch: ${CI_REPO_DEFAULT_BRANCH}
@ -242,7 +239,7 @@ steps:
dockerfile: docker/Dockerfile.server.multiarch dockerfile: docker/Dockerfile.server.multiarch
platforms: *platforms_server platforms: *platforms_server
# remove 'latest' on older version branches to avoid accidental downgrade # remove 'latest' on older version branches to avoid accidental downgrade
tag: [latest, "${CI_COMMIT_TAG}"] tag: [latest, '${CI_COMMIT_TAG}']
logins: *publish_logins logins: *publish_logins
when: when:
event: tag event: tag
@ -255,7 +252,7 @@ steps:
dockerfile: docker/Dockerfile.server.alpine.multiarch dockerfile: docker/Dockerfile.server.alpine.multiarch
platforms: *platforms_alpine platforms: *platforms_alpine
# remove 'latest-alpine' on older version branches to avoid accidental downgrade # remove 'latest-alpine' on older version branches to avoid accidental downgrade
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"] tag: [latest-alpine, '${CI_COMMIT_TAG}-alpine']
logins: *publish_logins logins: *publish_logins
when: when:
event: tag event: tag
@ -301,7 +298,7 @@ steps:
repo: *publish_repos_agent repo: *publish_repos_agent
dockerfile: docker/Dockerfile.agent.multiarch dockerfile: docker/Dockerfile.agent.multiarch
platforms: *platforms_release platforms: *platforms_release
tag: [next, "next-${CI_COMMIT_SHA:0:10}"] tag: [next, 'next-${CI_COMMIT_SHA:0:10}']
logins: *publish_logins logins: *publish_logins
build_args: *build_args build_args: *build_args
when: when:
@ -316,7 +313,7 @@ steps:
repo: *publish_repos_agent repo: *publish_repos_agent
dockerfile: docker/Dockerfile.agent.alpine.multiarch dockerfile: docker/Dockerfile.agent.alpine.multiarch
platforms: *platforms_alpine platforms: *platforms_alpine
tag: [next-alpine, "next-${CI_COMMIT_SHA:0:10}-alpine"] tag: [next-alpine, 'next-${CI_COMMIT_SHA:0:10}-alpine']
logins: *publish_logins logins: *publish_logins
build_args: *build_args build_args: *build_args
when: when:
@ -362,7 +359,7 @@ steps:
dockerfile: docker/Dockerfile.agent.multiarch dockerfile: docker/Dockerfile.agent.multiarch
platforms: *platforms_release platforms: *platforms_release
# remove 'latest' on older version branches to avoid accidental downgrade # remove 'latest' on older version branches to avoid accidental downgrade
tag: [latest, "${CI_COMMIT_TAG}"] tag: [latest, '${CI_COMMIT_TAG}']
logins: *publish_logins logins: *publish_logins
build_args: *build_args build_args: *build_args
when: when:
@ -376,7 +373,7 @@ steps:
dockerfile: docker/Dockerfile.agent.alpine.multiarch dockerfile: docker/Dockerfile.agent.alpine.multiarch
platforms: *platforms_alpine platforms: *platforms_alpine
# remove 'latest-alpine' on older version branches to avoid accidental downgrade # remove 'latest-alpine' on older version branches to avoid accidental downgrade
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"] tag: [latest-alpine, '${CI_COMMIT_TAG}-alpine']
logins: *publish_logins logins: *publish_logins
build_args: *build_args build_args: *build_args
when: when:
@ -423,7 +420,7 @@ steps:
repo: *publish_repos_cli repo: *publish_repos_cli
dockerfile: docker/Dockerfile.cli.multiarch dockerfile: docker/Dockerfile.cli.multiarch
platforms: *platforms_release platforms: *platforms_release
tag: [next, "next-${CI_COMMIT_SHA:0:10}"] tag: [next, 'next-${CI_COMMIT_SHA:0:10}']
logins: *publish_logins logins: *publish_logins
build_args: *build_args build_args: *build_args
when: when:
@ -438,7 +435,7 @@ steps:
repo: *publish_repos_cli repo: *publish_repos_cli
dockerfile: docker/Dockerfile.cli.alpine.multiarch dockerfile: docker/Dockerfile.cli.alpine.multiarch
platforms: *platforms_alpine platforms: *platforms_alpine
tag: [next-alpine, "next-${CI_COMMIT_SHA:0:10}-alpine"] tag: [next-alpine, 'next-${CI_COMMIT_SHA:0:10}-alpine']
logins: *publish_logins logins: *publish_logins
build_args: *build_args build_args: *build_args
when: when:
@ -484,7 +481,7 @@ steps:
dockerfile: docker/Dockerfile.cli.multiarch dockerfile: docker/Dockerfile.cli.multiarch
platforms: *platforms_release platforms: *platforms_release
# remove 'latest' on older version branches to avoid accidental downgrade # remove 'latest' on older version branches to avoid accidental downgrade
tag: [latest, "${CI_COMMIT_TAG}"] tag: [latest, '${CI_COMMIT_TAG}']
logins: *publish_logins logins: *publish_logins
build_args: *build_args build_args: *build_args
when: when:
@ -498,7 +495,7 @@ steps:
dockerfile: docker/Dockerfile.cli.alpine.multiarch dockerfile: docker/Dockerfile.cli.alpine.multiarch
platforms: *platforms_alpine platforms: *platforms_alpine
# remove 'latest-alpine' on older version branches to avoid accidental downgrade # remove 'latest-alpine' on older version branches to avoid accidental downgrade
tag: [latest-alpine, "${CI_COMMIT_TAG}-alpine"] tag: [latest-alpine, '${CI_COMMIT_TAG}-alpine']
logins: *publish_logins logins: *publish_logins
build_args: *build_args build_args: *build_args
when: when:

View File

@ -2,13 +2,13 @@ when:
- event: pull_request - event: pull_request
- event: push - event: push
path: &when_path path: &when_path
- "docs/**" - 'docs/**'
- ".woodpecker/docs.yml" - '.woodpecker/docs.yml'
# since we generate docs for cli tool we have to watch this too # since we generate docs for cli tool we have to watch this too
- "cli/**" - 'cli/**'
- "cmd/cli/**" - 'cmd/cli/**'
# api docs # api docs
- "server/api/**" - 'server/api/**'
branch: ${CI_REPO_DEFAULT_BRANCH} branch: ${CI_REPO_DEFAULT_BRANCH}
- cron: update_docs - cron: update_docs
event: cron event: cron
@ -40,11 +40,11 @@ steps:
deploy-preview: deploy-preview:
image: woodpeckerci/plugin-surge-preview:1.2.2 image: woodpeckerci/plugin-surge-preview:1.2.2
settings: settings:
path: "docs/build/" path: 'docs/build/'
surge_token: surge_token:
from_secret: SURGE_TOKEN from_secret: SURGE_TOKEN
forge_type: github forge_type: github
forge_url: "https://github.com" forge_url: 'https://github.com'
forge_repo_token: forge_repo_token:
from_secret: GITHUB_TOKEN_SURGE from_secret: GITHUB_TOKEN_SURGE
failure: ignore failure: ignore

View File

@ -8,15 +8,14 @@ when:
variables: variables:
- &golang_image 'golang:1.21.3' - &golang_image 'golang:1.21.3'
- &when - &when
- path: &when_path - path: &when_path # related config files
# related config files - '.woodpecker/test.yml'
- ".woodpecker/test.yml" - '.golangci.yml'
- ".golangci.yml"
# go source code # go source code
- "**/*.go" - '**/*.go'
- "go.*" - 'go.*'
# schema changes # schema changes
- "pipeline/schema/**" - 'pipeline/schema/**'
event: [pull_request, tag] event: [pull_request, tag]
steps: steps:
@ -35,8 +34,8 @@ steps:
when: when:
- <<: *when - <<: *when
- path: - path:
- ".woodpecker/**" - '.woodpecker/**'
- "pipeline/schema/**" - 'pipeline/schema/**'
dummy-web: dummy-web:
image: *golang_image image: *golang_image
@ -58,9 +57,9 @@ steps:
image: *golang_image image: *golang_image
group: test group: test
commands: commands:
- "make generate-swagger" - 'make generate-swagger'
- "DIFF=$(git diff | head)" - 'DIFF=$(git diff | head)'
- "[ -n \"$DIFF\" ] && { echo \"swagger not up to date, exec 'make generate-swagger' and commit\"; exit 1; } || true" - '[ -n "$DIFF" ] && { echo "swagger not up to date, exec `make generate-swagger` and commit"; exit 1; } || true'
when: *when when: *when
lint-editorconfig: lint-editorconfig:
@ -74,7 +73,12 @@ steps:
group: test group: test
commands: commands:
- go install github.com/google/addlicense@latest - go install github.com/google/addlicense@latest
- "addlicense -check -ignore \"vendor/**\" **/*.go" - 'addlicense -check -ignore "vendor/**" **/*.go'
when: *when
prettier:
image: woodpeckerci/plugin-prettier:next
group: test
when: *when when: *when
test: test:
@ -137,7 +141,7 @@ steps:
services: services:
service-postgres: service-postgres:
image: postgres:16 image: postgres:16
ports: ["5432"] ports: ['5432']
environment: environment:
- POSTGRES_USER=postgres - POSTGRES_USER=postgres
- POSTGRES_HOST_AUTH_METHOD=trust - POSTGRES_HOST_AUTH_METHOD=trust
@ -145,7 +149,7 @@ services:
service-mysql: service-mysql:
image: mysql:8.1.0 image: mysql:8.1.0
ports: ["3306"] ports: ['3306']
environment: environment:
- MYSQL_DATABASE=test - MYSQL_DATABASE=test
- MYSQL_ALLOW_EMPTY_PASSWORD=yes - MYSQL_ALLOW_EMPTY_PASSWORD=yes

View File

@ -10,11 +10,11 @@ variables:
- &when - &when
path: path:
# related config files # related config files
- ".woodpecker/web.yml" - '.woodpecker/web.yml'
# web source code # web source code
- "web/**" - 'web/**'
# api source code # api source code
- "server/api/**" - 'server/api/**'
event: [pull_request, tag, deployment] event: [pull_request, tag, deployment]
steps: steps:

View File

@ -32,16 +32,18 @@ For security reasons, Owners must use 2FA.
To honor the past owners, here's the history of the owners and the time To honor the past owners, here's the history of the owners and the time
they served: they served:
* 2023-01-01 ~ 2023-12-31 - https://github.com/woodpecker-ci/woodpecker/issues/1467 - 2023-01-01 ~ 2023-12-31 - https://github.com/woodpecker-ci/woodpecker/issues/1467
* [6543](https://github.com/6543)
* [Anbraten](https://github.com/anbraten)
* 2021-09-28 ~ 2022-12-31 - https://github.com/woodpecker-ci/woodpecker/issues/633 - [6543](https://github.com/6543)
* [6543](https://github.com/6543) - [Anbraten](https://github.com/anbraten)
* [Anbraten](https://github.com/anbraten)
* 2019-07-25 ~ 2021-09-28 - 2021-09-28 ~ 2022-12-31 - https://github.com/woodpecker-ci/woodpecker/issues/633
* [Laszlo Fogas](https://github.com/laszlocph)
- [6543](https://github.com/6543)
- [Anbraten](https://github.com/anbraten)
- 2019-07-25 ~ 2021-09-28
- [Laszlo Fogas](https://github.com/laszlocph)
## Code Review ## Code Review

View File

@ -31,11 +31,11 @@ services:
GITEA__database__NAME: gitea GITEA__database__NAME: gitea
GITEA__database__USER: gitea GITEA__database__USER: gitea
GITEA__database__PASSWD: 123456 GITEA__database__PASSWD: 123456
GITEA__webhook__ALLOWED_HOST_LIST: "*" GITEA__webhook__ALLOWED_HOST_LIST: '*'
GITEA__security__INSTALL_LOCK: "true" GITEA__security__INSTALL_LOCK: 'true'
GITEA__security__INTERNAL_TOKEN: "123456" GITEA__security__INTERNAL_TOKEN: '123456'
extra_hosts: extra_hosts:
- "host.docker.internal:host-gateway" - 'host.docker.internal:host-gateway'
volumes: volumes:
gitea: gitea:

View File

@ -1,8 +1,8 @@
module.exports = { module.exports = {
semi: true, semi: true,
trailingComma: "all", trailingComma: 'all',
singleQuote: true, singleQuote: true,
printWidth: 120, printWidth: 120,
tabWidth: 2, tabWidth: 2,
endOfLine: "lf", endOfLine: 'lf',
}; };

View File

@ -41,6 +41,7 @@ Sometimes there are multiple terms that can be used to describe something. This
- Use the term **steps** instead of the previous **jobs** - Use the term **steps** instead of the previous **jobs**
<!-- References --> <!-- References -->
[Pipeline]: ../20-workflow-syntax.md [Pipeline]: ../20-workflow-syntax.md
[Workflow]: ../25-workflows.md [Workflow]: ../25-workflows.md
[Forge]: ../../30-administration/11-forges/10-overview.md [Forge]: ../../30-administration/11-forges/10-overview.md

View File

@ -388,7 +388,7 @@ Execute a step only on a pipeline with certain files being changed:
```yaml ```yaml
when: when:
- path: "src/*" - path: 'src/*'
``` ```
You can use [glob patterns](https://github.com/bmatcuk/doublestar#patterns) to match the changed files and specify if the step should run if a file matching that pattern has been changed `include` or if some files have **not** been changed `exclude`. You can use [glob patterns](https://github.com/bmatcuk/doublestar#patterns) to match the changed files and specify if the step should run if a file matching that pattern has been changed `include` or if some files have **not** been changed `exclude`.
@ -398,7 +398,7 @@ when:
- path: - path:
include: ['.woodpecker/*.yml', '*.ini'] include: ['.woodpecker/*.yml', '*.ini']
exclude: ['*.md', 'docs/**'] exclude: ['*.md', 'docs/**']
ignore_message: "[ALL]" ignore_message: '[ALL]'
``` ```
**Hint:** Passing a defined ignore-message like `[ALL]` inside the commit message will ignore all path conditions. **Hint:** Passing a defined ignore-message like `[ALL]` inside the commit message will ignore all path conditions.

View File

@ -37,7 +37,6 @@ steps:
+ from_secret: secret_token + from_secret: secret_token
``` ```
Please note parameter expressions are subject to pre-processing. When using secrets in parameter expressions they should be escaped. Please note parameter expressions are subject to pre-processing. When using secrets in parameter expressions they should be escaped.
```diff ```diff
@ -93,7 +92,7 @@ Please be careful when exposing secrets to pull requests. If your repository is
To prevent abusing your secrets with malicious pull requests, you can limit a secret to a list of images. They are not available to any other container. In addition, you can make the secret available only for plugins (steps without user-defined commands). To prevent abusing your secrets with malicious pull requests, you can limit a secret to a list of images. They are not available to any other container. In addition, you can make the secret available only for plugins (steps without user-defined commands).
:::warning :::warning
If you enable the option "Only available for plugins", always set an image filter too. Otherwise, the secret can be accessed by a very simple self-developed plugin and is thus *not* safe. If you enable the option "Only available for plugins", always set an image filter too. Otherwise, the secret can be accessed by a very simple self-developed plugin and is thus _not_ safe.
If you only set an image filter, you could still access the secret using the same image and by specifying a command that prints it. If you only set an image filter, you could still access the secret using the same image and by specifying a command that prints it.
::: :::

View File

@ -67,5 +67,3 @@ steps:
commands: commands:
- ./build.sh - ./build.sh
``` ```

View File

@ -41,6 +41,7 @@ There are also other plugin lists with additional plugins. Keep in mind that [Dr
- [Drone Plugins](http://plugins.drone.io) - [Drone Plugins](http://plugins.drone.io)
- [Geeklab Woodpecker Plugins](https://woodpecker-plugins.geekdocs.de/) - [Geeklab Woodpecker Plugins](https://woodpecker-plugins.geekdocs.de/)
::: :::
## Creating a plugin ## Creating a plugin

View File

@ -9,6 +9,7 @@ YAML has some advanced syntax features that can be used like variables to reduce
You can use [YAML anchors & aliases](https://yaml.org/spec/1.2.2/#3222-anchors-and-aliases) as variables in your pipeline config. You can use [YAML anchors & aliases](https://yaml.org/spec/1.2.2/#3222-anchors-and-aliases) as variables in your pipeline config.
To convert this: To convert this:
```yml ```yml
steps: steps:
test: test:
@ -107,8 +108,8 @@ steps:
init: init:
image: bash image: bash
commands: commands:
echo "FOO=hello" >> envvars - echo "FOO=hello" >> envvars
echo "BAR=world" >> envvars - echo "BAR=world" >> envvars
debug: debug:
image: bash image: bash

View File

@ -7,4 +7,3 @@ The chart contains two subcharts, `server` and `agent` which are automatically c
The chart started off with two independent charts but was merged into one to simplify the deployment at start of 2023. The chart started off with two independent charts but was merged into one to simplify the deployment at start of 2023.
A couple of backend-specific config env vars exists which are described in the [kubernetes backend docs](../22-backends/40-kubernetes.md). A couple of backend-specific config env vars exists which are described in the [kubernetes backend docs](../22-backends/40-kubernetes.md).

View File

@ -157,6 +157,7 @@ WOODPECKER_CUSTOM_CSS_FILE=/usr/local/www/woodpecker.js
The examples below show how to place a banner message in the top navigation bar of Woodpecker. The examples below show how to place a banner message in the top navigation bar of Woodpecker.
##### woodpecker.css ##### woodpecker.css
```css ```css
.banner-message { .banner-message {
position: absolute; position: absolute;
@ -175,44 +176,52 @@ The examples below show how to place a banner message in the top navigation bar
```javascript ```javascript
// place/copy a minified version of jQuery or ZeptoJS here ... // place/copy a minified version of jQuery or ZeptoJS here ...
!function(){"use strict";function e(){};/*...*/}(); !(function () {
'use strict';
function e() {} /*...*/
})();
$().ready(function () { $().ready(function () {
$(".app nav img").first().htmlAfter("<div class='banner-message'>This is a demo banner message :)</div>") $('.app nav img').first().htmlAfter("<div class='banner-message'>This is a demo banner message :)</div>");
}); });
``` ```
## All server configuration options ## All server configuration options
The following list describes all available server configuration options. The following list describes all available server configuration options.
### `WOODPECKER_LOG_LEVEL` ### `WOODPECKER_LOG_LEVEL`
> Default: empty > Default: empty
Configures the logging level. Possible values are `trace`, `debug`, `info`, `warn`, `error`, `fatal`, `panic`, `disabled` and empty. Configures the logging level. Possible values are `trace`, `debug`, `info`, `warn`, `error`, `fatal`, `panic`, `disabled` and empty.
### `WOODPECKER_LOG_XORM` ### `WOODPECKER_LOG_XORM`
> Default: `false` > Default: `false`
Enable XORM logs. Enable XORM logs.
### `WOODPECKER_LOG_XORM_SQL` ### `WOODPECKER_LOG_XORM_SQL`
> Default: `false` > Default: `false`
Enable XORM SQL command logs. Enable XORM SQL command logs.
### `WOODPECKER_DEBUG_PRETTY` ### `WOODPECKER_DEBUG_PRETTY`
> Default: `false` > Default: `false`
Enable pretty-printed debug output. Enable pretty-printed debug output.
### `WOODPECKER_DEBUG_NOCOLOR` ### `WOODPECKER_DEBUG_NOCOLOR`
> Default: `true` > Default: `true`
Disable colored debug output. Disable colored debug output.
### `WOODPECKER_HOST` ### `WOODPECKER_HOST`
> Default: empty > Default: empty
Server fully qualified URL of the user-facing hostname and path prefix. Server fully qualified URL of the user-facing hostname and path prefix.
@ -220,6 +229,7 @@ Server fully qualified URL of the user-facing hostname and path prefix.
Example: `WOODPECKER_HOST=http://woodpecker.example.org` or `WOODPECKER_HOST=http://example.org/woodpecker` Example: `WOODPECKER_HOST=http://woodpecker.example.org` or `WOODPECKER_HOST=http://example.org/woodpecker`
### `WOODPECKER_WEBHOOK_HOST` ### `WOODPECKER_WEBHOOK_HOST`
> Default: value from `WOODPECKER_HOST` config env > Default: value from `WOODPECKER_HOST` config env
Server fully qualified URL of the Webhook-facing hostname and path prefix. Server fully qualified URL of the Webhook-facing hostname and path prefix.
@ -227,16 +237,19 @@ Server fully qualified URL of the Webhook-facing hostname and path prefix.
Example: `WOODPECKER_WEBHOOK_HOST=http://woodpecker-server.cicd.svc.cluster.local:8000` Example: `WOODPECKER_WEBHOOK_HOST=http://woodpecker-server.cicd.svc.cluster.local:8000`
### `WOODPECKER_SERVER_ADDR` ### `WOODPECKER_SERVER_ADDR`
> Default: `:8000` > Default: `:8000`
Configures the HTTP listener port. Configures the HTTP listener port.
### `WOODPECKER_SERVER_ADDR_TLS` ### `WOODPECKER_SERVER_ADDR_TLS`
> Default: `:443` > Default: `:443`
Configures the HTTPS listener port when SSL is enabled. Configures the HTTPS listener port when SSL is enabled.
### `WOODPECKER_SERVER_CERT` ### `WOODPECKER_SERVER_CERT`
> Default: empty > Default: empty
Path to an SSL certificate used by the server to accept HTTPS requests. Path to an SSL certificate used by the server to accept HTTPS requests.
@ -244,6 +257,7 @@ Path to an SSL certificate used by the server to accept HTTPS requests.
Example: `WOODPECKER_SERVER_CERT=/path/to/cert.pem` Example: `WOODPECKER_SERVER_CERT=/path/to/cert.pem`
### `WOODPECKER_SERVER_KEY` ### `WOODPECKER_SERVER_KEY`
> Default: empty > Default: empty
Path to an SSL certificate key used by the server to accept HTTPS requests. Path to an SSL certificate key used by the server to accept HTTPS requests.
@ -251,6 +265,7 @@ Path to an SSL certificate key used by the server to accept HTTPS requests.
Example: `WOODPECKER_SERVER_KEY=/path/to/key.pem` Example: `WOODPECKER_SERVER_KEY=/path/to/key.pem`
### `WOODPECKER_CUSTOM_CSS_FILE` ### `WOODPECKER_CUSTOM_CSS_FILE`
> Default: empty > Default: empty
File path for the server to serve a custom .CSS file, used for customizing the UI. File path for the server to serve a custom .CSS file, used for customizing the UI.
@ -260,6 +275,7 @@ The file must be UTF-8 encoded, to ensure all special characters are preserved.
Example: `WOODPECKER_CUSTOM_CSS_FILE=/usr/local/www/woodpecker.css` Example: `WOODPECKER_CUSTOM_CSS_FILE=/usr/local/www/woodpecker.css`
### `WOODPECKER_CUSTOM_JS_FILE` ### `WOODPECKER_CUSTOM_JS_FILE`
> Default: empty > Default: empty
File path for the server to serve a custom .JS file, used for customizing the UI. File path for the server to serve a custom .JS file, used for customizing the UI.
@ -269,26 +285,31 @@ The file must be UTF-8 encoded, to ensure all special characters are preserved.
Example: `WOODPECKER_CUSTOM_JS_FILE=/usr/local/www/woodpecker.js` Example: `WOODPECKER_CUSTOM_JS_FILE=/usr/local/www/woodpecker.js`
### `WOODPECKER_LETS_ENCRYPT` ### `WOODPECKER_LETS_ENCRYPT`
> Default: `false` > Default: `false`
Automatically generates an SSL certificate using Let's Encrypt, and configures the server to accept HTTPS requests. Automatically generates an SSL certificate using Let's Encrypt, and configures the server to accept HTTPS requests.
### `WOODPECKER_GRPC_ADDR` ### `WOODPECKER_GRPC_ADDR`
> Default: `:9000` > Default: `:9000`
Configures the gRPC listener port. Configures the gRPC listener port.
### `WOODPECKER_GRPC_SECRET` ### `WOODPECKER_GRPC_SECRET`
> Default: `secret` > Default: `secret`
Configures the gRPC JWT secret. Configures the gRPC JWT secret.
### `WOODPECKER_GRPC_SECRET_FILE` ### `WOODPECKER_GRPC_SECRET_FILE`
> Default: empty > Default: empty
Read the value for `WOODPECKER_GRPC_SECRET` from the specified filepath. Read the value for `WOODPECKER_GRPC_SECRET` from the specified filepath.
### `WOODPECKER_METRICS_SERVER_ADDR` ### `WOODPECKER_METRICS_SERVER_ADDR`
> Default: empty > Default: empty
Configures an unprotected metrics endpoint. An empty value disables the metrics endpoint completely. Configures an unprotected metrics endpoint. An empty value disables the metrics endpoint completely.
@ -296,6 +317,7 @@ Configures an unprotected metrics endpoint. An empty value disables the metrics
Example: `:9001` Example: `:9001`
### `WOODPECKER_ADMIN` ### `WOODPECKER_ADMIN`
> Default: empty > Default: empty
Comma-separated list of admin accounts. Comma-separated list of admin accounts.
@ -303,6 +325,7 @@ Comma-separated list of admin accounts.
Example: `WOODPECKER_ADMIN=user1,user2` Example: `WOODPECKER_ADMIN=user1,user2`
### `WOODPECKER_ORGS` ### `WOODPECKER_ORGS`
> Default: empty > Default: empty
Comma-separated list of approved organizations. Comma-separated list of approved organizations.
@ -310,6 +333,7 @@ Comma-separated list of approved organizations.
Example: `org1,org2` Example: `org1,org2`
### `WOODPECKER_REPO_OWNERS` ### `WOODPECKER_REPO_OWNERS`
> Default: empty > Default: empty
Comma-separated list of syncable repo owners. ??? Comma-separated list of syncable repo owners. ???
@ -317,41 +341,49 @@ Comma-separated list of syncable repo owners. ???
Example: `user1,user2` Example: `user1,user2`
### `WOODPECKER_OPEN` ### `WOODPECKER_OPEN`
> Default: `false` > Default: `false`
Enable to allow user registration. Enable to allow user registration.
### `WOODPECKER_DOCS` ### `WOODPECKER_DOCS`
> Default: `https://woodpecker-ci.org/` > Default: `https://woodpecker-ci.org/`
Link to documentation in the UI. Link to documentation in the UI.
### `WOODPECKER_AUTHENTICATE_PUBLIC_REPOS` ### `WOODPECKER_AUTHENTICATE_PUBLIC_REPOS`
> Default: `false` > Default: `false`
Always use authentication to clone repositories even if they are public. Needed if the forge requires to always authenticate as used by many companies. Always use authentication to clone repositories even if they are public. Needed if the forge requires to always authenticate as used by many companies.
### `WOODPECKER_DEFAULT_CANCEL_PREVIOUS_PIPELINE_EVENTS` ### `WOODPECKER_DEFAULT_CANCEL_PREVIOUS_PIPELINE_EVENTS`
> Default: `pull_request, push` > Default: `pull_request, push`
List of event names that will be canceled when a new pipeline for the same context (tag, branch) is created. List of event names that will be canceled when a new pipeline for the same context (tag, branch) is created.
### `WOODPECKER_DEFAULT_CLONE_IMAGE` ### `WOODPECKER_DEFAULT_CLONE_IMAGE`
> Default is defined in [shared/constant/constant.go](https://github.com/woodpecker-ci/woodpecker/blob/main/shared/constant/constant.go) > Default is defined in [shared/constant/constant.go](https://github.com/woodpecker-ci/woodpecker/blob/main/shared/constant/constant.go)
The default docker image to be used when cloning the repo The default docker image to be used when cloning the repo
### `WOODPECKER_DEFAULT_PIPELINE_TIMEOUT` ### `WOODPECKER_DEFAULT_PIPELINE_TIMEOUT`
> 60 (minutes) > 60 (minutes)
The default time for a repo in minutes before a pipeline gets killed The default time for a repo in minutes before a pipeline gets killed
### `WOODPECKER_MAX_PIPELINE_TIMEOUT` ### `WOODPECKER_MAX_PIPELINE_TIMEOUT`
> 120 (minutes) > 120 (minutes)
The maximum time in minutes you can set in the repo settings before a pipeline gets killed The maximum time in minutes you can set in the repo settings before a pipeline gets killed
### `WOODPECKER_SESSION_EXPIRES` ### `WOODPECKER_SESSION_EXPIRES`
> Default: `72h` > Default: `72h`
Configures the session expiration time. Configures the session expiration time.
@ -360,6 +392,7 @@ As long as the session is valid (until it expires or log-out),
a user can log into Woodpecker, without re-authentication. a user can log into Woodpecker, without re-authentication.
### `WOODPECKER_ESCALATE` ### `WOODPECKER_ESCALATE`
> Defaults are defined in [shared/constant/constant.go](https://github.com/woodpecker-ci/woodpecker/blob/main/shared/constant/constant.go) > Defaults are defined in [shared/constant/constant.go](https://github.com/woodpecker-ci/woodpecker/blob/main/shared/constant/constant.go)
Docker images to run in privileged mode. Only change if you are sure what you do! Docker images to run in privileged mode. Only change if you are sure what you do!
@ -374,6 +407,7 @@ Example: `WOODPECKER_VOLUME=/path/on/host:/path/in/container:rw`|
--> -->
### `WOODPECKER_DOCKER_CONFIG` ### `WOODPECKER_DOCKER_CONFIG`
> Default: empty > Default: empty
Configures a specific private registry config for all pipelines. Configures a specific private registry config for all pipelines.
@ -395,16 +429,19 @@ Example: `WOODPECKER_NETWORK=network1,network2`
--> -->
### `WOODPECKER_AGENT_SECRET` ### `WOODPECKER_AGENT_SECRET`
> Default: empty > Default: empty
A shared secret used by server and agents to authenticate communication. A secret can be generated by `openssl rand -hex 32`. A shared secret used by server and agents to authenticate communication. A secret can be generated by `openssl rand -hex 32`.
### `WOODPECKER_AGENT_SECRET_FILE` ### `WOODPECKER_AGENT_SECRET_FILE`
> Default: empty > Default: empty
Read the value for `WOODPECKER_AGENT_SECRET` from the specified filepath Read the value for `WOODPECKER_AGENT_SECRET` from the specified filepath
### `WOODPECKER_KEEPALIVE_MIN_TIME` ### `WOODPECKER_KEEPALIVE_MIN_TIME`
> Default: empty > Default: empty
Server-side enforcement policy on the minimum amount of time a client should wait before sending a keepalive ping. Server-side enforcement policy on the minimum amount of time a client should wait before sending a keepalive ping.
@ -412,16 +449,19 @@ Server-side enforcement policy on the minimum amount of time a client should wai
Example: `WOODPECKER_KEEPALIVE_MIN_TIME=10s` Example: `WOODPECKER_KEEPALIVE_MIN_TIME=10s`
### `WOODPECKER_DATABASE_DRIVER` ### `WOODPECKER_DATABASE_DRIVER`
> Default: `sqlite3` > Default: `sqlite3`
The database driver name. Possible values are `sqlite3`, `mysql` or `postgres`. The database driver name. Possible values are `sqlite3`, `mysql` or `postgres`.
### `WOODPECKER_DATABASE_DATASOURCE` ### `WOODPECKER_DATABASE_DATASOURCE`
> Default: `woodpecker.sqlite` > Default: `woodpecker.sqlite`
The database connection string. The default value is the path of the embedded SQLite database file. The database connection string. The default value is the path of the embedded SQLite database file.
Example: Example:
```bash ```bash
# MySQL # MySQL
# https://github.com/go-sql-driver/mysql#dsn-data-source-name # https://github.com/go-sql-driver/mysql#dsn-data-source-name
@ -433,47 +473,56 @@ WOODPECKER_DATABASE_DATASOURCE=postgres://root:password@1.2.3.4:5432/woodpecker?
``` ```
### `WOODPECKER_DATABASE_DATASOURCE_FILE` ### `WOODPECKER_DATABASE_DATASOURCE_FILE`
> Default: empty > Default: empty
Read the value for `WOODPECKER_DATABASE_DATASOURCE` from the specified filepath Read the value for `WOODPECKER_DATABASE_DATASOURCE` from the specified filepath
### `WOODPECKER_ENCRYPTION_KEY` ### `WOODPECKER_ENCRYPTION_KEY`
> Default: empty > Default: empty
Encryption key used to encrypt secrets in DB. See [secrets encryption](./40-encryption.md) Encryption key used to encrypt secrets in DB. See [secrets encryption](./40-encryption.md)
### `WOODPECKER_ENCRYPTION_KEY_FILE` ### `WOODPECKER_ENCRYPTION_KEY_FILE`
> Default: empty > Default: empty
Read the value for `WOODPECKER_ENCRYPTION_KEY` from the specified filepath Read the value for `WOODPECKER_ENCRYPTION_KEY` from the specified filepath
### `WOODPECKER_ENCRYPTION_TINK_KEYSET_FILE` ### `WOODPECKER_ENCRYPTION_TINK_KEYSET_FILE`
> Default: empty > Default: empty
Filepath to encryption keyset used to encrypt secrets in DB. See [secrets encryption](./40-encryption.md) Filepath to encryption keyset used to encrypt secrets in DB. See [secrets encryption](./40-encryption.md)
### `WOODPECKER_ENCRYPTION_DISABLE` ### `WOODPECKER_ENCRYPTION_DISABLE`
> Default: empty > Default: empty
Boolean flag to decrypt secrets in DB and disable server encryption. See [secrets encryption](./40-encryption.md) Boolean flag to decrypt secrets in DB and disable server encryption. See [secrets encryption](./40-encryption.md)
### `WOODPECKER_PROMETHEUS_AUTH_TOKEN` ### `WOODPECKER_PROMETHEUS_AUTH_TOKEN`
> Default: empty > Default: empty
Token to secure the Prometheus metrics endpoint. Token to secure the Prometheus metrics endpoint.
Must be set to enable the endpoint. Must be set to enable the endpoint.
### `WOODPECKER_PROMETHEUS_AUTH_TOKEN_FILE` ### `WOODPECKER_PROMETHEUS_AUTH_TOKEN_FILE`
> Default: empty > Default: empty
Read the value for `WOODPECKER_PROMETHEUS_AUTH_TOKEN` from the specified filepath Read the value for `WOODPECKER_PROMETHEUS_AUTH_TOKEN` from the specified filepath
### `WOODPECKER_STATUS_CONTEXT` ### `WOODPECKER_STATUS_CONTEXT`
> Default: `ci/woodpecker` > Default: `ci/woodpecker`
Context prefix Woodpecker will use to publish status messages to SCM. You probably will only need to change it if you run multiple Woodpecker instances for a single repository. Context prefix Woodpecker will use to publish status messages to SCM. You probably will only need to change it if you run multiple Woodpecker instances for a single repository.
### `WOODPECKER_STATUS_CONTEXT_FORMAT` ### `WOODPECKER_STATUS_CONTEXT_FORMAT`
> Default: `{{ .context }}/{{ .event }}/{{ .workflow }}` > Default: `{{ .context }}/{{ .event }}/{{ .workflow }}`
Template for the status messages published to forges, uses [Go templates](https://pkg.go.dev/text/template) as template language. Template for the status messages published to forges, uses [Go templates](https://pkg.go.dev/text/template) as template language.
@ -488,50 +537,57 @@ Supported variables:
--- ---
### `WOODPECKER_LIMIT_MEM_SWAP` ### `WOODPECKER_LIMIT_MEM_SWAP`
> Default: `0` > Default: `0`
The maximum amount of memory a single pipeline container is allowed to swap to disk, configured in bytes. There is no limit if `0`. The maximum amount of memory a single pipeline container is allowed to swap to disk, configured in bytes. There is no limit if `0`.
### `WOODPECKER_LIMIT_MEM` ### `WOODPECKER_LIMIT_MEM`
> Default: `0` > Default: `0`
The maximum amount of memory a single pipeline container can use, configured in bytes. There is no limit if `0`. The maximum amount of memory a single pipeline container can use, configured in bytes. There is no limit if `0`.
### `WOODPECKER_LIMIT_SHM_SIZE` ### `WOODPECKER_LIMIT_SHM_SIZE`
> Default: `0` > Default: `0`
The maximum amount of memory of `/dev/shm` allowed in bytes. There is no limit if `0`. The maximum amount of memory of `/dev/shm` allowed in bytes. There is no limit if `0`.
### `WOODPECKER_LIMIT_CPU_QUOTA` ### `WOODPECKER_LIMIT_CPU_QUOTA`
> Default: `0` > Default: `0`
The number of microseconds per CPU period that the container is limited to before throttled. There is no limit if `0`. The number of microseconds per CPU period that the container is limited to before throttled. There is no limit if `0`.
### `WOODPECKER_LIMIT_CPU_SHARES` ### `WOODPECKER_LIMIT_CPU_SHARES`
> Default: `0` > Default: `0`
The relative weight vs. other containers. The relative weight vs. other containers.
### `WOODPECKER_LIMIT_CPU_SET` ### `WOODPECKER_LIMIT_CPU_SET`
> Default: empty > Default: empty
Comma-separated list to limit the specific CPUs or cores a pipeline container can use. Comma-separated list to limit the specific CPUs or cores a pipeline container can use.
Example: `WOODPECKER_LIMIT_CPU_SET=1,2` Example: `WOODPECKER_LIMIT_CPU_SET=1,2`
### `WOODPECKER_CONFIG_SERVICE_ENDPOINT` ### `WOODPECKER_CONFIG_SERVICE_ENDPOINT`
> Default: `` > Default: ``
Specify a configuration service endpoint, see [Configuration Extension](./100-external-configuration-api.md) Specify a configuration service endpoint, see [Configuration Extension](./100-external-configuration-api.md)
### `WOODPECKER_FORGE_TIMEOUT` ### `WOODPECKER_FORGE_TIMEOUT`
> Default: 3sec > Default: 3sec
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` ### `WOODPECKER_ROOT_PATH`
> Default: extracted from `WOODPECKER_HOST` > Default: extracted from `WOODPECKER_HOST`
Server URL path prefix (used for statics loading when having a url path prefix), should start with `/` Server URL path prefix (used for statics loading when having a url path prefix), should start with `/`
@ -539,6 +595,7 @@ Server URL path prefix (used for statics loading when having a url path prefix),
Example: `WOODPECKER_ROOT_PATH=/woodpecker` Example: `WOODPECKER_ROOT_PATH=/woodpecker`
### `WOODPECKER_ENABLE_SWAGGER` ### `WOODPECKER_ENABLE_SWAGGER`
> Default: true > Default: true
Enable the Swagger UI for API documentation. Enable the Swagger UI for API documentation.

View File

@ -56,9 +56,7 @@ WOODPECKER_CONFIG_SERVICE_ENDPOINT=https://example.com/ciconfig
"author_avatar": "https://myforge.com/avatars/d6b3f7787a685fcdf2a44e2c685c7e03", "author_avatar": "https://myforge.com/avatars/d6b3f7787a685fcdf2a44e2c685c7e03",
"author_email": "my@email.com", "author_email": "my@email.com",
"branch": "main", "branch": "main",
"changed_files": [ "changed_files": ["somefilename.txt"],
"somefilename.txt"
],
"commit": "2fff90f8d288a4640e90f05049fe30e61a14fd50", "commit": "2fff90f8d288a4640e90f05049fe30e61a14fd50",
"created_at": 0, "created_at": 0,
"deploy_to": "", "deploy_to": "",

View File

@ -3,7 +3,7 @@
## Supported features ## Supported features
| Feature | [GitHub](github/) | [Gitea / Forgejo](gitea/) | [Gitlab](gitlab/) | [Bitbucket](bitbucket/) | | Feature | [GitHub](github/) | [Gitea / Forgejo](gitea/) | [Gitlab](gitlab/) | [Bitbucket](bitbucket/) |
| --- | :---: | :---: | :---: | :---: | | ------------------------------------------------------------- | :----------------: | :-----------------------: | :----------------: | :---------------------: |
| Event: Push | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | Event: Push | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Event: Tag | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | Event: Tag | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Event: Pull-Request | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | Event: Pull-Request | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |

View File

@ -25,51 +25,59 @@ services:
Register your application with Gitea to create your client id and secret. You can find the OAuth applications settings of Gitea at `https://gitea.<host>/user/settings/`. It is very import the authorization callback URL matches your http(s) scheme and hostname exactly with `https://<host>/authorize` as the path. Register your application with Gitea to create your client id and secret. You can find the OAuth applications settings of Gitea at `https://gitea.<host>/user/settings/`. It is very import the authorization callback URL matches your http(s) scheme and hostname exactly with `https://<host>/authorize` as the path.
If you run the Woodpecker CI server on the same host as the Gitea instance, you might also need to allow local connections in Gitea, since version `v1.16`. Otherwise webhooks will fail. Add the following lines to your Gitea configuration (usually at `/etc/gitea/conf/app.ini`). If you run the Woodpecker CI server on the same host as the Gitea instance, you might also need to allow local connections in Gitea, since version `v1.16`. Otherwise webhooks will fail. Add the following lines to your Gitea configuration (usually at `/etc/gitea/conf/app.ini`).
```ini ```ini
... ...
[webhook] [webhook]
ALLOWED_HOST_LIST=external,loopback ALLOWED_HOST_LIST=external,loopback
``` ```
For reference see [Configuration Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/#webhook-webhook). For reference see [Configuration Cheat Sheet](https://docs.gitea.io/en-us/config-cheat-sheet/#webhook-webhook).
![gitea oauth setup](gitea_oauth.gif) ![gitea oauth setup](gitea_oauth.gif)
## Configuration ## Configuration
This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations. This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations.
### `WOODPECKER_GITEA` ### `WOODPECKER_GITEA`
> Default: `false` > Default: `false`
Enables the Gitea driver. Enables the Gitea driver.
### `WOODPECKER_GITEA_URL` ### `WOODPECKER_GITEA_URL`
> Default: `https://try.gitea.io` > Default: `https://try.gitea.io`
Configures the Gitea server address. Configures the Gitea server address.
### `WOODPECKER_GITEA_CLIENT` ### `WOODPECKER_GITEA_CLIENT`
> Default: empty > Default: empty
Configures the Gitea OAuth client id. This is used to authorize access. Configures the Gitea OAuth client id. This is used to authorize access.
### `WOODPECKER_GITEA_CLIENT_FILE` ### `WOODPECKER_GITEA_CLIENT_FILE`
> Default: empty > Default: empty
Read the value for `WOODPECKER_GITEA_CLIENT` from the specified filepath Read the value for `WOODPECKER_GITEA_CLIENT` from the specified filepath
### `WOODPECKER_GITEA_SECRET` ### `WOODPECKER_GITEA_SECRET`
> Default: empty > Default: empty
Configures the Gitea OAuth client secret. This is used to authorize access. Configures the Gitea OAuth client secret. This is used to authorize access.
### `WOODPECKER_GITEA_SECRET_FILE` ### `WOODPECKER_GITEA_SECRET_FILE`
> Default: empty > Default: empty
Read the value for `WOODPECKER_GITEA_SECRET` from the specified filepath Read the value for `WOODPECKER_GITEA_SECRET` from the specified filepath
### `WOODPECKER_GITEA_SKIP_VERIFY` ### `WOODPECKER_GITEA_SKIP_VERIFY`
> Default: `false` > Default: `false`
Configure if SSL verification should be skipped. Configure if SSL verification should be skipped.

View File

@ -32,36 +32,43 @@ If you run the Woodpecker CI server on a private IP (RFC1918) or use a non stand
This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations. This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations.
### `WOODPECKER_GITLAB` ### `WOODPECKER_GITLAB`
> Default: `false` > Default: `false`
Enables the GitLab driver. Enables the GitLab driver.
### `WOODPECKER_GITLAB_URL` ### `WOODPECKER_GITLAB_URL`
> Default: `https://gitlab.com` > Default: `https://gitlab.com`
Configures the GitLab server address. Configures the GitLab server address.
### `WOODPECKER_GITLAB_CLIENT` ### `WOODPECKER_GITLAB_CLIENT`
> Default: empty > Default: empty
Configures the GitLab OAuth client id. This is used to authorize access. Configures the GitLab OAuth client id. This is used to authorize access.
### `WOODPECKER_GITLAB_CLIENT_FILE` ### `WOODPECKER_GITLAB_CLIENT_FILE`
> Default: empty > Default: empty
Read the value for `WOODPECKER_GITLAB_CLIENT` from the specified filepath Read the value for `WOODPECKER_GITLAB_CLIENT` from the specified filepath
### `WOODPECKER_GITLAB_SECRET` ### `WOODPECKER_GITLAB_SECRET`
> Default: empty > Default: empty
Configures the GitLab OAuth client secret. This is used to authorize access. Configures the GitLab OAuth client secret. This is used to authorize access.
### `WOODPECKER_GITLAB_SECRET_FILE` ### `WOODPECKER_GITLAB_SECRET_FILE`
> Default: empty > Default: empty
Read the value for `WOODPECKER_GITLAB_SECRET` from the specified filepath Read the value for `WOODPECKER_GITLAB_SECRET` from the specified filepath
### `WOODPECKER_GITLAB_SKIP_VERIFY` ### `WOODPECKER_GITLAB_SKIP_VERIFY`
> Default: `false` > Default: `false`
Configure if SSL verification should be skipped. Configure if SSL verification should be skipped.

View File

@ -49,26 +49,31 @@ Webhooks: Read and Write
This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations. This is a full list of configuration options. Please note that many of these options use default configuration values that should work for the majority of installations.
### `WOODPECKER_BITBUCKET` ### `WOODPECKER_BITBUCKET`
> Default: `false` > Default: `false`
Enables the Bitbucket driver. Enables the Bitbucket driver.
### `WOODPECKER_BITBUCKET_CLIENT` ### `WOODPECKER_BITBUCKET_CLIENT`
> Default: empty > Default: empty
Configures the Bitbucket OAuth client key. This is used to authorize access. Configures the Bitbucket OAuth client key. This is used to authorize access.
### `WOODPECKER_BITBUCKET_CLIENT_FILE` ### `WOODPECKER_BITBUCKET_CLIENT_FILE`
> Default: empty > Default: empty
Read the value for `WOODPECKER_BITBUCKET_CLIENT` from the specified filepath Read the value for `WOODPECKER_BITBUCKET_CLIENT` from the specified filepath
### `WOODPECKER_BITBUCKET_SECRET` ### `WOODPECKER_BITBUCKET_SECRET`
> Default: empty > Default: empty
Configures the Bitbucket OAuth client secret. This is used to authorize access. Configures the Bitbucket OAuth client secret. This is used to authorize access.
### `WOODPECKER_BITBUCKET_SECRET_FILE` ### `WOODPECKER_BITBUCKET_SECRET_FILE`
> Default: empty > Default: empty
Read the value for `WOODPECKER_BITBUCKET_SECRET` from the specified filepath Read the value for `WOODPECKER_BITBUCKET_SECRET` from the specified filepath

View File

@ -73,91 +73,109 @@ To get an _agent token_ you have to register the agent manually in the server us
Here is the full list of configuration options and their default variables. Here is the full list of configuration options and their default variables.
### `WOODPECKER_SERVER` ### `WOODPECKER_SERVER`
> Default: `localhost:9000` > Default: `localhost:9000`
Configures gRPC address of the server. Configures gRPC address of the server.
### `WOODPECKER_USERNAME` ### `WOODPECKER_USERNAME`
> Default: `x-oauth-basic` > Default: `x-oauth-basic`
The gRPC username. The gRPC username.
### `WOODPECKER_AGENT_SECRET` ### `WOODPECKER_AGENT_SECRET`
> Default: empty > Default: empty
A shared secret used by server and agents to authenticate communication. A secret can be generated by `openssl rand -hex 32`. A shared secret used by server and agents to authenticate communication. A secret can be generated by `openssl rand -hex 32`.
### `WOODPECKER_AGENT_SECRET_FILE` ### `WOODPECKER_AGENT_SECRET_FILE`
> Default: empty > Default: empty
Read the value for `WOODPECKER_AGENT_SECRET` from the specified filepath, e.g. `/etc/woodpecker/agent-secret.conf` Read the value for `WOODPECKER_AGENT_SECRET` from the specified filepath, e.g. `/etc/woodpecker/agent-secret.conf`
### `WOODPECKER_LOG_LEVEL` ### `WOODPECKER_LOG_LEVEL`
> Default: empty > Default: empty
Configures the logging level. Possible values are `trace`, `debug`, `info`, `warn`, `error`, `fatal`, `panic`, `disabled` and empty. Configures the logging level. Possible values are `trace`, `debug`, `info`, `warn`, `error`, `fatal`, `panic`, `disabled` and empty.
### `WOODPECKER_DEBUG_PRETTY` ### `WOODPECKER_DEBUG_PRETTY`
> Default: `false` > Default: `false`
Enable pretty-printed debug output. Enable pretty-printed debug output.
### `WOODPECKER_DEBUG_NOCOLOR` ### `WOODPECKER_DEBUG_NOCOLOR`
> Default: `true` > Default: `true`
Disable colored debug output. Disable colored debug output.
### `WOODPECKER_HOSTNAME` ### `WOODPECKER_HOSTNAME`
> Default: empty > Default: empty
Configures the agent hostname. Configures the agent hostname.
### `WOODPECKER_AGENT_CONFIG_FILE` ### `WOODPECKER_AGENT_CONFIG_FILE`
> Default: `/etc/woodpecker/agent.conf` > Default: `/etc/woodpecker/agent.conf`
Configures the path of the agent config file. Configures the path of the agent config file.
### `WOODPECKER_MAX_WORKFLOWS` ### `WOODPECKER_MAX_WORKFLOWS`
> Default: `1` > Default: `1`
Configures the number of parallel workflows. Configures the number of parallel workflows.
### `WOODPECKER_FILTER_LABELS` ### `WOODPECKER_FILTER_LABELS`
> Default: empty > Default: empty
Configures labels to filter pipeline pick up. Use a list of key-value pairs like `key=value,second-key=*`. `*` can be used as a wildcard. By default, agents provide three additional labels `platform=os/arch`, `hostname=my-agent` and `repo=*` which can be overwritten if needed. To learn how labels work, check out the [pipeline syntax page](../20-usage/20-workflow-syntax.md#labels). Configures labels to filter pipeline pick up. Use a list of key-value pairs like `key=value,second-key=*`. `*` can be used as a wildcard. By default, agents provide three additional labels `platform=os/arch`, `hostname=my-agent` and `repo=*` which can be overwritten if needed. To learn how labels work, check out the [pipeline syntax page](../20-usage/20-workflow-syntax.md#labels).
### `WOODPECKER_HEALTHCHECK` ### `WOODPECKER_HEALTHCHECK`
> Default: `true` > Default: `true`
Enable healthcheck endpoint. Enable healthcheck endpoint.
### `WOODPECKER_HEALTHCHECK_ADDR` ### `WOODPECKER_HEALTHCHECK_ADDR`
> Default: `:3000` > Default: `:3000`
Configures healthcheck endpoint address. Configures healthcheck endpoint address.
### `WOODPECKER_KEEPALIVE_TIME` ### `WOODPECKER_KEEPALIVE_TIME`
> Default: empty > Default: empty
After a duration of this time of no activity, the agent pings the server to check if the transport is still alive. After a duration of this time of no activity, the agent pings the server to check if the transport is still alive.
### `WOODPECKER_KEEPALIVE_TIMEOUT` ### `WOODPECKER_KEEPALIVE_TIMEOUT`
> Default: `20s` > Default: `20s`
After pinging for a keepalive check, the agent waits for a duration of this time before closing the connection if no activity. After pinging for a keepalive check, the agent waits for a duration of this time before closing the connection if no activity.
### `WOODPECKER_GRPC_SECURE` ### `WOODPECKER_GRPC_SECURE`
> Default: `false` > Default: `false`
Configures if the connection to `WOODPECKER_SERVER` should be made using a secure transport. Configures if the connection to `WOODPECKER_SERVER` should be made using a secure transport.
### `WOODPECKER_GRPC_VERIFY` ### `WOODPECKER_GRPC_VERIFY`
> Default: `true` > Default: `true`
Configures if the gRPC server certificate should be verified, only valid when `WOODPECKER_GRPC_SECURE` is `true`. Configures if the gRPC server certificate should be verified, only valid when `WOODPECKER_GRPC_SECURE` is `true`.
### `WOODPECKER_BACKEND` ### `WOODPECKER_BACKEND`
> Default: `auto-detect` > Default: `auto-detect`
Configures the backend engine to run pipelines on. Possible values are `auto-detect`, `docker`, `local` or `kubernetes`. Configures the backend engine to run pipelines on. Possible values are `auto-detect`, `docker`, `local` or `kubernetes`.

View File

@ -5,16 +5,19 @@ This is the original backend used with Woodpecker. The docker backend executes e
## Configuration ## Configuration
### `WOODPECKER_BACKEND_DOCKER_NETWORK` ### `WOODPECKER_BACKEND_DOCKER_NETWORK`
> Default: empty > Default: empty
Set to the name of an existing network which will be attached to all your pipeline containers (steps). Please be careful as this allows the containers of different pipelines to access each other! Set to the name of an existing network which will be attached to all your pipeline containers (steps). Please be careful as this allows the containers of different pipelines to access each other!
### `WOODPECKER_BACKEND_DOCKER_ENABLE_IPV6` ### `WOODPECKER_BACKEND_DOCKER_ENABLE_IPV6`
> Default: `false` > Default: `false`
Enable IPv6 for the networks used by pipeline containers (steps). Make sure you configured your docker daemon to support IPv6. Enable IPv6 for the networks used by pipeline containers (steps). Make sure you configured your docker daemon to support IPv6.
### `WOODPECKER_BACKEND_DOCKER_VOLUMES` ### `WOODPECKER_BACKEND_DOCKER_VOLUMES`
> Default: empty > Default: empty
List of default volumes separated by comma to be mounted to all pipeline containers (steps). For example to use custom CA List of default volumes separated by comma to be mounted to all pipeline containers (steps). For example to use custom CA

View File

@ -77,15 +77,13 @@ manual clone step.
The `image` entry is used to specify the shell, such as Bash or Fish, that is The `image` entry is used to specify the shell, such as Bash or Fish, that is
used to run the commands. used to run the commands.
```yaml ```yaml
# .woodpecker.yml # .woodpecker.yml
steps: steps:
build: build:
image: bash image: bash
commands: commands: [...]
[...]
``` ```
### Plugins as Executable Binaries ### Plugins as Executable Binaries
@ -123,7 +121,5 @@ only run on this agent:
labels: labels:
type: exec type: exec
steps: steps: [...]
[...]
``` ```

View File

@ -134,10 +134,10 @@ steps:
nodeSelector: nodeSelector:
beta.kubernetes.io/instance-type: p3.8xlarge beta.kubernetes.io/instance-type: p3.8xlarge
tolerations: tolerations:
- key: "key1" - key: 'key1'
operator: "Equal" operator: 'Equal'
value: "value1" value: 'value1'
effect: "NoSchedule" effect: 'NoSchedule'
tolerationSeconds: 3600 tolerationSeconds: 3600
``` ```
@ -166,8 +166,8 @@ CRI-O users currently need to configure the workspace for all workflows in order
```yml ```yml
workspace: workspace:
base: "/woodpecker" base: '/woodpecker'
path: "/" path: '/'
``` ```
See [this issue](https://github.com/woodpecker-ci/woodpecker/issues/2510) for more details. See [this issue](https://github.com/woodpecker-ci/woodpecker/issues/2510) for more details.

View File

@ -4,10 +4,11 @@
Secrets encryption is currently broken and therefore disabled by default. It will be fixed in an upcoming release. Secrets encryption is currently broken and therefore disabled by default. It will be fixed in an upcoming release.
Check: Check:
- https://github.com/woodpecker-ci/woodpecker/issues/1541 and - https://github.com/woodpecker-ci/woodpecker/issues/1541 and
- https://github.com/woodpecker-ci/woodpecker/pull/2300 - https://github.com/woodpecker-ci/woodpecker/pull/2300
:::
:::
By default, Woodpecker does not encrypt secrets in its database. You can enable encryption By default, Woodpecker does not encrypt secrets in its database. You can enable encryption
using simple AES key or more advanced [Google TINK](https://developers.google.com/tink) encryption. using simple AES key or more advanced [Google TINK](https://developers.google.com/tink) encryption.
@ -31,25 +32,31 @@ enabled encryption method, and `WOODPECKER_ENCRYPTION_DISABLE` set to true.
After secrets was decrypted server will proceed working in unencrypted mode. You will not need to use "disable encryption" After secrets was decrypted server will proceed working in unencrypted mode. You will not need to use "disable encryption"
variable or encryption keys to start server anymore. variable or encryption keys to start server anymore.
## AES ## AES
Simple AES encryption. Simple AES encryption.
### Configuration ### Configuration
You can manage encryption on server using these environment variables: You can manage encryption on server using these environment variables:
- `WOODPECKER_ENCRYPTION_KEY` - encryption key - `WOODPECKER_ENCRYPTION_KEY` - encryption key
- `WOODPECKER_ENCRYPTION_KEY_FILE` - file to read encryption key from - `WOODPECKER_ENCRYPTION_KEY_FILE` - file to read encryption key from
- `WOODPECKER_ENCRYPTION_DISABLE` - disable encryption flag used to decrypt all data on server - `WOODPECKER_ENCRYPTION_DISABLE` - disable encryption flag used to decrypt all data on server
## TINK ## TINK
TINK uses AEAD encryption instead of simple AES and supports key rotation. TINK uses AEAD encryption instead of simple AES and supports key rotation.
### Configuration ### Configuration
You can manage encryption on server using these two environment variables: You can manage encryption on server using these two environment variables:
- `WOODPECKER_ENCRYPTION_TINK_KEYSET_FILE` - keyset filepath - `WOODPECKER_ENCRYPTION_TINK_KEYSET_FILE` - keyset filepath
- `WOODPECKER_ENCRYPTION_DISABLE` - disable encryption flag used to decrypt all data on server - `WOODPECKER_ENCRYPTION_DISABLE` - disable encryption flag used to decrypt all data on server
### Encryption keys ### Encryption keys
You will need plaintext AEAD-compatible Google TINK keyset to encrypt your data. You will need plaintext AEAD-compatible Google TINK keyset to encrypt your data.
To generate it and then rotate keys if needed, install `tinkey`([installation guide](https://developers.google.com/tink/install-tinkey)) To generate it and then rotate keys if needed, install `tinkey`([installation guide](https://developers.google.com/tink/install-tinkey))
@ -58,12 +65,15 @@ Keyset contains one or more keys, used to encrypt or decrypt your data, and prim
to use while encrypting new data. to use while encrypting new data.
Keyset generation example: Keyset generation example:
```shell ```shell
tinkey create-keyset --key-template AES256_GCM --out-format json --out keyset.json tinkey create-keyset --key-template AES256_GCM --out-format json --out keyset.json
``` ```
### Key rotation ### Key rotation
Use `tinkey` to rotate encryption keys in your existing keyset: Use `tinkey` to rotate encryption keys in your existing keyset:
```shell ```shell
tinkey rotate-keyset --in keyset_v1.json --out keyset_v2.json --key-template AES256_GCM tinkey rotate-keyset --in keyset_v1.json --out keyset_v2.json --key-template AES256_GCM
``` ```

View File

@ -108,7 +108,6 @@ ngrok http 8000
Set `WOODPECKER_HOST` (for example in `docker-compose.yml`) to the ngrok URL (usually xxx.ngrok.io) and start the server. Set `WOODPECKER_HOST` (for example in `docker-compose.yml`) to the ngrok URL (usually xxx.ngrok.io) and start the server.
## Traefik ## Traefik
To install the Woodpecker server behind a [Traefik](https://traefik.io/) load balancer, you must expose both the `http` and the `gRPC` ports. Here is a comprehensive example, considering you are running Traefik with docker swarm and want to do TLS termination and automatic redirection from http to https. To install the Woodpecker server behind a [Traefik](https://traefik.io/) load balancer, you must expose both the `http` and the `gRPC` ports. Here is a comprehensive example, considering you are running Traefik with docker swarm and want to do TLS termination and automatic redirection from http to https.
@ -168,7 +167,6 @@ services:
- traefik.http.middlewares.woodpecker-grpc-redirect.redirectscheme.permanent=true - traefik.http.middlewares.woodpecker-grpc-redirect.redirectscheme.permanent=true
- traefik.http.routers.woodpecker-grpc.middlewares=woodpecker-grpc-redirect@docker - traefik.http.routers.woodpecker-grpc.middlewares=woodpecker-grpc-redirect@docker
volumes: volumes:
woodpecker-server-data: woodpecker-server-data:
driver: local driver: local

View File

@ -59,12 +59,14 @@ Some versions need some changes to the server configuration or the pipeline conf
- Dropped support for `DRONE_*` environment variables. The according `WOODPECKER_*` variables must be used instead. - Dropped support for `DRONE_*` environment variables. The according `WOODPECKER_*` variables must be used instead.
Additionally some alternative namings have been removed to simplify maintenance: Additionally some alternative namings have been removed to simplify maintenance:
- `WOODPECKER_AGENT_SECRET` replaces `WOODPECKER_SECRET`, `DRONE_SECRET`, `WOODPECKER_PASSWORD`, `DRONE_PASSWORD` and `DRONE_AGENT_SECRET`. - `WOODPECKER_AGENT_SECRET` replaces `WOODPECKER_SECRET`, `DRONE_SECRET`, `WOODPECKER_PASSWORD`, `DRONE_PASSWORD` and `DRONE_AGENT_SECRET`.
- `WOODPECKER_HOST` replaces `DRONE_HOST` and `DRONE_SERVER_HOST`. - `WOODPECKER_HOST` replaces `DRONE_HOST` and `DRONE_SERVER_HOST`.
- `WOODPECKER_DATABASE_DRIVER` replaces `DRONE_DATABASE_DRIVER` and `DATABASE_DRIVER`. - `WOODPECKER_DATABASE_DRIVER` replaces `DRONE_DATABASE_DRIVER` and `DATABASE_DRIVER`.
- `WOODPECKER_DATABASE_DATASOURCE` replaces `DRONE_DATABASE_DATASOURCE` and `DATABASE_CONFIG`. - `WOODPECKER_DATABASE_DATASOURCE` replaces `DRONE_DATABASE_DATASOURCE` and `DATABASE_CONFIG`.
- Dropped support for `DRONE_*` environment variables in pipeline steps. Pipeline meta-data can be accessed with `CI_*` variables. - Dropped support for `DRONE_*` environment variables in pipeline steps. Pipeline meta-data can be accessed with `CI_*` variables.
- `CI_*` prefix replaces `DRONE_*` - `CI_*` prefix replaces `DRONE_*`
- `CI` value is now `woodpecker` - `CI` value is now `woodpecker`
- `DRONE=true` has been removed - `DRONE=true` has been removed
@ -94,6 +96,7 @@ Some versions need some changes to the server configuration or the pipeline conf
- Default workspace base path has moved from `/drone` to `/woodpecker` - Default workspace base path has moved from `/drone` to `/woodpecker`
- Default SQLite database location has changed: - Default SQLite database location has changed:
- `/var/lib/drone/drone.sqlite` -> `/var/lib/woodpecker/woodpecker.sqlite` - `/var/lib/drone/drone.sqlite` -> `/var/lib/woodpecker/woodpecker.sqlite`
- `drone.sqlite` -> `woodpecker.sqlite` - `drone.sqlite` -> `woodpecker.sqlite`

View File

@ -27,6 +27,7 @@ Install Golang (>=1.20) as described by [this guide](https://go.dev/doc/install)
> GNU Make is a tool which controls the generation of executables and other non-source files of a program from the program's source files. (https://www.gnu.org/software/make/) > GNU Make is a tool which controls the generation of executables and other non-source files of a program from the program's source files. (https://www.gnu.org/software/make/)
Install make on: Install make on:
- Ubuntu: `apt install make` - [Docs](https://wiki.ubuntuusers.de/Makefile/) - Ubuntu: `apt install make` - [Docs](https://wiki.ubuntuusers.de/Makefile/)
- [Windows](https://stackoverflow.com/a/32127632/8461267) - [Windows](https://stackoverflow.com/a/32127632/8461267)
- Mac OS: `brew install make` - Mac OS: `brew install make`

View File

@ -3,6 +3,7 @@
To develop the UI you need to install [Node.js and pnpm](./01-getting-started.md#install-nodejs--pnpm). In addition it is recommended to use VS-Code with the recommended plugin selection to get features like auto-formatting, linting and typechecking. The UI is written with [Vue 3](https://v3.vuejs.org/) as Single-Page-Application accessing the Woodpecker REST api. To develop the UI you need to install [Node.js and pnpm](./01-getting-started.md#install-nodejs--pnpm). In addition it is recommended to use VS-Code with the recommended plugin selection to get features like auto-formatting, linting and typechecking. The UI is written with [Vue 3](https://v3.vuejs.org/) as Single-Page-Application accessing the Woodpecker REST api.
## Setup ## Setup
The UI code is placed in `web/`. Change to that folder in your terminal with `cd web/` and install all dependencies by running `pnpm install`. For production builds the generated UI code is integrated into the Woodpecker server by using [go-embed](https://pkg.go.dev/embed). The UI code is placed in `web/`. Change to that folder in your terminal with `cd web/` and install all dependencies by running `pnpm install`. For production builds the generated UI code is integrated into the Woodpecker server by using [go-embed](https://pkg.go.dev/embed).
Testing UI changes would require us to rebuild the UI after each adjustment to the code by running `pnpm build` and restarting the Woodpecker server. To avoid this you can make use of the dev-proxy integrated into the Woodpecker server. This integrated dev-proxy will forward all none api request to a separate http-server which will only serve the UI files. Testing UI changes would require us to rebuild the UI after each adjustment to the code by running `pnpm build` and restarting the Woodpecker server. To avoid this you can make use of the dev-proxy integrated into the Woodpecker server. This integrated dev-proxy will forward all none api request to a separate http-server which will only serve the UI files.

View File

@ -8,36 +8,36 @@
### main package hierarchy ### main package hierarchy
| package | meaning | imports | package | meaning | imports |
|------------|--------------------------------------------------------------|---------- | ------------------ | -------------------------------------------------------------- | ------------------------------------- |
| `cmd/**` | parse command-line args & environment to stat server/cli/agent | all other | `cmd/**` | parse command-line args & environment to stat server/cli/agent | all other |
| `agent/**` | code only agent (remote worker) will need | `pipeline`, `shared` | `agent/**` | code only agent (remote worker) will need | `pipeline`, `shared` |
| `cli/**` | code only cli tool does need | `pipeline`, `shared`, `woodpecker-go` | `cli/**` | code only cli tool does need | `pipeline`, `shared`, `woodpecker-go` |
| `server/**`| code only server will need | `pipeline`, `shared` | `server/**` | code only server will need | `pipeline`, `shared` |
| `shared/**`| code shared for all three main tools (go help utils) | only std and external libs | `shared/**` | code shared for all three main tools (go help utils) | only std and external libs |
| `woodpecker-go/**` | go client for server rest api | std | `woodpecker-go/**` | go client for server rest api | std |
### Server ### Server
| package | meaning | imports | package | meaning | imports |
|----------------------|-------------------------------------------------------------------------------------|---------- | -------------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `server/api/**` | handle web requests from `server/router` | `pipeline`, `../badges`, `../ccmenue`, `../logging`, `../model`, `../pubsub`, `../queue`, `../forge`, `../shared`, `../store`, `shared`, (TODO: mv `server/router/middleware/session`) | `server/api/**` | handle web requests from `server/router` | `pipeline`, `../badges`, `../ccmenue`, `../logging`, `../model`, `../pubsub`, `../queue`, `../forge`, `../shared`, `../store`, `shared`, (TODO: mv `server/router/middleware/session`) |
| `server/badges/**` | generate svg badges for pipelines | `../model` | `server/badges/**` | generate svg badges for pipelines | `../model` |
| `server/ccmenu/**` | generate xml ccmenu for pipelines | `../model` | `server/ccmenu/**` | generate xml ccmenu for pipelines | `../model` |
| `server/grpc/**` | gRPC server agents can connect to | `pipeline/rpc/**`, `../logging`, `../model`, `../pubsub`, `../queue`, `../forge`, `../pipeline`, `../store` | `server/grpc/**` | gRPC server agents can connect to | `pipeline/rpc/**`, `../logging`, `../model`, `../pubsub`, `../queue`, `../forge`, `../pipeline`, `../store` |
| `server/logging/**` | logging lib for gPRC server to stream logs while running | std | `server/logging/**` | logging lib for gPRC server to stream logs while running | std |
| `server/model/**` | structs for store (db) and api (json) | std | `server/model/**` | structs for store (db) and api (json) | std |
| `server/plugins/**` | plugins for server | `../model`, `../forge` | `server/plugins/**` | plugins for server | `../model`, `../forge` |
| `server/pipeline/**` | orchestrate pipelines | `pipeline`, `../model`, `../pubsub`, `../queue`, `../forge`, `../store`, `../plugins` | `server/pipeline/**` | orchestrate pipelines | `pipeline`, `../model`, `../pubsub`, `../queue`, `../forge`, `../store`, `../plugins` |
| `server/pubsub/**` | pubsub lib for server to push changes to the WebUI | std | `server/pubsub/**` | pubsub lib for server to push changes to the WebUI | std |
| `server/queue/**` | queue lib for server where agents pull new pipelines from via gRPC | `server/model` | `server/queue/**` | queue lib for server where agents pull new pipelines from via gRPC | `server/model` |
| `server/forge/**` | forge lib for server to connect and handle forge specific stuff | `shared`, `server/model` | `server/forge/**` | forge lib for server to connect and handle forge specific stuff | `shared`, `server/model` |
| `server/router/**` | handle requests to REST API (and all middleware) and serve UI and WebUI config | `shared`, `../api`, `../model`, `../forge`, `../store`, `../web` | `server/router/**` | handle requests to REST API (and all middleware) and serve UI and WebUI config | `shared`, `../api`, `../model`, `../forge`, `../store`, `../web` |
| `server/store/**` | handle database | `server/model` | `server/store/**` | handle database | `server/model` |
| `server/shared/**` | TODO: move and split [#974](https://github.com/woodpecker-ci/woodpecker/issues/974) | | `server/shared/**` | TODO: move and split [#974](https://github.com/woodpecker-ci/woodpecker/issues/974) |
| `server/web/**` | server SPA | | `server/web/**` | server SPA |
* `../` = `server/` - `../` = `server/`
### Agent ### Agent

View File

@ -39,12 +39,13 @@ type User struct {
``` ```
These guidelines aim to have consistent wording in the swagger doc: These guidelines aim to have consistent wording in the swagger doc:
* first word after `@Summary` and `@Summary` are always uppercase
* `@Summary` has no . (dot) at the end of the line - first word after `@Summary` and `@Summary` are always uppercase
* model structs shall use custom short names, to ease life for API consumers, using `@name` - `@Summary` has no . (dot) at the end of the line
* `@Success` object or array declarations shall be short, this means the actual `model.User` struct must have a `@name` annotation, so that the model can be renderend in Swagger - model structs shall use custom short names, to ease life for API consumers, using `@name`
* when pagination is used, `@Parame page` and `@Parame perPage` must be added manually - `@Success` object or array declarations shall be short, this means the actual `model.User` struct must have a `@name` annotation, so that the model can be renderend in Swagger
* `@Param Authorization` is almost always present, there are just a few un-protected endpoints - when pagination is used, `@Parame page` and `@Parame perPage` must be added manually
- `@Param Authorization` is almost always present, there are just a few un-protected endpoints
There are many examples in the server/api package, which you can use a blueprint. There are many examples in the server/api package, which you can use a blueprint.
More enhanced information you can find here https://github.com/swaggo/swag/blob/main/README.md#declarative-comments-format More enhanced information you can find here https://github.com/swaggo/swag/blob/main/README.md#declarative-comments-format

View File

@ -213,14 +213,14 @@ module.exports = {
includeCurrentVersion: true, includeCurrentVersion: true,
lastVersion: '1.0', lastVersion: '1.0',
versions: { versions: {
'current': { current: {
label: 'Next', label: 'Next',
banner: 'unreleased', banner: 'unreleased',
}, },
'1.0': { '1.0': {
label: '1.0.x', label: '1.0.x',
}, },
'0.15': { 0.15: {
label: '0.15.x', label: '0.15.x',
banner: 'unmaintained', banner: 'unmaintained',
}, },

View File

@ -60,9 +60,7 @@ export function WoodpeckerPlugin({ plugin }: { plugin: WoodpeckerPluginType }) {
<p style={{ marginTop: '2rem', marginBottom: '1rem' }}>{plugin.description}</p> <p style={{ marginTop: '2rem', marginBottom: '1rem' }}>{plugin.description}</p>
</div> </div>
<div className="col col--2"> <div className="col col--2">{plugin.icon ? <img src={plugin.icon} width="150" /> : IconPlugin(150)}</div>
{plugin.icon ? <img src={plugin.icon} width="150" /> : IconPlugin(150)}
</div>
</div> </div>
<hr style={{ margin: '1rem 0' }} /> <hr style={{ margin: '1rem 0' }} />
<div dangerouslySetInnerHTML={{ __html: plugin.docs }} /> <div dangerouslySetInnerHTML={{ __html: plugin.docs }} />

View File

@ -17,7 +17,7 @@
max-width: 32rem; max-width: 32rem;
color: var(--ifm-navbar-link-color); color: var(--ifm-navbar-link-color);
text-decoration: none; text-decoration: none;
padding: .5rem 0 1rem; padding: 0.5rem 0 1rem;
flex-grow: 1; flex-grow: 1;
margin: 0 auto; margin: 0 auto;
width: 100%; width: 100%;
@ -28,7 +28,6 @@
text-decoration: none; text-decoration: none;
} }
.wp-plugin-card:hover h3 { .wp-plugin-card:hover h3 {
color: var(--ifm-link-color); color: var(--ifm-link-color);
text-decoration: underline; text-decoration: underline;
@ -40,14 +39,14 @@
.wp-plugin-verified { .wp-plugin-verified {
position: absolute; position: absolute;
top: .75rem; top: 0.75rem;
right: 1rem; right: 1rem;
color: #0369a1; color: #0369a1;
} }
.wp-plugin-tags { .wp-plugin-tags {
display: flex; display: flex;
gap: .5rem; gap: 0.5rem;
flex-wrap: wrap; flex-wrap: wrap;
} }
@ -58,8 +57,9 @@
padding: 1rem 1rem 1rem 2.25rem; padding: 1rem 1rem 1rem 2.25rem;
font-size: 1.1rem; font-size: 1.1rem;
appearance: none; appearance: none;
background: var(--ifm-navbar-search-input-background-color) var(--ifm-navbar-search-input-icon) no-repeat 0.75rem 1rem / 1.1rem 1.1rem; background: var(--ifm-navbar-search-input-background-color) var(--ifm-navbar-search-input-icon) no-repeat 0.75rem 1rem /
border-radius: .5rem; 1.1rem 1.1rem;
border-radius: 0.5rem;
border: 1px solid var(--ifm-card-background-color); border: 1px solid var(--ifm-card-background-color);
color: var(--ifm-navbar-search-input-color); color: var(--ifm-navbar-search-input-color);
} }

View File

@ -8,8 +8,11 @@ const FeatureList = [
Svg: require('../../static/img/feat-opensource.svg').default, Svg: require('../../static/img/feat-opensource.svg').default,
description: ( description: (
<> <>
Woodpecker is and always will be totally free. As Woodpecker's <a href="https://github.com/woodpecker-ci/woodpecker" target="_blank">source code</a> is Woodpecker is and always will be totally free. As Woodpecker's{' '}
open-source you can contribute to help evolving the project. <a href="https://github.com/woodpecker-ci/woodpecker" target="_blank">
source code
</a>{' '}
is open-source you can contribute to help evolving the project.
</> </>
), ),
}, },
@ -19,7 +22,8 @@ const FeatureList = [
description: ( description: (
<> <>
Woodpecker uses docker containers to execute pipeline steps. If you need more than a normal docker image, you Woodpecker uses docker containers to execute pipeline steps. If you need more than a normal docker image, you
can create plugins to extend the pipeline features. <a href="/docs/usage/plugins/plugins">How do plugins work?</a> can create plugins to extend the pipeline features.{' '}
<a href="/docs/usage/plugins/plugins">How do plugins work?</a>
</> </>
), ),
}, },

View File

@ -54,9 +54,11 @@ steps:
``` ```
Get the container id using `docker ps` and copy the id from the first column. Enter the container with: `docker exec -it 1234asdf bash` (replace `1234asdf` with the docker id). Then try to clone the git repository with the commands from the failing pipeline: Get the container id using `docker ps` and copy the id from the first column. Enter the container with: `docker exec -it 1234asdf bash` (replace `1234asdf` with the docker id). Then try to clone the git repository with the commands from the failing pipeline:
```bash ```bash
git init git init
git remote add origin https://git.example.com/username/repo.git git remote add origin https://git.example.com/username/repo.git
git fetch --no-tags origin +refs/heads/branch: git fetch --no-tags origin +refs/heads/branch:
``` ```
(replace the url AND the branch with the correct values, use your username and password as log in values) (replace the url AND the branch with the correct values, use your username and password as log in values)

View File

@ -14,9 +14,7 @@ function HomepageHeader() {
<h1 className="hero__title">{siteConfig.title}</h1> <h1 className="hero__title">{siteConfig.title}</h1>
<p className="hero__subtitle">{siteConfig.tagline}</p> <p className="hero__subtitle">{siteConfig.tagline}</p>
<div className={styles.buttons}> <div className={styles.buttons}>
<Link <Link className="button button--secondary button--lg" to="/docs/intro">
className="button button--secondary button--lg"
to="/docs/intro">
Woodpecker Tutorial - 5min Woodpecker Tutorial - 5min
</Link> </Link>
</div> </div>
@ -28,9 +26,7 @@ function HomepageHeader() {
export default function Home() { export default function Home() {
const { siteConfig } = useDocusaurusContext(); const { siteConfig } = useDocusaurusContext();
return ( return (
<Layout <Layout title={`${siteConfig.title}`} description="Woodpecker is a simple CI engine with great extensibility.">
title={`${siteConfig.title}`}
description="Woodpecker is a simple CI engine with great extensibility.">
<HomepageHeader /> <HomepageHeader />
<main> <main>
<HomepageFeatures /> <HomepageFeatures />

View File

@ -1,4 +1 @@
[ ["1.0", "0.15"]
"1.0",
"0.15"
]

View File

@ -92,12 +92,7 @@
"HOME": "c:\\root", "HOME": "c:\\root",
"SHELL": "powershell.exe" "SHELL": "powershell.exe"
}, },
"entrypoint": [ "entrypoint": ["powershell", "-noprofile", "-noninteractive", "-command"],
"powershell",
"-noprofile",
"-noninteractive",
"-command"
],
"command": [ "command": [
"[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($Env:CI_SCRIPT)) | iex" "[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($Env:CI_SCRIPT)) | iex"
], ],

View File

@ -8,7 +8,6 @@ clone:
depth: 50 depth: 50
steps: steps:
# these steps define a parallel execution # these steps define a parallel execution
# group and will fan out. # group and will fan out.

View File

@ -11,7 +11,7 @@ steps:
build: build:
image: tutum/curl image: tutum/curl
# A container named "vpn" should exist on the same docker daemon # A container named "vpn" should exist on the same docker daemon
network_mode: "container:vpn" network_mode: 'container:vpn'
# Replace HOST_OR_IP with the IP or hostname of a server behind the VPN # Replace HOST_OR_IP with the IP or hostname of a server behind the VPN
commands: commands:
- curl -s -f -L http://HOST_OR_IP/ - curl -s -f -L http://HOST_OR_IP/

View File

@ -14,4 +14,3 @@ services:
environment: environment:
- POSTGRES_USER=postgres - POSTGRES_USER=postgres
- POSTGRES_DB=test - POSTGRES_DB=test

View File

@ -96,10 +96,7 @@
"PLUGIN_PATH": "/cache", "PLUGIN_PATH": "/cache",
"PLUGIN_RESTORE": "true" "PLUGIN_RESTORE": "true"
}, },
"volumes": [ "volumes": ["pipeline_default:/pipeline", "/cache/drone/drone/envsubst:/cache"],
"pipeline_default:/pipeline",
"/cache/drone/drone/envsubst:/cache"
],
"networks": [ "networks": [
{ {
"name": "pipeline_default", "name": "pipeline_default",
@ -211,10 +208,7 @@
"PLUGIN_PATH": "/cache", "PLUGIN_PATH": "/cache",
"PLUGIN_REBUILD": "true" "PLUGIN_REBUILD": "true"
}, },
"volumes": [ "volumes": ["pipeline_default:/pipeline", "/cache/drone/drone/envsubst:/cache"],
"pipeline_default:/pipeline",
"/cache/drone/drone/envsubst:/cache"
],
"networks": [ "networks": [
{ {
"name": "pipeline_default", "name": "pipeline_default",

View File

@ -7,4 +7,3 @@ steps:
commands: commands:
- npm install - npm install
- npm test - npm test

View File

@ -1,7 +1,7 @@
labels: labels:
location: europe location: europe
weather: sun weather: sun
hostname: "" hostname: ''
steps: steps:
build: build: