webdis (0.1.1-2) unstable; urgency=medium
authorAndriy Senkovych <jolly_roger@itblog.org.ua>
Fri, 24 Oct 2014 19:48:16 +0000 (20:48 +0100)
committerAndriy Senkovych <jolly_roger@itblog.org.ua>
Fri, 24 Oct 2014 19:48:16 +0000 (20:48 +0100)
  * Use correct license names in debian/copyright
  * Document hiredis and jansson libraries
  * Add autopkgtest support
  * Update Standards-Version to 3.9.6. No changes required

[dgit import unpatched webdis 0.1.1-2]

26 files changed:
1  2 
debian/changelog
debian/compat
debian/control
debian/copyright
debian/docs
debian/gbp.conf
debian/patches/series
debian/patches/tests.patch
debian/redis-test.conf
debian/rules
debian/source/format
debian/test.sh
debian/tests/control
debian/tests/webdis
debian/watch
debian/webdis-test.json
debian/webdis.1
debian/webdis.default
debian/webdis.dirs
debian/webdis.init
debian/webdis.install
debian/webdis.json
debian/webdis.logrotate
debian/webdis.manpages
debian/webdis.postinst
debian/webdis.postrm

index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..31d84834c496eb11fb344fd4cfb4acf1a97737bb
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,14 @@@
++webdis (0.1.1-2) unstable; urgency=medium
++
++  * Use correct license names in debian/copyright
++  * Document hiredis and jansson libraries
++  * Add autopkgtest support
++  * Update Standards-Version to 3.9.6. No changes required
++
++ -- Andriy Senkovych <jolly_roger@itblog.org.ua>  Fri, 24 Oct 2014 22:48:16 +0300
++
++webdis (0.1.1-1) unstable; urgency=low
++
++  * Initial release (Closes: #623528)
++
++ -- Andriy Senkovych <jolly_roger@itblog.org.ua>  Mon, 04 Aug 2014 02:10:55 +0300
diff --cc debian/compat
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..7f8f011eb73d6043d2e6db9d2c101195ae2801f2
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,1 @@@
++7
diff --cc debian/control
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..3bef0c68cd03fb15b5a5d0ed4bb6a7d803a7e08a
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,55 @@@
++Source: webdis
++Section: web
++Priority: optional
++Maintainer: Andriy Senkovych <jolly_roger@itblog.org.ua>
++Build-Depends: debhelper (>= 7.0.50~), 
++    libevent-dev (>= 1.4.13), 
++    libhiredis-dev (>= 0.10),
++    libjansson-dev (>= 1.3),
++    libb64-dev (>= 1.2),
++    libmsgpack-dev,
++    redis-server,
++    python-unittest2,
++    python-msgpack (>= 0.3),
++    net-tools
++Standards-Version: 3.9.6
++Vcs-Git: git://github.com/jollyroger/webdis.git -b debian
++Vcs-Browser: https://github.com/jollyroger/webdis
++Homepage: http://webd.is
++Testsuite: autopkgtest
++
++Package: webdis
++Architecture: any
++Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
++Suggests: redis-server
++Description: simple web server providing an HTTP interface to Redis
++ Webdis is a simple web server providing HTTP interface to Redis. Some features
++ include:
++  * Support for GET and POST requests.
++  * JSON output by default, optional JSONP parameter (?jsonp=myFunction).
++  * Raw Redis 2.0 protocol output with .raw suffix
++  * HTTP 1.1 pipelining (50,000 http requests per second on a desktop Linux
++    machine.)
++  * Restricted commands by IP range (CIDR subnet + mask) or HTTP Basic Auth,
++    returning 403 errors.
++  * Possible Redis authentication in the config file.
++  * Pub/Sub using Transfer-Encoding: chunked, works with JSONP as well. Webdis
++    can be used as a Comet server.
++  * Custom Content-Type using a pre-defined file extension, or with
++    ?type=some/thing.
++  * URL-encoded parameters for binary data or slashes.
++  * Logs, with a configurable verbosity.
++  * Cross-origin XHR, if compiled with libevent2 (for OPTIONS support).
++  * File upload with PUT.
++  * With the JSON output, the return value of INFO is parsed and transformed
++    into an object.
++
++Package: webdis-dbg
++Priority: extra
++Architecture: any
++Section: debug
++Depends: ${misc:Depends}, webdis (= ${binary:Version})
++Description: webdis debugging symbols
++ Webdis is a simple web server providing HTTP interface to Redis.
++ .
++ This package provides debug symbols for webdis.
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..f4e188b110fa5f13c46006ba3fdd5d085806d4d1
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,182 @@@
++Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
++Upstream-Name: webdis
++Upstream-Contact: Nicolas Favre-Félix <n.favrefelix@gmail.com>
++Source: https://github.com/nicolasff/webdis/blob/master/COPYING
++
++Files: *
++Copyright: 2010-2011, Nicolas Favre-Felix <n.favrefelix@gmail.com>
++License: bsd-2-clause
++ Redistribution and use in source and binary forms, with or without modification,
++ are permitted provided that the following conditions are met:
++ . 
++  * Redistributions of source code must retain the above copyright notice,
++    this list of conditions and the following disclaimer.
++  * Redistributions in binary form must reproduce the above copyright notice,
++    this list of conditions and the following disclaimer in the documentation
++    and/or other materials provided with the distribution.
++ . 
++ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
++ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
++ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
++ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
++ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
++ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
++ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++
++Files: hiredis/*
++Copyright:
++ 2009-2011, Salvatore Sanfilippo <antirez@gmail.com>
++ 2010-2011, Pieter Noordhuis <pcnoordhuis@gmail.com>
++License: BSD-3-Clause
++ Redistribution and use in source and binary forms, with or without
++ modification, are permitted provided that the following conditions
++ are met:
++ 1. Redistributions of source code must retain the above copyright
++    notice, this list of conditions and the following disclaimer.
++ 2. Redistributions in binary form must reproduce the above copyright
++    notice, this list of conditions and the following disclaimer in the
++    documentation and/or other materials provided with the distribution.
++ 3. Neither the name of the University nor the names of its contributors
++    may be used to endorse or promote products derived from this software
++    without specific prior written permission.
++ .
++ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++
++Files: jansson/*
++Copyright: 2009, 2010 Petri Lehtinen <petri@digip.org>
++License: Expat
++ Permission is hereby granted, free of charge, to any person obtaining a copy
++ of this software and associated documentation files (the "Software"), to deal
++ in the Software without restriction, including without limitation the rights
++ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
++ copies of the Software, and to permit persons to whom the Software is
++ furnished to do so, subject to the following conditions:
++ .
++ The above copyright notice and this permission notice shall be included in
++ all copies or substantial portions of the Software.
++ .
++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
++ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
++ THE SOFTWARE.
++
++Files: debian/*
++Copyright: 2011, Andriy Senkovych <jolly_roger@itblog.org.ua>
++License: GPL-2+
++ This package is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++ .
++ This package is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ GNU General Public License for more details.
++ .
++ You should have received a copy of the GNU General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>
++ .
++ On Debian systems, the complete text of the GNU General
++ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
++
++Files: md5/*
++Copyright: 1999, 2000, 2002, Aladdin Enterprises
++           1999, 2000, 2002, L. Peter Deutsch <ghost@aladdin.com>
++License: bsd-3-clause
++ This software is provided 'as-is', without any express or implied
++ warranty.  In no event will the authors be held liable for any damages
++ arising from the use of this software.
++ .
++ Permission is granted to anyone to use this software for any purpose,
++ including commercial applications, and to alter it and redistribute it
++ freely, subject to the following restrictions:
++ .
++ 1. The origin of this software must not be misrepresented; you must not
++    claim that you wrote the original software. If you use this software
++    in a product, an acknowledgment in the product documentation would be
++    appreciated but is not required.
++ 2. Altered source versions must be plainly marked as such, and must not be
++    misrepresented as being the original software.
++ 3. This notice may not be removed or altered from any source distribution.
++
++Files: sha1/*
++Copyright: 1998, 2009, Paul E. Jones <paulej@packetizer.com>
++License: FPL
++ This software is licensed as "freeware."  Permission to distribute
++ this software in source and binary forms, including incorporation 
++ into other products, is hereby granted without a fee.  THIS SOFTWARE 
++ IS PROVIDED 'AS IS' AND WITHOUT ANY EXPRESSED OR IMPLIED WARRANTIES, 
++ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
++ AND FITNESS FOR A PARTICULAR PURPOSE.  THE AUTHOR SHALL NOT BE HELD 
++ LIABLE FOR ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE, EITHER 
++ DIRECTLY OR INDIRECTLY, INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA 
++ OR DATA BEING RENDERED INACCURATE.
++
++Files: http-parser/*
++Copyright: 2009, 2010, Ryan Dahl <ry@tinyclouds.org>
++License: MIT
++ Permission is hereby granted, free of charge, to any person obtaining a copy
++ of this software and associated documentation files (the "Software"), to
++ deal in the Software without restriction, including without limitation the
++ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
++ sell copies of the Software, and to permit persons to whom the Software is
++ furnished to do so, subject to the following conditions:
++ .
++ The above copyright notice and this permission notice shall be included in
++ all copies or substantial portions of the Software.
++ .
++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
++ IN THE SOFTWARE.
++
++Files: b64/*
++Copyright: none
++License: public-domain
++ Copyright-Only Dedication (based on United States law)
++ or Public Domain Certification
++ .
++ The person or persons who have associated work with this document (the
++ "Dedicator" or "Certifier") hereby either (a) certifies that, to the best of
++ his knowledge, the work of authorship identified is in the public domain of
++ the country from which the work is published, or (b) hereby dedicates whatever
++ copyright the dedicators holds in the work of authorship identified below (the
++ "Work") to the public domain. A certifier, moreover, dedicates any copyright
++ interest he may have in the associated work, and for these purposes, is
++ described as a "dedicator" below.
++ .
++ A certifier has taken reasonable steps to verify the copyright status of this
++ work. Certifier recognizes that his good faith efforts may not shield him from
++ liability if in fact the work certified is not in the public domain.
++ .
++ Dedicator makes this dedication for the benefit of the public at large and to
++ the detriment of the Dedicator's heirs and successors. Dedicator intends this
++ dedication to be an overt act of relinquishment in perpetuity of all present
++ and future rights under copyright law, whether vested or contingent, in the
++ Work. Dedicator understands that such relinquishment of all rights includes
++ the relinquishment of all rights to enforce (by lawsuit or otherwise) those
++ copyrights in the Work.
++ .
++ Dedicator recognizes that, once placed in the public domain, the Work may be
++ freely reproduced, distributed, transmitted, used, modified, built upon, or
++ otherwise exploited by anyone for any purpose, commercial or non-commercial,
++ and in any way, including by methods that have not yet been invented or
++ conceived.
diff --cc debian/docs
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..8d526b990ffce78ebf981cac81ebcc125f9f5b26
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,1 @@@
++README.markdown
diff --cc debian/gbp.conf
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..3a338bdb35ed7d2cf30d223229730b6d22c0d2cf
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,4 @@@
++# ex: set ft=dosini:
++[DEFAULT]
++debian-branch = debian
++upstream-tag = %(version)s
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..6726658d8d3a1922c60842787d48361e939510b1
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,1 @@@
++tests.patch
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..9820f3d3041b6f8118ba126e73941a4db42cbbda
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,38 @@@
++Description: Pass tests with python-msgpack >= 0.3
++ Current test suite pass with python-msgpack v0.2 but fails with python-msgpack
++ v0.3 and later due to changes in the library. Currently Debian ships v0.3 
++ for jessie and wheezy-backports.
++Author: Andriy Senkovych <jolly_roger@itblog.org.ua>
++Bug: https://github.com/nicolasff/webdis/issues/92
++Last-Update: 2014-08-03
++diff --git a/tests/basic.py b/tests/basic.py
++index 89d664e..c70babe 100755
++--- a/tests/basic.py
+++++ b/tests/basic.py
++@@ -154,7 +154,7 @@ class TestMsgPack(TestWebdis):
++              f = self.query('SET/hello/world.msg')
++              self.assertTrue(f.headers.getheader('Content-Type') == 'application/x-msgpack')
++              obj = msgpack.loads(f.read())
++-             self.assertTrue(obj == {'SET': (True, 'OK')})
+++             self.assertTrue(obj == {'SET': [True, 'OK']})
++ 
++      @need_msgpack
++      def test_get(self):
++@@ -180,7 +180,7 @@ class TestMsgPack(TestWebdis):
++              self.query('RPUSH/hello/def')
++              f = self.query('LRANGE/hello/0/-1.msg')
++              obj = msgpack.loads(f.read())
++-             self.assertTrue(obj == {'LRANGE': ('abc', 'def')})
+++             self.assertTrue(obj == {'LRANGE': ['abc', 'def']})
++ 
++      @need_msgpack
++      def test_error(self):
++@@ -189,7 +189,7 @@ class TestMsgPack(TestWebdis):
++              obj = msgpack.loads(f.read())
++              self.assertTrue('UNKNOWN' in obj)
++              self.assertTrue(isinstance(obj, dict))
++-             self.assertTrue(isinstance(obj['UNKNOWN'], tuple))
+++             self.assertTrue(isinstance(obj['UNKNOWN'], list))
++              self.assertTrue(obj['UNKNOWN'][0] == False)
++              self.assertTrue(isinstance(obj['UNKNOWN'][1], str))
++ 
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..9a3bf307c502a957c78e319b824fe2b19ab50ff9
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,4 @@@
++daemonize yes
++pidfile REDIS_PID
++port 0
++unixsocket REDIS_SOCK
diff --cc debian/rules
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..35ba15e389e6c20dab79052163ce2fc7d31d8e9b
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,46 @@@
++#!/usr/bin/make -f
++# -*- makefile -*-
++
++#export DH_VERBOSE=1
++
++export PREFIX = /usr
++export DESTDIR = $(CURDIR)/debian/tmp
++export CONFDIR = $(DESTDIR)/etc/webdis
++
++CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
++CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
++LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
++
++# Add CPPFLAGS TO CFLAGS since build system does not know about them.
++CFLAGS += $(CPPFLAGS)
++
++# Objects to be removed from build procedure
++export HIREDIS_OBJ=
++export JANSSON_OBJ=
++export B64_OBJS=
++
++export CFLAGS += -I. -Ihttp-parser
++export LDFLAGS += -levent -pthread -lhiredis -ljansson -lb64
++
++build: build-arch
++build-arch: tests/pubsub tests/websocket
++
++tests/% :
++      $(MAKE) -C tests $*
++
++%:
++      dh $@
++
++override_dh_strip:
++      dh_strip --dbg-package=webdis-dbg
++
++override_dh_auto_clean:
++      $(MAKE) clean
++      $(MAKE) -C tests clean
++
++override_dh_auto_test:
++ifneq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
++      @echo "Skipping check (disabled in DEB_BUILD_OPTIONS)."
++else
++      $(CURDIR)/debian/test.sh $(MAKE) test
++endif
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..163aaf8d82b6c54f23c45f32895dbdfdcc27b047
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,1 @@@
++3.0 (quilt)
diff --cc debian/test.sh
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..f15c1aae21ff8a35aae73af64445904ee7b1f676
new file mode 100755 (executable)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,76 @@@
++#!/bin/sh
++# This script runs redis server and webdis server and launches the test
++# suite. It avoids race condition while obtaining a port to listen by
++# binding to random available port. The port is then found via netstat -nlp
++# using PID-file.
++
++TMPDIR=`mktemp -d`
++
++WEBDIS_PID=${TMPDIR}/webdis.pid
++WEBDIS_CONF=${TMPDIR}/webdis.json
++
++REDIS_CONF=${TMPDIR}/redis.conf
++REDIS_PID=${TMPDIR}/redis.pid
++REDIS_SOCK=${TMPDIR}/redis.sock
++
++if [ -n "$WEBDIS_BIN" ] ; then
++    if [ ! -x "$WEBDIS_BIN" ] ; then
++        echo "webdis binary $WEBDIS_BIN is not executable" 
++        exit 1
++    fi
++else
++    WEBDIS_BIN="$PWD/webdis"
++fi
++
++set_up() {
++    echo "Generating config files.."
++      sed -e "s|REDIS_SOCK|${REDIS_SOCK}|" -e "s|WEBDIS_PID|${WEBDIS_PID}|" \
++        debian/webdis-test.json > ${WEBDIS_CONF}
++      sed -e "s|REDIS_PID|${REDIS_PID}|" -e "s|REDIS_SOCK|${REDIS_SOCK}|" \
++        debian/redis-test.conf > ${REDIS_CONF}
++
++    echo "Starting redis-server.."
++      /sbin/start-stop-daemon --start --verbose \
++              --pidfile ${REDIS_PID} \
++              --exec `which redis-server` -- ${REDIS_CONF} || return 1
++
++    echo "Starting webdis.."
++      /sbin/start-stop-daemon --start --verbose \
++              --pidfile ${WEBDIS_PID} \
++              --exec $WEBDIS_BIN -- ${WEBDIS_CONF} || return 2
++
++    MATCH_STR="`cat $WEBDIS_PID`\\/webdis"
++    export WEBDIS_PORT=`netstat -ntlp 2>/dev/null| \
++        awk "/$MATCH_STR/ {print \\$4}"|cut -d: -f2`
++    [ "$WEBDIS_PORT" -gt 0 ] || return 3
++    echo webdis is listening on port "$WEBDIS_PORT"
++}
++
++tear_down() {
++    echo "Shutting down webdis.."
++      /sbin/start-stop-daemon --stop --verbose \
++              --retry=TERM/1/KILL/1 \
++              --pidfile ${WEBDIS_PID} \
++              --name webdis
++    echo "Shutting down redis-server.."
++      /sbin/start-stop-daemon --stop --verbose \
++              --retry=TERM/1/KILL/1 \
++              --pidfile ${REDIS_PID} \
++              --name redis-server
++}
++
++if ! set_up ; then
++    echo "Setting up redis/webdis server FAILED."
++    tear_down
++    exit 1
++fi
++
++echo Running test commands: $*
++
++$*
++EXIT_CODE=$?
++
++tear_down
++rm -fR $TMPDIR
++
++exit $EXIT_CODE
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..5af70ddc346c553c9f278cbec97b4ecf05239e10
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,4 @@@
++Tests: webdis
++Depends: @, redis-server, build-essential, libevent-dev,
++ python-unittest2, python-msgpack, net-tools
++Restrictions: isolation-container, allow-stderr
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..dc2cc9798cb3eaec00a80ec527d87605f0f17540
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,5 @@@
++#!/bin/sh
++set -e
++
++make -C tests
++WEBDIS_BIN=/usr/bin/webdis debian/test.sh make test
diff --cc debian/watch
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..5466d9c5bce8538918c0d08b3e0fd6009ca737c0
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,4 @@@
++version=3
++opts=dversionmangle=s/\+(dfsg|ds)$// \
++    https://github.com/nicolasff/webdis/releases \
++    .*\/([0-9.]+)\.tar\.gz
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..218ee1edf45aefc40487e9d94662126ed1744107
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,29 @@@
++{
++      "redis_host":   "REDIS_SOCK",
++
++      "http_host":    "127.0.0.1",
++      "http_port":    0,
++
++      "threads":      2,
++      "pool_size": 5,
++
++      "daemonize":    true,
++    "pidfile":       "WEBDIS_PID",
++      "websockets":   false,
++
++      "database":     0,
++
++      "acl": [
++              {
++                      "disabled":     ["DEBUG"]
++              },
++
++              {
++                      "http_basic_auth":      "user:password",
++                      "enabled":              ["DEBUG"]
++              }
++      ],
++
++        "verbosity": 3,
++        "logfile": "/dev/null"
++}
diff --cc debian/webdis.1
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..5639961b19d744b5cce176b77b28418f2d8b6a6f
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,25 @@@
++.TH WEBDIS 1 "August 29, 2013"
++.SH NAME
++webdis \- fast HTTP interface for redis-server(1)
++.SH SYNOPSIS
++.B webdis
++.RI configfile
++.SH DESCRIPTION
++Webdis is a Webdis is a simple HTTP server which forwards commands to Redis and
++sends the reply back using a format of your choice. Accessing
++/COMMAND/arg0/arg1/.../argN[.ext] on Webdis executes the command on Redis and
++returns the response; the reply format can be changed with the optional
++extension (.json, .txt).
++.PP
++.SH OPTIONS
++.IP "configfile"
++Read options from specified configuration file.
++.SH NOTES
++On Debian GNU/Linux systems, \fBwebdis\fP is typically started via the
++\fB/etc/init.d/webdis\fP initscript, not manually. This defaults to using
++\fB/etc/webdis/webdis.json\fP as a configuration file.
++.SH AUTHOR
++\fBwebdis\fP was written by Nicolas Favre-Félix.
++.PP
++This manual page was written by Andriy Senkovych <jolly_roger@itblog.org.ua> for
++the Debian project (but may be used by others).
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..c764a073d3075b45fca8aba0b0c4ec22f0bc6949
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,5 @@@
++# Webdis configuration file used at startup. 
++CONFFILE="/etc/webdis/webdis.json"
++
++# Additional options that are passed to the Daemon.
++DAEMON_OPTS=""
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..6ded28a582b4e0aa382548f057c17aa8ed6d14f2
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,1 @@@
++/var/log/webdis
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..7e5e7295a8b03b7f9a48934eaca9c52ae450fe54
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,175 @@@
++#! /bin/sh
++### BEGIN INIT INFO
++# Provides:          webdis
++# Required-Start:    $local_fs $remote_fs
++# Required-Stop:     $local_fs $remote_fs
++# Should-Start:      redis-server
++# Should-Stop:       redis-server
++# Default-Start:     2 3 4 5
++# Default-Stop:      0 1 6
++# Short-Description: Starts webdis daemon
++# Description:       Starts webdis daemon
++### END INIT INFO
++
++# Author: Andriy Senkovych <jolly_roger@itblog.org.ua>
++# Do NOT "set -e"
++
++# PATH should only include /usr/* if it runs after the mountnfs.sh script
++PATH=/sbin:/usr/sbin:/bin:/usr/bin
++DESC="webdis server"
++NAME=webdis
++DAEMON=/usr/bin/$NAME
++PIDDIR=/var/run/$NAME
++PIDFILE=$PIDDIR/$NAME.pid
++SCRIPTNAME=/etc/init.d/$NAME
++USER=webdis
++CONFFILE="/etc/webdis/webdis.json"
++
++# Exit if the package is not installed
++[ -x "$DAEMON" ] || exit 0
++
++# Read configuration variable file if it is present
++[ -r /etc/default/$NAME ] && . /etc/default/$NAME
++
++# Define LSB log_* functions.
++# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
++# and status_of_proc is working.
++. /lib/lsb/init-functions
++
++#
++# Function that starts the daemon/service
++#
++do_start()
++{
++    if [ ! -e $PIDDIR ] ; then
++        mkdir $PIDDIR
++        chown webdis: $PIDDIR
++    elif [ ! -d $PIDDIR ] ; then
++        log_action_cont_msg \ $PIDDIR exists but is not a directory
++        return 2
++    fi
++      # Return
++      #   0 if daemon has been started
++      #   1 if daemon was already running
++      #   2 if daemon could not be started
++      start-stop-daemon --start --quiet --test \
++        --pidfile $PIDFILE \
++        --user $USER --chuid $USER \
++        --exec $DAEMON > /dev/null \
++              || return 1
++      /sbin/start-stop-daemon --start --quiet \
++              --pidfile $PIDFILE \
++        --user $USER --chuid $USER \
++        --exec $DAEMON -- $CONFFILE $DAEMON_OPTS\
++              || return 2
++      # Add code here, if necessary, that waits for the process to be ready
++      # to handle requests from services started subsequently which depend
++      # on this one.  As a last resort, sleep for some time.
++}
++
++#
++# Function that stops the daemon/service
++#
++do_stop()
++{
++      # Return
++      #   0 if daemon has been stopped
++      #   1 if daemon was already stopped
++      #   2 if daemon could not be stopped
++      #   other if a failure occurred
++      start-stop-daemon --stop --quiet \
++        --pidfile $PIDFILE \
++        --user $USER \
++        --retry=TERM/1/KILL/1 \
++        --name $NAME
++      RETVAL="$?"
++      [ "$RETVAL" = 2 ] && return 2
++      # Wait for children to finish too if this is a daemon that forks
++      # and if the daemon is only ever run from this initscript.
++      # If the above conditions are not satisfied then add some other code
++      # that waits for the process to drop all resources that could be
++      # needed by services started subsequently.  A last resort is to
++      # sleep for some time.
++      start-stop-daemon --stop --quiet --oknodo \
++        --pidfile $PIDIFLE \
++        --user $USER \
++        --retry=0/1/KILL/1 \
++        --exec $DAEMON
++      [ "$?" = 2 ] && return 2
++      # Many daemons don't delete their pidfiles when they exit.
++      rm -f $PIDFILE
++      return "$RETVAL"
++}
++
++#
++# Function that sends a SIGHUP to the daemon/service
++#
++do_reload() {
++      #
++      # If the daemon can reload its configuration without
++      # restarting (for example, when it is sent a SIGHUP),
++      # then implement that here.
++      #
++      start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
++      return 0
++}
++
++case "$1" in
++  start)
++      log_daemon_msg "Starting $DESC" "$NAME"
++      do_start
++      case "$?" in
++              0|1) log_end_msg 0 ;;
++              2) log_end_msg 1 ;;
++      esac
++      ;;
++  stop)
++      log_daemon_msg "Stopping $DESC" "$NAME"
++      do_stop
++      case "$?" in
++              0|1) log_end_msg 0 ;;
++              2) log_end_msg 1 ;;
++      esac
++      ;;
++  status)
++       status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
++       ;;
++  #reload|force-reload)
++      #
++      # If do_reload() is not implemented then leave this commented out
++      # and leave 'force-reload' as an alias for 'restart'.
++      #
++      #log_daemon_msg "Reloading $DESC" "$NAME"
++      #do_reload
++      #log_end_msg $?
++      #;;
++  restart|force-reload)
++      #
++      # If the "reload" option is implemented then remove the
++      # 'force-reload' alias
++      #
++      log_daemon_msg "Restarting $DESC" "$NAME"
++      do_stop
++      case "$?" in
++        0|1)
++              do_start
++              case "$?" in
++                      0) log_end_msg 0 ;;
++                      1) log_end_msg 1 ;; # Old process is still running
++                      *) log_end_msg 1 ;; # Failed to start
++              esac
++              ;;
++        *)
++              # Failed to stop
++              log_end_msg 1
++              ;;
++      esac
++      ;;
++  *)
++      #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
++      echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
++      exit 3
++      ;;
++esac
++
++:
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..b25d53d39d9869eba856d575d93c45ed7af03bc6
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,2 @@@
++debian/webdis.json /etc/webdis/
++/usr/bin/webdis
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..19a67a7646d71324cdf5a22027356c0efb5611a8
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,29 @@@
++{
++    "redis_host": "127.0.0.1",
++
++    "redis_port": 6379,
++    "redis_auth": null,
++
++    "http_host": "127.0.0.1",
++    "http_port": 7379,
++    "threads": 2,
++
++    "daemonize": true,
++    "pidfile": "/var/run/webdis/webdis.pid",
++
++    "database": 0,
++
++    "acl": [
++        {
++            "disabled":["DEBUG"]
++        },
++
++        {
++            "http_basic_auth": "user:password",
++            "enabled": ["DEBUG"]
++        }
++    ],
++
++        "verbosity": 3,
++        "logfile": "/var/log/webdis/webdis.log"
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..7ff7c3d2549764dd1b2022607c2e3eaf48a819b3
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,11 @@@
++/var/log/webdis/webdis.log {
++    missingok
++    rotate 5
++    weekly
++    size 10M
++    compress
++    notifempty
++    postrotate
++        /usr/bin/killall -HUP webdis
++    endscript
++}
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..d588228f0d7548ea8c58725f960e0a632bb94c91
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,1 @@@
++debian/webdis.1
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..8e0b4cb167625efc028f54a32ad32cdc75956d41
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,33 @@@
++#! /bin/sh
++
++set -e
++WEBDIS_LOG=/var/log/webdis
++
++case "$1" in
++    configure)
++          adduser --system --group \
++            --home /var/lib/webdis \
++            --no-create-home \
++            --gecos "webdis system user" \
++            --disabled-login \
++            --disabled-password webdis
++        if ! dpkg-statoverride --list $WEBDIS_LOG >/dev/null 2>&1 ; then
++            dpkg-statoverride --update --add webdis webdis 0750 $WEBDIS_LOG
++        fi
++    ;;
++
++    abort-upgrade|abort-remove|abort-deconfigure)
++
++    ;;
++
++    *)
++        echo "postinst called with unknown argument \`$1'" >&2
++        exit 1
++    ;;
++esac
++
++#DEBHELPER#
++
++exit 0
++
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..416644b0cfd3999c0295008395855bbb7d0cee05
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,29 @@@
++#! /bin/sh
++
++set -e
++WEBDIS_LOG=/var/log/webdis
++
++case "$1" in
++    upgrade|failed-upgrade|abort-install|abort-upgrade|disappear|remove)
++        ;;
++
++    purge)
++        # Since no data is stored in the webdis home directory, the package is
++        # not affected by bug #621833 and thus homedir can be safely removed
++        if dpkg-statoverride --list $WEBDIS_LOG >/dev/null 2>&1 ; then
++            dpkg-statoverride --remove /var/log/webdis
++        fi
++        rm -rf $WEBDIS_LOG
++
++        deluser --system webdis
++        ;;
++
++    *)
++        echo "postrm called with unknown argument \`$1'" >&2
++        exit 1
++
++esac
++
++#DEBHELPER#
++
++exit 0