Skip to content

Commit d65b118

Browse files
author
AdrianBan
committed
First release
1 parent acdca44 commit d65b118

27 files changed

+535
-0
lines changed

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/make -f
2+
3+
# This file is part of nftables-persistent
4+
# Copyright (C) 2019 Adrian Ban
5+
#
6+
# This program is free software; you can redistribute it and/or
7+
# modify it under the terms of the GNU General Public License
8+
# as published by the Free Software Foundation, either version 3
9+
# of the License, or (at your option) any later version.
10+
11+
PREFIX=/
12+
DEST=$(DESTDIR)$(PREFIX)
13+
14+
all:
15+
16+
clean:
17+
18+
install:
19+
install -d $(DEST)/usr/sbin
20+
install -d $(DEST)/usr/share/nftables-persistent
21+
install -d $(DEST)/usr/share/nftables-persistent/plugins.d
22+
# Main wrapper
23+
install nftables-persistent $(DEST)/usr/sbin
24+
# Systemd
25+
install -d $(DEST)/lib/systemd/system
26+
install --mode=644 systemd/* $(DEST)/lib/systemd/system
27+
# Manual
28+
install -d $(DEST)/usr/share/man/man8
29+
install --mode=644 nftables-persistent.8 $(DEST)/usr/share/man/man8
30+
31+
install-plugins:
32+
# Plugins
33+
install plugins/* $(DEST)/usr/share/nftables-persistent/plugins.d

debian/README

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
nftables-persistent and its plugins
2+
------------------------------------
3+
4+
nftables-persistent is used to load and save filter rules.
5+
This tool cames with a nft plugin.
6+
7+
Commands are run from nftables-persistent. For example, to save
8+
all filter rules:
9+
10+
nftables-persistent save
11+
12+
or to load them:
13+
14+
nftables-persistent start
15+
16+
For more details, see `man nftables-persistent`.
17+
18+
The system service will try to load rules at startup if enabled, but by
19+
default it will not flush rules at shutdown. This behaviour can be changed
20+
by editing /etc/default/nftables-persistent.
21+
22+
-- Adrian Ban <devel@abtelecom.ro> Tue, 16 Oct 2019 11:11:00 +0100

debian/README.source

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
nftables-persistent has become a native package (meaning there is no
3+
upstream tarball). In its present form, nftables-persistent is unlikely
4+
to be useful outside Debian or Debian-derivatives, and I do not plan to
5+
include any support for other distributions, so a native package makes the
6+
maintenance overhead considerably smaller.
7+
8+
-- Adrian Ban <devel@abtelecom.ro> Tue, 16 Oct 2019 16:38:17 +0200

debian/changelog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
nftables-persistent (0.1.0) unstable; urgency=medium
2+
3+
* First release of nftables-persistent
4+
* Based on netfilter-persistent
5+
6+
-- Adrian Ban <devel@abtelecom.ro> Tue, 16 Oct 2019 16:12:28 +0200
7+

debian/compat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9

debian/control

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Source: nftables-persistent
2+
Section: admin
3+
Priority: optional
4+
Maintainer: Adrian Ban <devel@abtelecom.ro>
5+
Build-Depends: debhelper (>= 7.0.50~), dh-systemd, po-debconf
6+
Standards-Version: 3.9.6
7+
Vcs-Browser: https://github.com/AdrianBan/nftables-persistent
8+
Vcs-Git: https://github.com/AdrianBan/nftables-persistent
9+
10+
Package: nftables-persistent
11+
Architecture: all
12+
Depends: lsb-base, ${misc:Depends}
13+
Breaks: iptables-persistent, netfilter-persistent, ipset-persistent
14+
Replaces: iptables-persistent, netfilter-persistent, ipset-persistent
15+
Pre-Depends: ${misc:Pre-Depends}
16+
Description: boot-time loader for nftables configuration
17+
This package provides a loader for nftables configuration using a
18+
plugin-based architecture. It can load, flush and save a running
19+
configuration. Extending nftables-persistent with plugins is trivial and can
20+
be done in any language.
21+

debian/copyright

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: nftables-persistent
3+
Upstream-Contact: Adrian Ban <devel@abtelecom.ro>
4+
5+
Files: *
6+
Copyright: © 2018, Adrian Ban <devel@abtelecom.ro>
7+
License: GPL-3
8+
This program is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU General Public License as published by
10+
the Free Software Foundation, either version 3 of the License, or
11+
(at your option) any later version.
12+
.
13+
This package is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
GNU General Public License for more details.
17+
.
18+
You should have received a copy of the GNU General Public License
19+
along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
.
21+
On Debian systems, the complete text of the GNU General
22+
Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'.

debian/gbp.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[DEFAULT]
2+
compression = bzip2
3+
debian-branch=debian
4+
5+
[dch]
6+
meta = true
7+
id-length = 6

debian/nftables-persistent.config

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
# Source debconf library
6+
. /usr/share/debconf/confmodule
7+
8+
db_get nft-persistent/autosave_done || true
9+
if [ "x$RET" != "xtrue" ]; then
10+
# Save nft rules?
11+
db_input high nft-persistent/autosave || true
12+
db_go
13+
fi

debian/nftables-persistent.default

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Configuration for netfilter-persistent
2+
# Plugins may extend this file or have their own
3+
4+
FLUSH_ON_STOP=1
5+

0 commit comments

Comments
 (0)