lint: lint yaml files

This commit is contained in:
Jimmy Zelinskie 2022-01-15 13:12:49 -05:00
parent c28d7ad788
commit e2991d59e4
6 changed files with 127 additions and 111 deletions

4
.github/FUNDING.yml vendored
View file

@ -1 +1,3 @@
github: [ jzelinskie ] ---
github:
- "jzelinskie"

View file

@ -1,3 +1,4 @@
---
version: 2 version: 2
updates: updates:
- package-ecosystem: "github-actions" - package-ecosystem: "github-actions"

View file

@ -37,7 +37,7 @@ jobs:
- uses: "actions/checkout@v2" - uses: "actions/checkout@v2"
- uses: "actions/setup-go@v2" - uses: "actions/setup-go@v2"
with: with:
go-version: ^1.17 go-version: "^1.17"
- name: "Install and configure chihaya" - name: "Install and configure chihaya"
run: | run: |
go install ./cmd/chihaya go install ./cmd/chihaya
@ -62,7 +62,7 @@ jobs:
- uses: "actions/checkout@v2" - uses: "actions/checkout@v2"
- uses: "actions/setup-go@v2" - uses: "actions/setup-go@v2"
with: with:
go-version: ^1.17 go-version: "^1.17"
- name: "Install and configure chihaya" - name: "Install and configure chihaya"
run: | run: |
go install ./cmd/chihaya go install ./cmd/chihaya

11
.yamllint Normal file
View file

@ -0,0 +1,11 @@
# vim: ft=yaml
---
yaml-files:
- "*.yaml"
- "*.yml"
- ".yamllint"
ignore: "dist/helm/"
extends: "default"
rules:
quoted-strings: "enable"
line-length: "disable"

View file

@ -1,11 +1,12 @@
---
chihaya: chihaya:
# The interval communicated with BitTorrent clients informing them how # The interval communicated with BitTorrent clients informing them how
# frequently they should announce in between client events. # frequently they should announce in between client events.
announce_interval: 30m announce_interval: "30m"
# The interval communicated with BitTorrent clients informing them of the # The interval communicated with BitTorrent clients informing them of the
# minimal duration between announces. # minimal duration between announces.
min_announce_interval: 15m min_announce_interval: "15m"
# The network interface that will bind to an HTTP endpoint that can be # The network interface that will bind to an HTTP endpoint that can be
# scraped by programs collecting metrics. # scraped by programs collecting metrics.
@ -30,14 +31,14 @@ chihaya:
tls_key_path: "" tls_key_path: ""
# The timeout durations for HTTP requests. # The timeout durations for HTTP requests.
read_timeout: 5s read_timeout: "5s"
write_timeout: 5s write_timeout: "5s"
# When true, persistent connections will be allowed. Generally this is not # When true, persistent connections will be allowed. Generally this is not
# useful for a public tracker, but helps performance in some cases (use of # useful for a public tracker, but helps performance in some cases (use of
# a reverse proxy, or when there are few clients issuing many requests). # a reverse proxy, or when there are few clients issuing many requests).
enable_keepalive: false enable_keepalive: false
idle_timeout: 30s idle_timeout: "30s"
# Whether to time requests. # Whether to time requests.
# Disabling this should increase performance/decrease load. # Disabling this should increase performance/decrease load.
@ -88,7 +89,7 @@ chihaya:
addr: "0.0.0.0:6969" addr: "0.0.0.0:6969"
# The leeway for a timestamp on a connection ID. # The leeway for a timestamp on a connection ID.
max_clock_skew: 10s max_clock_skew: "10s"
# The key used to encrypt connection IDs. # The key used to encrypt connection IDs.
private_key: "paste a random string here that will be used to hmac connection IDs" private_key: "paste a random string here that will be used to hmac connection IDs"
@ -113,17 +114,17 @@ chihaya:
# This block defines configuration used for the storage of peer data. # This block defines configuration used for the storage of peer data.
storage: storage:
name: memory name: "memory"
config: config:
# The frequency which stale peers are removed. # The frequency which stale peers are removed.
# This balances between # This balances between
# - collecting garbage more often, potentially using more CPU time, but potentially using less memory (lower value) # - collecting garbage more often, potentially using more CPU time, but potentially using less memory (lower value)
# - collecting garbage less frequently, saving CPU time, but keeping old peers long, thus using more memory (higher value). # - collecting garbage less frequently, saving CPU time, but keeping old peers long, thus using more memory (higher value).
gc_interval: 3m gc_interval: "3m"
# The amount of time until a peer is considered stale. # The amount of time until a peer is considered stale.
# To avoid churn, keep this slightly larger than `announce_interval` # To avoid churn, keep this slightly larger than `announce_interval`
peer_lifetime: 31m peer_lifetime: "31m"
# The number of partitions data will be divided into in order to provide a # The number of partitions data will be divided into in order to provide a
# higher degree of parallelism. # higher degree of parallelism.
@ -131,7 +132,7 @@ chihaya:
# The interval at which metrics about the number of infohashes and peers # The interval at which metrics about the number of infohashes and peers
# are collected and posted to Prometheus. # are collected and posted to Prometheus.
prometheus_reporting_interval: 1s prometheus_reporting_interval: "1s"
# This block defines configuration used for redis storage. # This block defines configuration used for redis storage.
# storage: # storage:
@ -141,46 +142,46 @@ chihaya:
# # This balances between # # This balances between
# # - collecting garbage more often, potentially using more CPU time, but potentially using less memory (lower value) # # - collecting garbage more often, potentially using more CPU time, but potentially using less memory (lower value)
# # - collecting garbage less frequently, saving CPU time, but keeping old peers long, thus using more memory (higher value). # # - collecting garbage less frequently, saving CPU time, but keeping old peers long, thus using more memory (higher value).
# gc_interval: 3m # gc_interval: "3m"
# # The interval at which metrics about the number of infohashes and peers # # The interval at which metrics about the number of infohashes and peers
# # are collected and posted to Prometheus. # # are collected and posted to Prometheus.
# prometheus_reporting_interval: 1s # prometheus_reporting_interval: "1s"
# # The amount of time until a peer is considered stale. # # The amount of time until a peer is considered stale.
# # To avoid churn, keep this slightly larger than `announce_interval` # # To avoid churn, keep this slightly larger than `announce_interval`
# peer_lifetime: 31m # peer_lifetime: "31m"
# # The address of redis storage. # # The address of redis storage.
# redis_broker: "redis://pwd@127.0.0.1:6379/0" # redis_broker: "redis://pwd@127.0.0.1:6379/0"
# # The timeout for reading a command reply from redis. # # The timeout for reading a command reply from redis.
# redis_read_timeout: 15s # redis_read_timeout: "15s"
# # The timeout for writing a command to redis. # # The timeout for writing a command to redis.
# redis_write_timeout: 15s # redis_write_timeout: "15s"
# # The timeout for connecting to redis server. # # The timeout for connecting to redis server.
# redis_connect_timeout: 15s # redis_connect_timeout: "15s"
# This block defines configuration used for middleware executed before a # This block defines configuration used for middleware executed before a
# response has been returned to a BitTorrent client. # response has been returned to a BitTorrent client.
prehooks: prehooks:
#- name: jwt # - name: "jwt"
# options: # options:
# issuer: "https://issuer.com" # issuer: "https://issuer.com"
# audience: "https://chihaya.issuer.com" # audience: "https://chihaya.issuer.com"
# jwk_set_url: "https://issuer.com/keys" # jwk_set_url: "https://issuer.com/keys"
# jwk_set_update_interval: 5m # jwk_set_update_interval: "5m"
#- name: client approval # - name: "client approval"
# options: # options:
# whitelist: # whitelist:
# - "OP1011" # - "OP1011"
# blacklist: # blacklist:
# - "OP1012" # - "OP1012"
#- name: interval variation # - name: "interval variation"
# options: # options:
# modify_response_probability: 0.2 # modify_response_probability: 0.2
# max_increase_delta: 60 # max_increase_delta: 60
@ -188,7 +189,7 @@ chihaya:
# This block defines configuration used for torrent approval, it requires to be given # This block defines configuration used for torrent approval, it requires to be given
# hashes for whitelist or for blacklist. Hashes are hexadecimal-encoaded. # hashes for whitelist or for blacklist. Hashes are hexadecimal-encoaded.
#- name: torrent approval # - name: "torrent approval"
# options: # options:
# whitelist: # whitelist:
# - "a1b2c3d4e5a1b2c3d4e5a1b2c3d4e5a1b2c3d4e5" # - "a1b2c3d4e5a1b2c3d4e5a1b2c3d4e5a1b2c3d4e5"

View file

@ -1,11 +1,12 @@
---
global: global:
scrape_interval: 5s scrape_interval: "5s"
evaluation_interval: 5s evaluation_interval: "5s"
# A scrape configuration containing exactly one endpoint to scrape: # A scrape configuration containing exactly one endpoint to scrape:
scrape_configs: scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'local-chihaya' # you can name this however you want - job_name: "local-chihaya" # you can name this however you want
scrape_interval: 5s # optionally override the global scrape_interval scrape_interval: "5s" # optionally override the global scrape_interval
static_configs: static_configs:
- targets: ['localhost:6881'] # provide the address of chihaya's prometheus endpoint - targets: ["localhost:6881"] # provide the address of chihaya's prometheus endpoint