Skip to content

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
soulteary committed Jun 13, 2022
1 parent 4e07c43 commit f0285e6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ http_proxy=http://your-domain-or-ip-address:3142 apt-get -o pkgProblemResolver=t

When we need to execute the above commands repeatedly in batches, the speed of update and installation **will be greatly improved**.

### Specified Mirror

```bash
# proxy cache for both `ubuntu` and `debian`
./apt-proxy --ubuntu=https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ --debian=https://mirrors.tuna.tsinghua.edu.cn/debian/
# proxy cache for `ubuntu` only
./apt-proxy --mode=ubuntu --ubuntu=https://mirrors.tuna.tsinghua.edu.cn/ubuntu/
# proxy cache for `debian` only
./apt-proxy --mode=debian --debian=https://mirrors.tuna.tsinghua.edu.cn/debian/
```

### Speed UP Docker Container

Assuming you have started a container:
Expand Down Expand Up @@ -80,16 +91,18 @@ View configuration items:
Usage of apt-proxy:
-cachedir string
the dir to store cache data in (default "./.aptcache")
-debian string
the debian mirror for fetching packages
-debug
whether to output debugging logging
-host string
the host to bind to (default "0.0.0.0")
-mirror string
the mirror for fetching packages
-mode all
select the mode of system to cache: all / `ubuntu` / `debian` (default "all")
-port string
the port to bind to (default "3142")
-ubuntu string
the ubuntu mirror for fetching packages
```
## [WIP] Development
Expand Down
1 change: 0 additions & 1 deletion cli/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ func initStore(appFlags AppFlags) (cache httpcache.Cache, err error) {
}

func initProxy(appFlags AppFlags, cache httpcache.Cache) (ap *proxy.AptProxy) {
// TODO support both ubuntu and debian
ap = proxy.CreateAptProxyRouter()
ap.Handler = httpcache.NewHandler(cache, ap.Handler)
return ap
Expand Down
4 changes: 0 additions & 4 deletions proxy/proxy.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package proxy

import (
"fmt"
"log"
"net/http"
"net/http/httputil"
Expand All @@ -25,10 +24,7 @@ type AptProxy struct {
}

func CreateAptProxyRouter() *AptProxy {

mode := state.GetProxyMode()
fmt.Println("mode", mode)
// TODO support both ubuntu and debian
rewriter = linux.CreateNewRewriters(mode)

return &AptProxy{
Expand Down

0 comments on commit f0285e6

Please sign in to comment.