summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog190
-rw-r--r--debian/compat1
-rw-r--r--debian/control8
-rw-r--r--debian/copyright7
-rw-r--r--debian/links2
-rw-r--r--debian/patches/0001-link-with-libatomic-for-test.patch32
-rw-r--r--debian/patches/0002-siri-db-add-NULL-check-before-calling-siridb_tasks_d.patch41
-rw-r--r--debian/patches/series2
-rwxr-xr-xdebian/rules7
-rw-r--r--debian/siridb-server.lintian-overrides5
-rw-r--r--debian/tests/control6
-rw-r--r--debian/tests/http-api198
-rw-r--r--debian/upstream/metadata5
-rw-r--r--debian/watch7
14 files changed, 368 insertions, 143 deletions
diff --git a/debian/changelog b/debian/changelog
index fbb397e5..2a598a8e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,186 +1,112 @@
-siridb-server (2.0.50-0~cb1) unstable; urgency=medium
+siridb-server (2.0.48-1) unstable; urgency=medium
+ [ Paul Gevers ]
* New upstream release
- - Fixed potential bug while removing data
- -- Jeroen van der Heijden <jeroen@cesbit.com> Tue, 21 Mar 2023 11:22:27 +0100
+ [ Nick Rosbrook ]
+ * Add patch to prevent segfault with libuv1 1.44.2 (Closes: #1017748)
-siridb-server (2.0.49-0~cb1) unstable; urgency=medium
+ -- Paul Gevers <elbrus@debian.org> Thu, 25 Aug 2022 21:06:59 +0200
- * New upstream release
- - Fixed HTTP requests with new libuv version (#183, Thanks to Nick Rosbrook)
-
- -- Jeroen van der Heijden <jeroen@cesbit.com> Mon, 19 Sep 2022 16:08:54 +0200
-
-siridb-server (2.0.48-0~cb1) unstable; urgency=medium
-
- * New upstream release
- - Implement smaller indexes for old data
- - Added `head` and `tail` syntax queries (#180)
-
- -- Jeroen van der Heijden <jeroen@cesbit.com> Fri, 15 Jul 2022 07:55:12 +0200
-
-siridb-server (2.0.47-0~cb1) unstable; urgency=medium
+siridb-server (2.0.45-1) unstable; urgency=medium
+ [ Ileana Dumitrescu ]
+ * Non-maintainer upload
* New upstream release
- - Fixed initializing `random` (Thanks to Jayakrishna Menon)
- - Changed Tee from Unix to TCP socket (#179)
+ * Added latomic patch to port for riscv (Closes: #983768)
- -- Jeroen van der Heijden <jeroen@cesbit.com> Fri, 29 Apr 2022 08:17:01 +0200
+ -- Ileana Dumitrescu <ileanadumi95@protonmail.com> Mon, 07 Feb 2022 16:09:39 +0100
-siridb-server (2.0.46-0~tt1) unstable; urgency=medium
+siridb-server (2.0.44-1) unstable; urgency=medium
+ [ Paul Gevers ]
* New upstream release
- - Switch to omap for storing promises (#175)
- - Increased chunk size for numeric shards
-
- -- Jeroen van der Heijden <jeroen@cesbit.com> Thu, 17 Feb 2022 14:21:58 +0100
+ * Drop patch, applied upstream
-siridb-server (2.0.45-0~tt1) unstable; urgency=medium
+ [ Debian Janitor ]
+ * Update standards version to 4.5.1, no changes needed.
- * New upstream release
- - Compatibility with libcleri v1.x
- - Prioritize replication
+ -- Paul Gevers <elbrus@debian.org> Sun, 02 Jan 2022 17:40:53 +0100
- -- Jeroen van der Heijden <jeroen@cesbit.com> Thu, 13 Jan 2022 11:37:26 +0100
+siridb-server (2.0.43-1) unstable; urgency=medium
-siridb-server (2.0.44-0~tt1) unstable; urgency=medium
+ [ Helmut Grohne ]
+ * Improve cross building: (Closes: #982363)
+ [ Paul Gevers ]
* New upstream release
- - Improve imap data structure (#168)
- - Added ignore_broken_data option (@ubnt-michals, #172)
- - Fixed siridb_time_now for arm32 builds (@srdgame, #169)
- -- Jeroen van der Heijden <jeroen@cesbit.com> Tue, 06 Apr 2021 11:39:12 +0200
+ -- Paul Gevers <elbrus@debian.org> Fri, 19 Feb 2021 20:37:54 +0100
-siridb-server (2.0.43-0~tt1.1) UNRELEASED; urgency=medium
+siridb-server (2.0.42-1) unstable; urgency=medium
- * Non-maintainer upload.
- * Improve cross building: (Closes: #-1)
- + cross.patch: Make gcc substitutable.
- + Let dh_auto_build pass cross tools to make.
+ New upstream release
- -- Helmut Grohne <helmut@subdivi.de> Tue, 09 Feb 2021 13:48:47 +0100
+ -- Paul Gevers <elbrus@debian.org> Sun, 03 Jan 2021 21:54:23 +0100
-siridb-server (2.0.43-0~tt1) unstable; urgency=medium
+siridb-server (2.0.40-1) unstable; urgency=medium
* New upstream release
- - Fixed HTTP pipeline issue (@srdgame, #161)
- - Fixed possible memory corruption (@ubnt-michals, #158)
- - Changed SIRIDB_DB_PATH configuration (#154)
- - Fixed shard duration for ARM builds (@srdgame, #164)
- - Use IPv4 for health and API when configured (@ubnt-michals, #155)
+ - Drop patches (applied upstream)
- -- Jeroen van der Heijden <jeroen@cesbit.com> Thu, 04 Feb 2021 15:36:02 +0100
+ -- Paul Gevers <elbrus@debian.org> Sun, 18 Oct 2020 20:47:25 +0200
-siridb-server (2.0.42-0~tt1) unstable; urgency=medium
+siridb-server (2.0.38-3) unstable; urgency=medium
- * New upstream release
- - Fixed handle ready status in Kubernetes statefulset (#153)
+ * Drop valgrind check on mips*el for now
- -- Jeroen van der Heijden <jeroen@cesbit.com> Thu, 12 Nov 2020 09:39:13 +0100
+ -- Paul Gevers <elbrus@debian.org> Sat, 12 Sep 2020 21:30:15 +0200
-siridb-server (2.0.41-0~tt1) unstable; urgency=medium
+siridb-server (2.0.38-2) unstable; urgency=medium
- * New upstream release
- - Fixed bug in insert loop (#147)
- - Fixed loading databases with duplicated series (#148)
- - Allow server names without defining a port (#150)
+ * Only add valgrind as Build-Depends where it exists
+ * Add patches to fix issues found by valgrind on mips*el
- -- Jeroen van der Heijden <jeroen@cesbit.com> Wed, 04 Nov 2020 13:15:29 +0100
+ -- Paul Gevers <elbrus@debian.org> Thu, 10 Sep 2020 21:24:55 +0200
-siridb-server (2.0.40-0~tt1) unstable; urgency=medium
+siridb-server (2.0.38-1) unstable; urgency=medium
+ [ Paul Gevers ]
* New upstream release
- - Added `alter tag` syntax (#144)
- - Fixed list tags error when conditions are used (#145)
- - Fixed division by zero bug (#146)
-
- -- Jeroen van der Heijden <jeroen@cesbit.com> Fri, 25 Sep 2020 16:35:28 +0200
+ * Add simple (but not superficial) autopkgtest
-siridb-server (2.0.39-0~tt1) unstable; urgency=medium
+ [ Debian Janitor ]
+ * Set upstream metadata fields: Bug-Database, Bug-Submit, Repository,
+ Repository-Browse.
- * New upstream release
- - Added auto shard duration option (#141)
- - Added `shard_duration` property on list series (#140)
- - Added `timeval()` and `interval()` functions (#138)
- - Fixed build error on 32 bit systems (#135)
-
- -- Jeroen van der Heijden <jeroen@cesbit.com> Fri, 18 Sep 2020 15:50:10 +0200
+ -- Paul Gevers <elbrus@debian.org> Thu, 10 Sep 2020 09:55:01 +0200
-siridb-server (2.0.38-0~tt1) unstable; urgency=medium
+siridb-server (2.0.37-1) unstable; urgency=medium
* New upstream release
- - Added tag support (#74)
- - Fixed cleanup duplicate package (#134)
+ - Fix FTBFS with GCC-10 (Closes: #957800)
- -- Jeroen van der Heijden <jeroen@cesbit.com> Fri, 28 Aug 2020 11:12:24 +0200
+ -- Paul Gevers <elbrus@debian.org> Mon, 27 Jul 2020 07:38:34 +0200
-siridb-server (2.0.37-0~tt1) unstable; urgency=medium
+siridb-server (2.0.36-1) unstable; urgency=medium
* New upstream release
- - Fixed reading `series.dat` after unclean shutdown (#130)
- - Fixed `gcc-10` compile errors (#132)
+ - Fixed headers (Closes: #933220)
+ * Add new B-D: libyajl-dev
- -- Jeroen van der Heijden <jeroen@cesbit.com> Thu, 23 Jul 2020 14:38:50 +0200
+ -- Paul Gevers <elbrus@debian.org> Sun, 17 May 2020 16:02:21 +0200
-siridb-server (2.0.36-0~tt1) unstable; urgency=medium
+siridb-server (2.0.34-1) unstable; urgency=medium
* New upstream release
- - Fixed bug in max open files setting (#125)
- - Accept Grafana compatible API requests (#129)
- - Added support for configuration using environment variable (#128)
+ * Update d/copyright
- -- Jeroen van der Heijden <jeroen@cesbit.com> Wed, 22 Apr 2020 11:18:32 +0200
+ -- Paul Gevers <elbrus@debian.org> Wed, 24 Jul 2019 14:58:21 +0200
-siridb-server (2.0.35-0~tt1) unstable; urgency=medium
+siridb-server (2.0.32-1) unstable; urgency=medium
* New upstream release
- - Added shard expiration (#123)
- - Added HTTP API (#124)
- -- Jeroen van der Heijden <jeroen@cesbit.com> Mon, 24 Feb 2020 16:23:37 +0100
+ -- Paul Gevers <elbrus@debian.org> Wed, 23 Jan 2019 20:06:04 +0100
-siridb-server (2.0.34-0~tt1) unstable; urgency=medium
-
- * New upstream release
- - Added readiness and liveness HTTP handler (#122)
- - Fixed bug in sending packages to multiple SiriDB servers (#120)
-
- -- Jeroen van der Heijden <jeroen@cesbit.com> Mon, 08 Jul 2019 14:18:56 +0200
-
-siridb-server (2.0.33-0~tt1) unstable; urgency=medium
-
- * New upstream release
- - Fixed deep recursion in series selection (#118)
- - Fixed a few gcc version 8 warnings (#117)
- - Increased package size limit and warning
- - Added check for unexpected time-stamps in shards at startup
-
- -- Jeroen van der Heijden <jeroen@cesbit.com> Thu, 04 Apr 2019 14:19:22 +0200
-
-siridb-server (2.0.32-0~tt1) unstable; urgency=medium
-
- * New upstream release
- - Fixed drop database
-
- -- Jeroen van der Heijden <jeroen@cesbit.com> Fri, 11 Jan 2019 16:03:42 +0100
-
-siridb-server (2.0.31-0~tt1) unstable; urgency=medium
-
- * New upstream release
- - Added option for adding a data tee
- - Added option to drop a database (#115)
- - Remove limit of 4 database (#114)
- - Do not return with an error if series do not exist (#112)
- - Allow the use of parentheses in selecting series (#111)
- - Fixed bug in merging series with high time precision (#108)
- - Code forward compatible with upcoming cleri release
-
- -- Jeroen van der Heijden <jeroen@cesbit.com> Thu, 10 Jan 2019 11:35:12 +0100
-
-siridb-server (2.0.30-0~tt1) unstable; urgency=medium
+siridb-server (2.0.30-1) unstable; urgency=medium
+ [ Jeroen van der Heijden ]
* New upstream release
- SiriDB Server can now compile with gnu89/gnu90 (#101)
- Removed deprecated info- and loaddb requests
@@ -191,8 +117,12 @@ siridb-server (2.0.30-0~tt1) unstable; urgency=medium
- The buffer size can now be adjusted by using the database.conf
configuration file
- Added conversion of invalid value types
+ * Lower log level of the service file
+
+ [ Paul Gevers ]
+ * Run testsuite during build
- -- Jeroen van der Heijden <jeroen@cesbit.com> Fri, 12 Oct 2018 19:44:24 +0200
+ -- Paul Gevers <elbrus@debian.org> Sun, 28 Oct 2018 18:43:45 +0100
siridb-server (2.0.29-1) unstable; urgency=medium
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index b4de3947..00000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-11
diff --git a/debian/control b/debian/control
index 4c4eeb40..972fac50 100644
--- a/debian/control
+++ b/debian/control
@@ -7,16 +7,18 @@ Uploaders:
Paul Gevers <elbrus@debian.org>,
Rules-Requires-Root: no
Build-Depends:
- debhelper (>= 11~),
+ debhelper-compat (= 13),
help2man,
libcleri-dev,
libpcre2-dev,
libuv1-dev,
+ libyajl-dev,
uuid-dev,
+ valgrind [amd64 arm64 armhf i386 powerpc ppc64 ppc64el s390x] <!nocheck>
Homepage: https://siridb.net/
Vcs-Browser: https://salsa.debian.org/siridb-team/siridb-server
Vcs-Git: https://salsa.debian.org/siridb-team/siridb-server.git
-Standards-Version: 4.1.3
+Standards-Version: 4.5.1
Package: siridb-server
Architecture: any
@@ -24,8 +26,6 @@ Depends:
ucf,
${misc:Depends},
${shlibs:Depends},
- libuv1 (>= 1.8.0),
- libcleri0 (>= 0.9.3),
Description: SiriDB time series database server
SiriDB is a scalable, robust and fast time series database. Build from the
ground up SiriDB uses a mechanism to operate without a global index and allows
diff --git a/debian/copyright b/debian/copyright
index f645a16e..154d2364 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -5,7 +5,12 @@ Copyright: 2016-2022, Cesbit <jeroen@cesbit.com>
License: Expat
Files: debian/*
-Copyright: 2017-2018 Paul Gevers <elbrus@debian.org>
+Copyright: 2017-2019 Paul Gevers <elbrus@debian.org>
+License: Expat
+
+Files: include/lib/http_parser.h
+ src/lib/http_parser.c
+Copyright: ?, Joyent, Inc. and other Node contributors
License: Expat
License: Expat
diff --git a/debian/links b/debian/links
index 0de57b22..c3314e06 100644
--- a/debian/links
+++ b/debian/links
@@ -1,3 +1,3 @@
-usr/lib/siridb-server/siridb-server usr/bin/siridb-server
+usr/lib/siridb-server/siridb-server usr/bin/siridb-server
usr/share/siridb-server/help usr/lib/siridb-server/help
usr/share/siridb-server/help usr/share/doc/siridb-server/help
diff --git a/debian/patches/0001-link-with-libatomic-for-test.patch b/debian/patches/0001-link-with-libatomic-for-test.patch
new file mode 100644
index 00000000..affbab47
--- /dev/null
+++ b/debian/patches/0001-link-with-libatomic-for-test.patch
@@ -0,0 +1,32 @@
+From 8e6e9a883121dc8077e2b29b51fe6f399c6d7141 Mon Sep 17 00:00:00 2001
+From: ildumi95 <ileanadumi95@protonmail.com>
+Date: Mon, 7 Feb 2022 15:47:57 +0100
+Subject: [PATCH] link with libatomic for test
+
+---
+ test/test.sh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/test/test.sh b/test/test.sh
+index 2683a52c..de9bd235 100755
+--- a/test/test.sh
++++ b/test/test.sh
+@@ -25,7 +25,7 @@ run () {
+ OUT=$1.out
+ rm "$OUT" 2> /dev/null
+
+- gcc -I"../include" -O0 -g3 -Wall -Wextra -Winline -std=gnu99 $SOURCE $C_SRC -lm -lpcre2-8 -lcleri -luuid -luv -lyajl $LCRYPT -o "$OUT"
++ gcc -I"../include" -O0 -g3 -Wall -Wextra -Winline -std=gnu99 $SOURCE $C_SRC -lm -latomic -lpcre2-8 -lcleri -luuid -luv -lyajl $LCRYPT -o "$OUT"
+ if [[ "$NOMEMTEST" -ne "1" ]]; then
+ valgrind --tool=memcheck --error-exitcode=1 --leak-check=full -q ./$OUT
+ else
+@@ -45,4 +45,4 @@ else
+ run "test_$name"
+ fi
+
+-exit $RET
+\ No newline at end of file
++exit $RET
+--
+2.30.2
+
diff --git a/debian/patches/0002-siri-db-add-NULL-check-before-calling-siridb_tasks_d.patch b/debian/patches/0002-siri-db-add-NULL-check-before-calling-siridb_tasks_d.patch
new file mode 100644
index 00000000..ca0e917c
--- /dev/null
+++ b/debian/patches/0002-siri-db-add-NULL-check-before-calling-siridb_tasks_d.patch
@@ -0,0 +1,41 @@
+Description: siri/db: add NULL check before calling siridb_tasks_dec
+ When built against libuv1 1.44.2, siridb_query_free may call
+ siridb_tasks_dec on NULL, causing a segfault. Add a NULL check on siridb
+ before calling siridb_tasks_dec to avoid this.
+Author: Nick Rosbrook <nick.rosbrook@canonical.com>
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/siridb-server/+bug/1987558
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1017748
+Forwarded: https://github.com/SiriDB/siridb-server/pull/182
+Last-Update: 2022-08-24
+---
+From 90c261499af260f3450b4a2e00ec828bca81211a Mon Sep 17 00:00:00 2001
+From: Nick Rosbrook <nick.rosbrook@canonical.com>
+Date: Wed, 24 Aug 2022 14:57:07 -0400
+Subject: [PATCH] siri/db: add NULL check before calling siridb_tasks_dec
+
+When built against libuv1 1.44.2, siridb_query_free may call
+siridb_tasks_dec on NULL, causing a segfault. Add a NULL check on siridb
+before calling siridb_tasks_dec to avoid this.
+---
+ src/siri/db/query.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/siri/db/query.c b/src/siri/db/query.c
+index 3f9f7a0a..555628e4 100644
+--- a/src/siri/db/query.c
++++ b/src/siri/db/query.c
+@@ -156,7 +156,10 @@ void siridb_query_free(uv_handle_t * handle)
+ siridb_t * siridb = query->client->siridb;
+
+ /* decrement active tasks */
+- siridb_tasks_dec(siridb->tasks);
++ if (siridb != NULL)
++ {
++ siridb_tasks_dec(siridb->tasks);
++ }
+
+ /* free query */
+ free(query->q);
+--
+2.34.1
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 00000000..20678d8b
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+0001-link-with-libatomic-for-test.patch
+0002-siri-db-add-NULL-check-before-calling-siridb_tasks_d.patch
diff --git a/debian/rules b/debian/rules
index 875c4440..ad3e4854 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,6 +2,8 @@
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) -latomic
+
%:
dh $@
@@ -12,3 +14,8 @@ override_dh_auto_build-arch:
override_dh_auto_clean:
$(MAKE) --directory=Release clean
dh_auto_clean
+
+override_dh_auto_test:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+ $(MAKE) --directory=Release test
+endif
diff --git a/debian/siridb-server.lintian-overrides b/debian/siridb-server.lintian-overrides
new file mode 100644
index 00000000..665e8767
--- /dev/null
+++ b/debian/siridb-server.lintian-overrides
@@ -0,0 +1,5 @@
+# The help files are arch indep, so this is no issue
+siridb-server: breakout-link usr/lib/siridb-server/help -> usr/share/siridb-server/help
+
+# The help files are needed by the program
+siridb-server: package-contains-documentation-outside-usr-share-doc
diff --git a/debian/tests/control b/debian/tests/control
index 8ce3097d..3fa074bc 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,3 +1,3 @@
-Test-Command: NOMEMTEST=1 make --directory=Release test
-Features: test-name=siridb-unit-tests
-Depends: @, @builddeps@
+Tests: http-api
+Depends: @, curl
+Restrictions: needs-root, isolation-container
diff --git a/debian/tests/http-api b/debian/tests/http-api
new file mode 100644
index 00000000..3f359c68
--- /dev/null
+++ b/debian/tests/http-api
@@ -0,0 +1,198 @@
+#!/bin/sh
+set -e
+
+RES=0
+
+echo '* fixing /etc/siridb/siridb.conf'
+sed --in-place 's/http_api_port = 0/http_api_port = 9020/' /etc/siridb/siridb.conf
+
+echo '* restarting siridb-server'
+service siridb-server restart
+
+echo '* run queries'
+echo ' get-version'
+curl --silent --show-error --location --output res.txt \
+ --request GET 'http://localhost:9020/get-version' \
+ --header 'Content-Type: application/json' \
+ --header 'Authorization: Basic c2E6c2lyaQ==' || RES=1
+cat res.txt
+echo
+
+echo ' new-database'
+curl --silent --show-error --location --output res.txt \
+ --request POST 'http://localhost:9020/new-database' \
+ --header 'Content-Type: application/json' \
+ --header 'Authorization: Basic c2E6c2lyaQ==' \
+ --header 'Content-Type: text/plain' \
+ --data-raw '{
+ "dbname": "sampledb",
+ "time_precision": "s",
+ "buffer_size": 8192,
+ "duration_num": "1w",
+ "duration_log": "3d"
+}' || RES=1
+cat res.txt
+echo
+expect='"OK"'
+if [ "$(cat res.txt)" != "$expect" ] ; then RES=1 ; echo "FAILED: expected $expect" ; fi
+
+echo ' new-account'
+curl --silent --show-error --location --output res.txt \
+ --request POST 'http://localhost:9020/new-account' \
+ --header 'Content-Type: application/json' \
+ --header 'Authorization: Basic c2E6c2lyaQ==' \
+ --header 'Content-Type: text/plain' \
+ --data-raw '{
+ "account": "bob",
+ "password": "passwd4bob"
+}' || RES=1
+cat res.txt
+echo
+expect='"OK"'
+if [ "$(cat res.txt)" != "$expect" ] ; then RES=1 ; echo "FAILED: expected $expect" ; fi
+
+echo ' change-password'
+curl --silent --show-error --location --output res.txt \
+ --request POST 'http://localhost:9020/change-password' \
+ --header 'Content-Type: application/json' \
+ --header 'Authorization: Basic c2E6c2lyaQ==' \
+ --header 'Content-Type: text/plain' \
+ --data-raw '{
+ "account": "bob",
+ "password": "pass"
+}' || RES=1
+cat res.txt
+echo
+expect='"OK"'
+if [ "$(cat res.txt)" != "$expect" ] ; then RES=1 ; echo "FAILED: expected $expect" ; fi
+
+echo ' drop-account'
+curl --silent --show-error --location --output res.txt \
+ --request POST 'http://localhost:9020/drop-account' \
+ --header 'Content-Type: application/json' \
+ --header 'Authorization: Basic c2E6c2lyaQ==' \
+ --header 'Content-Type: text/plain' \
+ --data-raw '{
+ "account": "bob"
+}' || RES=1
+cat res.txt
+echo
+expect='"OK"'
+if [ "$(cat res.txt)" != "$expect" ] ; then RES=1 ; echo "FAILED: expected $expect" ; fi
+
+echo ' drop-database'
+curl --silent --show-error --location --output res.txt \
+ --request POST 'http://localhost:9020/drop-database' \
+ --header 'Content-Type: application/json' \
+ --header 'Authorization: Basic c2E6c2lyaQ==' \
+ --header 'Content-Type: text/plain' \
+ --data-raw '{
+ "database": "sampledb",
+ "ignore_offline": false
+}' || RES=1
+cat res.txt
+echo
+expect='"OK"'
+if [ "$(cat res.txt)" != "$expect" ] ; then RES=1 ; echo "FAILED: expected $expect" ; fi
+
+echo ' drop-database again'
+curl --silent --show-error --location --output res.txt \
+ --request POST 'http://localhost:9020/drop-database' \
+ --header 'Content-Type: application/json' \
+ --header 'Authorization: Basic c2E6c2lyaQ==' \
+ --header 'Content-Type: text/plain' \
+ --data-raw '{
+ "database": "sampledb",
+ "ignore_offline": false
+}' || RES=1
+cat res.txt
+echo
+expect='{"error_msg":"cannot find database '"'"'sampledb'"'"'"}'
+if [ "$(cat res.txt)" != "$expect" ] ; then RES=1 ; echo "FAILED: expected $expect" ; fi
+
+echo ' get-accounts'
+curl --silent --show-error --location --output res.txt \
+ --request GET 'http://localhost:9020/get-accounts' \
+ --header 'Content-Type: application/json' \
+ --header 'Authorization: Basic c2E6c2lyaQ=='
+cat res.txt
+echo
+expect='["sa"]'
+if [ "$(cat res.txt)" != "$expect" ] ; then RES=1 ; echo "FAILED: expected $expect" ; fi
+
+echo ' new-database for queries'
+curl --silent --show-error --location --output res.txt \
+ --request POST 'http://localhost:9020/new-database' \
+ --header 'Content-Type: application/json' \
+ --header 'Authorization: Basic c2E6c2lyaQ==' \
+ --header 'Content-Type: text/plain' \
+ --data-raw '{
+ "dbname": "sampledb",
+ "time_precision": "s",
+ "buffer_size": 8192,
+ "duration_num": "1w",
+ "duration_log": "3d"
+}' || RES=1
+cat res.txt
+echo
+expect='"OK"'
+if [ "$(cat res.txt)" != "$expect" ] ; then RES=1 ; echo "FAILED: expected $expect" ; fi
+
+echo ' get-databases'
+curl --silent --show-error --location --output res.txt \
+ --request GET 'http://localhost:9020/get-databases' \
+ --header 'Content-Type: application/json' \
+ --header 'Authorization: Basic c2E6c2lyaQ=='
+cat res.txt
+echo
+expect='["sampledb"]'
+if [ "$(cat res.txt)" != "$expect" ] ; then RES=1 ; echo "FAILED: expected $expect" ; fi
+
+echo ' query data (nothing there)'
+curl --silent --show-error --location --output res.txt \
+ --request POST 'http://localhost:9020/query/sampledb' \
+ --header 'Content-Type: application/json' \
+ --header 'Authorization: Basic aXJpczpzaXJp' \
+ --header 'Content-Type: text/plain' \
+ --data-raw '{
+ "q": "select count() from '\''aggr'\''",
+ "t": "ms"
+}' || RES=1
+cat res.txt
+echo
+expect='{}'
+if [ "$(cat res.txt)" != "$expect" ] ; then RES=1 ; echo "FAILED: expected $expect" ; fi
+
+echo ' insert data'
+curl --silent --show-error --location --output res.txt \
+ --request POST 'http://localhost:9020/insert/sampledb' \
+ --header 'Content-Type: application/json' \
+ --header 'Authorization: Basic aXJpczpzaXJp' \
+ --header 'Content-Type: text/plain' \
+ --data-raw '{
+ "aggr": [
+ [1578933215, 42],
+ [1578933223, 123]
+ ]
+}' || RES=1
+cat res.txt
+echo
+expect='{"success_msg":"Successfully inserted 2 point(s)."}'
+if [ "$(cat res.txt)" != "$expect" ] ; then RES=1 ; echo "FAILED: expected $expect" ; fi
+
+echo ' query data'
+curl --silent --show-error --location --output res.txt \
+ --request POST 'http://localhost:9020/query/sampledb' \
+ --header 'Content-Type: application/json' \
+ --header 'Authorization: Basic aXJpczpzaXJp' \
+ --header 'Content-Type: text/plain' \
+ --data-raw '{
+ "q": "select count() from '\''aggr'\''",
+ "t": "ms"
+}' || RES=1
+cat res.txt
+echo
+expect='{"aggr":[[1578933223000,2]]}'
+if [ "$(cat res.txt)" != "$expect" ] ; then RES=1 ; echo "FAILED: expected $expect" ; fi
+
+exit $RES
diff --git a/debian/upstream/metadata b/debian/upstream/metadata
new file mode 100644
index 00000000..978b263b
--- /dev/null
+++ b/debian/upstream/metadata
@@ -0,0 +1,5 @@
+---
+Bug-Database: https://github.com/transceptor-technology/siridb-server/issues
+Bug-Submit: https://github.com/transceptor-technology/siridb-server/issues/new
+Repository: https://github.com/transceptor-technology/siridb-server.git
+Repository-Browse: https://github.com/transceptor-technology/siridb-server
diff --git a/debian/watch b/debian/watch
index bc17067b..a461d8c4 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,4 +1,5 @@
version=4
-opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%siridb-server-$1.tar.gz%" \
- https://github.com/cesbit/siridb-server/releases \
- (?:.*?/)?v?(\d[\d.]*)\.tar\.gz
+ opts="searchmode=plain,\
+ filenamemangle=s%v?@ANY_VERSION@%@PACKAGE@-$1.tar.xz%" \
+ https://api.github.com/repos/SiriDB/siridb-server/releases?per_page=50 \
+ https://api.github.com/repos/[^/]+/[^/]+/tarball/v?@ANY_VERSION@