Commit Graph

56 Commits

Author SHA1 Message Date
Alexander Neumann b6ec6f45cc Update VERSION files for 0.14.0 2025-05-31 22:20:43 +02:00
DarkSpir 2b6f0b39fc Hardened tls cipher suits and added option for tls min version (#315)
* handlers.go: Added parameter for TLS min version

rest-server/main.go: Added parameter handling for TLS min version

rest-server/main.go: Added crypto.tls, implemented and configured tlsConfig object

* tls min version parameter documentation

* Added changelog documentation

* README.md: Fixed typo

main.go: Added error for unknown TLS min versions

main.go: Changed CurvePreferences in TLS config to Go default

main.go: Removed handling for TLS min versions 1.0 and 1.1

Signed-off-by: darkspir <forgejo.darkspir@teemitmil.ch>

* main.go: Improved TLSMinVer parameter documentation

* README.md: Improved --tls-min-ver parameter documentation

* main.go: Changed --tls-min-ver parameter documentation again

* main.go: Added allowed versions in Error Unsupported TLS min version

* update rest-server help output in readme

---------

Signed-off-by: darkspir <forgejo.darkspir@teemitmil.ch>
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2025-04-14 19:09:57 +00:00
akmet b0a9a0452e Add support for proxy-based authentication 2025-02-17 22:25:25 +01:00
Massimo Lusetti f053e33486 Add group-accessible-repos option (#308)
test / Go ${{ matrix.go }} (1.22.x) (push) Has been cancelled
test / Go ${{ matrix.go }} (1.23.x) (push) Has been cancelled
test / lint (push) Has been cancelled
test / Analyze results (push) Has been cancelled
* Add group-accessible-repos option

The group-accessible-repos option will let filesystem group id
be able to access files and dir within the restic repo
Default stick with old behaviour to be owner restricted
While here make dirMode and fileMode within Options struct
private

---------

Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2025-02-17 22:17:54 +01:00
Michael Eischer 9fc5066fc4 fix most linter errors 2025-02-07 22:34:40 +01:00
Leo R. Lundgren da5bb66030 Output status of append only mode on startup 2024-07-29 01:20:10 +02:00
Alexander Neumann 238eceb2a1 Update VERSION files for 0.13.0 2024-07-26 14:47:04 +02:00
Adam Eijdenberg e0674c6150 Enhancement: can now listen on a unix socket 2024-02-19 14:47:43 +11:00
Michael Eischer 13083acc1a Merge pull request #273 from ae-govau/gracefulshutdown
fix: shutdown gracefully on TERM or INT signals
2024-02-08 19:30:39 +01:00
Adam Eijdenberg ce15402f74 fix: increase test timeout to 10s, listen on 127.0.0.1 only
This is to try to fix test reliability in GitHub actions.
2024-02-06 10:14:40 +11:00
Adam Eijdenberg 8becd574cb fix: shutdown gracefully on TERM or INT signals
This allows server listen resources to be cleaned up appropriately.
2024-02-05 10:48:58 +11:00
Adam Eijdenberg 03ad2420db fix: print the actual address listened on
This is useful when the server is started with an ephemeral port, e.g.:

./rest-server --no-auth --listen "127.0.0.1:0"

...

start server on 127.0.0.1:46015
2024-02-05 10:44:25 +11:00
Alexander Neumann 76759aa52e Update version for development 2023-07-09 17:21:54 +02:00
Alexander Neumann 46e3c7248b Set version 2023-07-09 17:15:15 +02:00
Michael Eischer c064e4c1ed Merge pull request #217 from HeikoSchlittermann/feat-log-to-stdout
feat: allow logging to stdout, stderr
2023-04-30 14:56:29 +02:00
Michael Eischer e8a839673f Set development version for 0.12.0 2023-04-27 21:41:32 +02:00
Heiko Schlittermann (HS12-RIPE) 9f074d8b3a feat: allow logging to stdout
The --log option accepts "-" as filename. This prevents rest-server from
opening the log file, it simply writes to the STDOUT stream provided by
the caller.

**BREAKING** in case use really used "-" to specify a file named "-"
you'll need to update your rest-server invocation to use "./-".
2023-04-24 11:15:38 +02:00
Michael Eischer fa795cc66a upgrade go-systemd to latest major version 2023-01-14 21:00:32 +01:00
Michael Eischer 43c96fb6f2 Error out on unexpected command line argument
rest-server doesn't accept arguments. Thus, error out to prevent wrong
usage.
2023-01-11 21:47:25 +01:00
rawtaz 6bc87b8e95 Merge pull request #188 from dwmunster/f-config-htpasswd
Add configurable htpasswd file location
2022-06-20 23:40:49 +02:00
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
Drayton Munster bc1545c717 Clarifying descriptions as suggested in PR review 2022-03-25 22:25:48 -04:00
Drayton Munster 3903ed000c Add configurable htpasswd location 2022-03-25 15:39:20 -04: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