From 5c27c960f0d1f82c27fcac89b0ae51183d9aa6f2 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Mon, 25 Jan 2016 00:39:16 -0500 Subject: [PATCH] clean the slate! --- AUTHORS | 5 - CONFIGURATION.md | 237 --------------------------- CONTRIBUTING.md | 77 --------- Dockerfile | 33 ---- Godeps/Godeps.json | 57 ------- Godeps/Readme | 5 - LICENSE | 24 --- README.md | 99 ----------- api/api.go | 162 ------------------ api/routes.go | 120 -------------- chihaya.go | 121 -------------- cmd/chihaya/main.go | 11 -- config/config.go | 193 ---------------------- debug.go | 56 ------- example_config.json | 35 ---- http/announce_test.go | 299 ---------------------------------- http/http.go | 152 ----------------- http/http_test.go | 90 ---------- http/query/query.go | 112 ------------- http/query/query_test.go | 100 ------------ http/routes.go | 46 ------ http/scrape_test.go | 98 ----------- http/tracker.go | 197 ---------------------- http/writer.go | 118 -------------- stats/mem.go | 78 --------- stats/stats.go | 291 --------------------------------- tracker/announce.go | 241 --------------------------- tracker/jwt.go | 147 ----------------- tracker/models/models.go | 227 -------------------------- tracker/models/models_test.go | 64 -------- tracker/models/peermap.go | 205 ----------------------- tracker/scrape.go | 28 ---- tracker/storage.go | 274 ------------------------------- tracker/tracker.go | 109 ------------- udp/announce_test.go | 87 ---------- udp/connection.go | 90 ---------- udp/connection_test.go | 70 -------- udp/protocol.go | 267 ------------------------------ udp/scrape_test.go | 77 --------- udp/udp.go | 148 ----------------- udp/udp_test.go | 129 --------------- udp/writer.go | 97 ----------- 42 files changed, 5076 deletions(-) delete mode 100644 AUTHORS delete mode 100644 CONFIGURATION.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Dockerfile delete mode 100644 Godeps/Godeps.json delete mode 100644 Godeps/Readme delete mode 100644 LICENSE delete mode 100644 README.md delete mode 100644 api/api.go delete mode 100644 api/routes.go delete mode 100644 chihaya.go delete mode 100644 cmd/chihaya/main.go delete mode 100644 config/config.go delete mode 100644 debug.go delete mode 100644 example_config.json delete mode 100644 http/announce_test.go delete mode 100644 http/http.go delete mode 100644 http/http_test.go delete mode 100644 http/query/query.go delete mode 100644 http/query/query_test.go delete mode 100644 http/routes.go delete mode 100644 http/scrape_test.go delete mode 100644 http/tracker.go delete mode 100644 http/writer.go delete mode 100644 stats/mem.go delete mode 100644 stats/stats.go delete mode 100644 tracker/announce.go delete mode 100644 tracker/jwt.go delete mode 100644 tracker/models/models.go delete mode 100644 tracker/models/models_test.go delete mode 100644 tracker/models/peermap.go delete mode 100644 tracker/scrape.go delete mode 100644 tracker/storage.go delete mode 100644 tracker/tracker.go delete mode 100644 udp/announce_test.go delete mode 100644 udp/connection.go delete mode 100644 udp/connection_test.go delete mode 100644 udp/protocol.go delete mode 100644 udp/scrape_test.go delete mode 100644 udp/udp.go delete mode 100644 udp/udp_test.go delete mode 100644 udp/writer.go diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index b62effb..0000000 --- a/AUTHORS +++ /dev/null @@ -1,5 +0,0 @@ -# This is the official list of Chihaya authors for copyright purposes, in alphabetical order. - -Jimmy Zelinskie -Justin Li - diff --git a/CONFIGURATION.md b/CONFIGURATION.md deleted file mode 100644 index 81370b0..0000000 --- a/CONFIGURATION.md +++ /dev/null @@ -1,237 +0,0 @@ -# Configuration - -Chihaya's behaviour is customized by setting up a JSON configuration file. -Available keys are as follows: - -##### `httpListenAddr` - - type: string - default: "localhost:6881" - -The listen address for the HTTP server. If only a port is specified, the tracker will listen on all interfaces. If left empty, the tracker will not run a HTTP endpoint. - -##### `httpRequestTimeout` - - type: duration - default: "4s" - -The duration to allow outstanding requests to survive before forcefully terminating them. - -##### `httpReadTimeout` - - type: duration - default: "4s" - -The maximum duration before timing out read of the request. - -##### `httpWriteTimeout` - - type: duration - default: "4s" - -The maximum duration before timing out write of the request. - -##### `httpListenLimit` - - type: integer - default: 0 - -Limits the number of outstanding requests. Set to `0` to disable. - -##### `udpListenAddr` - - type: string - default: "localhost:6881" - -Then listen address for the UDP server. If only a port is specified, the tracker will listen on all interfaces. If left empty, the tracker will not run a UDP endpoint. - -##### `createOnAnnounce` - - type: bool - default: true - -Whether to register new torrents with the tracker when any client announces (`true`), or to return an error if the torrent doesn't exist (`false`). - -##### `purgeInactiveTorrents` - - type: bool - default: true - -If torrents should be forgotten when there are no active peers. - -##### `announce` - - type: duration - default: "30m" - -The announce `interval` value sent to clients. This specifies how long clients should wait between regular announces. - -##### `minAnnounce` - - type: duration - default: "30m" - -The announce `min_interval` value sent to clients. This theoretically specifies the minimum allowed time between announces, but most clients don't really respect it. - -##### `defaultNumWant` - - type: integer - default: 50 - -The default maximum number of peers to return if the client has not requested a specific number. - -##### `allowIPSpoofing` - - type: bool - default: true - -Whether peers are allowed to set their own IP via the various supported methods or if these are ignored. This must be enabled for dual-stack IP support, since there is no other way to determine both IPs of a peer otherwise. - -##### `dualStackedPeers` - - type: bool - default: true - -True if peers may have both an IPv4 and IPv6 address, otherwise only one IP per peer will be used. - -##### `realIPHeader` - - type: string - default: blank - -An optional HTTP header indicating the upstream IP, for example `X-Forwarded-For` or `X-Real-IP`. Use this when running the tracker behind a reverse proxy. - -##### `respectAF` - - type: bool - default: false - -Whether responses should only include peers of the same address family as the announcing peer, or if peers of any family may be returned (i.e. both IPv4 and IPv6). - -##### `clientWhitelistEnabled` - - type: bool - default: false - -Enables the peer ID whitelist. - -##### `clientWhitelist` - - type: array of strings - default: [] - -List of peer ID prefixes to allow if `client_whitelist_enabled` is set to true. - -##### `torrentMapShards` - - type: integer - default: 1 - -Number of internal torrent maps to use. Leave this at 1 in general, however it can potentially improve performance when there are many unique torrents and few peers per torrent. - -##### `reapInterval` - - type: duration - default: "60s" - -Interval at which a search for inactive peers should be performed. - -##### `reapRatio` - - type: float64 - default: 1.25 - -Peers will be rated inactive if they haven't announced for `reapRatio * minAnnounce`. - -##### `apiListenAddr` - - type: string - default: "localhost:6880" - -The listen address for the HTTP API. If only a port is specified, the tracker will listen on all interfaces. If left empty, the tracker will not run the HTTP API. - -##### `apiRequestTimeout` - - type: duration - default: "4s" - -The duration to allow outstanding requests to survive before forcefully terminating them. - -##### `apiReadTimeout` - - type: duration - default: "4s" - -The maximum duration before timing out read of the request. - -##### `apiWriteTimeout` - - type: duration - default: "4s" - -The maximum duration before timing out write of the request. - -##### `apiListenLimit` - - type: integer - default: 0 - -Limits the number of outstanding requests. Set to `0` to disable. - -##### `driver` - - type: string - default: "noop" - -Sets the backend driver to load. The included `"noop"` driver provides no functionality. - -##### `statsBufferSize` - - type: integer - default: 0 - -The size of the event-queues for statistics. - -##### `includeMemStats` - - type: bool - default: true - -Whether to include information about memory in the statistics. - -##### `verboseMemStats` - - type: bool - default: false - -Whether the information about memory should be verbose. - -##### `memStatsInterval` - - type: duration - default: "5s" - -Interval at which to collect statistics about memory. - - -##### `jwkSetURI` - - type: string - default: "" - -If this string is not empty, then the tracker will attempt to use JWTs to validate infohashes before announces. The format for the JSON at this endpoint can be found at [the RFC for JWKs](https://tools.ietf.org/html/draft-ietf-jose-json-web-key-41#page-10) with the addition of an "issuer" key. Simply stated, this feature requires two fields at this JSON endpoint: "keys" and "issuer". "keys" is a list of JWKs that can be used to validate JWTs and "issuer" should match the "iss" claim in the JWT. The lifetime of a JWK is based upon standard HTTP caching headers and falls back to 5 minutes if no cache headers are provided. - - -#### `jwkSetUpdateInterval` - - type: duration - default: "5m" - -The interval at which keys are updated from JWKSetURI. Because the fallback lifetime for keys without cache headers is 5 minutes, this value should never be below 5 minutes unless you know your jwkSetURI has caching headers. - -#### `jwtAudience` - - type: string - default: "" - -The audience claim that is used to validate JWTs. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 0260a5f..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,77 +0,0 @@ -## Communication - -Currently, real time conversation happens on [#chihaya] on [freenode]. -We are currently attempting to have more information available on GitHub. - -[#chihaya]: http://webchat.freenode.net?channels=chihaya -[freenode]: http://freenode.net - -## Pull request procedure - -Please don't write massive patches without prior communication, as it will most -likely lead to confusion and time wasted for everyone. However, small -unannounced fixes are always welcome! - -Pull requests will be treated as "review requests", and we will give -feedback we expect to see corrected on [style] and substance before merging. -Changes contributed via pull request should focus on a single issue at a time, -like any other. We will not accept pull-requests that try to "sneak" unrelated -changes in. - -The average contribution flow is as follows: - -- Create a topic branch from where you want to base your work. This is usually `master`. -- Make commits of logical units. -- Make sure your commit messages are in the [proper format] -- Push your changes to a topic branch in your fork of the repository. -- Submit a pull request. -- Your PR will be reviewed and merged by one of the maintainers. - - -Any new files should include the license header found at the top of every -source file. - -[style]: https://github.com/chihaya/chihaya/blob/master/CONTRIBUTING.md#style -[proper format]: https://github.com/chihaya/chihaya/blob/master/CONTRIBUTING.md#commit-messages - -## Style - -### Go - -The project follows idiomatic [Go conventions] for style. If you're just -starting out writing Go, you can check out this [meta-package] that documents -style idiomatic style decisions you will find in open source Go code. - - -[Go conventions]: https://github.com/golang/go/wiki/CodeReviewComments -[meta-package]: https://github.com/jzelinskie/conventions - -### Commit Messages - -We follow a rough convention for commit messages that is designed to answer two -questions: what changed and why. The subject line should feature the what and -the body of the commit should describe the why. - -``` -scripts: add the test-cluster command - -this uses tmux to setup a test cluster that you can easily kill and -start for debugging. - -Fixes #38 -``` - -The format can be described more formally as follows: - -``` -: - - - -