Commit Graph

15 Commits

Author SHA1 Message Date
Paul Holzinger 379a8b87bb fix windows config path regression
The path no longer included the path separator between the env and our
config dir. The regression was added in commit 8921ad98b6.

Fixes #2025

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-30 17:47:45 +02:00
Mario Loriedo 8921ad98b6 Support system-wide containers config folder on windows
Add %PROGRAMDATA%/containers to the list of possible
config folders.

Fixes https://github.com/containers/podman/issues/22411

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2024-04-29 16:49:54 +02:00
Paul Holzinger 8f0f7109e5 pkg/config: read user local config also as root
There is really no need to limit reading the config under
$XDG_CONFIG_HOME or $HOME to rootless users only. This poses two
problems, first on a multi user system any config that should be only
applied to root in /etc will also be read by all other users which makes
this impossible to use without having all user overwrite that option
with their local containers.conf. If we read the config from $HOME as
root as well then such changes are easy.
Second, because connections/farms are currently written by the cli it
means as root is tries to write under /etc which is not good as in some
envs /etc is mounted read only.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-01-29 16:28:07 +01:00
Paul Holzinger 745268b117 pkg/config: use containersConfEnv constant everywhere
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-01-29 16:28:06 +01:00
Doug Rabson 478419732a Change default image volume mode to "nullfs" on FreeBSD
This fixes a regression in
https://github.com/containers/podman/pull/19241 which quite reasonably
assumed that the default image volume mode from pkg/config was correct.

Signed-off-by: Doug Rabson <dfr@rabson.org>
2023-07-17 14:58:23 +01:00
Doug Rabson 4b906d8159 pkg/config: Fix DefaultSignaturePath on FreeBSD
The correct location on FreeBSD is /usr/local/etc/containers/policy.json
which is consistent with path conventions for installed packages. This
fixes 'podman commit' on FreeBSD.

There are several definitions of this path:

- c/image/signature has builtinDefaultPolicyPath and DefaultPolicy
- c/podman/pkg/trust has systemDefaultPolicyPath and DefaultPolicyPath
- c/common/pkg/config has DefaultSignaturePolicyPath

As far as I can tell, buildah uses c/image/signature which is why 'buildah
commit' was already working for me. Podman is using the c/common one. Very
confusing.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-11-09 16:50:45 +00:00
Doug Rabson a4a658034b Config files should live in /usr/local on FreeBSD
Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-05-09 14:07:58 +01:00
Paul Holzinger 25622da26e Add HelperBinariesDir field to engine config
This field contains a list of directories which should be used to store
some helper binaries, e.g. gvproxy.

Also add a FindHelperBinary method to the config struct to get the full
path to a helper binary.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-10 13:38:19 +02:00
Ashley Cui e237d2da9b Fix reading configs on mac and windows
On Mac and Windows, automtically read default rootless config location, since
unshare.IsRootless doesn't work.

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-05-10 15:27:01 -04:00
Paul Holzinger 4abbe16f3b fix windows containers.conf path
customConfigFile() has to return the full path to the file
LOCALAPPDATA only returns a directory.

I also recommend using APPDATA instead of LOCALAPPDATA.
If a domain user would logon to a new computer they would
automatically have their containers.conf from the last
login at a different pc. No manual copy is needed since
windows syncs the APPDATA dir by default in a domain
environment at login.

So the config file path on windows would be:
`C:\Users\<username>\AppData\Roaming\containers\containers.conf`

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-08-25 22:06:13 +02:00
Daniel J Walsh a288c7cb3a Update pkg/config/config_windows.go
Co-authored-by: Jhon Honce <jhonce@redhat.com>
2020-08-22 09:11:12 -04:00
Brent Baude 054d133710 getCustomConfigFile for windows and darwin
podman remote clients that run on windows and darwin cannot use the isRootless to determine the configuration file locations.  here we do by OS and also honor the environment variable.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-08-22 09:11:12 -04:00
Daniel J Walsh 7b97b08724 Do not validate paths on remote platforms
Modify validate functions to work on a remote clients.
Any of the path checks will not work on remote machines or make
sense on remote clients. Therefore they should not be checked.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-28 13:29:37 -04:00
Qi Wang 894913abdf add libpod.conf to containers.conf
Add configurations from libpod.conf to containers.conf.Use merge code from libpod to read and merge configurations from file.

Add unshare_linux for build linux: HomeDir should buildah not only for linux. so add unshare_linux for linux and unshare.go for other

convert bool to optinalbool:Use OptionalBool for on-disk configurations so we can distinguish field is undefined  vs. user set to false.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-12-06 15:55:47 -05:00
Qi Wang 9bb8e7e62b Add config package for containers.conf
This PR adds a package config for reading configurations from the containers.conf into the go struct.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-10-07 13:38:17 -04:00