Dumb test looking for either a Copyright header or sign that the file
was autogenerated (e.g. by `go generate`) in all non-Godep .go files.
Also moves the actual unit/functional tests after the pre-flight checks
(gofmt, go vet, this new check)
Fixes build errors like these when building for arm64:
rkt/pkg/sys/sys_linux.go: undefined: SYS_SYNCFS
Signed-off-by: Geoff Levand <geoff@infradead.org>
this introduces tar extraction inside a chroot. This is done spawning a
new process. Instead of creating a new executable (difficult to find,
package etc...) it adds the concept of a multicall process (like busybox).
Now a new multicall command "extracttar" is added.
tar.ExtractTar executes this new command passing a pipe to send the
filesMap and the tar contents to stdin.
The incomplete "insecure link" checks are removed from the the tar
functions. Additionally these functions are now not exported and the
extraction directory is always the root directory.
As syncfs is neither provided by golang syscall package nor by
golang.org/x/sys/unix adds a local syncfs syscall implementation. By now the
syscall numbers for linux amd64, 386 and arm architectures are provided.
This adds a KeyLock struct and related functions trying to keep the same
semantic of DirLock.
KeyLock is a lock for a specific key. The lock file is created inside a
directory using the key name.
This is useful when multiple processes want to take a lock but cannot use
FileLock as they don't have a well defined file on the filesystem.
For example it's needed for image file locking and in future for download locking
This patch renames DirLock to FileLock (where a file can be a regular file or a
directory), adds a new LockType type to specify if the lock must be on a
directory or on a regular file and checks if the file is valid for the
requested type.
The one provided by appc/spec creates the manifest file with uid=0 and gid=0,
this break tests launched as non root user, because pkg/tar cannot to lchown
the manifest.
There is nothing private about our collection of public keys. Make it
world-readable by default. This makes it possible to fetch containers as
non-root users.
if the Reader for the *.sig is without an armored signature, then the
returned error is just EOF. Not helpful.
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
Take two at getting the spec vendored into Rocket with Godep.
Since actool is used during the construction of the stage1.aci, it
really needs to be vendored too to prevent any unexpected divergence
between whatever version the user happens to have in their PATH. Thus,
we introduce a silly dummy package (stage1/dummy.go) to coerce Godep
into vendoring actool. This also requires a slight rearrangement of the
appc repo, moving some functionality from actool itself into the aci
package.
Restore the extracted entry uid and gid. This uses tar header Uid and Gid
values and ignores header's Uname and Gname.
As the tests are usually run as a unprivileged user the generated test tars'
entries are defaulted to the running user uid and gid. For this reason tests
are implictly verifing that the os.Chown/os.LChows calls works but it's
difficult to create a more comprehensive test using different uid and gid
values.
Also add a NewBasicACI functions with the previous NewACI behavior.
Both functions now requires the dir where the new file should be created. Without
this, the generated ACIs will be created inside the default temp dir and calling
functions should remember to remove every single aci, now the tests can remove
the whole test dir when finished.
Currently rocket does not perform signature validation for ACI images.
Fix the issue by validating all ACI images during the initial download.
Example Usage:
```
$ sudo rkt run example.com/hello:0.0.1
rkt: starting to discover app img example.com/hello:0.0.1
...
rkt: example.com/hello:0.0.1 verified signed by:
Kelsey Hightower (ACI signing key) <kelsey.hightower@coreos.com>
```
This patch introduces a new global flag `-insecure-skip-verify`, which
disables signature validation for a single run.
```
$ sudo rkt -insecure-skip-verify run example.com/hello:0.0.1
...
```
This patch changes the behaviour of the fetch and run subcommands. By
default rocket will attempt to verify all ACI images and fail if the
detached signature is missing.
This patch also includes a new tutorial on how to sign, host, and verify
ACI images.
In creating a more general interface to the container dirs a method for
unlocking a DirLock without closing it became necessary.
This should have been added when lock.NewLock() became public.
Add an overwrite option to ExtractTar so, calling the function on a non empty
directory, will overwrite existing files instead of returning an error.
It's needed during ACI rendering, as (in the actual implementation), extracting
a dependency list of ACIs over the same directory, the files provided by the
next ACI in the list have to overwrite the ones previously extracted.