File tree 3 files changed +16
-8
lines changed
3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -11,16 +11,14 @@ VELOCITA_HTTPS_PORT=8443
11
11
#VELOCITA_AUTH_TYPE=none
12
12
13
13
##
14
- # GitHub mirror configuration
14
+ # Mirrors configuration
15
15
##
16
16
17
+ # GitHub codeload
17
18
MIRROR_GITHUB_CODELOAD_URL=https://codeload.github.com
18
19
#MIRROR_GITHUB_CODELOAD_CACHE_SIZE=1g
19
20
20
- ##
21
- # Composer repository mirrors
22
- ##
23
-
21
+ # Packagist
24
22
MIRROR_PACKAGIST_URL=https://repo.packagist.org
25
23
MIRROR_PACKAGIST_TYPE=composer
26
24
#MIRROR_PACKAGIST_CACHE_EXPIRY=3650d
@@ -31,3 +29,9 @@ MIRROR_PACKAGIST_TYPE=composer
31
29
#MIRROR_PACKAGIST_AUTH_USERNAME=
32
30
#MIRROR_PACKAGIST_AUTH_PASSWORD=
33
31
#MIRROR_PACKAGIST_USER_AGENT=Velocita Composer Cache
32
+
33
+ # GitLab (example)
34
+ #MIRROR_GITLAB_URL=https://gitlab.com
35
+ #MIRROR_GITLAB_TYPE=composer
36
+ #MIRROR_GITLAB_AUTH_TYPE=bearer
37
+ #MIRROR_GITLAB_AUTH_PASSWORD=...
Original file line number Diff line number Diff line change @@ -59,9 +59,9 @@ For every mirror, the following configuration options are available:
59
59
| ` MIRROR_{name}_CACHE_SIZE ` | No | Size (default: ` 1g ` ) | Maximum size of this mirror's cache |
60
60
| ` MIRROR_{name}_ALLOW_REVALIDATE ` | No | Boolean (default: ` false ` ) | Allow revalidation of cached items |
61
61
| ` MIRROR_{name}_PACKAGES_JSON_EXPIRY ` | No | Time (default: ` 2m ` ) | Time after which ` packages.json ` expires |
62
- | ` MIRROR_{name}_AUTH_TYPE ` | No | Always ` basic ` (default) | Type of upstream authentication |
63
- | ` MIRROR_{name}_AUTH_USERNAME ` | No | String | Username for basic authentication |
64
- | ` MIRROR_{name}_AUTH_PASSWORD ` | No | String | Password for basic authentication |
62
+ | ` MIRROR_{name}_AUTH_TYPE ` | No | One of: ` basic ` (default), ` bearer ` | Type of upstream authentication |
63
+ | ` MIRROR_{name}_AUTH_USERNAME ` | No | String | Username for authentication |
64
+ | ` MIRROR_{name}_AUTH_PASSWORD ` | No | String | Password or token for authentication |
65
65
| ` MIRROR_{name}_USER_AGENT ` | No | String | User Agent header sent to upstream |
66
66
67
67
For time and size unit syntax, see: http://nginx.org/en/docs/syntax.html
Original file line number Diff line number Diff line change @@ -147,6 +147,10 @@ server {
147
147
<%- unless mirror[:auth_user].empty? || mirror[:auth_pass].empty? -%>
148
148
proxy_set_header Authorization "Basic <%= Base64.strict_encode64("#{mirror[:auth_user]}:#{mirror[:auth_pass]}") %> ";
149
149
<%- end -%>
150
+ <%- when 'bearer' -%>
151
+ <%- unless mirror[:auth_pass].empty? -%>
152
+ proxy_set_header Authorization "Bearer <%= mirror[:auth_pass] %> ";
153
+ <%- end -%>
150
154
<%- end -%>
151
155
<%- if mirror[:type] == 'composer' -%>
152
156
You can’t perform that action at this time.
0 commit comments