/lug

Extensible backend of software mirror

Primary LanguageGoApache License 2.0Apache-2.0

lug

release Go Report Card Build Status Docker pulls Apache License

Extensible backend of software mirror. Read our Wiki for usage and guides for developmenet.

Use it in docker

docker run -d -v {{host_path}}:{{docker_path}} -v {{absolute_path_of_config.yaml}}:/go/src/github.com/sjtug/lug/config.yaml htfy96/lug {other args...}

config.yaml

The below configuration may be outdated. Refer to config.example.yaml and Wiki for the latest version.

interval: 3 # Interval between pollings
loglevel: 5 # 0-5. 0 for ERROR and 5 for DEBUG
logstashaddr: "172.0.0.4:6000" # TCP Address of logstash. empty means no logstash support
dummy: # place your anchor here!
    common_interval: &common_interval
      interval: 3600
repos:
    - type: shell_script
      script: rsync -av rsync://rsync.chiark.greenend.org.uk/ftp/users/sgtatham/putty-website-mirror/ /tmp/putty
      name: putty
      rlimit: 300M
      <<: *common_interval # interval: 3600 will be inserted here
    - type: external
      name: ubuntu
      proxy_to: http://ftp.sjtu.edu.cn/ubuntu/
      <<: *common_interval
# You can add more repos here, different repos may have different worker types,
# refer to Worker Types section for detailed explanation

Development

Contributors should push to their own branch. Reviewed code will be merged to master branch.

Currently this project assumes Go >= 1.8.

  1. set your GOPATH to a directory: export GOPATH=/home/go. Set $GOPATH/bin to your $PATH: export PATH=$PATH:$GOPATH/bin
  2. go get github.com/sjtug/lug
  3. Install dep by curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
  4. cd $GOPATH/src/github.com/sjtug/lug && dep ensure
  5. Modify code, then use go build . to build binary, or test with go test $(go list ./... | grep -v /vendor/)
  6. Run scripts/gen_license.sh before committing your code

NOTICE: Please attach test files when contributing to your module