diff --git a/net-proxy/snowflake/Manifest b/net-proxy/snowflake/Manifest new file mode 100644 index 0000000000..fd29177a34 --- /dev/null +++ b/net-proxy/snowflake/Manifest @@ -0,0 +1 @@ +DIST snowflake-2.5.1.tar.gz 17989511 BLAKE2B 5d254e483803d0c03121acb12a188250eee79aec1af69d22bc88600ce5ffb67af09e437998a072977e6c9437b3fe5612e84663a90be66fb370eebf10f03327e2 SHA512 270eefa3cc999db36118871d23b2beebf4ef002c23e4c6a41e33bfa25a9c51c0305d2b8ad01f34863001ac5f822a9d97496249e2a4c0ae5c1a7af58cc56c26a4 diff --git a/net-proxy/snowflake/files/snowflake-proxy.initd b/net-proxy/snowflake/files/snowflake-proxy.initd new file mode 100644 index 0000000000..8818c6a855 --- /dev/null +++ b/net-proxy/snowflake/files/snowflake-proxy.initd @@ -0,0 +1,15 @@ +#!/sbin/openrc-run +# Copyright 2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 +# +# shellcheck shell=sh + +command="/usr/bin/snowflake-proxy" +command_args="${SNOWFLAKE_PROXY_OPTS}" +command_background=1 +command_user="nobody:nobody" +pidfile="/run/snowflake-proxy.pid" + +depend() { + need net +} diff --git a/net-proxy/snowflake/files/snowflake-proxy.service b/net-proxy/snowflake/files/snowflake-proxy.service new file mode 100644 index 0000000000..d023d57145 --- /dev/null +++ b/net-proxy/snowflake/files/snowflake-proxy.service @@ -0,0 +1,16 @@ +[Unit] +Description=Snowflake Proxy +Documentation=man:snowflake-proxy +Documentation=https://snowflake.torproject.org/ +After=network-online.target nss-lookup.target +Wants=network-online.target + +[Service] +ExecStart=/usr/bin/snowflake-proxy +Restart=on-failure + +DynamicUser=true +NoNewPrivileges=true + +[Install] +WantedBy=multi-user.target diff --git a/net-proxy/snowflake/metadata.xml b/net-proxy/snowflake/metadata.xml new file mode 100644 index 0000000000..85cf7c4b75 --- /dev/null +++ b/net-proxy/snowflake/metadata.xml @@ -0,0 +1,16 @@ + + + + + cyber+gentoo@sysrq.in + Anna + + + https://anonticket.onionize.space/ + + + Build the client application + Build the server application + Build standalone proxy application + + diff --git a/net-proxy/snowflake/snowflake-2.5.1.ebuild b/net-proxy/snowflake/snowflake-2.5.1.ebuild new file mode 100644 index 0000000000..fa82ac8eb6 --- /dev/null +++ b/net-proxy/snowflake/snowflake-2.5.1.ebuild @@ -0,0 +1,48 @@ +# Copyright 2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit go-module systemd + +JOB_ID="222736" +DESCRIPTION="Pluggable Transport using WebRTC, inspired by Flashproxy" +HOMEPAGE=" + https://snowflake.torproject.org/ + https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake +" +SRC_URI="https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/${PN}/-/jobs/${JOB_ID}/artifacts/raw/${P}.tar.gz" + +LICENSE="Apache-2.0 BSD BSD-2 CC0-1.0 MIT" +SLOT="0" +KEYWORDS="~amd64" + +COMPONENTS=( broker client probetest proxy server ) + +src_compile() { + for component in "${COMPONENTS[@]}"; do + pushd ${component} || die + einfo "Building ${component}" + ego build + popd || die + done +} + +src_test() { + ego test ./... +} + +src_install() { + local component + for component in "${COMPONENTS[@]}"; do + newbin ${component}/${component} snowflake-${component} + newdoc ${component}/README.md README_${component}.md + done + + systemd_dounit "${FILESDIR}"/snowflake-proxy.service + newinitd "${FILESDIR}"/snowflake-proxy.initd snowflake-proxy + + einstalldocs + dodoc doc/*.txt doc/*.md + doman doc/*.1 +}