Commit graph

163 commits

Author SHA1 Message Date
Konrad Wojas
ca0e09261f Add Prometheus metrics
Exposes a few metrics for Prometheus under /metrics if started with --prometheus.

Example:

    # HELP rest_server_blob_read_bytes_total Total number of bytes read from blobs
    # TYPE rest_server_blob_read_bytes_total counter
    rest_server_blob_read_bytes_total{repo="test",type="data"} 2.13557024e+09
    rest_server_blob_read_bytes_total{repo="test",type="index"} 1.198653e+06
    rest_server_blob_read_bytes_total{repo="test",type="keys"} 5388
    rest_server_blob_read_bytes_total{repo="test",type="locks"} 1975
    rest_server_blob_read_bytes_total{repo="test",type="snapshots"} 10018
    # HELP rest_server_blob_read_total Total number of blobs read
    # TYPE rest_server_blob_read_total counter
    rest_server_blob_read_total{repo="test",type="data"} 3985
    rest_server_blob_read_total{repo="test",type="index"} 21
    rest_server_blob_read_total{repo="test",type="keys"} 12
    rest_server_blob_read_total{repo="test",type="locks"} 12
    rest_server_blob_read_total{repo="test",type="snapshots"} 32
    # HELP rest_server_blob_write_bytes_total Total number of bytes written to blobs
    # TYPE rest_server_blob_write_bytes_total counter
    rest_server_blob_write_bytes_total{repo="test",type="data"} 1.063726179e+09
    rest_server_blob_write_bytes_total{repo="test",type="index"} 395586
    rest_server_blob_write_bytes_total{repo="test",type="locks"} 1975
    rest_server_blob_write_bytes_total{repo="test",type="snapshots"} 1933
    # HELP rest_server_blob_write_total Total number of blobs written
    # TYPE rest_server_blob_write_total counter
    rest_server_blob_write_total{repo="test",type="data"} 226
    rest_server_blob_write_total{repo="test",type="index"} 6
    rest_server_blob_write_total{repo="test",type="locks"} 12
    rest_server_blob_write_total{repo="test",type="snapshots"} 6
2017-10-25 17:53:37 +02:00
Konrad Wojas
526a2b3837 Limit htpasswd checks to once per 30s 2017-10-24 13:04:23 +02:00
Konrad Wojas
67a0f63773 Run goimports on htpasswd.go 2017-10-24 13:04:23 +02:00
Konrad Wojas
3e4edd3dd8 Automatically reload htpasswd
If htpasswd was modified, it will be automatically reloaded. This check
happens at most once per second and only on incoming requests.

Note that this removes the public `NewHtpasswd()` function.
2017-10-24 13:04:23 +02:00
Zlatko Čalušić
50b52dfd74 Version 0.9.5 2017-10-19 11:04:22 +02:00
Zlatko Čalušić
a20136a8da Set docker image default port also to 8000
So that rest-server can be started as non-root user.  You can choose
which port to expose, anyway.
2017-10-19 00:16:54 +02:00
Zlatko Čalušić
132232db69 Update dependencies 2017-10-19 00:05:02 +02:00
Zlatko Čalušić
e4071748b9 Update README.md 2017-10-18 23:52:03 +02:00
Zlatko Čalušić
ca5664b8a7 Makefile: add rules for docker image build 2017-10-18 23:38:18 +02:00
Zlatko Čalušić
ebe3bc04b5 Docker: various updates
- use exec in entrypoint.sh, get rid of extra shell process
- use CMD instead of ENTRYPOINT, so image can be run with /bin/sh arg
2017-10-18 23:18:44 +02:00
Zlatko Čalušić
87356ac452 Docker: use golang:1.9.1-alpine to build rest-server binary 2017-10-18 23:01:53 +02:00
Zlatko Čalušić
a43bfa19e4 Update Makefile 2017-10-15 21:19:38 +02:00
Zlatko Čalušić
dc9b99777b Update .gitignore 2017-10-10 19:07:48 +02:00
Zlatko Čalušić
fff8ecd210 Update Makefile, README.md
We now have make install rule.
2017-10-05 09:53:45 +02:00
Zlatko Čalušić
8bd0ed3219 Update .travis.yml 2017-10-04 22:20:26 +02:00
Zlatko Čalušić
c091bdc8bb Introduce Makefile 2017-10-04 22:17:34 +02:00
Zlatko Čalušić
d5bbf6aac8 Fix case 2017-10-04 22:07:06 +02:00
Zlatko Čalušić
ac7c83fa47 Update README.md 2017-10-04 21:59:58 +02:00
Zlatko Čalušić
56954b3131 Update dependencies 2017-10-04 21:44:44 +02:00
cgonzalez
65a41ff4e3 Allow the $OPTIONS env var when using docker image
Example: docker run -e OPTIONS="--append-only" restic/rest-server
2017-09-20 18:48:22 +02:00
Kenny Keslar
67583ff459 Fix formatting. 2017-09-13 14:46:56 +02:00
Kenny Keslar
618b530b88 Implement an append only mode. 2017-09-13 14:46:56 +02:00
Alexander Neumann
cff373e8aa Merge pull request #29 from wscott/master
Add a hint of how to make restic use this server.
2017-09-13 14:33:10 +02:00
Wayne Scott
9d0ff790e6 Add a hint of how to make restic use this server. 2017-09-10 09:36:36 -04:00
Zlatko Čalušić
16022faa7a Update .travis.yml 2017-08-25 09:45:26 +02:00
Zlatko Čalušić
0a0ed9c4b5 Version 0.9.4 2017-07-31 11:40:22 +02:00
Zlatko Čalušić
57ca1d7d6e Slightly improve error handling
Pass errors from Cobra runRoot() to main().
2017-07-30 17:45:23 +02:00
Alexander Neumann
a628c4e01a Fix directory traversal
This commit introduces the strict checks from net/http.Dir, which fixes
a directory traversal issue.

Closes #22
2017-07-30 17:37:45 +02:00
Zlatko Čalušić
9a6bb5eebe Update README.md
Document restic v0.7.1 as the required version to run with Rest Server.

Closes #11
2017-07-22 12:32:05 +02:00
Zlatko Čalušić
cae51e1478 Update dependencies 2017-07-19 22:18:06 +02:00
Zlatko Čalušić
0e5f662fed Switch to dep dependency management tool 2017-07-19 22:12:34 +02:00
Alexander Neumann
96cdf7b3b4 Add port publish to docker instructions
Closes #19
2017-07-03 19:52:17 +02:00
Zlatko Čalušić
b2e4715d1b Version 0.9.3 2017-06-29 00:01:23 +02:00
Zlatko Čalušić
4873fd9ffe Update dependencies 2017-06-25 12:06:41 +02:00
Zlatko Čalušić
0c22253d41 Update README.md 2017-06-25 12:04:48 +02:00
Alexander Neumann
90b868dfbc build.go: Fix path for new cmd/ subdir 2017-06-25 11:48:02 +02:00
Matthew Holt
65152c7bf5 Move main function into separate package (closes #12) 2017-06-25 11:48:02 +02:00
Bruno Clermont
07b6d5facf add docker image 2017-06-22 21:17:17 +02:00
Zlatko Čalušić
6b821132ec Travis can't determine latest versions of Go 2017-06-09 00:10:45 +02:00
Zlatko Čalušić
99eb5a4682 Update .travis.yml 2017-06-05 20:57:17 +02:00
Zlatko Čalušić
d54a589176 README.md: document why and when to use rest-server 2017-06-04 12:10:11 +02:00
Zlatko Čalušić
907801c8b9 Update dependencies 2017-06-02 10:27:10 +02:00
Zlatko Čalušić
5401014105 Version 0.9.2 2017-06-02 09:51:45 +02:00
Zlatko Čalušić
267f5d330a build.go: Use Go log package instead of custom die() implementation 2017-06-02 09:26:02 +02:00
Zlatko Čalušić
e591a330e5 build.go: Update for rest-server 2017-06-02 09:04:27 +02:00
Zlatko Čalušić
fbac61c6cb build.go: Strip temporary path, allow reproducible builds
de48a5ac9c
2017-06-02 08:56:08 +02:00
Zlatko Čalušić
ba98452c5e build.go: Add --enable-cgo
c49da4c6f7
2017-06-02 08:55:27 +02:00
Zlatko Čalušić
3122bd76ed build.go: Fix ineffassign mistakes
971ecee171
2017-06-02 08:54:30 +02:00
Zlatko Čalušić
fd9e42ed71 build.go: Also copy header files
e6ca604d24
2017-06-02 08:53:31 +02:00
Zlatko Čalušić
4bc2581b47 Check version in build.go
Print a sensible error for Go < 1.7 (the "context" package is missing there)

f8dd5d5088
2017-06-02 08:52:04 +02:00