Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.
/ NanoSync Public archive

Continuous filter update delivery

License

Notifications You must be signed in to change notification settings

NanoAdblockerLab/NanoSync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nano Sync Dependencies

NPM

Continuous filter update delivery

A file based differential update system for filter lists.

WORK IN PROGRESS - DEVELOPERS ONLY

Usage

Install

npm install -g nano-sync

Command Line

nano-sync /path/to/filter.txt

Integration

"use strict";

const nsync = require("nano-sync");
nsync.ezPatch("filter.txt");

You need to commit ./nano-sync-data/config.json, although not other cache files in that directory, you should add the following line to .gitignore file:

nano-sync-data/*.txt

If you change your filter list very often, it is recommended to create only one to two patches per day.

Technical

Nano Sync will, by default, generate the following output structure:

filter.txt
filter-diff/
    meta.json
    checkpoint.txt
    1.patch
    2.patch
    3.patch
    4.patch

The structure of meta.json:

{
  "checkpoint": 35,
  "latest": 37
}

checkpoint denotes the version of the checkpoint, latest denotes the latest version.

In the above example, 1.patch then 2.patch need to be applied to checkpoint.txt to generate the latest filter.

3.patch and 4.patch are leftover patch files from last round.

This default mode is optimized for Git repository, you will get a spike in traffic on every checkpoint, but in return, generates the least amount of extra Git history.

About

Continuous filter update delivery

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published