[stud] Initial import (#848108).

rohara rohara at fedoraproject.org
Fri Aug 24 14:32:34 UTC 2012


commit 395867324744a65c60e8ff330d1d4644cc17f065
Author: Ryan O'Hara <rohara at redhat.com>
Date:   Fri Aug 24 09:31:15 2012 -0500

    Initial import (#848108).

 .gitignore                            |    1 +
 sources                               |    1 +
 stud-0.3-fix-libev-include-path.patch |   12 ++++
 stud.cfg                              |  112 +++++++++++++++++++++++++++++++++
 stud.service                          |    9 +++
 stud.spec                             |   99 +++++++++++++++++++++++++++++
 6 files changed, 234 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..09a7a6f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/bumptech-stud-0.3-51-g0b88039.tar.gz
diff --git a/sources b/sources
index e69de29..b6a7400 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+b06f9ae3d6a36d60b11c876189124eba  bumptech-stud-0.3-51-g0b88039.tar.gz
diff --git a/stud-0.3-fix-libev-include-path.patch b/stud-0.3-fix-libev-include-path.patch
new file mode 100644
index 0000000..903114f
--- /dev/null
+++ b/stud-0.3-fix-libev-include-path.patch
@@ -0,0 +1,12 @@
+diff -Naupr bumptech-stud-84797cc.orig/Makefile bumptech-stud-84797cc/Makefile
+--- bumptech-stud-84797cc.orig/Makefile	2012-06-02 01:09:09.000000000 -0500
++++ bumptech-stud-84797cc/Makefile	2012-07-30 11:52:40.301348350 -0500
+@@ -7,7 +7,7 @@ PREFIX  = /usr/local
+ BINDIR  = $(PREFIX)/bin
+ MANDIR  = $(PREFIX)/share/man
+ 
+-CFLAGS  = -O2 -g -std=c99 -fno-strict-aliasing -Wall -W -D_GNU_SOURCE -I/usr/local/include
++CFLAGS  = -O2 -g -std=c99 -fno-strict-aliasing -Wall -W -D_GNU_SOURCE -I/usr/include/libev
+ LDFLAGS = -lssl -lcrypto -lev -L/usr/local/lib
+ OBJS    = stud.o ringbuffer.o configuration.o
+ 
diff --git a/stud.cfg b/stud.cfg
new file mode 100644
index 0000000..632d2ff
--- /dev/null
+++ b/stud.cfg
@@ -0,0 +1,112 @@
+#
+# stud(8), The Scalable TLS Unwrapping Daemon's configuration
+#
+
+# NOTE: all config file parameters can be overriden
+#       from command line!
+
+# Listening address. REQUIRED.
+#
+# type: string
+# syntax: [HOST]:PORT
+frontend = "[*]:8443"
+
+# Upstream server address. REQUIRED.
+#
+# type: string
+# syntax: [HOST]:PORT.
+backend = "[127.0.0.1]:8000"
+
+# SSL x509 certificate file. REQUIRED.
+#
+# type: string
+pem-file = ""
+
+# SSL protocol.
+#
+# tls = on
+# ssl = off
+
+# List of allowed SSL ciphers.
+#
+# Run openssl ciphers for list of available ciphers.
+# type: string
+ciphers = ""
+
+# Enforce server cipher list order
+#
+# type: boolean
+prefer-server-ciphers = off
+
+# Use specified SSL engine
+#
+# type: string
+ssl-engine = ""
+
+# Number of worker processes
+#
+# type: integer
+workers = 1
+
+# Listen backlog size
+#
+# type: integer
+backlog = 100
+
+# TCP socket keepalive interval in seconds
+#
+# type: integer
+keepalive = 3600
+
+# Chroot directory
+#
+# type: string
+chroot = ""
+
+# Set uid after binding a socket
+#
+# type: string
+user = "stud"
+
+# Set gid after binding a socket
+#
+# type: string
+group = "stud"
+
+# Quiet execution, report only error messages
+#
+# type: boolean
+quiet = on
+
+# Use syslog for logging
+#
+# type: boolean
+syslog = on
+
+# Syslog facility to use
+#
+# type: string
+syslog-facility = "daemon"
+
+# Run as daemon
+#
+# type: boolean
+daemon = on
+
+# Report client address by writing IP before sending data
+#
+# NOTE: This option is mutually exclusive with option write-proxy.
+#
+# type: boolean
+write-ip = off
+
+# Report client address using SENDPROXY protocol, see
+# http://haproxy.1wt.eu/download/1.5/doc/proxy-protocol.txt
+# for details.
+#
+# NOTE: This option is mutually exclusive with option write-ip.
+#
+# type: boolean
+write-proxy = off
+
+# EOF
diff --git a/stud.service b/stud.service
new file mode 100644
index 0000000..efc1bca
--- /dev/null
+++ b/stud.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Stud
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/stud --config=/etc/stud/stud.cfg
+
+[Install]
+WantedBy=multi-user.target
diff --git a/stud.spec b/stud.spec
new file mode 100644
index 0000000..07aa52c
--- /dev/null
+++ b/stud.spec
@@ -0,0 +1,99 @@
+%global stud_githash	0b88039
+%global stud_user	stud
+%global stud_group	stud
+%global stud_homedir	%{_localstatedir}/lib/stud
+%global stud_confdir	%{_sysconfdir}/stud
+%global stud_datadir	%{_datadir}/stud
+
+
+Name:		stud
+Version:	0.3
+Release:	1.20120814git%{?dist}
+Summary:	The Scalable TLS Unwrapping Daemon
+
+License:	BSD
+URL:		https://github.com/bumptech/stud
+Source0:	bumptech-%{name}-%{version}-51-g%{stud_githash}.tar.gz
+Source1:	%{name}.service
+Source2:	%{name}.cfg
+Patch0:		stud-0.3-fix-libev-include-path.patch
+
+BuildRequires:	libev-devel
+BuildRequires:	openssl-devel
+BuildRequires:	systemd-units
+
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+
+
+%description
+stud is a network proxy that terminates TLS/SSL connections and
+forwards the unencrypted traffic to some backend. It is designed to
+handle tens of thousands of connections efficiently on multicore
+machines. stud has very few features -- it is designed to be paired
+with an intelligent backend like haproxy or nginx.
+
+
+%prep
+%setup -q -n bumptech-%{name}-%{stud_githash}
+%patch0 -p1
+
+
+%build
+make %{?_smp_mflags}
+
+
+%install
+rm -rf %{buildroot}
+make install DESTDIR=%{buildroot} PREFIX=%{_prefix} BINDIR=%{_sbindir}
+%{__install} -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/stud.service
+%{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{stud_confdir}/stud.cfg
+%{__install} -d -m 0755 %{buildroot}%{stud_homedir}
+%{__install} -d -m 0755 %{buildroot}%{stud_datadir}
+
+
+%clean
+rm -rf %{buildroot}
+
+
+%pre
+groupadd -r %{stud_group} &>/dev/null ||:
+useradd -r -g %{stud_group} -s /sbin/nologin -d %{stud_homedir} %{stud_user} &>/dev/null ||:
+
+
+%post
+if [ $1 -eq 1 ]; then
+   /bin/systemctl daemon-reload >/dev/null 2>&1 ||:
+fi
+
+
+%preun
+if [ $1 -eq 0 ]; then
+   /bin/systemctl --no-reload disable stud.service >/dev/null 2>&1 ||:
+   /bin/systemctl stop stud.service >/dev/null 2>&1 ||:
+fi
+
+
+%postun
+/bin/systemctl daemon-reload >/dev/null 2>&1 ||:
+if [ $1 -ge 1 ]; then
+   /bin/systemctl try-restart stud.service >/dev/null 2>&1 ||:
+fi
+
+
+%files
+%defattr(-,root,root,-)
+%doc LICENSE README.md
+%dir %{stud_confdir}
+%dir %{stud_datadir}
+%config(noreplace) %{stud_confdir}/stud.cfg
+%{_unitdir}/stud.service
+%{_sbindir}/stud
+%{_mandir}/man8/stud.8*
+%attr(-,%{stud_user},%{stud_group}) %dir %{stud_homedir}
+
+
+%changelog
+* Tue Aug 14 2012 Ryan O'Hara <rohara at redhat.com> - 0.3-1.20120814git
+- Initial build.


More information about the scm-commits mailing list