2021-10-09 09:11:05 +00:00
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
#
|
2022-01-15 07:33:46 +00:00
|
|
|
# Copyright (C) 2021-2022 Gerald Kerma <gandalf@gk2.net>
|
2021-10-09 09:11:05 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=crowdsec-firewall-bouncer
|
2023-10-02 15:30:48 +00:00
|
|
|
PKG_VERSION:=0.0.28
|
2023-10-21 17:22:13 +00:00
|
|
|
PKG_RELEASE:=2
|
2021-10-09 09:11:05 +00:00
|
|
|
|
2022-01-07 13:41:00 +00:00
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
|
|
PKG_SOURCE_URL:=https://codeload.github.com/crowdsecurity/cs-firewall-bouncer/tar.gz/v$(PKG_VERSION)?
|
2023-10-02 15:30:48 +00:00
|
|
|
PKG_HASH:=1e0f4d3cd8bc73da21eafc9b965fda0c1c1b0a27a2acc038004602797e4fccf0
|
2021-10-09 09:11:05 +00:00
|
|
|
|
|
|
|
PKG_LICENSE:=MIT
|
|
|
|
PKG_LICENSE_FILES:=LICENSE
|
|
|
|
PKG_MAINTAINER:=Gerald Kerma <gandalf@gk2.net>
|
|
|
|
|
|
|
|
PKG_BUILD_DEPENDS:=golang/host
|
|
|
|
PKG_BUILD_PARALLEL:=1
|
2023-03-23 07:39:01 +00:00
|
|
|
PKG_BUILD_FLAGS:=no-mips16
|
2022-01-07 13:41:00 +00:00
|
|
|
PKG_BUILD_DIR:=$(BUILD_DIR)/cs-firewall-bouncer-$(PKG_VERSION)
|
2021-10-09 09:11:05 +00:00
|
|
|
|
2022-01-07 13:41:00 +00:00
|
|
|
CSFB_BUILD_VERSION?=v$(PKG_VERSION)
|
|
|
|
CSFB_BUILD_GOVERSION:=$(shell go version | cut -d " " -f3 | sed -E 's/[go]+//g')
|
2022-01-15 07:33:46 +00:00
|
|
|
CSFB_BUILD_TIMESTAMP:=$(shell date +%F"_"%T)
|
2022-01-07 13:41:00 +00:00
|
|
|
CSFB_BUILD_TAG:=openwrt-$(PKG_VERSION)-$(PKG_RELEASE)
|
2021-10-09 09:11:05 +00:00
|
|
|
CSFB_VERSION_PKG:=github.com/crowdsecurity/cs-firewall-bouncer/pkg/version
|
|
|
|
|
|
|
|
GO_PKG:=github.com/crowdsecurity/cs-firewall-bouncer
|
2022-01-07 13:41:00 +00:00
|
|
|
GO_PKG_INSTALL_ALL:=1
|
2021-10-09 09:11:05 +00:00
|
|
|
GO_PKG_LDFLAGS_X:=$(CSFB_VERSION_PKG).Version=$(CSFB_BUILD_VERSION) \
|
|
|
|
$(CSFB_VERSION_PKG).BuildDate=$(CSFB_BUILD_TIMESTAMP) \
|
|
|
|
$(CSFB_VERSION_PKG).Tag=$(CSFB_BUILD_TAG) \
|
|
|
|
$(CSFB_VERSION_PKG).GoVersion=$(CSFB_BUILD_GOVERSION)
|
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
include ../../lang/golang/golang-package.mk
|
|
|
|
|
|
|
|
define Package/crowdsec-firewall-bouncer/Default
|
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
|
|
|
TITLE:=Firewall bouncer for Crowdsec
|
2022-01-15 07:33:46 +00:00
|
|
|
URL:=https://github.com/crowdsecurity/cs-firewall-bouncer/
|
2021-10-09 09:11:05 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/crowdsec-firewall-bouncer
|
|
|
|
$(call Package/crowdsec-firewall-bouncer/Default)
|
2023-01-30 18:26:59 +00:00
|
|
|
DEPENDS:=$(GO_ARCH_DEPENDS)
|
2021-10-09 09:11:05 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/golang-crowdsec-firewall-bouncer-dev
|
|
|
|
$(call Package/crowdsec-firewall-bouncer/Default)
|
|
|
|
$(call GoPackage/GoSubMenu)
|
|
|
|
TITLE+= (source files)
|
|
|
|
DEPENDS:=$(GO_ARCH_DEPENDS)
|
|
|
|
PKGARCH:=all
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/crowdsec-firewall-bouncer/Default/description
|
|
|
|
Crowdsec bouncer written in golang for firewalls.
|
|
|
|
|
|
|
|
crowdsec-firewall-bouncer will fetch new and old decisions
|
|
|
|
from a CrowdSec API to add them in a blocklist used by supported firewalls.
|
|
|
|
|
2023-01-30 18:26:59 +00:00
|
|
|
You must install nftables.
|
2021-10-09 09:11:05 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/crowdsec-firewall-bouncer/description
|
|
|
|
$(call Package/crowdsec-firewall-bouncer/Default/description)
|
|
|
|
|
|
|
|
This package contains the main program.
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/golang-crowdsec-firewall-bouncer-dev/description
|
|
|
|
$(call Package/crowdsec-firewall-bouncer/Default/description)
|
|
|
|
|
|
|
|
This package provides the source files for the program.
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/crowdsec-firewall-bouncer/install
|
|
|
|
$(call GoPackage/Package/Install/Bin,$(1))
|
|
|
|
|
2023-01-30 18:26:59 +00:00
|
|
|
$(INSTALL_DIR) $(1)/etc/config
|
|
|
|
$(INSTALL_CONF) ./files/crowdsec.config $(1)/etc/config/crowdsec
|
2021-10-09 09:11:05 +00:00
|
|
|
|
|
|
|
$(INSTALL_DIR) $(1)/etc/init.d
|
2023-01-30 18:26:59 +00:00
|
|
|
$(INSTALL_BIN) ./files/crowdsec-firewall-bouncer.initd $(1)/etc/init.d/crowdsec-firewall-bouncer
|
2021-10-09 09:11:05 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/crowdsec-firewall-bouncer/conffiles
|
2023-01-30 18:26:59 +00:00
|
|
|
/etc/config/crowdsec
|
2021-10-09 09:11:05 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call GoBinPackage,crowdsec-firewall-bouncer))
|
|
|
|
$(eval $(call BuildPackage,crowdsec-firewall-bouncer))
|