Comments (12)
Yes, it is causes upstream, but I do not know if it can be called an issue.
If we change the Dockerfileto something like this:
RUN echo "/var/lib/woodpecker/woodpecker.sqlite" > /etc/woodpecker-datasource.conf
ENV WOODPECKER_DATABASE_DATASOURCE_FILE=/etc/woodpecker-datasource.conf
the problem should vanish.
If the user does set -e WOODPECKER_DATABASE_DATASOURCE...
this will take precedence and if he sets -e WOODPECKER_DATABASE_DATASOURCE_FILE...
it will overwrite the setting in the Dockerfile.
from woodpecker.
But we get this flag from Env via os package:
Yes, I know, I mean we're using the FilePath
feature of urfave/cli.
Weird, then this should work 🤔 Or do I misunderstand something completely here?
from woodpecker.
Yeah, we need more gold tests :) There are no open issues about precedence. So, should work...
from woodpecker.
Precedence rules are different https://cli.urfave.org/v2/examples/flags/#precedence
Envelope var before file.
from woodpecker.
In my oppinion, the env var should take precedence to the content of some file.
The shorter the lifetime of a flag the higher the precedence. Rational: The user wants to override some argument for the next execution of a program without much hazzle.
So
- command line arg
- Env var
- Some file
Shall I post a PR for changing the Dockerfile?
from woodpecker.
Only database settings don't work, right? Do other (WOODPECKER_GRPC_SECRET_FILE
, WOODPECKER_AGENT_SECRET_FILE
, WOODPECKER_GITEA_CLIENT_FILE
, WOODPECKER_GITEA_SECRET_FILE
) settings work as intended?
the env var WOODPECKER_DATABASE_DATASOURCE is set in the Dockerfile and takes precedence
from woodpecker.
Yes, it is only the datasource, others work as expected.
I do not have an idea of what could be changed. The code uses a sqlite file relative to the executable, but this can not be used with docker, as yoiu can not mount a volume there.
from woodpecker.
I think we should process WOODPECKER_DATABASE_DATASOURCE_FILE
with higher priority than WOODPECKER_DATABASE_DATASOURCE
as it is supposed to be more secure. So, that is is not a documentation issue.
from woodpecker.
It looks like this is an upstream issue of https://github.com/urfave/cli because we're directly using the feature:
woodpecker/cmd/server/flags.go
Line 223 in 4e44dd0
from woodpecker.
It looks like this is an upstream issue of https://github.com/urfave/cli because we're directly using the feature
But we get this flag from Env via os
package:
- FilePath: os.Getenv("WOODPECKER_DATABASE_DATASOURCE_FILE"),
+ FilePath: "/etc/mysql/password",
Also If EnvVars contains more than one string, the first environment variable that resolves is used.
from woodpecker.
Shall I post a PR for changing the Dockerfile?
Would be fine for me.
from woodpecker.
ah now i know where it did come from :D
please dont fix bugs in the wrong place ... this bugfix would e.g. not fix it for anything not using docker
(...yes it might not be a problem as that environments dont have preset things... but it still will exist)
from woodpecker.
Related Issues (20)
- Woodpecker-cli exec linter invalid type HOT 2
- woodpecker cli parse matrix fail HOT 2
- External configuration for pipelines is no longer working since 2.4.0 HOT 3
- The value of CI_PIPELINE_PARENT is the ID of the parent pipeline HOT 1
- Nil pointer with invalid id on trigger pipeline api
- Stuck on login screen. HOT 13
- Linter: cSpell add golang dic HOT 5
- Agent failed to retrieve new jobs due to RPC error "keepalive ping failed to receive ACK within timeout" HOT 1
- Woodpecker UI output not updating/out of sync HOT 1
- Docs: create a jsonschema for plugin docs HOT 1
- woodpecker-cli requires dbus-launch? HOT 11
- Misleading setting name when restricting secrets to images
- K8s: moving towards appArmorProfile
- BITBUCKET_DC forge stopped working with the release of version 2.5.0
- Per-agent environment variables option HOT 2
- `docker run woodpeckerci/woodpecker-cli setup` tries to run xdg-open to spawn a web browser HOT 3
- Add pagination for log entry loading to database HOT 1
- Bogusly worded lint: "Please set an event filter for all steps or the whole workflow on all items of the when block" HOT 2
- Gitea Webhook fails with Woodpecker 2.5.0 HOT 3
- Set user-agent for HTTP Requests from Woodpecker HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from woodpecker.