aptly-dev / aptly

aptly - Debian repository management tool
https://www.aptly.info/
MIT License
2.56k stars 374 forks source link

Mirrors API. Can't download repository #1185

Closed Sheridan closed 1 year ago

Sheridan commented 1 year ago

I am writing a module for ansible to work with aptly. Creating a mirror does not work - there is a strange Get link in the error.

Detailed Description

Please tell me what I'm doing wrong? Python code:

self.api_post("api/mirrors", {
      "Name"             : self.module.params['name'],
      "ArchiveURL"       : self.module.params['url'],
      "Distribution"     : self.module.params['distribution'],
      "Components"       : self.module.params['components'],
      "DownloadSources"  : self.module.params['with_sources'],
      "DownloadUdebs"    : self.module.params['with_udebs'],
      "DownloadInstaller": self.module.params['with_installer'],
      "Filter"           : self.module.params['filter'],
      "Keyrings"         : [self.module.params['key']],
    })

and query:

(
  'api/mirrors', 
  {
    'Filter': '.*', 
    'DownloadInstaller': True, 
    'DownloadUdebs': True, 
    'Name': 'microsoft', 
    'Components': ['main'], 
    'DownloadSources': True, 
    'Distribution': 'buster', 
    'Keyrings': ['https://packages.microsoft.com/keys/microsoft.asc'], 
    'ArchiveURL': 'https://packages.microsoft.com/debian/10/prod'
  }
)

result (my format):

(
 'Request fail', 
 400, 
 'http://localhost:8080/api/mirrors', 
 '{
    "error":"unable to fetch mirror: 
                   https://packages.microsoft.com/debian/10/prod/dists/buster/Release: 
                   Get \\"https:/debian/10/prod/dists/buster/Release\\": 
                   dial tcp 104.214.230.139:443: connect: connection refused"
  }'
)

The problem is that Internet access is only through an http proxy. The system environment variables http_proxy and https_proxy are set. For localhost in python requests, the setting proxies={'no_proxy': 'localhost'} is set

Sheridan commented 1 year ago

Hang up. Proxy was configured incorrectly

r4co0n commented 1 year ago

@Sheridan You should be able to close this issue - It seems to have been an error in your proxy setup, and not something we can fix.