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

Clean up config environment variables for server and agent #218

Merged
merged 35 commits into from
Sep 28, 2021

Conversation

marians
Copy link
Contributor

@marians marians commented May 31, 2021

close #209

The goal here is to make consistent use of configuration environment variables prefixed WOODPECKER_. Where several variants existed, this PR aims to remove all but one option, leaving the most explicit.

This PR only changes server and agent code, but not documentation, in order to keep the PR digestible. Once we have consensus that this is correct, I'll change docs accordingly.

User (rather: admin) facing changes in this PR:

  • In general, support for all server and agent config environment variables (env vars) starting with DRONE_ is removed. The according WOODPECKER_* variables must be used instead.
  • The env var WOODPECKER_HOST replaces DRONE_HOST, and DRONE_SERVER_HOST.
  • The env var WOODPECKER_AGENT_SECRET is used to configure the shared secret which agents use to authenticate against the server. It replaces WOODPECKER_SECRET, DRONE_SECRET, WOODPECKER_PASSWORD, DRONE_PASSWORD, and DRONE_AGENT_SECRET.
  • The env var WOODPECKER_DATABASE_DRIVER replaces DRONE_DATABASE_DRIVER and DATABASE_DRIVER.
  • The env var WOODPECKER_DATABASE_DATASOURCE replaces DRONE_DATABASE_DATASOURCE and DATABASE_CONFIG.

Todo

  • cleanup cli flags
  • add migration notes to docs
    • instead of DRONE_ use WOODPECKER_
    • renamed env-vars and their new names (WOODPECKER_AGENT_SECRET, WOODPECKER_SERVER_HOST, WOODPECKER_DATABASE_DRIVER, WOODPECKER_DATABASE_DATASOURCE)
  • update docs (docker-compose samples, server config)
  • update sample docker-compose

Wait for

@marians
Copy link
Contributor Author

marians commented Jun 7, 2021

TODO: As pointed out in #209 (comment) the XDG_ variable should not be touched here.

@marians
Copy link
Contributor Author

marians commented Jun 7, 2021

I just reverted the removal of XDG_CACHE_HOME.

@marians
Copy link
Contributor Author

marians commented Jun 8, 2021

@laszlocph This is ready for a review.

@6543
Copy link
Member

6543 commented Jun 18, 2021

got conflicts :O

@6543 6543 added this to the v0.15.0 milestone Jun 18, 2021
@6543 6543 added breaking will break existing installations if no manual action happens refactor delete or replace old code labels Jun 18, 2021
@6543 6543 self-assigned this Sep 17, 2021
@anbraten anbraten added the wip label Sep 20, 2021
@6543

This comment has been minimized.

@anbraten anbraten removed the wip label Sep 24, 2021
@anbraten anbraten marked this pull request as ready for review September 24, 2021 18:45
@6543
Copy link
Member

6543 commented Sep 25, 2021

I'll review it soon :)

cli/exec/exec.go Show resolved Hide resolved
@6543 6543 requested a review from anbraten September 28, 2021 12:23
cli/exec/exec.go Show resolved Hide resolved
cmd/agent/flags.go Outdated Show resolved Hide resolved
cmd/agent/flags.go Outdated Show resolved Hide resolved
cmd/agent/flags.go Outdated Show resolved Hide resolved
cmd/server/flags.go Outdated Show resolved Hide resolved
cmd/cli/main.go Outdated Show resolved Hide resolved
cmd/cli/main.go Outdated Show resolved Hide resolved
cmd/server/flags.go Show resolved Hide resolved
@6543 6543 enabled auto-merge (squash) September 28, 2021 13:25
@6543 6543 merged commit 17b8867 into woodpecker-ci:master Sep 28, 2021
@marians marians deleted the server-remove-drone-env-variables branch September 28, 2021 13:56
@marians
Copy link
Contributor Author

marians commented Sep 28, 2021

Thanks for taking over!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking will break existing installations if no manual action happens refactor delete or replace old code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Phase out environment variables prefixed DRONE_, use WOODPECKER_
3 participants