Add an endpoint for proxying artifacts on a GitLab server
Per https://gitlab.com/gitlab-org/gitlab-ce/issues/34102#note_38326228
We want to be able to serve any file in any GitLab artifact from the Pages daemon.
Pages will need to take a new option: -artifacts-server
Authentication is out of scope for this iteration, meaning only public artifacts will be browsable in this way.
Some representation of the full path of the project (to support subgroups) will be joined with the job ID to create a unique domain label. One suggestion is group~group~group~project~jobID
. Another is artifact~<projectID>~<jobID>
. This will then be joined to pages-domain
to create an unambiguous endpoint.
- Make sure all possible combinations are globally unique
- What about label length? We're limited to 63 characters, maximum nesting is 20...
Requests to that endpoint will cause Pages to hit the .../raw
endpoint in GitLab and stream the content to the user, setting both Content-Type
and Content-Length
correctly.
- Range queries and other oddities?
-
Caching? I assume we'll want basic
Cache-Control
headers just like the rest of Pages.
We've been talking elsewhere about making Pages operate on artifacts directly, rather than having the current -pages-root
and the unpack step in gitlab-ce: https://gitlab.com/gitlab-org/gitlab-pages/issues/68#note_35039355 . This will be a good chance to investigate how such a solution could look without breaking existing setups!