Introduce an arch field that can be used to filter repositories based on
the local architecture.
If arch is provided and matching with the current GOARCH then the
repository is enabled
This changeset allows to have shared templates in a static folder
"templates" present in each luet tree. If the directory is present, it
gets scanned and templated accordingly on top of each package. This
allows to use such folder to store custom blocks to share between
packages.
This is still experimental and subject to change, this is just a first
pass version to provide the feature. It needs to be refined still as it
would be more elegant to use the helm engine properly and map our
structure to the engine instead of adapting it roughly.
Fixes#224
docker.Untar
(https://github.com/mudler/luet/blob/master/vendor/github.com/docker/docker/pkg/archive/archive.go#L942) requires absolute paths.
We didn't do any input validation before, assuming the path passed by
were absolute since they were coming from YAML configuration files, now
that this is not the truth anymore we need to sanitize the input.
With this change we check if the given path is absolute or relative, if
it's relative we calculate the absolute path and use it in place.
* Reduce possibility of circular dependency
Just by adding an import for bus to anything in the helper dir, we would
run into a circular dependency due to how things are structured. That
means that we cannot set any events for unpacking or docker helper
pulling an image.
This commit tries to work around this by doing several things.
- Remove full imports of the helper module by segmentating some modules
into their own submodule, like docker or match so just using a small match
function doesnt bring the whole module
- Removing a simple function to check if a dir exists from importing
the full helper module and instead write the function (5 lines)
- Using logrus in the bus module instead of logger, which avoids a
circular dependency
Signed-off-by: Itxaka <igarcia@suse.com>
* Add two new events for unpacking an image
Both pre and post unpacking an image
Signed-off-by: Itxaka <igarcia@suse.com>
Contact the notary server if ```--verify``` is specified (or `verify:
true` is enabled on the repo config) and verify if the image is signed,
use the returned value to pull the verified image.
Currently, it's used the archive.ReplaceFileTarWrapper
that requite a []byte of the files replaced. This is not
a good idea if files are big and instead could be better
in the near future reimplement ReplaceFileTarWrapper with
a callback that return io.Reader instead of []byte.
If a protected file is already present on target rootfs
it is created a file with the same prefix used in Gentoo:
._cfgXXXX_<filename>
Now it's possible disable color and emoji on standard
output with:
$> luet <cmd> --color=false --emoji=false
Hereinafter, the list of changes:
* Added logging option logging.color (default true)
* Added logging option logging.enable_emoji (default true)
* Added persistent flag --color
* Added persistent flag --emoji
Now it's possible logging to file is handled by the enable_logfile
option and by the path.
From cli is now possible:
* enable log to file with the option --enable-logfile
* modify the logfile path with the option --logfile/-l <path>
* installer.LuetRepository is now installer.LuetSystemRepository,
a struct that extend config.LuetRepository
* config: system_repositories option is now "repositories".
This resolve viper issue.
* config: cache_repositories option is now "repetitors"
This resolve viper issue.
* cmd/*: Now use new config.LuetRepository
* cmd/search: now create local luet repository if database_engine
is equal to "boltdb"