Commit Graph

28 Commits

Author SHA1 Message Date
Ying Li 34aecae033 Split out parsing the client TLS in notary-server.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-28 15:40:41 -07:00
Ying Li 04a78e720f Factor out and test TLS configuration in notary-server.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-28 15:39:52 -07:00
David Lawrence 2833a88292 adding gotuf to notary
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-10-27 16:36:06 -07:00
Ying Li a5e64ecf03 Do not use the viper singleton instance everywhere
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-19 11:50:04 -07:00
Ying Li 6db76a873e Small cleanup as per review comments
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-16 14:48:05 -07:00
Ying Li 81380e0862 Even simpler - cancel the GRPC call using the context object passed
to the GRPC clients - thanks @endophage!

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-16 09:46:08 -07:00
Ying Li a49406de42 Log an error if the notary server cannot reach the signer or otherwise
if the signer is in trouble, but do not fail the health check, since
the server can operate for a while without the signer (the server will
have degraded performance, but is not down)

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-15 10:48:10 -07:00
Ying Li bca919c65f Making an RPC call would hang forever if the connection to the GRPC server dies
(it just retries to connect, and the RPC call would just block until it does), so change up
how this works by timing out the health check.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-14 18:03:19 -07:00
Ying Li cd5015592a Fix the key names for the server health checks
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-14 14:52:31 -07:00
Ying Li 30330f43e2 Register trust health checks and DB health check with the notary server.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-14 13:23:38 -07:00
Ying Li 7fa991c3ff Gormizes the server database and make it SQL-DB agnostic.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-12 16:45:41 -07:00
Diogo Mónica 52b064b6a6 Merge pull request #174 from docker/logging
Change logging to use contexts effectively
2015-08-10 10:31:21 -07:00
Aaron Lehmann a833f055e2 Change logging to use contexts effectively
Use the github.com/docker/distribution/context package to get a logger
that adds a unique ID and useful information about each HTTP request.

Use this logger in HTTP handlers instead of using logrus or the log
package directly.

Remove [Notary Server] and [Notary Signer] prefixes from log messages.

The distribution/context package was already vendored, so there are no
Godeps changes necessary.

Sample output:

    notaryserver_1 | time="2015-07-31T23:02:01Z" level=debug msg="retrieving timestamp key for docker.com/docker"
    notarysigner_1 | time="2015-07-31T23:02:01Z" level=debug msg="generated ECDSA key with keyID: ea89e7dc49a13feab1e5ed349760b148c3c6ebd86968b2bc6cb0d003a8b79f78"
    notarysigner_1 | time="2015-07-31T23:02:01Z" level=debug msg="generated new ecdsa key for role:  and keyID: ea89e7dc49a13feab1e5ed349760b148c3c6ebd86968b2bc6cb0d003a8b79f78"
    notarysigner_1 | time="2015-07-31T23:02:01Z" level=info msg="CreateKey: Created KeyID ea89e7dc49a13feab1e5ed349760b148c3c6ebd86968b2bc6cb0d003a8b79f78"
    notaryserver_1 | time="2015-07-31T23:02:01Z" level=debug msg="Creating new timestamp key for docker.com/docker. With algo: ecdsa"
    notaryserver_1 | time="2015-07-31T23:02:01Z" level=debug msg="Inserting timestamp key for docker.com/docker"
    notaryserver_1 | time="2015-07-31T23:02:01Z" level=debug msg="200 GET timestamp key" docker.com/docker=gun http.request.host="192.168.99.100:4443" http.request.id=a720da02-4312-48ae-b122-6d4bce9d3b20 http.request.method=GET http.request.remoteaddr="192.168.99.1:58178" http.request.uri="/v2/docker.com/docker/_trust/tuf/timestamp.key" http.request.useragent="Go 1.1 package http"
    notaryserver_1 | time="2015-07-31T23:02:01Z" level=info msg="response completed" http.request.host="192.168.99.100:4443" http.request.id=a720da02-4312-48ae-b122-6d4bce9d3b20 http.request.method=GET http.request.remoteaddr="192.168.99.1:58178" http.request.uri="/v2/docker.com/docker/_trust/tuf/timestamp.key" http.request.useragent="Go 1.1 package http" http.response.duration=29.703624ms http.response.status=200 http.response.written=181

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-31 16:06:56 -07:00
Jessica Frazelle 95cdfbeb58 add version to signer and server logs for debugging and issues
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-07-31 15:17:42 -07:00
Aaron Lehmann d7f11844c8 Accept configuration parameters from environment variables
For example, trust_service.type becomes
NOTARY_SERVER_TRUST_SERVICE_TYPE.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-31 13:05:34 -07:00
David Lawrence e7fa1951ab hard fail if TLS is only partially configured
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-31 10:49:42 -07:00
David Lawrence f7ca3ef62e make key algorithm configurable for local development with in memory ed25519 crypto service
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-30 11:53:39 -07:00
David Lawrence d27f480231 parse string log level from config
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-29 15:52:35 -07:00
David Lawrence 72d7d35221 fixing database queries
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-15 16:19:14 -07:00
Diogo Monica f03626a10e Refactored Rufus API
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-14 00:23:38 -07:00
David Lawrence da59198191 adding htpasswd auth to support the same set of mechanisms as distribution
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-13 14:17:24 -07:00
Derek McGowan 0f5f340d0c Fix default log level
Work around bug in viper configuration.
Viper will always use the default since it matches the whole key match first.
Setting the default to a map keeps the config file as the first matched item.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-07 11:55:49 -07:00
David Lawrence 89379a728c adding timestamping and some general cleanup
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-03 15:38:09 -07:00
David Lawrence ffc135ace9 Merge pull request #9 from docker/notaryserver_readme
Notary Server README
2015-06-21 13:21:06 -07:00
David Lawrence cd8c17b5c3 filling in README for notary-server 2015-06-21 13:19:13 -07:00
David Lawrence 73f9935ea1 renaming server/version to server/storage. version was a bad name I picked late at night 2015-06-20 19:16:20 -07:00
Nathan McCauley 518d0a2702 Notary Server in server log messages
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-06-19 11:17:06 -07:00
Nathan McCauley e46a95227c rename vetinari to notary
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-06-19 11:01:19 -07:00