Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-06-08Use pages root directory from APIJanis Altherr
2023-02-14Revert back to archive/zipKassio Borges
2022-07-15Revert: open files lazily when serving contentVladimir Shushlin
This reverts merge request https://gitlab.com/gitlab-org/gitlab-pages/-/merge_requests/803 because it caused an incident when serving large compressed files Changelog: fixed
2022-07-07Open files lazily when serving contentfeistel
Changelog: performance
2022-07-04Null out file slicefeistel
2022-07-04Convert archive field to a local variablefeistel
2022-07-04Null out zip reader after reading archivefeistel
2022-06-28Improve consistency of log fieldsfeistel
2022-06-21Clear timezones from cached zip entriesJacob Vosmaer
In https://gitlab.com/gitlab-org/gitlab-pages/-/issues/702 we discovered that by caching many `*zip.File` instances, we end up storing many Go timezone objects on the heap: one per cached `*zip.File`. This adds up to about 25% of the heap size. In this commit we set the timestamp of `*zip.File` to UTC. Because Go re-uses a single timezone object for UTC, this causes the original timezone objects of the `*zip.File` instances to be garbage collected. This reduces the heap size. Here is an example program that demonstrates the effect: ```golang package main import ( "archive/zip" "log" "os" "runtime/pprof" ) func main() { if err := load(os.Args[1]); err != nil { log.Fatal(err) } log.Printf("load finished: %d archives", len(readers)) pprof.WriteHeapProfile(os.Stdout) } var readers []*zip.ReadCloser func load(filename string) error { for i := 0; i < 1000; i++ { zr, err := zip.OpenReader(filename) if err != nil { return err } if os.Getenv("FORCE_UTC") == "1" { for _, zf := range zr.File { zf.Modified = zf.Modified.UTC() } } readers = append(readers, zr) } return nil } ```
2022-05-16Add logs for more visibility in 404s and archive corruption eventVishal Tak
2022-01-24lint: fix errorlint issuesfeistel
2022-01-24lint: fix gci issuesfeistel
2021-12-16fix: update vfs/zip implementation to ensure minimum range requests for go1.17Arran Walker
Using `gitlab.com/gitlab-org/golang-archive-zip` instead of the `archive/zip` package from the stdlib. Changelog: changed
2021-09-15refactor: move lru cache to its own packageJaime Martinez
so it can be reused by different components like the zip vfs and the rate limiter. related to https://gitlab.com/gitlab-org/gitlab-pages/-/issues/626.
2021-09-09fix: unaligned 64-bit atomic operationÆx
Changelog: fixed
2021-07-07Improve logging and correlation IDJaime Martinez
2021-02-08Refactor http client usage in httprageJaime Martinez
Moves the http.Client initialization inside the `httprange` package to the zip VFS. This makes the type `Resource` depend on an http.Client that needs to be passed on initialization. It also makes the zip VFS initialize the client. It's possible to reconfigure it to register a file protocol by calling vfs.Reconfigure explicitly.
2021-01-11Optimize zip file findingajwalker/zip-pathArran Walker
2020-11-10Allow to refresh an existing cached archives when accessedKamil Trzciński
If archive is broken (which should in fact never happen) we fail the first request and mark the cache entry as invalid. It will be refreshed on a next try.
2020-10-29Do not refresh errored archivesJaime Martinez
Remove to-do and update test
2020-10-27Make timeouts for ZIP configurableKamil Trzciński
2020-10-14Apply 2 suggestion(s) to 1 file(s)fix-zip-directoriesKamil Trzciński
2020-10-13Fix support for archives without directory structureKamil Trzciński
In case of archives that do not store directories we would fail to automatically serve `index.html` for a `/` type of request. This makes us create directories when traversing the file list. ``` Archive: public-without-dirs.zip Length Date Time Name --------- ---------- ----- ---- 40 2020-09-15 02:47 public/subdir/hello.html 14 2020-09-15 03:35 public/subdir/2bp3Qzs9CCW7cGnxhghdavZ2bJDTzvu2mrj6O8Yqjm3YMRozRZULxBBKzJXCK16GlsvO1GlbCyONf2LTCndJU9cIr5T3PLDN7XnfG00lEmf9DWHPXiAbbi0v8ioSjnoTqdyjELVKuhsGRGxeV9RptLMyGnbpJx1w2uECiUQSHrRVQNuq2xoHLlk30UAmis1EhGXP5kKprzHxuavsKMdT4XRP0d79tie4tjqtfRsP4y60hmNS1vSujrxzhDa 33 2020-09-15 02:47 public/subdir/linked.html 31 2020-09-15 02:47 public/404.html 33 2020-09-15 02:47 public/index.html 258 2020-10-13 12:40 public/bad_symlink.html 18 2020-10-13 12:40 public/symlink.html ```
2020-10-13Update LRU cache valuesKamil Trzciński
2020-10-13Rename `namespace` to `cacheNamespace`Kamil Trzciński
2020-10-13Improve LRU cache tests and implementationKamil Trzciński
2020-10-13Update metricsKamil Trzciński
2020-10-13Reduce the number of items to pruneJaime Martinez
2020-10-13Split cache set/get and add metricsJaime Martinez
2020-10-13Remove extra : from cache keyKamil Trzciński
2020-10-13Try to LRU cache offsets and symlinksKamil Trzciński
2020-10-01Move ZipCachedArchives closerKamil Trzciński
2020-10-01Move metrics.ZipOpened to readArchive()Jaime Martinez
2020-10-01Rename all zip and httprange metricsJaime Martinez
Renames all metrics to make them easier to understand. Adds a missing metric for number of open requests made by httprange.
2020-10-01Move onEvicted to zipArchiveJaime Martinez
2020-09-30Add correct measureJaime Martinez
2020-09-30Add extra metric for currently cached files per archiveJaime Martinez
2020-09-30Use histograms instead of gauges for transport durationsJaime Martinez
2020-09-30Add more metrics for zip servingJaime Martinez
Adds a bunch of new metrics related to https://gitlab.com/gitlab-org/gitlab-pages/-/issues/423. It uses [httptrace.ClienTrace](https://golang.org/src/net/http/httptrace/trace.go) to add a bunch of very granular metrics that happen when an http connection is established.
2020-09-25Return early if openArchive is already doneJaime Martinez
2020-09-22Pass context to httprange ReaderJaime Martinez
Assert that if a context is canceled the read request will fail. Add missing ctx to zip
2020-09-21Apply suggestions from feedbackJaime Martinez
2020-09-21Read archive with its own timeoutJaime Martinez
2020-09-21Add to-do referencesJaime Martinez
2020-09-21New ctx from parentCtx before opening archiveJaime Martinez
2020-09-21WIP: apply some of the suggestionsJaime Martinez
2020-09-21Add zip package that implements vfs.RootJaime Martinez
Adds a zip package capable of reading zip files from an httprange.Resource. It reads archive file contents into memory per archive that is requested from the vfs.Root. WIP: add simple test for archive reader WIP: fix build WIP: update archive test WIP: adding tests for archive WIP: print more info WIP: update zip file correct symlink WIP: use correct file Add bad symlink file to zip Update handling long symlinks update documentation and reorg code fix up stuff