Skip to content

VectorLogoZone/gitlab-proxy

Repository files navigation

GitLab SVG Proxy SVG Logo

build Status 30 day uptime

This server is a proxy to GitLab to serve SVG files.

The problem with linking directly is with the HTTP headers. GitLab sends Content-Disposition: attachment, which makes the browser try to download the image instead of displaying it.

GitLab does allow hotlinking.

It should have been simple, but for some unknown reason (probably caching conflicts), I needed to delete a lot more headers when running in production.

Running

It is a standard Dockerfile. The only tricky bit is getting the port to be configurable. See the run.sh for the parameters I use to run locally for development.

Credits

Docker Gitlab Google Cloud Run nginx NodePing water.css

Tests

# API with raw suffix: content-disposition: attachment; filename="Samsung.svg"; filename*=UTF-8''Samsung.svg
curl --verbose https://gitlab.com/api/v4/projects/celebdor%2Fdesign/repository/files/logos%2FSamsung.svg/raw?ref=master

# raw subdirectory: content-disposition: attachment
curl --verbose https://gitlab.com/celebdor/design/raw/master/logos/Samsung.svg

To Do

  • cleanup 50x error page
  • is redirect.html ever used?
  • switch to custom server using fiber

About

Proxy SVGs in gitlab repositories

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published