Commit Graph

34 Commits

Author SHA1 Message Date
Alexander Neumann
d24ffc13d8 Fix tests 2022-04-15 09:38:23 +02:00
Alexander Neumann
a87a50ad11 Sync settinsg with restic, require Go >= 1.15 2022-04-15 09:38:23 +02:00
Luc Gommans
1fd9538f73 Reword --log option in --help output 2022-02-17 23:33:42 +01:00
Alexander Neumann
b739e22b04 Update VERSION files for 0.11.0 2022-02-10 19:53:08 +01:00
Enrico204
223520b964 Use os.TempDir() for temporary directory in default path 2021-09-12 21:27:45 +02:00
networkException
f373e45bc8 Config: Read in PrometheusNoAuth correctly
Previously setting --prometheus-no-auth flag would override --prometheus
2021-09-04 01:09:41 +02:00
Alexander Neumann
f90205eefe Support running on demand systemd socket activation 2021-08-17 21:37:02 +02:00
Alexander Neumann
4db46a5d3d Check error 2021-08-11 14:32:10 +02:00
Alexander Neumann
39839cfac4 Merge pull request #135 from MichaelEischer/cpu-profile-shutdown
Properly close CPU profile on SIGINT
2021-08-11 14:27:52 +02:00
Michael Eischer
16889717c6 Add option to disable integrity check on upload 2021-08-09 15:40:50 +02:00
Alexander Neumann
96a6f0a5c4 Use Cobra for showing the version 2021-08-09 11:31:54 +02:00
Konrad Wojas
9db2d52fbe Prometheus: keep auth by default
Restore the previous behaviour where the Prometheus /metrics endpoint
required auth if auth was enabled.

A new -prometheus-no-auth flag allows you to override this and disable
auth for that specific endpoint.
2021-08-09 10:49:41 +02:00
Konrad Wojas
1f593fafaf Make Server use the new repo.Handler
This contains all the glue to make Server use the new repo.Handler:

- Remove all old handlers
- Add ServeHTTP to make Server a single http.Handler
- Remove Goji routing and replace by net/http and custom routing logic

Additionally, this implements two-level backup repositories.
2021-08-09 10:49:41 +02:00
Alexander Neumann
980bff189e Add config for golangci-lint 2021-01-31 13:15:53 +01:00
Michael Eischer
0a6e0dbdf9 Properly close CPU profile on sigint
The rest server is normally shutdown via a SIGINT signal. The http
handle calls are endless loops and don't return in the normal case. Thus
add a signal handler to shutdown the profiler.
2021-01-03 20:16:54 +01:00
Alexander Neumann
65fb54cbca Update version for development 2020-09-13 11:45:09 +02:00
Alexander Neumann
13f56bbb3c Update VERSION files for 0.10.0 2020-09-13 11:24:22 +02:00
Matt Holt
a87d968870 Add --max-size flag to limit size of repositories (#72)
* Add --max-size flag to limit repository size

* Only update repo size on successful write

* Use initial size as current size for first SaveBlob

* Apply LimitReader to request body

* Use HTTP 413 for size overage responses

* Refactor size limiting; do checks after every write

* Remove extra commented lines, d'oh

* Account for deleting blobs when counting space usage

* Remove extra commented line

* Fix unrelated bug (inverted err check)

* Update comment to trigger new CI build
2018-06-14 15:53:29 -06:00
Matthew Holt
df3b6aa1cf Rename Config to Server and use singular one in main 2018-04-15 08:31:50 -06:00
Matthew Holt
b98c171644 Refactor handlers: make Config not global 2018-04-12 19:55:44 -06:00
Konrad Wojas
4d2493388a Require auth by default, add --no-auth flag
In order to prevent users from accidentally exposing rest-server without
authentication, rest-server now defaults to requiring a .htpasswd. If
you want to disable authentication, you need to explicitly pass the new
--no-auth flag.
2018-03-24 13:30:54 +01:00
Leo R. Lundgren
cbafb98113 Add --version flag to print version and exit. 2018-03-21 22:50:14 +01:00
Leo R. Lundgren
ec7289235c Rename --cpuprofile flag to --cpu-profile (#53) 2018-03-20 21:46:30 +01:00
Alexander Neumann
69ed06aa66 Move TestIsUserPath to correct package 2018-03-20 21:16:58 +01:00
Mebus
97835b4cfd added test for private repos 2018-01-23 13:56:26 +01:00
Mebus
75578acd66 fixed the code style with goimports 2018-01-23 13:56:26 +01:00
Mebus
6c846f856c added a feature for private repositories 2018-01-23 13:56:26 +01:00
n0npax
b786c5d1cc add option to secify tls cert and tls key as params
fix  #35
2017-11-23 20:20:09 +01:00
Brice Waegeneire
1bc1698f4e fix prometheus config flag 2017-11-06 00:50:16 +01:00
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
Zlatko Čalušić
d5bbf6aac8 Fix case 2017-10-04 22:07:06 +02:00
Kenny Keslar
618b530b88 Implement an append only mode. 2017-09-13 14:46:56 +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
Matthew Holt
65152c7bf5 Move main function into separate package (closes #12) 2017-06-25 11:48:02 +02:00