diff options
author | Alin Năstac <mrness@gentoo.org> | 2006-09-28 08:29:28 +0000 |
---|---|---|
committer | Alin Năstac <mrness@gentoo.org> | 2006-09-28 08:29:28 +0000 |
commit | 8abd8a8f2399a5007b0f0f04f0ec6214861518d8 (patch) | |
tree | d466d87d7904ca9b1bf84a12a7aa3c31392c4580 /net-proxy | |
parent | Stable on alpha as per bug #147979 (diff) | |
download | gentoo-2-8abd8a8f2399a5007b0f0f04f0ec6214861518d8.tar.gz gentoo-2-8abd8a8f2399a5007b0f0f04f0ec6214861518d8.tar.bz2 gentoo-2-8abd8a8f2399a5007b0f0f04f0ec6214861518d8.zip |
Version bump (#147921).
(Portage version: 2.1.1)
Diffstat (limited to 'net-proxy')
-rw-r--r-- | net-proxy/sshproxy/ChangeLog | 9 | ||||
-rw-r--r-- | net-proxy/sshproxy/files/digest-sshproxy-0.5.0 | 3 | ||||
-rw-r--r-- | net-proxy/sshproxy/files/sshproxy.ini | 26 | ||||
-rw-r--r-- | net-proxy/sshproxy/files/sshproxyd.confd | 7 | ||||
-rw-r--r-- | net-proxy/sshproxy/files/sshproxyd.initd | 6 | ||||
-rw-r--r-- | net-proxy/sshproxy/sshproxy-0.5.0.ebuild | 169 |
6 files changed, 217 insertions, 3 deletions
diff --git a/net-proxy/sshproxy/ChangeLog b/net-proxy/sshproxy/ChangeLog index c8b3090d90dc..e910689de522 100644 --- a/net-proxy/sshproxy/ChangeLog +++ b/net-proxy/sshproxy/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-proxy/sshproxy # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-proxy/sshproxy/ChangeLog,v 1.3 2006/08/25 15:39:33 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-proxy/sshproxy/ChangeLog,v 1.4 2006/09/28 08:29:28 mrness Exp $ + +*sshproxy-0.5.0 (28 Sep 2006) + + 28 Sep 2006; Alin Nastac <mrness@gentoo.org> +files/sshproxy.ini, + +files/sshproxyd.confd, files/sshproxyd.initd, -sshproxy-0.4.3.ebuild, + +sshproxy-0.5.0.ebuild: + Version bump (#147921). *sshproxy-0.4.4 (25 Aug 2006) diff --git a/net-proxy/sshproxy/files/digest-sshproxy-0.5.0 b/net-proxy/sshproxy/files/digest-sshproxy-0.5.0 new file mode 100644 index 000000000000..9d1c946f5202 --- /dev/null +++ b/net-proxy/sshproxy/files/digest-sshproxy-0.5.0 @@ -0,0 +1,3 @@ +MD5 0ac38d77eeffb24b0f406e53e34772ea sshproxy-0.5.0.tar.gz 108834 +RMD160 786a8b2708329ec5e91657cc20479928f73e2b22 sshproxy-0.5.0.tar.gz 108834 +SHA256 a5f091fc389696cfe618466b61e76559a36ee503b6ce7855089050900021caa8 sshproxy-0.5.0.tar.gz 108834 diff --git a/net-proxy/sshproxy/files/sshproxy.ini b/net-proxy/sshproxy/files/sshproxy.ini new file mode 100644 index 000000000000..983669d6146a --- /dev/null +++ b/net-proxy/sshproxy/files/sshproxy.ini @@ -0,0 +1,26 @@ +[sshproxy] +max_connections = 0 +client_db = file_db +pkey_id = sshproxy@%HOSTNAME% +plugin_dir = /usr/lib/sshproxy +plugin_list = file_db +port = 2242 +logger_conf = /usr/share/sshproxy/logger.conf +cipher_type = blowfish +log_dir = /var/log/sshproxy +acl_db = file_db +site_db = file_db +listen_on = +auto_add_key = no + +[blowfish] +secret = %BLOWFISH_SECRET% + +[client_db.file] +file = /var/lib/sshproxy/client.db + +[acl_db.file] +file = /var/lib/sshproxy/acl.db + +[site_db.file] +db_path = /var/lib/sshproxy/site.db diff --git a/net-proxy/sshproxy/files/sshproxyd.confd b/net-proxy/sshproxy/files/sshproxyd.confd new file mode 100644 index 000000000000..a6f715df09d4 --- /dev/null +++ b/net-proxy/sshproxy/files/sshproxyd.confd @@ -0,0 +1,7 @@ +# /etc/conf.d/sshproxyd: config file for /etc/init.d/sshproxyd + +# Where is your sshproxy.ini file stored? +SSHPROXYD_CONFDIR="/etc/sshproxy" + +# What user runs the proxy? +SSHPROXYD_USER="sshproxy" diff --git a/net-proxy/sshproxy/files/sshproxyd.initd b/net-proxy/sshproxy/files/sshproxyd.initd index b1f2909b0284..02e3bdcc35f0 100644 --- a/net-proxy/sshproxy/files/sshproxyd.initd +++ b/net-proxy/sshproxy/files/sshproxyd.initd @@ -2,13 +2,15 @@ depend() { need net - use logger + use logger mysql } start() { ebegin "Starting SSH Proxy daemon" start-stop-daemon --start --exec /usr/bin/sshproxyd -- \ - --daemon --user sshproxy --pid /var/run/sshproxyd.pid + --daemon --user ${SSHPROXYD_USER:-sshproxy} \ + --config-dir ${SSHPROXYD_CONFDIR:-/etc/sshproxy} \ + --pid /var/run/sshproxyd.pid eend $? } diff --git a/net-proxy/sshproxy/sshproxy-0.5.0.ebuild b/net-proxy/sshproxy/sshproxy-0.5.0.ebuild new file mode 100644 index 000000000000..0f1c264b66e5 --- /dev/null +++ b/net-proxy/sshproxy/sshproxy-0.5.0.ebuild @@ -0,0 +1,169 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/sshproxy/sshproxy-0.5.0.ebuild,v 1.1 2006/09/28 08:29:28 mrness Exp $ + +inherit distutils + +DESCRIPTION="sshproxy is an ssh gateway to apply ACLs on ssh connections" +HOMEPAGE="http://penguin.fr/sshproxy/" +SRC_URI="http://penguin.fr/sshproxy/download/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +IUSE="client-only mysql minimal" +# mysql: install the mysql_db backend driver +# minimal: do not install extra plugins +# client-only: install only the client wrappers + +DEPEND="!client-only? ( + >=dev-python/paramiko-1.6.2 + mysql? >=dev-python/mysql-python-1.2.0 + )" +RDEPEND="${DEPEND} + net-misc/openssh" + +pkg_setup() { + enewgroup sshproxy + enewuser sshproxy -1 -1 /var/lib/sshproxy sshproxy +} + +src_install () { + dobin bin/pssh + dobin bin/pscp + if ! use client-only; then + distutils_src_install + + diropts -o sshproxy -g sshproxy -m0750 + keepdir /var/lib/sshproxy + keepdir /var/log/sshproxy + + # Create a default sshproxy.ini + dodir /etc/sshproxy + insopts -o sshproxy -g sshproxy -m0600 + insinto /etc/sshproxy + doins "${FILESDIR}/sshproxy.ini" + local BLOWFISH_SECRET=$(printf "%04hX%04hX%04hX%04hX\n" ${RANDOM} ${RANDOM} ${RANDOM} ${RANDOM}) + sed -i -e "s/%BLOWFISH_SECRET%/${BLOWFISH_SECRET}/" \ + -e "s/%HOSTNAME%/${HOSTNAME}/" \ + "${D}/etc/sshproxy/sshproxy.ini" + + rm -rf "${D}/usr/lib/sshproxy/spexpect" + if use minimal; then + local p + for p in acl_funcs console_extra logusers; do + rm -rf "${D}/usr/lib/sshproxy/${p}" + done + else + keepdir /var/log/sshproxy/logusers + { # initialize a reasonable value for the logusers plugin + echo + echo "[logusers]" + echo "logdir = /var/log/sshproxy/logusers" + echo + } >> "${D}/etc/sshproxy/sshproxy.ini" + fi + + # init/conf files for sshproxy daemon + newinitd "${FILESDIR}/sshproxyd.initd" sshproxyd + newconfd "${FILESDIR}/sshproxyd.confd" sshproxyd + + if use mysql; then + insinto /usr/share/sshproxy/mysql_db + doins misc/mysql_db.sql + doins misc/sshproxy-mysql-user.sql + else + rm -rf "${D}/usr/lib/sshproxy/mysql_db" + sed -i -e 's/[ \t]\+mysql//' \ + "${D}/etc/init.d/sshproxyd" + fi + fi +} + +pkg_postinst () { + if use client-only; then + echo + einfo "Don't forget to set the following environment variables" + einfo " SSHPROXY_HOST (default to localhost)" + einfo " SSHPROXY_PORT (default to 2242)" + einfo " SSHPROXY_USER (default to $USER)" + einfo "for each sshproxy user." + else + pkg_setup #for creating the user when installed from binary package + + distutils_pkg_postinst + + echo + einfo "If this is your first installation, run" + einfo " emerge --config =${CATEGORY}/${PF}" + einfo "to initialize the backend and configure sshproxy." + echo + einfo "There is no need to install sshproxy on a client machine." + einfo "You can connect to a SSH server using this proxy by running" + einfo " ssh -tp PROXY_PORT PROXY_HOST REMOTE_USER@REMOTE_HOST" + fi +} + +pkg_config() { + if [[ -d "${ROOT}/usr/lib/sshproxy/mysql_db" ]]; then + local PASSWD=$(printf "%04hX%04hX%04hX%04hX\n" ${RANDOM} ${RANDOM} ${RANDOM} ${RANDOM}) + local SHARE="${ROOT}/usr/share/sshproxy/mysql_db" + local DB_HOST DB_PORT + read -p "Enter the MySQL host (default localhost): " DB_HOST + [[ -n "${DB_HOST}" ]] || DB_HOST=localhost + read -p "Enter the MySQL port (default 3306): " DB_PORT + [[ -n "${DB_PORT}" ]] || DB_PORT=3306 + + ewarn "When prompted for a password, enter your MySQL root password" + ewarn + + if mysql -h ${DB_HOST} -P ${DB_PORT} -u root -p <<EOF ; then +CREATE DATABASE sshproxy; +USE sshproxy; +$(sed -e "s/sshproxypw/${PASSWD}/g" "${SHARE}/sshproxy-mysql-user.sql") +$(<"${SHARE}/mysql_db.sql") +EOF + + { + echo + echo "[client_db.mysql]" + echo "host = ${DB_HOST}" + echo "password = ${PASSWD}" + echo "db = sshproxy" + echo "user = sshproxy" + echo "port = ${DB_PORT}" + echo + echo "[acl_db.mysql]" + echo "host = ${DB_HOST}" + echo "password = ${PASSWD}" + echo "db = sshproxy" + echo "user = sshproxy" + echo "port = ${DB_PORT}" + echo + echo "[site_db.mysql]" + echo "host = ${DB_HOST}" + echo "password = ${PASSWD}" + echo "db = sshproxy" + echo "user = sshproxy" + echo "port = ${DB_PORT}" + } >> "${ROOT}/etc/sshproxy/sshproxy.ini" + + sed -i -e 's/^\(\(acl\|client\|site\)_db = \)file_db/\1mysql_db/g' \ + "${ROOT}/etc/sshproxy/sshproxy.ini" + grep -q "^plugin_list .* mysql_db" \ + "${ROOT}/etc/sshproxy/sshproxy.ini" || \ + sed -i -e 's/^\(plugin_list = .*\)$/\1 mysql_db/g' \ + "${ROOT}/etc/sshproxy/sshproxy.ini" + else + ewarn "Failed to create MySQL database!" + ewarn "If the database already existed and you want to replace it," + ewarn "hit Ctrl-C now and drop the old database by running the command:" + ewarn " /usr/bin/mysqladmin -h ${DB_HOST} -P ${DB_PORT} -u root -p drop sshproxy" + read -p "Hit Ctrl-C to stop the procedure or Enter to continue " key + fi + fi + + INITD_STARTUP="/etc/init.d/sshproxyd start" chroot "${ROOT}" \ + sshproxy-setup -u sshproxy -c /etc/sshproxy +} |