Snowflake Makefile

I needed snowflake proxy for a project, so created a Makefile. Should one of the Maintainers of the Network section want to take ownership of it to include in the master branch--Please do.

Enjoy.

$ cat feeds/packages/net/snowflake/Makefile 
#
# Copyright (C) 2022 Tor Project
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=snowflake
PKG_VERSION:=2.4.1
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/archive/v$(PKG_VERSION)/
PKG_HASH:=af565cda52e26e32d40e272e95a0b715985732872d138b05ff14cb90f4f164e0
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)

PKG_LICENSE:=BSD-2-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Tor-Relays <tor-relays@lists.torproject.org>

PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0

GO_PKG:=git.torproject.org/pluggable-transports/snowflake.git

include $(INCLUDE_DIR)/package.mk
include ../../lang/golang/golang-package.mk

define Package/snowflake/Default
  TITLE:=Pluggable Transport using WebRTC, inspired by Flashproxy
  URL:=https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake
  DEPENDS:=$(GO_ARCH_DEPENDS)
endef

define Package/snowflake
$(call Package/snowflake/Default)
  SECTION:=net
  CATEGORY:=Network
  #DEPENDS:=+golang
endef

define Package/snowflake/Default/description
Snowflake is a pluggable transport that proxies traffic through temporary proxies using WebRTC, a peer-to-peer protocol with built-in NAT punching. It aims to work kind of like flash proxy, but without flash proxy's problems with NAT.

It is written in Go and is compliant with the Tor pluggable transports specification, and its modular architecture allows it to support multiple pluggable transports.
endef

define Package/snowflake/description
$(call Package/snowflake/Default/description)

This package contains the broker, client, distinctcounter, probetest, proxy, and server for the program.
endef

$(eval $(call GoBinPackage,snowflake))
$(eval $(call BuildPackage,snowflake))
1 Like

The package repo already contains snowflake-blah

Ugh! Before creating the Snowflake Makefile, I updated my feed and checked for its availability. It wasn't available. I Googled "openwrt snowflake" and it didn't produce any references to an OpenWRT package. I should have checked the OpenWRT GIT Repo. Full Disclosure: I'm running Entware and the Entware feed must not be up-to-date with Snowflake. I just grabbed the OpenWRT Makefile and files, made the necessary Entware changes, and it's compiling Great. Thanks for the heads-up!

P.S. I additionally created a Makefile for extor-static-cookie that is a Pluggable Transport between Snowflake and Tor.