This is a simple script that allows you to mount a usenet server as a webdav drive.
This is not a tool to mount any nzb files, nzb files that are supported on the tool needs to be created by this tool.
Use at your own risk
curl https://rclone.org/install.sh | sudo bash
rclone config
Add a new webdav remote with the following parameters:
- Name:
usenet
- URL:
http://localhost:8080
It's hight recommended to use an rclone crypt remote to encrypt your data since this tool just obfuscate the file names.
Add a new crypt remote with the following parameters:
- Name:
usenet-crypt
- Storage provider:
Crypt
- Encrypt the filenames:
off
- Option directory_name_encryption:
Don't encrypt directory names, leave them intact
### Mount the remote
```bash
rclone mount --allow-other --async-read=true --dir-cache-time=1000h --buffer-size=32M --poll-interval=15s --rc --rc-no-auth --rc-addr=localhost:5572 --use-mmap --vfs-read-ahead=128M --vfs-read-chunk-size=32M --vfs-read-chunk-size-limit=2G --vfs-cache-max-age=504h --vfs-cache-mode=full --vfs-cache-poll-interval=30s --vfs-cache-max-size=50G --timeout=10m usenet: ${PATH_TO_MOUNT} --umask=002
When mounting it's high recommended to use a vfs cache to avoid problems with uploads and downloads.
An API to control the server, is available at http://localhost:8081/api/v1/
.
WebAdmin, is available at http://localhost:8081
.
See the endpoints at api.yaml.
- Allow mount nzb files as the original file
- Allow streaming of video files
- Allow upload new files full obfuscated to prevent DMCA takedowns
- Filesystem upload new files to usenet automatically
- Api to manage the server
Choose the release for your system at releases.
Create the required folders:
mkdir -p ./config ./nzbs
Create the config file:
nano ./config/config.yaml
See an example at config.yaml.
Run the application:
./usenet-drive -c ./config/config.yaml
Create the required folders:
mkdir -p ./config ./nzbs
Create a config file:
cp config.sample.yaml ./config/config.yaml
Edit the config file:
nano ./config/config.yaml
Run docker compose:
docker-compose up
Alternatively, you can run the docker image directly creating a docker compose:
version: "3"
services:
usenet-drive:
image: laris11/usenet-drive:latest
command: /usenetdrive -c /config/config.yaml
ports:
- "8080:8080"
volumes:
- ./config:/config
- ./nzbs:/nzbs
environment:
- PUID=1000
- PGID=1000
restart: unless-stopped
The Config
struct defines the configuration for the Usenet Drive application. See an example at config.yaml.
root_path
(string!): The root path of your webdav virtual file system and where all nzb and not uploaded files will be saved. It is recommended to add a path to a fast disk for instance a SSD or NVME since this will improve a lot the playback of video files.web_dav_port
(string): The port number for the server. Default value is8080
.api_port
(string): The port number for the server. Default value is8080
.usenet
(Usenet): The Usenet configuration.db_path
(string): The path where the database will be saved. Default value is/config/usenet-drive.db
.rclone
(Rclone): The Rclone configuration.
Since rclone webdav backend do not supports polling, if an vfs controller url is provided, the application will refresh the rclone cache when a new file is uploaded.
vfs_url
(string): The url+port to the rclone vfs . Examplehttp://localhost:7579
.
The usenet
struct defines the Usenet configuration.
download
(Download): Downloading configuration.upload
(Upload): Uploading configuration.providers
(UsenetProvider): Usenet providers to download/upload filesfake_connections
(bool): Whether to use fake connections. Default value isfalse
. This is useful for testing purposes.max_connection_ttl_in_minutes
(int): The maximum time a connection will be kept alive in minutes. Default value is60
.max_connection_idle_time_in_minutes
(int): Idle connections will be closed after this max time10
.
The Download
struct defines the Usenet provider for downloading.
max_download_workers
(int): The maximum number of download workers. Default value is5
. WARN the tool will use 1 connections per worker. Min value is 1. The number observed optimal for good speed is 5.max_retries
(int): The maximum number of retries to download a segment. Default value is8
.providers
(UsenetProvider): Usenet providers to download files. (It is recommended an unlimited provider for this)
The Upload
struct defines the Usenet provider for uploading.
file_allow_list
([]string): The list of allowed file extensions. For example,[".mkv", ".mp4"]
, in this case only files with the extensions.mkv
and.mp4
will be uploaded to usenet. Take care not upload files that change frequently, like subtitules or text files, since they will be uploaded every time they change. In usenet you can not edit files. If using rclone crypt all file extensions will ends with .bin so in order to specify the real extension, you must add .bin at the end. Ex: .mkv.bin .max_retries
(int): The maximum number of retries to upload a segment. Default value is8
.providers
(UsenetProvider): Usenet providers to upload files. (It is recommended a block account for this)
The UsenetProvider
struct defines the Usenet provider configuration.
host
(string): The hostname of the Usenet provider. For example,news.usenetserver.com
.port
(int): The port number of the Usenet provider. For example,563
.username
(string): The username for the Usenet provider. For example,user
.password
(string): The password for the Usenet provider. For example,pass
.groups
([]string): The list of Usenet groups. For example,["alt.binaries.teevee", "alt.binaries.movies"]
.tls
(bool): Whether to use SSL for the Usenet provider. Default value istrue
.max_connections
(int): The maximum number of connections to the Usenet provider.download_only
(bool): Whether this provider only allows downloading. Default value isfalse
.
- Files uploaded to usenet can not be edited. If you need to edit a file, you need to upload a new file with the changes. This is more a limitation of usenet itself than the tool. (Future workaround can be done)
- The number of reads by file is limited by the number of connections to the usenet provider, normally not more than 3 connections are needed peer file read.
go tool pprof -http=:8082 http://localhost:8080/debug/pprof/profile
- Upload feature: https://github.com/F4n4t/GoPostStuff
- Yenc encode: https://github.com/F4n4t/GoPostStuff
- Nzb feature: https://github.com/chrisfarms/nzb