81 Commits
Author SHA1 Message Date
Jonathan Boulle c5430a4ee5 test: add check for license header
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)
2015-05-29 10:16:22 -07:00
Alban Crequy a07bdc34b9 version: bump to v0.5.6 2015-05-28 17:27:21 +02:00
Jonathan Boulle 6607d48103 *: add license header where missing 2015-05-26 18:44:41 -07:00
Jonathan Boulle 128f4459bd Merge pull request #934 from glevand/for-merge-1
pkg: arm64 support for pkg/sys
2015-05-26 16:02:20 -07:00
Geoff Levand 0a8d5270ef pkg/sys: Add arm64 support
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>
2015-05-26 15:27:32 -07:00
Simone Gotti 2c66843cc1 aci: extract tar in chroot
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.
2015-05-26 23:40:36 +02:00
Jonathan Boulle 4c64fa6e93 Merge pull request #861 from jonboulle/copyright
*: adjust copyright header + remove NOTICE
2015-05-07 14:38:45 -07:00
Jonathan Boulle 9685f37575 *: adjust copyright header
Inspired by a similar change in the Kubernetes project [1], this changes
the copyright header to the more generic "The rkt Authors" rather than
"CoreOS, Inc.", which is only sometimes correct.

https://github.com/GoogleCloudPlatform/kubernetes/commit/6b3a6e6b983f967c88d14d26542ec6e30c49ebd3
2015-05-03 14:29:15 -07:00
Brandon Philips 40ced98c32 version: bump to v0.5.5 2015-05-01 19:16:44 -04:00
Jonathan Boulle c8a7050a88 version: bump to v0.5.4 2015-04-23 10:39:30 -07:00
Krzesimir Nowak 21ccdbd1cd *: Standardize on "system" and "local" configuration
So "vendor" config becomes "system" and "custom" one - "local".
2015-04-22 13:26:59 +02:00
Krzesimir Nowak 8b7c134be4 keystore: Make it easy to create keystore config 2015-04-22 12:18:41 +02:00
Jonathan Boulle b250e651be Merge pull request #762 from sgotti/rktsyncfs
rkt: sync prepared pod file contents on disk and use syncfs also in treestore
2015-04-17 12:14:50 -07:00
Simone Gotti 6530acf8e0 lock: add missing closes in keylock.
* the keylock FileLock wasn't closed on error in createAndLock
* fd for changed file detection wasn't closed.
2015-04-15 12:04:45 +02:00
Simone Gotti 6e3989f59a sys: add linux syncfs syscall.
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.
2015-04-15 10:36:54 +02:00
Jonathan Boulle a8afce77b6 version: bump to v0.5.3 2015-03-31 20:38:54 -07:00
Jonathan Boulle 79753c9b19 *: rocket -> rkt 2015-03-31 16:31:21 -07:00
Jonathan Boulle 16bcfe9750 version: bump to v0.5.2 2015-03-30 23:10:05 -07:00
Vito Caputo 58bd354961 Merge pull request #571 from sgotti/casdiskvlock
cas: add image locking.
2015-03-26 19:15:51 -07:00
Jonathan Boulle 3117f69c56 version: bump to v0.5.1 2015-03-26 15:31:44 -07:00
Simone Gotti c7e19e85f3 lock: add lock functions to lock by specific keys.
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
2015-03-26 14:09:10 +01:00
Simone Gotti deea994424 lock: convert DirLock to handle also locks on regular files.
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.
2015-03-26 14:09:10 +01:00
Vito Caputo c2ec98e25e keystore: improve fingerprint mismatch error message
Show the filename & fingerprint for the mismatching key to assist
troubleshooting.
2015-03-23 15:08:56 -07:00
Simone Gotti 20fad0750e pkg/aci: use local imageArchiveWriter.
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.
2015-03-23 12:49:52 +01:00
Eugene Yakubovich 0b935f467f net: set FD_CLOEXEC on RktLock prior to fork/exec
When launching metadata service and net plugins,
set the close-on-exec flag so the child processes
don't end up holding the lock.
2015-03-19 17:14:31 -07:00
Simone Gotti b5fb9522b9 tar: restore files mtime and atime. 2015-03-16 09:59:50 +01:00
Dardo D Kleiner dedc97f2f3 pkg/tar: implement tar.TypeFifo 2015-03-12 12:55:02 -04:00
Brandon Philips 62bd3ec5be pkg: keystore: default to 0755 for keystore
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.
2015-03-09 03:05:44 -04:00
Simone Gotti 6d0dccb1d7 aci: add rendering functions.
Adds ACI rendering function using the acirenderer library.
2015-03-10 10:54:55 +01:00
Simone Gotti 022b9bc4c8 tar: call os.Chmod after os.LChown
Fix the TODO introduced and discussed in #462 calling os.Chmod after the
os.LChown for all files except symlinks.
2015-02-16 10:23:40 +01:00
Vincent Batts aea9f30a59 pkg/keystore: error for no sigs in *.sig
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>
2015-02-10 21:36:35 +01:00
Jonathan Boulle 72395d1ffa *: vendor appc spec
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.
2015-02-05 14:36:40 +01:00
Simone Gotti 3b8276065c tar: restore entry's uid and gid.
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.
2015-02-03 21:49:12 +01:00
Jonathan Boulle 6d58c1fd17 *: add missing godocs and copyright headers
Also moves pkg/util/aci.go -> pkg/aci/aci.go for simplicity and
consistency with the other pkgs.
2015-01-24 19:03:56 -08:00
Jonathan Boulle 8b72cf0f91 pkg: remove unused code 2015-01-23 21:48:05 -08:00
Jonathan Boulle f3970570b3 pkg/util: update to new appc/spec 2015-01-23 17:28:23 -08:00
Vito Caputo f6231f333a build/test: cleanup /tmp file and directory leaks 2015-01-21 14:17:49 -08:00
Simone Gotti af073571fc utils: aci: let NewACI create ACIs with files and custom imagemanifest.
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.
2015-01-21 09:49:21 +01:00
Kelsey Hightower 1cf92232eb Merge pull request #335 from kelseyhightower/add-encryption-and-verification
fetch: add signature validation
2015-01-12 23:44:00 -08:00
Kelsey Hightower bad73895c9 fetch: add signature validation
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.
2015-01-12 23:40:33 -08:00
Jonathan Boulle ffc83935cd Merge pull request #348 from sgotti/taroverwrite
pkg/tar: add overwrite option to ExtractTar.
2015-01-12 20:59:41 -08:00
Vito Caputo 6cc9661f2d pkg/lock: add DirLock.Unlock()
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.
2015-01-12 17:12:27 -08:00
Simone Gotti 77c6331669 pkg/tar: add overwrite option to ExtractTar.
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.
2015-01-13 00:14:37 +01:00
Jonathan Boulle 73ad65ae6d Merge pull request #349 from sgotti/tarpathwhitelist
pkg/tar: add PathWhitelistMap to whitelist files for tar extraction.
2015-01-10 19:07:25 -08:00
Jonathan Boulle 798f3d11af pkg/tar: fix typos in docstrings 2015-01-10 17:53:03 -08:00
Simone Gotti 5c989ccb31 pkg/tar: add PathWhitelistMap to whitelist files for tar extraction. 2015-01-10 16:55:58 +01:00
Simone Gotti ab3a7ff5f0 pkg/tar: add an ExtractFileFromTar function to extract a single file to a byte slice. 2015-01-10 15:10:29 +01:00
Simone Gotti d25a0416ca pkg/tar: create a function for single tar file extraction so it can be reused by
different tar extraction functions.
2015-01-09 09:33:25 +01:00
Vito Caputo d98608c7e5 pkg/lock: add errors for ENOENT and EACCES for new locks 2015-01-07 15:04:35 -08:00
Simone Gotti ce302c1a72 keystore: tests: remove the whole temporary directory.
removeKeyStore removes only the files known in Config.
Drop it and just defer the removal of the whole temp dir.
2015-01-06 16:41:39 +01:00