Commit graph

164 commits

Author SHA1 Message Date
c286b3b1d0 Added TokenBucket to limit the rate of validation failures (#151)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
v4.4
Added new TockenBucket named `acmeClientFailLimit` to avoid being banned because of the [Failed validation limit](https://letsencrypt.org/docs/failed-validation-limit/) of Let's Encrypt. The behaviour is similar to the other limiters blocking the `obtainCert` func ensuring rate under limit. Co-authored-by: fsologureng <sologuren@estudiohum.cl> Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: #151 Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: Felipe Leopoldo Sologuren Gutiérrez <fsologureng@noreply.codeberg.org> Co-committed-by: Felipe Leopoldo Sologuren Gutiérrez <fsologureng@noreply.codeberg.org>
2023-01-04 05:26:14 +00:00
f7fad2a5ae Integration Tests use https://codeberg.org/cb_pages_tests
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful
2023-01-04 06:08:06 +01:00
98d198d419 Safely get certificate's leaf (#150)
- It's not guaranteed that `tls.X509KeyPair` will set `c.Leaf`. - This patch fixes this by using a wrapper that parses the leaf certificate(in bytes) if `c.Leaf` wasn't set. - Resolves #149 Co-authored-by: Gusted <postmaster@gusted.xyz> Reviewed-on: #150 Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: Gusted <gusted@noreply.codeberg.org> Co-committed-by: Gusted <gusted@noreply.codeberg.org>
2023-01-04 04:51:27 +00:00
9d769aeee7 Fix error page generation (#145) v4.3
Co-authored-by: crapStone <crapstone01@gmail.com> Reviewed-on: #145 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: crapStone <crapstone@noreply.codeberg.org> Co-committed-by: crapStone <crapstone@noreply.codeberg.org>
2022-12-04 21:24:58 +00:00
dcf03fc078 Fix error page (#144)
Co-authored-by: crapStone <crapstone01@gmail.com> Reviewed-on: #144 Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: crapStone <crapstone@noreply.codeberg.org> Co-committed-by: crapStone <crapstone@noreply.codeberg.org>
2022-12-02 15:25:25 +00:00
5e72753e91
ci: "docker-tag" use tags v4.2 2022-11-22 22:30:53 +01:00
caeb1a4acb Return a 404 if there is no repository (#141)
If no repository is found the user expects a 404 status code instead of a dependency failed status code (as it was before). Signed-off-by: Jan Klippel <c0d3b3rg@kl1pp3l.de> Fixes: Codeberg/Community#809 Co-authored-by: Jan Klippel <c0d3b3rg@kl1pp3l.de> Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: #141 Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: jklippel <jklippel@noreply.codeberg.org> Co-committed-by: jklippel <jklippel@noreply.codeberg.org>
2022-11-22 21:26:10 +00:00
f2f943c0d8 Remove unnecessary conversion (#139)
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
- Remove unnecessary type conversion. - Enforce via CI Co-authored-by: Gusted <williamzijl7@hotmail.com> Reviewed-on: #139 Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: Gusted <gusted@noreply.codeberg.org> Co-committed-by: Gusted <gusted@noreply.codeberg.org>
2022-11-15 16:15:11 +01:00
3c61a39864 Enable http/2 support (#137)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
v4.1
As per [the documentation](https://pkg.go.dev/net/http#Serve), it doesn't enable HTTP2 by-default, unless we enable it via the `NextProtos` option. Co-authored-by: Gusted <williamzijl7@hotmail.com> Reviewed-on: #137 Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: Gusted <gusted@noreply.codeberg.org> Co-committed-by: Gusted <gusted@noreply.codeberg.org>
2022-11-12 22:25:20 +01:00
4565481643
refactor: finish use default const for defaultPagesBranch and defaultPagesRepo
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
v4.0
2022-11-12 21:16:11 +01:00
c827a28dd8
defaultPagesBranch
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2022-11-12 21:13:13 +01:00
aa90356f0a
use a const for defaultPagesRepo
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-11-12 21:10:16 +01:00
b6d0a04b21
refactor: rm not needed type conversion
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-11-12 21:04:34 +01:00
6c63b66ce4 Refactor split long functions (#135)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
we have big functions that handle all stuff ... we should split this into smaler chuncks so we could test them seperate and make clear cuts in what happens where Reviewed-on: #135
2022-11-12 20:43:44 +01:00
b9966487f6 switch to std http implementation instead of fasthttp (#106)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
close #100 close #109 close #113 close #28 close #63 Reviewed-on: #106
2022-11-12 20:37:20 +01:00
69eabb248a
CI publish next only on default branch
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-11-12 00:23:45 +01:00
8e67d28c4f
Add editorconfig, fix files and lint via ci
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-11-11 23:51:45 +01:00
91b54bef29
add newline
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-11-07 23:09:41 +01:00
bf9a08e1fd Fatal on ACME Client creation failure (#133)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- For production(*cough* Codeberg *cough*), it's important to not use mock certs. So fail right from the start if this is the case and not try to "handle it gracefully", as it would break production. - Resolves #131 CC @6543 Co-authored-by: Gusted <williamzijl7@hotmail.com> Reviewed-on: #133 Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: Gusted <gusted@noreply.codeberg.org> Co-committed-by: Gusted <gusted@noreply.codeberg.org>
2022-11-07 16:27:37 +01:00
b9e9f14209 use codeberg.org/6543/docker-images/golang_just
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
v3.2.1
Signed-off-by: 6543 <6543@obermui.de>
2022-10-10 23:27:33 +02:00
df2228b6d5 ci: let tag run pipeline
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2022-10-10 23:25:21 +02:00
091e6c8ed9 Add explicit logging in GetBranchTimestamp (#130)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- Logs are currently indicating that it's returning `nil` in valid scenarios, therefor this patch adds extra logging in this code to better understand what it is doing in this function. Co-authored-by: Gusted <williamzijl7@hotmail.com> Reviewed-on: #130 Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: Gusted <gusted@noreply.codeberg.org> Co-committed-by: Gusted <gusted@noreply.codeberg.org>
2022-09-18 16:13:27 +02:00
2a730b2439 Update README (#128)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- Update readme accordingly to the 876a53d9a2 Co-authored-by: Gusted <williamzijl7@hotmail.com> Reviewed-on: #128 Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: Gusted <gusted@noreply.codeberg.org> Co-committed-by: Gusted <gusted@noreply.codeberg.org>
2022-09-13 23:26:45 +02:00
8f2699407d Make verbose checks in tryBranch (#127)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- It's likely that the tryBranch is returning false when it should be returning true, make these logs more verbose so they show up on production logs. Co-authored-by: Gusted <williamzijl7@hotmail.com> Reviewed-on: #127 Reviewed-by: 6543 <6543@obermui.de> Co-authored-by: Gusted <gusted@noreply.codeberg.org> Co-committed-by: Gusted <gusted@noreply.codeberg.org>
2022-09-13 23:06:31 +02:00
1ae50735a1 Add host to handler logging (#123)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
v3.2
- Add the host to the Handler's logging fields, so you don't just see the path, but also which domain was being requested. Co-authored-by: Gusted <williamzijl7@hotmail.com> Reviewed-on: #123 Reviewed-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: Gusted <gusted@noreply.codeberg.org> Co-committed-by: Gusted <gusted@noreply.codeberg.org>
2022-08-13 18:03:31 +02:00
392c6ae452
full-name
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-08-12 07:02:24 +02:00
88a217fbe6
docker images must be lowercase
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2022-08-12 06:55:35 +02:00
dc41a4caf4 Add Support to Follow Symlinks and LFS (#114)
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
close #79 close #80 close #91 Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: #114
2022-08-12 06:40:12 +02:00
519259f459
publish docker images on tag and push to main (#122)
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: #122
2022-08-12 06:32:21 +02:00
f72bbfd85f Fix just dev (#121)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- Use the correct log level command, since 876a53d9a2 Co-authored-by: Gusted <williamzijl7@hotmail.com> Reviewed-on: #121 Reviewed-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: Gusted <gusted@noreply.codeberg.org> Co-committed-by: Gusted <gusted@noreply.codeberg.org>
2022-08-12 05:24:05 +02:00
876a53d9a2 Improve logging (#116)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- Actually log useful information at their respective log level. - Add logs in hot-paths to be able to deep-dive and debug specific requests (see server/handler.go) - Add more information to existing fields(e.g. the host that the user is visiting, this was noted by @fnetX). Co-authored-by: Gusted <williamzijl7@hotmail.com> Reviewed-on: #116 Reviewed-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: Gusted <gusted@noreply.codeberg.org> Co-committed-by: Gusted <gusted@noreply.codeberg.org>
2022-08-12 05:06:26 +02:00
e06900d5e5
fix lint issue
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-08-08 15:25:31 +02:00
00e8a41c89 Add Dockerfile (#111)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: #111 Reviewed-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: dorianim <mail@dorian.im> Co-committed-by: dorianim <mail@dorian.im>
2022-07-16 00:59:55 +02:00
8207586a48
just fix bcaceda711
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
v3.1
2022-07-15 21:39:42 +02:00
bcaceda711 dont cache if ContentLength greater fileCacheSizeLimit (#108)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: #108 Reviewed-by: Otto <otto@codeberg.org>
2022-07-15 21:21:26 +02:00
5411c96ef3 Tell fasthttp to not set "Content-Length: 0" on non cached content (#107)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
fix #97 Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: #107
2022-07-15 21:06:05 +02:00
baf4e7e326 Make the 404 page more readable and natural (#104)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: #104 Reviewed-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: Jeremy <jtbx@noreply.codeberg.org> Co-committed-by: Jeremy <jtbx@noreply.codeberg.org>
2022-07-15 17:18:25 +02:00
fd24b4a2bc Pass logger to fasthttp (#98)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- Use a logger with `FASTHTTP` prefix as fasthttp's logger so it's easy to see what fasthttp is logging in console/journal. Co-authored-by: Gusted <williamzijl7@hotmail.com> Reviewed-on: #98 Reviewed-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: Gusted <gusted@noreply.codeberg.org> Co-committed-by: Gusted <gusted@noreply.codeberg.org>
2022-07-12 15:32:48 +02:00
9076bc3f75 Support access branch that contains slash character (#102)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
So we can access branch that contain slash like `branch/name` with `username.codeberg.page/repo/@branch~name/`. Branch name cannot contain `~` character but it can be in a HTTP URL, so replace the `~` from URL to `/` could be a valid solution to me. Resolve #101 Co-authored-by: Gary Wang <wzc782970009@gmail.com> Reviewed-on: #102 Reviewed-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: Gary Wang <blumia@noreply.codeberg.org> Co-committed-by: Gary Wang <blumia@noreply.codeberg.org>
2022-07-08 13:39:24 +02:00
48a49f69a7 Increase concurrent connections to default value (#99)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
v3.0a
Use the default value of `256 * 1024` for the concurrency limit, this will mean that the server will be able to handle more connections. Co-authored-by: Gusted <williamzijl7@hotmail.com> Reviewed-on: #99 Reviewed-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: Gusted <gusted@noreply.codeberg.org> Co-committed-by: Gusted <gusted@noreply.codeberg.org>
2022-07-03 13:20:02 +02:00
6dedd55eb3 Release via CI (#94)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
v3.0
* release via CI * general CI improvements close #76, close #92 Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: #94
2022-06-14 20:35:11 +02:00
4c6164ef05 Propagate ETag from gitea (#93)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
close #15 Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: #93
2022-06-14 18:23:34 +02:00
cc32bab31f Enhance joinURL and return error on gitea client on start instead while running (#88)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: #88
2022-06-13 20:07:32 +02:00
913f762eb0 Add integration test for custom domain (#90)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
and some nits --- close #89 Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: #90
2022-06-13 14:43:49 +02:00
38fb28f84f implement custom 404 pages (#81)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
solves #56. - The expected filename is `404.html`, like GitHub Pages - Each repo/branch can have one `404.html` file at it's root - If a repo does not have a `pages` branch, the 404.html file from the `pages` repository is used - You get status code 404 (unless you request /404.html which returns 200) - The error page is cached --- close #56 Reviewed-on: #81 Reviewed-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: crystal <crystal@noreply.codeberg.org> Co-committed-by: crystal <crystal@noreply.codeberg.org>
2022-06-12 03:50:00 +02:00
35b35c5d67 Add integration tests (#86)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
close #82 close #32 make sure we dont get regressions again ... as we currently have in **main** followups: - create a DNS subdomayn specific to redirect to mock url ... Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: #86 Reviewed-by: crapStone <crapstone@noreply.codeberg.org>
2022-06-11 23:17:43 +02:00
02bd942b04 Move gitea api calls in own "client" package (#78)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
continue #75 close #16 - fix regression (from #34) _thanks to @crystal_ - create own gitea client package - more logging - add mock impl of CertDB Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: crystal <crystal@noreply.codeberg.org> Reviewed-on: #78 Reviewed-by: crapStone <crapstone@noreply.codeberg.org>
2022-06-11 23:02:06 +02:00
659932521c Add info how to test & debug the server (#85)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: #85
2022-06-10 20:17:07 +02:00
bb8eb32ee2 make debug messages unique
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-06-10 15:29:47 +02:00
f2ba7eac64 set golang to 1.18 (#84)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: #84
2022-06-10 15:27:17 +02:00