Skip to content

Commit

Permalink
Option to configure Content disposition for raw and maven2 proxies (#386
Browse files Browse the repository at this point in the history
)

* Set enableCookies and enableCircularRedirects

* Update create_repos_from_list.groovy

* Update README.md

---------

Co-authored-by: Olivier Clavel <olivier.clavel@gmail.com>
  • Loading branch information
brianveltman and zeitounator committed Dec 15, 2023
1 parent 2125dba commit 1fd793a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,8 @@ Configuring blobstore on S3 is provided as a convenience and is not part of the
# maximum_metadata_age: 1440
# negative_cache_enabled: true
# negative_cache_ttl: 1440
# Content disposition is only supported for raw and maven2 proxies and can be set to attachment or inline. Inline is Nexus default, even when the property is not set explicitly.
# content_disposition: inline
- name: jboss
remote_url: 'https://repository.jboss.org/nexus/content/groups/public-jboss/'
# cleanup_policies:
Expand All @@ -636,6 +638,8 @@ Configuring blobstore on S3 is provided as a convenience and is not part of the
# maximum_metadata_age: 1440
# negative_cache_enabled: true
# negative_cache_ttl: 1440
# Content disposition is only supported for raw and maven2 proxies and can be set to attachment or inline. Inline is Nexus default, even when the property is not set explicitly.
# content_disposition: inline
# example with a login/password :
# - name: secret-remote-repo
# remote_url: 'https://company.com/repo/secure/private/go/away'
Expand All @@ -645,6 +649,8 @@ Configuring blobstore on S3 is provided as a convenience and is not part of the
# # maximum_metadata_age: 1440
# # negative_cache_enabled: true
# # negative_cache_ttl: 1440
# Content disposition is only supported for raw and maven2 proxies and can be set to attachment or inline. Inline is Nexus default, even when the property is not set explicitly.
# # content_disposition: inline
# To set HTTP request settings:
# # enable_circular_redirects: true
# # enable_cookies: true
Expand Down
7 changes: 7 additions & 0 deletions files/groovy/create_repos_from_list.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ parsed_args.each { currentRepo ->
]
}

// Configure content disposition for maven and raw proxy repos
if (currentRepo.type == 'proxy' && currentRepo.format == 'maven2' || currentRepo.format == 'raw'){
configuration.attributes['raw'] = [
contentDisposition: currentRepo.content_disposition ? currentRepo.content_disposition.toUpperCase() : "INLINE"
]
}

// Configure cleanup policy
if (currentRepo.type == 'proxy' || currentRepo.type == 'hosted') {
def cleanupPolicies = currentRepo.cleanup_policies as Set
Expand Down

0 comments on commit 1fd793a

Please sign in to comment.