summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docker_auth.service8
-rw-r--r--docker_auth.spec69
-rw-r--r--docker_auth.sysconfig2
3 files changed, 79 insertions, 0 deletions
diff --git a/docker_auth.service b/docker_auth.service
new file mode 100644
index 0000000..9f35987
--- /dev/null
+++ b/docker_auth.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Docker registry 2 authentication server service
+After=network.target
+
+[Service]
+Type=simple
+EnvironmentFile=/etc/sysconfig/docker_auth
+ExecStart=/usr/bin/auth_server -log_dir ${DOCKER_AUTH_LOGDIR} ${DOCKER_AUTH_CONFIG}
diff --git a/docker_auth.spec b/docker_auth.spec
new file mode 100644
index 0000000..c304a1a
--- /dev/null
+++ b/docker_auth.spec
@@ -0,0 +1,69 @@
+# FIXME:
+%undefine _missing_build_ids_terminate_build
+
+%global commit 164bba8f60bf35fa2ff2cc275461270a7779286e
+%global shortcommit %(c=%{commit}; echo ${c:0:7})
+
+Name: docker_auth
+Version: 1.3.1
+Release: 1%{?dist}
+Summary: Docker Registry 2 authentication server
+License: ASL 2.0
+URL: https://github.com/hguemar/docker_auth
+Source0: https://github.com/hguemar/docker_auth/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
+Source1: docker_auth.service
+Source2: docker_auth.sysconfig
+
+
+BuildRequires: golang
+BuildRequires: go-bindata
+BuildRequires: GitPython
+
+%{?systemd_requires}
+BuildRequires: systemd
+
+%description
+Authentication server implementing the Docker Registry 2.0 token-based
+authentication and authorization protocol.
+
+
+%prep
+%autosetup -n %{name}-%{commit} -S git
+
+%build
+pushd auth_server
+./gen_version.py
+go build -mod vendor
+popd
+
+
+%install
+pushd auth_server
+install -p -d -m 755 %{buildroot}%{_var}/log/docker_auth
+install -p -D -m 644 %SOURCE1 %{buildroot}%{_unitdir}/docker_auth.service
+install -p -D -m 644 %SOURCE2 %{buildroot}%{_sysconfdir}/sysconfig/docker_auth
+install -p -D -m 755 auth_server %{buildroot}%{_bindir}/auth_server
+popd
+
+%post
+%systemd_post docker_auth.service
+
+%preun
+%systemd_preun docker_auth.service
+
+%postun
+%systemd_postun
+
+%files
+%{_bindir}/auth_server
+%config(noreplace) %{_sysconfdir}/sysconfig/docker_auth
+%{_unitdir}/docker_auth.service
+%dir %{_var}/log/docker_auth
+
+
+
+%changelog
+* Wed Mar 6 2019 Haïkel Guémar <hguemar@fedoraproject.org> - 1.3.1-1
+- Initial packaging
+
+
diff --git a/docker_auth.sysconfig b/docker_auth.sysconfig
new file mode 100644
index 0000000..90871e1
--- /dev/null
+++ b/docker_auth.sysconfig
@@ -0,0 +1,2 @@
+DOCKER_AUTH_LOGDIR=/var/log/docker_auth
+DOCKER_AUTH_CONFIG=/etc/docker_auth.yml