public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Manuel Rüger" <mrueg@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/reg/files/, app-emulation/reg/
Date: Mon,  6 Aug 2018 17:40:32 +0000 (UTC)	[thread overview]
Message-ID: <1533577211.50e6b0f5b4bcc233723fb8a24de376dbda7b10cb.mrueg@gentoo> (raw)

commit:     50e6b0f5b4bcc233723fb8a24de376dbda7b10cb
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  6 14:27:22 2018 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Mon Aug  6 17:40:11 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=50e6b0f5

app-emulation/reg: Include patch to set listen addr

Package-Manager: Portage-2.3.44, Repoman-2.3.10

 .../reg/files/reg-0.15.4-listen-addr.patch         | 47 ++++++++++++++++++++
 app-emulation/reg/reg-0.15.4-r2.ebuild             | 50 ++++++++++++++++++++++
 2 files changed, 97 insertions(+)

diff --git a/app-emulation/reg/files/reg-0.15.4-listen-addr.patch b/app-emulation/reg/files/reg-0.15.4-listen-addr.patch
new file mode 100644
index 00000000000..21f2759e5b8
--- /dev/null
+++ b/app-emulation/reg/files/reg-0.15.4-listen-addr.patch
@@ -0,0 +1,47 @@
+From b3c826e2e48108d832cbe9fc3b630e7ff207915a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Manuel=20R=C3=BCger?= <manuel@rueg.eu>
+Date: Wed, 18 Jul 2018 19:47:12 +0200
+Subject: [PATCH] server: Allow to restrict listen address (#115)
+
+e.g. limit to listen on localhost only
+---
+ server.go | 12 +++++++-----
+ 2 files changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/server.go b/server.go
+index 8866efed..a7cc2048 100644
+--- a/server.go
++++ b/server.go
+@@ -35,6 +35,7 @@ func (cmd *serverCommand) Register(fs *flag.FlagSet) {
+ 
+ 	fs.StringVar(&cmd.cert, "cert", "", "path to ssl cert")
+ 	fs.StringVar(&cmd.key, "key", "", "path to ssl key")
++	fs.StringVar(&cmd.listenAddress, "listen-address", "", "address to listen on")
+ 	fs.StringVar(&cmd.port, "port", "8080", "port for server to run on")
+ 	fs.StringVar(&cmd.assetPath, "asset-path", "", "Path to assets and templates")
+ 
+@@ -48,10 +49,11 @@ type serverCommand struct {
+ 
+ 	generateAndExit bool
+ 
+-	cert      string
+-	key       string
+-	port      string
+-	assetPath string
++	cert          string
++	key           string
++	listenAddress string
++	port          string
++	assetPath     string
+ }
+ 
+ func (cmd *serverCommand) Run(ctx context.Context, args []string) error {
+@@ -180,7 +182,7 @@ func (cmd *serverCommand) Run(ctx context.Context, args []string) error {
+ 
+ 	// Set up the server.
+ 	server := &http.Server{
+-		Addr:    ":" + cmd.port,
++		Addr:    cmd.listenAddress + ":" + cmd.port,
+ 		Handler: mux,
+ 	}
+ 	logrus.Infof("Starting server on port %q", cmd.port)

diff --git a/app-emulation/reg/reg-0.15.4-r2.ebuild b/app-emulation/reg/reg-0.15.4-r2.ebuild
new file mode 100644
index 00000000000..1bebb08c1e9
--- /dev/null
+++ b/app-emulation/reg/reg-0.15.4-r2.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit golang-build golang-vcs-snapshot user
+
+EGO_PN="github.com/genuinetools/reg"
+GIT_COMMIT="8c930c585418564a4ce472fbbfccb8c5741c2520"
+ARCHIVE_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64"
+
+DESCRIPTION="Docker registry v2 command line client"
+HOMEPAGE="https://github.com/genuinetools/reg"
+SRC_URI="${ARCHIVE_URI}"
+LICENSE="MIT"
+SLOT="0"
+IUSE=""
+
+RESTRICT="test"
+
+PATCHES=( "${FILESDIR}"/${P}-listen-addr.patch )
+
+pkg_setup() {
+	enewgroup reg
+	enewuser reg -1 -1 /var/lib/reg reg
+}
+
+src_prepare() {
+	pushd src/${EGO_PN} || die
+	default
+	popd || die
+}
+
+src_compile() {
+	pushd src/${EGO_PN} || die
+	GOPATH="${S}" go build -v -ldflags "-X ${EGO_PN}/version.GITCOMMIT=${GIT_COMMIT} -X ${EGO_PN}/version.VERSION=${PV}" -o "${S}"/bin/reg . || die
+	popd || die
+}
+
+src_install() {
+	dobin bin/*
+	dodoc src/${EGO_PN}/README.md
+	insinto /var/lib/${PN}
+	doins -r src/${EGO_PN}/server/*
+	newinitd "${FILESDIR}"/reg.initd reg
+	newconfd "${FILESDIR}"/reg.confd reg
+
+	keepdir /var/log/reg
+	fowners -R reg:reg /var/log/reg /var/lib/reg/static
+}


             reply	other threads:[~2018-08-06 17:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-06 17:40 Manuel Rüger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-01-28 10:54 [gentoo-commits] repo/gentoo:master commit in: app-emulation/reg/files/, app-emulation/reg/ Manuel Rüger
2018-07-18 11:23 Manuel Rüger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1533577211.50e6b0f5b4bcc233723fb8a24de376dbda7b10cb.mrueg@gentoo \
    --to=mrueg@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox