Commit graph

19 commits

Author SHA1 Message Date
Konrad Wojas
83e78c6cd7 Allow numbers in htpasswd usernames 2021-01-05 00:08:26 +08:00
Juergen Hoetzel
33c41b55bb Security: Prevent loading of usernames containing a slash
"/" is valid char in HTTP authorization headers, but is also used in
rest-server to map usernames to private repos.

This commit prevents loading maliciously composed usernames like
"/foo/config" by restricting the allowed characters to the unicode
character class, numbers, "-", "." and "@".

Closes #131
2020-12-28 11:30:00 +01:00
Aaron Bieber
f18a5c16be
reload htpasswd on SIGHUP 2019-03-04 16:55:29 -07:00
Aaron Bieber
bdaa1ae345 Check for more bcrypt prefixes 2018-02-15 17:19:17 +01:00
Aaron Bieber
733c8da8fc Enable support for bcrypt'd password hashes in htpasswd 2018-02-15 17:19:17 +01:00
Zlatko Čalušić
d056b85432 Check errors in many places
Admittedly, in some places just document the fact that we ignore error
return values, 'cause we don't know what to do with it.  At least, the
linter is happy.
2017-10-25 18:31:34 +02:00
Zlatko Čalušić
9b89df0842 Comment global variables 2017-10-25 18:14:07 +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
Matthew Holt
65152c7bf5 Move main function into separate package (closes #12) 2017-06-25 11:48:02 +02:00
Zlatko Čalušić
267ae63276 Remove fs package and dirty tricks it does
The Linux kernel page cache ALWAYS knows better.  Fighting it brings
only worse performance. Usage of fadvise() is wrong 9 out of 10 times.

Removing the whole fs package brings a nice 100% speedup when running
costly prune command. And that is measured on localhost, the improvement
could be much bigger when using network with higher latency.
2016-11-06 20:09:42 +01:00
Zlatko Čalušić
e0ac4f7afb Remove needless build tags 2016-11-06 11:26:06 +01:00
Zlatko Čalušić
5de6d4fd00 Reformat comments 2016-11-06 11:24:28 +01:00
Zlatko Čalušić
93d8c2beba Copy errors & fs packages from the restic repo and fix import paths
Tedious, but I see no better way...
2016-11-05 17:33:34 +01:00
Zlatko Čalušić
80196e6df6 Update with changes from github.com/restic/restic tree
Uncompilable right now, due to bad import paths.
2016-11-05 17:18:42 +01:00
Chapuis Bertil
60fe10382a added htpasswd 2015-09-19 14:28:43 +02:00
Chapuis Bertil
c19c63325c simple backend 2015-09-16 23:34:11 +02:00
Chapuis Bertil
436de7f687 https support 2015-09-07 15:11:03 +02:00