📝 Simple&powerful hosts file generator for hosts projects
hostsgen is designed to make hosts projects modular🗄 and writting-friendly✍️
hostsgen.yml
is project config file for hostsgen. Hostsgen uses this file to know what your project is
available fields:
-
name (String, your project name)
-
desc (String, description)
-
authors (String|[String], project authors)
-
out (String, output file path)
-
mods ([String], your project root modules)
for example:
name: project name
desc: example hostgen project config
authors: duangsuse
out: example_hosts
mods:
- foo-mod desc #splited using ' '
- ads-baidu AD Block for Baidu
- google google hosts
Create module dirs
in project root
. There must be a "mod.txt" in module dir, which contains module settings.
For configure above, module dir foo-mod, ads-baidu and google should be created.
mod.txt syntax:
#{filename} {rule}
foo.txt: (I am description) 12.13.{IP} {HOST}.xm.com
main.txt: (ad block for baidu ads) 0.0.0.0 {HOST}
Each hosts entry will be processed using rule
If only {IP} or {HOST} persent, whole line will be placed in the field.
Copyright 2017 duangsuse
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.