From 3b23ec5b328adebe2f6416b30ae1782cb5aa89d4 Mon Sep 17 00:00:00 2001 From: balki <3070606-balki@users.noreply.gitlab.com> Date: Fri, 24 Jun 2022 13:52:11 -0400 Subject: [PATCH] add examples for proxy --- app/config.go | 2 +- docs/schema.json | 2 +- docs/schema.yaml | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/config.go b/app/config.go index 5d85fa8..c609e06 100644 --- a/app/config.go +++ b/app/config.go @@ -51,7 +51,7 @@ type Config struct { // default proxy url that http.Client can understand // or socks5://unix/path/to/sock for socks proxy over unix socket // empty for no proxy - Proxy string `yaml:"proxy" jsonschema:"default="` + Proxy string `yaml:"proxy" jsonschema:"default=,example=socks5://unix/run/tor/socks,example=*myvpsproxy"` // proxy for telegram if different from default // NONE to not use global default diff --git a/docs/schema.json b/docs/schema.json index 449dfc4..639fdb8 100644 --- a/docs/schema.json +++ b/docs/schema.json @@ -1 +1 @@ -{"$schema":"http://json-schema.org/draft/2020-12/schema","properties":{"proxy":{"type":"string","description":"default proxy url that http.Client can understand\nor socks5://unix/path/to/sock for socks proxy over unix socket\nempty for no proxy","default":""},"telegram_proxy":{"type":"string","description":"proxy for telegram if different from default\nNONE to not use global default","default":"\u003cglobal proxy\u003e"},"telegram_auth_token":{"type":"string","description":"Auth token for telegram in the form of 424242424:AB02132skdcjlisjkjflewjlfkjslkfHHXX"},"data_dir":{"type":"string","description":"Base directory to write feed data and schedule file","default":"./"},"last_loaded_path":{"type":"string","description":"Path to the file where last success time for each feed is saved","default":"\u003cdatadir\u003e/last_success.yml"},"db_dir":{"type":"string","description":"Path to the directory where feed content is saved","default":"\u003cdatadir\u003e/feed_data"},"first_time_limit":{"type":"integer","description":"Number of entries to process when the feed is seen for the first time\n-1 means no limit","default":-1},"feeds":{"items":{"properties":{"name":{"type":"string","description":"Unique identifier for the feed. Used as filename, so keep it simple"},"channel":{"type":"string","description":"Telegram channel name in the form \"@foobar\" or \"-1004242442\" (private)"},"rhash":{"type":"string","description":"Telegram instant view rhash id, see https://instantview.telegram.org/#publishing-templates","default":""},"url":{"oneOf":[{"type":"string"},{"type":"array"}],"items":{"type":"string"},"description":"Feed URL, string or array of strings\nIf array, all entries are merged, e.g [\"https://example.com/blog/tag/foo/feed\", \"https://example.com/blog/tag/bar/feed\" ]"},"cron":{"type":"string","description":"Cron expression, see https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format"},"proxy":{"type":"string","description":"Proxy for this feed if different from global","default":"\u003cglobal proxy\u003e"},"type":{"type":"string","enum":["rss","atom"],"description":"Rss or Atom feed"},"title":{"type":"string","description":"Text of the link sent to telegram,","default":"Link"},"first_time_limit":{"type":"integer","description":"Number of entries to process when the feed is seen for the first time","default":0}},"additionalProperties":false,"type":"object","required":["name","channel","url","cron","type"]},"type":"array","description":"Feed config"},"refs":{"type":"object","description":"Placeholder to put any yaml anchors to use elsewhere, E.g.\nrefs:\n myvpsproxy: \u0026myvpsproxy \"socks5://vps.example.com:1080\"\n twiceaday: \u0026twiceaday \"00 1,13 * * *\""}},"additionalProperties":false,"type":"object","required":["telegram_auth_token","feeds"]} \ No newline at end of file +{"$schema":"http://json-schema.org/draft/2020-12/schema","properties":{"proxy":{"type":"string","description":"default proxy url that http.Client can understand\nor socks5://unix/path/to/sock for socks proxy over unix socket\nempty for no proxy","default":"","examples":["socks5://unix/run/tor/socks","*myvpsproxy"]},"telegram_proxy":{"type":"string","description":"proxy for telegram if different from default\nNONE to not use global default","default":"\u003cglobal proxy\u003e"},"telegram_auth_token":{"type":"string","description":"Auth token for telegram in the form of 424242424:AB02132skdcjlisjkjflewjlfkjslkfHHXX"},"data_dir":{"type":"string","description":"Base directory to write feed data and schedule file","default":"./"},"last_loaded_path":{"type":"string","description":"Path to the file where last success time for each feed is saved","default":"\u003cdatadir\u003e/last_success.yml"},"db_dir":{"type":"string","description":"Path to the directory where feed content is saved","default":"\u003cdatadir\u003e/feed_data"},"first_time_limit":{"type":"integer","description":"Number of entries to process when the feed is seen for the first time\n-1 means no limit","default":-1},"feeds":{"items":{"properties":{"name":{"type":"string","description":"Unique identifier for the feed. Used as filename, so keep it simple"},"channel":{"type":"string","description":"Telegram channel name in the form \"@foobar\" or \"-1004242442\" (private)"},"rhash":{"type":"string","description":"Telegram instant view rhash id, see https://instantview.telegram.org/#publishing-templates","default":""},"url":{"oneOf":[{"type":"string"},{"type":"array"}],"items":{"type":"string"},"description":"Feed URL, string or array of strings\nIf array, all entries are merged, e.g [\"https://example.com/blog/tag/foo/feed\", \"https://example.com/blog/tag/bar/feed\" ]"},"cron":{"type":"string","description":"Cron expression, see https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format"},"proxy":{"type":"string","description":"Proxy for this feed if different from global","default":"\u003cglobal proxy\u003e"},"type":{"type":"string","enum":["rss","atom"],"description":"Rss or Atom feed"},"title":{"type":"string","description":"Text of the link sent to telegram,","default":"Link"},"first_time_limit":{"type":"integer","description":"Number of entries to process when the feed is seen for the first time","default":0}},"additionalProperties":false,"type":"object","required":["name","channel","url","cron","type"]},"type":"array","description":"Feed config"},"refs":{"type":"object","description":"Placeholder to put any yaml anchors to use elsewhere, E.g.\nrefs:\n myvpsproxy: \u0026myvpsproxy \"socks5://vps.example.com:1080\"\n twiceaday: \u0026twiceaday \"00 1,13 * * *\""}},"additionalProperties":false,"type":"object","required":["telegram_auth_token","feeds"]} \ No newline at end of file diff --git a/docs/schema.yaml b/docs/schema.yaml index 4d2e6cb..a4024d4 100644 --- a/docs/schema.yaml +++ b/docs/schema.yaml @@ -78,6 +78,9 @@ properties: default proxy url that http.Client can understand or socks5://unix/path/to/sock for socks proxy over unix socket empty for no proxy + examples: + - socks5://unix/run/tor/socks + - '*myvpsproxy' type: string refs: description: |-