Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to support security.debian.org? #37

Closed
kenhys opened this issue Mar 16, 2018 · 5 comments
Closed

How to support security.debian.org? #37

kenhys opened this issue Mar 16, 2018 · 5 comments
Assignees
Labels

Comments

@kenhys
Copy link
Contributor

kenhys commented Mar 16, 2018

Problem

It seems that go-apt-cacher can't handle missing path case.
Are there any workaround configuration on this issue?

Expected

There is a workaround configuration in go-apt-cacher.toml or something.

Actual

It works with apt-line:

deb http://security.debian.org/debian-security/ jessie/updates main
deb-src http://security.debian.org/debian-security/ jessie/updates main

and go-apt-cacher.toml.

[mapping]
debian = "http://ftp.jp.debian.org/debian"
debian-security = "http://security.debian.org/debian-security"

But It doesn't work with apt-line and above toml:

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main
% sudo apt update
...(skip)...
Fetched 23.1 MB in 2s (10.4 MB/s)                                                 
W: Failed to fetch http://security.debian.org/dists/jessie/updates/main/source/Sources  404  Not Found

W: Failed to fetch http://security.debian.org/dists/jessie/updates/main/binary-amd64/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

How to configure go-apt-cacher.toml mapping correctly for http://security.debian.org/? (without modifiyng /etc/apt/sources.list?)

@ymmt2005
Copy link
Member

@kenhys Thank you for the bug report.
This may be related to #27. I will take a look.

@ymmt2005 ymmt2005 self-assigned this Mar 19, 2018
@ymmt2005
Copy link
Member

ymmt2005 commented Mar 19, 2018

@kenhys
I failed to reproduce the reported problem with apt on Ubuntu 16.04.
Could you provide information about the environment where the problem can be reproduced?

go-apt-cacher.toml:

(snip)

[mapping]
debian = "http://ftp.jp.debian.org/debian"
debian-security = "http://security.debian.org/debian-security"

/etc/apt/sources.list:

deb http://localhost:3142/debian jessie main
deb-src http://localhost:3142/debian jessie main
deb http://localhost:3142/debian-security jessie/updates main
deb-src http://localhost:3142/debian-security jessie/updates main

Result of sudo apt update:

$ sudo apt update
Ign:1 http://localhost:3142/debian jessie InRelease
Get:2 http://localhost:3142/debian-security jessie/updates InRelease [63.1 kB]
Get:3 http://localhost:3142/debian jessie Release [148 kB] 
Get:4 http://localhost:3142/debian jessie Release.gpg [2,434 B]                   
Hit:5 http://packages.microsoft.com/repos/vscode stable InRelease                       
Ign:6 http://localhost:3142/debian jessie/main Sources
Ign:7 http://localhost:3142/debian jessie/main amd64 Packages
Ign:8 http://localhost:3142/debian jessie/main i386 Packages
Get:9 http://localhost:3142/debian jessie/main Translation-en [4,583 kB]
Get:6 http://localhost:3142/debian jessie/main Sources [9,167 kB]   
Get:7 http://localhost:3142/debian jessie/main amd64 Packages [9,064 kB]
Get:8 http://localhost:3142/debian jessie/main i386 Packages [9,065 kB]
Fetched 32.1 MB in 2s (14.7 MB/s)                                
Reading package lists... Done
Building dependency tree       
Reading state information... Done
113 packages can be upgraded. Run 'apt list --upgradable' to see them.

@kenhys
Copy link
Contributor Author

kenhys commented Mar 19, 2018

Thanks, @ymmt2005

Here is the reproducible environment, I know:

  • sid(host) with go-apt-cacher running
  • jessie(doker container) (docker pull debian:jessie), use cache on host via proxy (Acquire::http::proxy "http://172.17.0.1:3142/";)

I think that important point to reproduce this issue is "missing path" (/debian-security suffix) with guest container's default apt-line.

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

And problem is how to map missing path( /debian-security ) between apt-line(guest) and go-apt-cacher.toml(host) correctly.

@ymmt2005
Copy link
Member

ymmt2005 commented Mar 19, 2018

Understood. What you want is a forward HTTP proxy, isn't it?

go-apt-cacher is not a forward HTTP proxy by design.
It is a reverse HTTP(HTTPS) proxy specially designed for APT repositories.
By being a reverse-proxy, go-apt-cacher can support HTTPS origins as well as HTTP.

Please read the detailed descriptions in this article:
http://ymmt2005.hatenablog.com/entry/2016/07/19/Introducing_go-apt-cacher_and_go-apt-mirror

So, you need to edit /etc/apt/sources.list to point go-apt-cacher directly.

@kenhys
Copy link
Contributor Author

kenhys commented Mar 22, 2018

Ah, I got it. I've misunderstood design of it.
So, I'll close this issue.
Thanks, @ymmt2005 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants