Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Config File

Preston edited this page Jul 19, 2021 · 11 revisions

First Run

A default config file will be generated on first run of the program.

Since version v1.2.0, it is preferred to use yaml, but the original json format is also accepted.

And the arg -c (--config-path) is no longer necessary. The program looks to the following locations for file names "cloud-torrent" (.json/.yaml/.toml ...)

  • /etc/cloud-torrent/
  • /etc/
  • $HOME/.cloud-torrent
  • $PWD working dir of current shell

Upgrade from json

A CLI arg --conv-yaml is added to v1.2.0 to convert old json file to a yaml config:

./cloud-torrent_linux_amd64 --conv-yaml -c /tmp/cld.json 
2020/01/08 14:15:46 ############# SimpleTorrent ver[1.2.0] #############
2020/01/08 14:15:46 [config] selected config file:  /tmp/cld.json
2020/01/08 14:15:46 [config] current file path:  /tmp/cld.json
2020/01/08 14:15:46 Config file converted and written to: /tmp/cld.yaml

As demonstrated in the logs, a .yaml file will be generated at the same directory with what is provided to -c (--config-path).

But the old json format is also works perfect with version 1.2.0, no need to convert or "upgrade" if you don't want to.

What's changed since v1.2.0 is that, the key in the config became case-insensitive, eg: AutoStart is equivalent with autoStart or autostart. The yaml format is easier to maintain.

Config On the fly

Most of the items can be edited in WEB-UI on the fly in the config board. (Click the first logo from the top right). DoneCmd is blocked for security considerations).

Some of the item can be changed in the WEB UI on the fly

Example of Config

An example of config.yaml (not all keys are necessary)

Note: the keys are case-insensitive.

AutoStart: true 
# AutoStart Whether start torrent task on added Magnet/Torrent.

AllowRuntimeConfigure: true
#AllowRuntimeConfigure is the switch whether to offer the WEB UI configuration to users.

EngineDebug: false
# EngineDebug Print debug log from anacrolix/torrent engine (lots of them)

MuteEngineLog: true
# MuteEngineLog anacrolix/torrent engine prints chunks exchanging logs, normal user can just mute them.

ObfsPreferred: true
# ObfsPreferred Whether torrent header obfuscation is preferred.

ObfsRequirePreferred: false
# ObfsRequirePreferred Whether the value of ObfsPreferred is a strict requirement. This hides torrent traffic from being censored.

DisableTrackers: false
# DisableTrackers Don't announce to trackers. This only leaves DHT to discover peers.

DisableIPv6: false
# DisableIPv6 Don't connect to IPv6 peers.

DisableUTP: false
# Disable UTP in the torrent protocol.
# In recent versions, the UTP process cause quite high CPU usage. Set to true can ease the situation.

NoDefaultPortForwarding: true
# Don't broadcast the UPNP request for gateway port forwarding, 
# which is unnecessary in machines that has public IP (of which this program is mean for?)

DownloadDirectory: /home/ubuntu/Workdir/cloud-torrent/downloads
# DisableEncryption A switch disables [BitTorrent protocol encryption](https://en.wikipedia.org/wiki/BitTorrent_protocol_encryption)

WatchDirectory: /home/ubuntu/Workdir/cloud-torrent/torrents
# DownloadDirectory The directory where downloaded file saves.

EnableUpload: true
# EnableUpload Whether send chunks to peers

EnableSeeding: true
# EnableSeeding Whether upload even after there's nothing further for us. 
# By default uploading is not altruistic, we'll only upload to encourage the peer to reciprocate.

IncomingPort: 50007
# IncomingPort The port SimpleTorrent listens to.

DoneCmd: ""
# DoneCmd is An external program to be called on task finished.
# See [DoneCmd Usage](https://github.com/boypt/simple-torrent/wiki/DoneCmdUsage).

SeedRatio: 1.5
# SeedRatio The ratio of task Upload/Download data when reached, the task will be stop.

SeedTime: "0s"
# SeedTime is the time to seed after a task is done downloading,
# during which if `SeedRatio` is reached, the tasks will stop and deleted; 
# after the duration, the tasks will also stop and removed. But if the waiting queue is empty, will not remove.

UploadRate: High
DownloadRate: Unlimited
# UploadRate/DownloadRate The global speed limiter, 
# a fixed level amoung Low(~50k/s), Medium(~500k/s) and High(~1500k/s) is accepted , Unlimited / 0 
# or empty result in unlimited rate, or a customed value eg: 850k/720kb/2.85MB.

TrackerList: ""
# TrackerList is the list of trackers.
# If empty (default), program will download a list from `https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt`
# You can specify a list trackers; or a line starts with `remote:` will be downloaded as a list.
# Example:
TrackerList: |-
  remote:https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt
  http://p4p.arenabg.com:1337/announce

  
AlwaysAddTrackers: true
# Always add tracers from TrackerListURL wheather the torrent/magnet link has it's own trackers already

MaxConcurrentTask: 0
# MaxConcurrentTask the the maximum tasks concurrently running. 
# Too many task consumes CPU a lot, use this option to limit and queue up download task.

ProxyURL: ""
# ProxyURL Socks5 Proxy to torrent engine. Authentication should be included in the url if needed.
# Eg. socks5://demo:[email protected]:1080

# ScraperURL: ""
# The magnet search engine configuration file. Don't set this option (leave it commented) if not intended to.

RSSUrl: ""
# The RSS superscription list.
Example:
RSSUrl: |-
  http://domian./rss.xml
  http://some-other-site/rss.xml
Clone this wiki locally