1
0
mirror of https://github.com/HorlogeSkynet/Nftables synced 2024-11-24 20:00:11 +01:00
💄 [MIRROR] A Sublime Text 3+ syntax definition for your nftables rules https://git.io/Nftables
Go to file
2022-04-05 22:30:23 +02:00
.github Adds a CI job running syntax tests using SublimeText/syntax-test-action 2021-08-31 14:54:31 +02:00
.gitattributes Publishes a .gitattributes file to make Linguist detect YAML & JSON 2020-02-19 23:16:15 +01:00
CHANGELOG.md Publishes a proper CHANGELOG 2022-04-05 22:30:23 +02:00
Comments.tmPreferences Allows source lines comment toggling (#1) 2020-09-25 17:04:07 +00:00
LICENSE So we finally got something here, let's draft a first commit ! 2020-02-18 21:17:02 +01:00
Nftables.sublime-build Renames project source files to match internal syntax name (Nftables) 2020-02-22 21:50:53 +01:00
Nftables.sublime-syntax Stops messing with prototype propagation cancellation 2022-04-05 20:03:33 +02:00
README.md Improves README style (minor) 2022-03-30 19:31:01 +02:00
syntax_test_Nftables.nft Adds ct expectation & ct timeout test cases and fixes policy 2022-04-05 19:46:18 +02:00

Nftables

A Sublime Text 3+ syntax definition for your nftables rules

Preview

Introduction

nftables should now be the regular way of handling Netfilter rules, and I was surprised not to find any syntax definition for Sublime Text.
This project aims to provide a "basic" one, as long as a building procedure for GNU/Linux users (when the nft binary is available for "dynamic" syntax checks).

This project has been inspired by the official nano syntax definition.
See the Scripting nftables Wiki page for external reference.

Installation

With Package Control

  1. Open your command palette and type in : Package Control: Install Package
  2. Browse the list or search for Nftables
  3. Press Enter and you're done !

Package Control dedicated page here.

Manually

  1. Move into Sublime Text packages folder (usually $HOME/.config/sublime-text-3/Packages/ or %AppData%\Sublime Text 3\Packages\)
  2. Clone this repository there : $ git clone https://github.com/HorlogeSkynet/Nftables.git
  3. Restart Sublime Text and... 🎉

Usage

Syntax

  • Open your command palette and type in : Set Syntax: Nftables

  • Click on the bottom-right corner : Nftables

  • View > Syntax > Nftables

Build

  • Open your command palette and type in : Build With: Nftables

  • Press CTRL + B

  • Tools > Build

Formats currently supported

  • nftables output
  • scripted configuration

Frequently Asked Questions

Do you plan to support the whole nftables syntax ?

No, but feel free to contribute.

Why does this syntax coloration s*cks ?

Well, sorry to hear that. Grammar wasn't my favorite course at school.
I'd be pleased to review any issue or pull request.

Why didn't you convert the official Bison parser to Sublime's definition syntax ?

It looks like such a tool does not exist (yet ?).

Would this plugin help me building a secure fire-wall ?

No, but I would advise you this blog post as a well-explained starting point, written by @tasn.

I've noticed you got an extensive tests suite, can I run it ?

Of course, open the Nftables.sublime-syntax file, press CTRL + Shift + B and choose Build With: Syntax Tests.