git: 8bee9d3bead6 - main - www/mirrorselect: New port
Guangyuan Yang
ygy at FreeBSD.org
Sun May 30 21:14:45 UTC 2021
The branch main has been updated by ygy:
URL: https://cgit.FreeBSD.org/ports/commit/?id=8bee9d3bead6a4d7e57a8893fd76fb294cd4fa04
commit 8bee9d3bead6a4d7e57a8893fd76fb294cd4fa04
Author: Aaron LI <aly at aaronly.me>
AuthorDate: 2021-05-30 21:12:36 +0000
Commit: Guangyuan Yang <ygy at FreeBSD.org>
CommitDate: 2021-05-30 21:12:36 +0000
www/mirrorselect: New port
HTTP service that selects pkg(8) mirrors near to the client.
PR: 253622
Submitted by: Aaron LI <aly at aaronly.me>
Approved by: lwhsu (mentor)
---
www/Makefile | 1 +
www/mirrorselect/Makefile | 63 ++++++++++++++++++++++++++++++++
www/mirrorselect/distinfo | 61 +++++++++++++++++++++++++++++++
www/mirrorselect/files/mirrorselect.in | 67 ++++++++++++++++++++++++++++++++++
www/mirrorselect/pkg-descr | 4 ++
5 files changed, 196 insertions(+)
diff --git a/www/Makefile b/www/Makefile
index c7e72e976954..d38f36336638 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -344,6 +344,7 @@
SUBDIR += minio-client
SUBDIR += miniserve
SUBDIR += mitmproxy
+ SUBDIR += mirrorselect
SUBDIR += mknmz-wwwoffle
SUBDIR += mnogosearch
SUBDIR += mod_amazon_proxy
diff --git a/www/mirrorselect/Makefile b/www/mirrorselect/Makefile
new file mode 100644
index 000000000000..9d4bf9af288e
--- /dev/null
+++ b/www/mirrorselect/Makefile
@@ -0,0 +1,63 @@
+# Created by: Aaron LI <aly at aaronly.me>
+
+PORTNAME= mirrorselect
+DISTVERSIONPREFIX= v
+DISTVERSION= 0.9.0
+CATEGORIES= www
+
+MAINTAINER= aly at aaronly.me
+COMMENT= HTTP service that selects pkg(8) mirrors near to the client
+
+LICENSE= BSD3CLAUSE
+
+USES= go:modules
+USE_RC_SUBR= ${PORTNAME}
+SUB_FILES= ${PORTNAME}
+
+USE_GITHUB= yes
+GH_ACCOUNT= DragonFlyBSD
+
+GH_TUPLE= \
+ fsnotify:fsnotify:v1.4.7:fsnotify_fsnotify/vendor/github.com/fsnotify/fsnotify \
+ gin-contrib:sse:v0.1.0:gin_contrib_sse/vendor/github.com/gin-contrib/sse \
+ gin-gonic:gin:v1.6.3:gin_gonic_gin/vendor/github.com/gin-gonic/gin \
+ go-ini:ini:v1.51.0:go_ini_ini/vendor/gopkg.in/ini.v1 \
+ go-playground:locales:v0.13.0:go_playground_locales/vendor/github.com/go-playground/locales \
+ go-playground:universal-translator:v0.17.0:go_playground_universal_translator/vendor/github.com/go-playground/universal-translator \
+ go-playground:validator:v10.2.0:go_playground_validator_v10/vendor/github.com/go-playground/validator/v10 \
+ go-yaml:yaml:v2.2.8:go_yaml_yaml/vendor/gopkg.in/yaml.v2 \
+ golang:protobuf:v1.3.3:golang_protobuf/vendor/github.com/golang/protobuf \
+ golang:sys:b77594299b42:golang_sys/vendor/golang.org/x/sys \
+ golang:text:v0.3.2:golang_text/vendor/golang.org/x/text \
+ hashicorp:hcl:v1.0.0:hashicorp_hcl/vendor/github.com/hashicorp/hcl \
+ jlaffaye:ftp:9aae4d151126:jlaffaye_ftp/vendor/github.com/jlaffaye/ftp \
+ json-iterator:go:v1.1.9:json_iterator_go/vendor/github.com/json-iterator/go \
+ leodido:go-urn:v1.2.0:leodido_go_urn/vendor/github.com/leodido/go-urn \
+ magiconair:properties:v1.8.1:magiconair_properties/vendor/github.com/magiconair/properties \
+ mattn:go-isatty:v0.0.12:mattn_go_isatty/vendor/github.com/mattn/go-isatty \
+ mitchellh:mapstructure:v1.1.2:mitchellh_mapstructure/vendor/github.com/mitchellh/mapstructure \
+ modern-go:concurrent:bacd9c7ef1dd:modern_go_concurrent/vendor/github.com/modern-go/concurrent \
+ modern-go:reflect2:v1.0.1:modern_go_reflect2/vendor/github.com/modern-go/reflect2 \
+ oschwald:maxminddb-golang:v1.8.0:oschwald_maxminddb_golang/vendor/github.com/oschwald/maxminddb-golang \
+ pelletier:go-toml:v1.2.0:pelletier_go_toml/vendor/github.com/pelletier/go-toml \
+ spf13:afero:v1.1.2:spf13_afero/vendor/github.com/spf13/afero \
+ spf13:cast:v1.3.0:spf13_cast/vendor/github.com/spf13/cast \
+ spf13:jwalterweatherman:v1.0.0:spf13_jwalterweatherman/vendor/github.com/spf13/jwalterweatherman \
+ spf13:pflag:v1.0.3:spf13_pflag/vendor/github.com/spf13/pflag \
+ spf13:viper:v1.7.1:spf13_viper/vendor/github.com/spf13/viper \
+ subosito:gotenv:v1.2.0:subosito_gotenv/vendor/github.com/subosito/gotenv \
+ ugorji:go:v1.1.7:ugorji_go_codec/vendor/github.com/ugorji/go
+
+PLIST_FILES= ${LOCALBASE}/bin/${PORTNAME} \
+ "@dir ${ETCDIR}/mirrorselect" \
+ "@sample ${ETCDIR}/${PORTNAME}.toml.sample" \
+ "@sample ${ETCDIR}/mirrors.toml.sample"
+
+post-install:
+ ${MKDIR} ${STAGEDIR}${ETCDIR}/${PORTNAME}
+ ${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.toml \
+ ${STAGEDIR}${ETCDIR}/${PORTNAME}.toml.sample
+ ${INSTALL_DATA} ${WRKSRC}/mirrors.toml \
+ ${STAGEDIR}${ETCDIR}/mirrors.toml.sample
+
+.include <bsd.port.mk>
diff --git a/www/mirrorselect/distinfo b/www/mirrorselect/distinfo
new file mode 100644
index 000000000000..e10e55c57e38
--- /dev/null
+++ b/www/mirrorselect/distinfo
@@ -0,0 +1,61 @@
+TIMESTAMP = 1612841638
+SHA256 (DragonFlyBSD-mirrorselect-v0.9.0_GH0.tar.gz) = cf55425e133423c07a9caee7943068b50e079bb94ffe4845217664d05979d6d6
+SIZE (DragonFlyBSD-mirrorselect-v0.9.0_GH0.tar.gz) = 34353
+SHA256 (fsnotify-fsnotify-v1.4.7_GH0.tar.gz) = b7530d973d0ab0e58ad8ce1b9a4b963d6f57b3d72f2f9e13d49846976361b1cd
+SIZE (fsnotify-fsnotify-v1.4.7_GH0.tar.gz) = 31139
+SHA256 (gin-contrib-sse-v0.1.0_GH0.tar.gz) = e92addababc6e94d319606d45fa9ed7fe7b0e0748d8a918ae8acf5b0b87d7889
+SIZE (gin-contrib-sse-v0.1.0_GH0.tar.gz) = 6109
+SHA256 (gin-gonic-gin-v1.6.3_GH0.tar.gz) = 3d89db8a45f56ee85c18ac21d5ba39bf26f498a39d7d04f8b8a289bc95548fe1
+SIZE (gin-gonic-gin-v1.6.3_GH0.tar.gz) = 132438
+SHA256 (go-ini-ini-v1.51.0_GH0.tar.gz) = 6c98311d375afbe36a246c5d29acb5cb428634a4186e591ce9b7fe2fa4f2a471
+SIZE (go-ini-ini-v1.51.0_GH0.tar.gz) = 43536
+SHA256 (go-playground-locales-v0.13.0_GH0.tar.gz) = 046a2f8c6011d050bedc67a34f8c577238abe4db91f3da9dfdd3d74565f08512
+SIZE (go-playground-locales-v0.13.0_GH0.tar.gz) = 4225718
+SHA256 (go-playground-universal-translator-v0.17.0_GH0.tar.gz) = a029ec247ca60b39bbc7d447b845a604a7ad00a8b7e52abea9e362db1b4fae88
+SIZE (go-playground-universal-translator-v0.17.0_GH0.tar.gz) = 36838
+SHA256 (go-playground-validator-v10.2.0_GH0.tar.gz) = 7a9007d79c5e8f66415fd6dff4c948ed30bb0431a832aae6dea571985d8d723a
+SIZE (go-playground-validator-v10.2.0_GH0.tar.gz) = 150397
+SHA256 (go-yaml-yaml-v2.2.8_GH0.tar.gz) = 9632d0760e9a07c414f2b2b6cd453d6225e42ecea77906883b23f1f1d0546045
+SIZE (go-yaml-yaml-v2.2.8_GH0.tar.gz) = 72732
+SHA256 (golang-protobuf-v1.3.3_GH0.tar.gz) = b3a1440808d6ed4dc0d194c482de029f6c116b1de7f7a3bf927324d965ff3853
+SIZE (golang-protobuf-v1.3.3_GH0.tar.gz) = 315377
+SHA256 (golang-sys-b77594299b42_GH0.tar.gz) = 484bf05a828f18a9ea48f32b64322d6cc8e716b5cbfd455be72f445db8495b82
+SIZE (golang-sys-b77594299b42_GH0.tar.gz) = 1534631
+SHA256 (golang-text-v0.3.2_GH0.tar.gz) = 0b9309698f5708531c5377ab1e29b423a6d9e20c55a8d386c3b8283428212f22
+SIZE (golang-text-v0.3.2_GH0.tar.gz) = 7168069
+SHA256 (hashicorp-hcl-v1.0.0_GH0.tar.gz) = 50632428210503070fd2fde748c88b7414bf84a6a0eadebf9d8e596a033bead2
+SIZE (hashicorp-hcl-v1.0.0_GH0.tar.gz) = 70658
+SHA256 (jlaffaye-ftp-9aae4d151126_GH0.tar.gz) = 91537e471c0b63430946501a56dee6489283f307072d3b7bdd1aed76c483657c
+SIZE (jlaffaye-ftp-9aae4d151126_GH0.tar.gz) = 19869
+SHA256 (json-iterator-go-v1.1.9_GH0.tar.gz) = ca1fee8594ea5b4f41bce678c09a7b4b8300bf185701930cc5fcb1758e98dab1
+SIZE (json-iterator-go-v1.1.9_GH0.tar.gz) = 79624
+SHA256 (leodido-go-urn-v1.2.0_GH0.tar.gz) = c5aee85151ad7ca482f5b0a63dea1f47e89300d7ac9d66c45e992c77e857fa1c
+SIZE (leodido-go-urn-v1.2.0_GH0.tar.gz) = 1102396
+SHA256 (magiconair-properties-v1.8.1_GH0.tar.gz) = 4449df3d2be86608bfc997228f66f1cff57bf620cc5bf9ba44339c7e4c5612dd
+SIZE (magiconair-properties-v1.8.1_GH0.tar.gz) = 29735
+SHA256 (mattn-go-isatty-v0.0.12_GH0.tar.gz) = addbdc341d7685ed4cc8d2d8a8fd2bd9b784bde00d0ea99fb251039fc10c611c
+SIZE (mattn-go-isatty-v0.0.12_GH0.tar.gz) = 4548
+SHA256 (mitchellh-mapstructure-v1.1.2_GH0.tar.gz) = 53fbc06b125ff1c9c73a4eb1764346932671a29c67a45a92e2ebc6855635069b
+SIZE (mitchellh-mapstructure-v1.1.2_GH0.tar.gz) = 20980
+SHA256 (modern-go-concurrent-bacd9c7ef1dd_GH0.tar.gz) = d673e902118a6ece63198dc7e0961e904d0410f142726df0936ec1a52035a60f
+SIZE (modern-go-concurrent-bacd9c7ef1dd_GH0.tar.gz) = 7526
+SHA256 (modern-go-reflect2-v1.0.1_GH0.tar.gz) = d24e856d9aa8fd51b9e6c2cdd712a44c8d18cb8b72802f1bd16e0470322363fd
+SIZE (modern-go-reflect2-v1.0.1_GH0.tar.gz) = 14394
+SHA256 (oschwald-maxminddb-golang-v1.8.0_GH0.tar.gz) = bb215e75bc25e25ccd733225ccc2f2144ab10a76d616f13232d5cd873b983986
+SIZE (oschwald-maxminddb-golang-v1.8.0_GH0.tar.gz) = 25029
+SHA256 (pelletier-go-toml-v1.2.0_GH0.tar.gz) = 1a5a620f680033f17e34148bee8f26d96d8c27ff1d7f56f0fe1c7253595b5244
+SIZE (pelletier-go-toml-v1.2.0_GH0.tar.gz) = 57496
+SHA256 (spf13-afero-v1.1.2_GH0.tar.gz) = 66554a6b09b0009340ae77c119d5a14e2460bb3aea56e75e138c87e621f3803b
+SIZE (spf13-afero-v1.1.2_GH0.tar.gz) = 45309
+SHA256 (spf13-cast-v1.3.0_GH0.tar.gz) = e685282ea33f89e9354d148ad1886f532bcebe86b0b60a167988f7c6d081085f
+SIZE (spf13-cast-v1.3.0_GH0.tar.gz) = 11085
+SHA256 (spf13-jwalterweatherman-v1.0.0_GH0.tar.gz) = 2ece12b964e0d230b10851555185d42d3c81b401efda044265ae716eb1d0bc2d
+SIZE (spf13-jwalterweatherman-v1.0.0_GH0.tar.gz) = 6392
+SHA256 (spf13-pflag-v1.0.3_GH0.tar.gz) = 9e57f86f493f04d9077fccd04e7139ebf243dd544e917ab83d35729b3e54a124
+SIZE (spf13-pflag-v1.0.3_GH0.tar.gz) = 46002
+SHA256 (spf13-viper-v1.7.1_GH0.tar.gz) = de85215b50e9fbb2cdf63b0aa9df826a866dff8f718ba2dc3f5866e98d5bd39a
+SIZE (spf13-viper-v1.7.1_GH0.tar.gz) = 82641
+SHA256 (subosito-gotenv-v1.2.0_GH0.tar.gz) = 5f6826992c11981018c77377f33dbc56d0be932e0d38a2f51e795c99725e7ba5
+SIZE (subosito-gotenv-v1.2.0_GH0.tar.gz) = 7359
+SHA256 (ugorji-go-v1.1.7_GH0.tar.gz) = a696a597d24c4743e125a00f771778a3cc8701c8bd9c3e31345524f61b560259
+SIZE (ugorji-go-v1.1.7_GH0.tar.gz) = 293690
diff --git a/www/mirrorselect/files/mirrorselect.in b/www/mirrorselect/files/mirrorselect.in
new file mode 100644
index 000000000000..91a0b992f659
--- /dev/null
+++ b/www/mirrorselect/files/mirrorselect.in
@@ -0,0 +1,67 @@
+#!/bin/sh
+#
+# PROVIDE: mirrorselect
+# REQUIRE: LOGIN
+#
+# Configurations:
+#
+# mirrorselect_enable (bool): Set to YES to enable mirrorselect
+# Default: NO
+# mirrorselect_conf (str): Mirrorselect configuration file
+# Default: %%ETCDIR%%/mirrorselect.toml
+# mirrorselect_user (str): Mirrorselect daemon user
+# Default: nobody
+# mirrorselect_access_log (str): File to store the mirrorselect web access log
+# Default: /var/log/mirrorselect.log
+# mirrorselect_datadir (str): Data directory to store MMDB files
+# Default: /var/lib/mirrorselect
+# mirrorselect_fetch_dbip (str): DB-IP Lite city database filename to fetch
+# Default: dbip-city-lite-2021-02.mmdb.gz
+#
+
+. /etc/rc.subr
+
+name="mirrorselect"
+rcvar="${name}_enable"
+
+load_rc_config ${name}
+: ${mirrorselect_enable:="NO"}
+: ${mirrorselect_conf:="%%ETCDIR%%/${name}.toml"}
+: ${mirrorselect_user:="nobody"}
+: ${mirrorselect_access_log:="/var/log/${name}.log"}
+: ${mirrorselect_datadir:="/var/lib/${name}"}
+: ${mirrorselect_fetch_dbip:="dbip-city-lite-2021-02.mmdb.gz"}
+
+pidfile="/var/run/${name}.pid"
+procname="%%PREFIX%%/bin/${name}"
+command="/usr/sbin/daemon"
+command_args="-c -p ${pidfile} -T ${name}
+ ${procname} -config ${mirrorselect_conf}
+ -access-log ${mirrorselect_access_log}"
+start_precmd="mirrorselect_precmd"
+
+mirrorselect_precmd()
+{
+ install -o ${mirrorselect_user} /dev/null ${pidfile}
+ if [ ! -f "${mirrorselect_access_log}" ]; then
+ install -o ${mirrorselect_user} /dev/null ${mirrorselect_access_log}
+ fi
+
+ if [ -z "${mirrorselect_fetch_dbip}" ]; then
+ return
+ fi
+ if [ -f "${mirrorselect_datadir}/${mirrorselect_fetch_dbip%.gz}" ]; then
+ return
+ fi
+
+ [ -d "${mirrorselect_datadir}" ] || mkdir -pv ${mirrorselect_datadir}
+
+ echo "Fetching DB-IP Lite database: ${mirrorselect_fetch_dbip} ..."
+ fetch -a -o - \
+ https://download.db-ip.com/free/${mirrorselect_fetch_dbip} | \
+ gunzip > ${mirrorselect_datadir}/${mirrorselect_fetch_dbip%.gz}
+ chmod 0444 ${mirrorselect_datadir}/${mirrorselect_fetch_dbip%.gz}
+ ln -svf ${mirrorselect_fetch_dbip%.gz} ${mirrorselect_datadir}/dbip.mmdb
+}
+
+run_rc_command "$1"
diff --git a/www/mirrorselect/pkg-descr b/www/mirrorselect/pkg-descr
new file mode 100644
index 000000000000..20f146556708
--- /dev/null
+++ b/www/mirrorselect/pkg-descr
@@ -0,0 +1,4 @@
+Mirrorselect is an HTTP backend service that selects the pkg(8) mirrors
+according to their "distances" to the client.
+
+WWW: https://github.com/DragonFlyBSD/mirrorselect
More information about the dev-commits-ports-all
mailing list