people/ms/libloc.git
4 days agoRevert "importer: Import raw sources for inetnum's again" master
Michael Tremer [Thu, 24 Sep 2020 10:18:58 +0000 (10:18 +0000)] 
Revert "importer: Import raw sources for inetnum's again"

This reverts commit 64e95fa903edec8b4e4e59830b395e2e4a411853.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 days agoRevert "importer: Purge any redundant entries"
Michael Tremer [Thu, 24 Sep 2020 10:17:58 +0000 (10:17 +0000)] 
Revert "importer: Purge any redundant entries"

This reverts commit c2cc55d5a6875c3838f060032eaed89dcfb92ef6.

The query stalls the database and therefore the automatic
scripts are no longer able to generate a new version of the
database.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 days agoBump version to 0.9.4 0.9.4
Michael Tremer [Mon, 21 Sep 2020 16:21:21 +0000 (16:21 +0000)] 
Bump version to 0.9.4

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 days agoimporter: Purge any redundant entries
Peter Müller [Sun, 20 Sep 2020 19:21:03 +0000 (19:21 +0000)] 
importer: Purge any redundant entries

When importing inetnums, we might import various small networks
which are not relevant for us as long as they do not have a
different country code than their parent network.

Therefore we delete all these entries to keep the database
smaller without losing any information. The second version of this
patch introduces a SQL statement parallelised across all CPUs
available, while the DELETE-statement of the first version literally
took ages to complete.

However, cleaning up those data still takes about 26 hours (!) on
our location02 testing machine, making daily updates of the location
database impossible to the current knowledge.

real    1521m30.620s
user    38m45.521s
sys     9m6.027s

Special thanks goes to Michael for spending numerous hours
on this, setting up a testing environment, doing PostgreSQL magic
and providing helpful advice while debugging.

Partially fixes: #12458

Cc: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 days agoimporter: Import raw sources for inetnum's again
Peter Müller [Sun, 20 Sep 2020 19:20:18 +0000 (19:20 +0000)] 
importer: Import raw sources for inetnum's again

The extended feeds do not have enough detailed information
for us, so that we need to import inetnums from RIRs where
possible. Filtering private networks is necessary as RIR data
may contain 0.0.0.0/0 or similar entries for administrative
purposes or due to misfilings.

Special thanks goes to Michael for spending numerous hours
on this, setting up a testing environment and providing helpful
advice while debugging.

Partially fixes: #12458

Cc: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
6 days agolocation-importer.in: avoid violating NOT NULL constraints during JOIN
Peter Müller [Sun, 20 Sep 2020 19:19:36 +0000 (19:19 +0000)] 
location-importer.in: avoid violating NOT NULL constraints during JOIN

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agonetwork: Determine family when the network is initialised
Michael Tremer [Fri, 18 Sep 2020 13:50:11 +0000 (13:50 +0000)] 
network: Determine family when the network is initialised

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agonetwork: Export family, first_address and last_address in Python
Michael Tremer [Fri, 18 Sep 2020 13:46:58 +0000 (13:46 +0000)] 
network: Export family, first_address and last_address in Python

We can use this to avoid formatting the network in a string
representation which is then parsed again later to determine
the first and last addresses.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agonetwork: Store the first and last address of each network
Michael Tremer [Fri, 18 Sep 2020 13:20:21 +0000 (13:20 +0000)] 
network: Store the first and last address of each network

This avoids recomputing the last address multiple times.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agonetworks: Rename start_address to first_address
Michael Tremer [Fri, 18 Sep 2020 13:13:32 +0000 (13:13 +0000)] 
networks: Rename start_address to first_address

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
9 days agoexport: Skip writing any subnets
Michael Tremer [Fri, 18 Sep 2020 10:26:15 +0000 (10:26 +0000)] 
export: Skip writing any subnets

It is unnecessary to write any subnets in the output, because
they might already be included in a bigger parent network.

Since the tree is ordered, we only need to check if the network
to be written is a subnet of the previous one. If so, we skip it.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
10 days agolocation: Fix message sting if the database has been recently updated
Stefan Schantl [Mon, 14 Sep 2020 18:36:36 +0000 (20:36 +0200)] 
location: Fix message sting if the database has been recently updated

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 weeks agoperl: Add test for get_continent_code() function.
Stefan Schantl [Thu, 10 Sep 2020 15:57:47 +0000 (17:57 +0200)] 
perl: Add test for get_continent_code() function.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 weeks agoperl: Add test for get_country_name() function.
Stefan Schantl [Thu, 10 Sep 2020 15:57:46 +0000 (17:57 +0200)] 
perl: Add test for get_country_name() function.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 weeks agopython example script: Add country name and continent code.
Stefan Schantl [Thu, 10 Sep 2020 15:57:45 +0000 (17:57 +0200)] 
python example script: Add country name and continent code.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 weeks agoperl: Add get_country_name() function.
Stefan Schantl [Thu, 10 Sep 2020 15:57:44 +0000 (17:57 +0200)] 
perl: Add get_country_name() function.

This function can be used to get the stored name for a given country
code.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 weeks agoperl: Add test for the lookup_network_has_flag() function
Stefan Schantl [Sun, 30 Aug 2020 10:36:02 +0000 (12:36 +0200)] 
perl: Add test for the lookup_network_has_flag() function

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 weeks agoAdd example network flag to the python create-database example script.
Stefan Schantl [Sun, 30 Aug 2020 10:36:01 +0000 (12:36 +0200)] 
Add example network flag to the python create-database example script.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 weeks agoperl: Add lookup_network_has_flag() function.
Stefan Schantl [Sun, 30 Aug 2020 10:36:00 +0000 (12:36 +0200)] 
perl: Add lookup_network_has_flag() function.

This function can be used to check if a given address or network has one
of the following network flags.

* LOC_NETWORK_FLAG_ANONYMOUS_PROXY
* LOC_NETWORK_FLAG_SATELLITE_PROVIDER
* LOC_NETWORK_FLAG_ANYCAST

It will return true if the given flag is set.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 weeks agoperl: Add get_as_name()
Stefan Schantl [Sat, 22 Aug 2020 14:02:31 +0000 (16:02 +0200)] 
perl: Add get_as_name()

This function can be use to give the numer of an Autonomous System and
get back the stored name from the used location database.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 weeks agoperl: Add test for the database_countries() function.
Stefan Schantl [Thu, 20 Aug 2020 17:28:56 +0000 (19:28 +0200)] 
perl: Add test for the database_countries() function.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 weeks agoAdd an example country to the python create-database example script.
Stefan Schantl [Thu, 20 Aug 2020 17:28:55 +0000 (19:28 +0200)] 
Add an example country to the python create-database example script.

The generated database is used by the testsuite of the perl binding.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
5 weeks agoperl: Add database_countries() function.
Stefan Schantl [Thu, 20 Aug 2020 17:28:54 +0000 (19:28 +0200)] 
perl: Add database_countries() function.

This function is used to the stored countries of a database, which
easily can be assigned to an array.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
7 weeks agoUpdate translations
Michael Tremer [Tue, 4 Aug 2020 15:44:41 +0000 (15:44 +0000)] 
Update translations

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
7 weeks agolocation: Provide a return code if the database does not need to be updated.
Stefan Schantl [Wed, 29 Jul 2020 16:51:59 +0000 (18:51 +0200)] 
location: Provide a return code if the database does not need to be updated.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 months agolocation-importer: Read all routes and not only those imported through iBGP
Michael Tremer [Tue, 28 Jul 2020 16:00:52 +0000 (16:00 +0000)] 
location-importer: Read all routes and not only those imported through iBGP

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 months agoimporter: Implement fetch routes from Bird
Michael Tremer [Fri, 24 Jul 2020 16:58:35 +0000 (16:58 +0000)] 
importer: Implement fetch routes from Bird

If the route server is now a socket, the importer will connect
to it and fetch the routing table. This is a lot faster than telnet.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 months agocountry: Terminate buffer when reading from database
Michael Tremer [Mon, 13 Jul 2020 10:47:30 +0000 (10:47 +0000)] 
country: Terminate buffer when reading from database

Compilers on ARM do not seem to initialise the buffer.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 months agoconfigure: Bump version to 0.9.3 0.9.3
Michael Tremer [Fri, 10 Jul 2020 14:49:49 +0000 (14:49 +0000)] 
configure: Bump version to 0.9.3

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 months agolocation(8): Remove any temporary files after unsuccessful downloads
Stefan Schantl [Fri, 10 Jul 2020 14:47:54 +0000 (16:47 +0200)] 
location(8): Remove any temporary files after unsuccessful downloads

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2 months agolocation(8): Fix pasing timestamp for systems not running on UTC
Stefan Schantl [Fri, 10 Jul 2020 14:40:33 +0000 (16:40 +0200)] 
location(8): Fix pasing timestamp for systems not running on UTC

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2 months agolocation(8): Allow downloading a database without one on disk
Michael Tremer [Fri, 10 Jul 2020 10:43:46 +0000 (10:43 +0000)] 
location(8): Allow downloading a database without one on disk

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 months agolocation(8): Allow limiting updates to once a day, week, month
Michael Tremer [Fri, 10 Jul 2020 10:41:23 +0000 (10:41 +0000)] 
location(8): Allow limiting updates to once a day, week, month

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 months agoimporter: Correctly sort the results
Michael Tremer [Mon, 6 Jul 2020 16:44:20 +0000 (16:44 +0000)] 
importer: Correctly sort the results

The results where incorrectly ordered so that the DISTINCT clause
removed the wrong rows matching an incorrect parent subnet.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 months agoimporter: Also add networks that are not announced to the database
Michael Tremer [Mon, 29 Jun 2020 15:42:43 +0000 (15:42 +0000)] 
importer: Also add networks that are not announced to the database

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 months agoimporter: Write NULL into database when bool is not set
Michael Tremer [Mon, 29 Jun 2020 13:34:26 +0000 (13:34 +0000)] 
importer: Write NULL into database when bool is not set

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 months agoimporter: Walk through all options for flags
Michael Tremer [Mon, 29 Jun 2020 13:28:06 +0000 (13:28 +0000)] 
importer: Walk through all options for flags

It could happen that a network was marked, but the AS was not.

Since the AS is checked first, we won't check the network and
therefore write the wrong information into the database.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2 months agodatabase: Always require SSL
Michael Tremer [Mon, 29 Jun 2020 13:27:52 +0000 (13:27 +0000)] 
database: Always require SSL

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agolocation.in: strip trailing whitespaces in database description while dumping
Peter Müller [Mon, 22 Jun 2020 17:55:17 +0000 (17:55 +0000)] 
location.in: strip trailing whitespaces in database description while dumping

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoconfigure: Bump version to 0.9.2 0.9.2
Michael Tremer [Mon, 15 Jun 2020 17:09:11 +0000 (17:09 +0000)] 
configure: Bump version to 0.9.2

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoEnable debug logging for all tests
Michael Tremer [Mon, 15 Jun 2020 16:48:04 +0000 (16:48 +0000)] 
Enable debug logging for all tests

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoconfigure: Update home and contact address
Michael Tremer [Mon, 15 Jun 2020 16:38:07 +0000 (16:38 +0000)] 
configure: Update home and contact address

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoman: Update documentation on renamed --output-format parameter
Michael Tremer [Mon, 15 Jun 2020 16:33:18 +0000 (16:33 +0000)] 
man: Update documentation on renamed --output-format parameter

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoman: Document export command
Michael Tremer [Mon, 15 Jun 2020 16:31:19 +0000 (16:31 +0000)] 
man: Document export command

Fixes: #12437
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoman: Order commands alphabetically on location(8)
Michael Tremer [Mon, 15 Jun 2020 16:23:14 +0000 (16:23 +0000)] 
man: Order commands alphabetically on location(8)

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agolocation: Fix handling of families argument
Michael Tremer [Fri, 12 Jun 2020 14:44:20 +0000 (14:44 +0000)] 
location: Fix handling of families argument

This was ignored, because it was already converted before
and the export function was expecting a string.

Fixes: #12436
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoFix timezone-dependant interpretation of database timestamp
Michael Tremer [Fri, 12 Jun 2020 14:33:48 +0000 (14:33 +0000)] 
Fix timezone-dependant interpretation of database timestamp

The timestamp that is retrieved from DNS is in UTC and we must
not interpret as local time.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agopython: Correctly set and use __version__
Michael Tremer [Fri, 12 Jun 2020 14:21:55 +0000 (14:21 +0000)] 
python: Correctly set and use __version__

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodebian: Also build for sid
Stefan Schantl [Wed, 10 Jun 2020 15:28:17 +0000 (17:28 +0200)] 
debian: Also build for sid

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoPrint ASes in format like: AS204867 - Lightning Wire Labs GmbH
Michael Tremer [Tue, 9 Jun 2020 11:03:03 +0000 (11:03 +0000)] 
Print ASes in format like: AS204867 - Lightning Wire Labs GmbH

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodebian: Disable perl package.
Stefan Schantl [Mon, 8 Jun 2020 16:35:19 +0000 (18:35 +0200)] 
debian: Disable perl package.

The perl package cannot be cross-compiled correctly for other
architectures different from the hosts one.

So currently disable the perl package until we get this fixed at a later
time.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoimporter: Return the last block, too
Michael Tremer [Tue, 9 Jun 2020 10:59:04 +0000 (10:59 +0000)] 
importer: Return the last block, too

Fixes: #12427
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodebian: Create separate package for the importer
Michael Tremer [Fri, 5 Jun 2020 13:08:01 +0000 (13:08 +0000)] 
debian: Create separate package for the importer

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodebian: build.sh: Stop printing every command that is executed
Michael Tremer [Fri, 5 Jun 2020 11:22:29 +0000 (11:22 +0000)] 
debian: build.sh: Stop printing every command that is executed

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodebian: Do not destroy the build result
Michael Tremer [Fri, 5 Jun 2020 11:22:09 +0000 (11:22 +0000)] 
debian: Do not destroy the build result

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodebian: unstable is called bullseye
Michael Tremer [Fri, 5 Jun 2020 11:20:30 +0000 (11:20 +0000)] 
debian: unstable is called bullseye

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodatabase: Fix broken search for networks with flags
Michael Tremer [Fri, 5 Jun 2020 10:01:47 +0000 (10:01 +0000)] 
database: Fix broken search for networks with flags

The search was ended after the first network. No matter if
it matched, or not.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoexport flagged networks with their faked country names, too
Michael Tremer [Fri, 5 Jun 2020 09:57:41 +0000 (09:57 +0000)] 
export flagged networks with their faked country names, too

This will lead to some networks showing up twice. Once with
their real country and once with their faked one.

It is likely that the first one will match.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agolocation(8): Export all countries by default
Michael Tremer [Fri, 5 Jun 2020 09:47:36 +0000 (09:47 +0000)] 
location(8): Export all countries by default

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoAdd option to iterate over all countries and print them to the console
Michael Tremer [Fri, 5 Jun 2020 09:41:28 +0000 (09:41 +0000)] 
Add option to iterate over all countries and print them to the console

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoMakefile: Remove accidentially committed hacks for Debian
Michael Tremer [Thu, 4 Jun 2020 10:37:50 +0000 (10:37 +0000)] 
Makefile: Remove accidentially committed hacks for Debian

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodebian: Mark all packages as "Multi-Arch: same"
Michael Tremer [Thu, 4 Jun 2020 10:37:28 +0000 (10:37 +0000)] 
debian: Mark all packages as "Multi-Arch: same"

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodebian: Correctly define runtime dependencies for all packages
Michael Tremer [Thu, 4 Jun 2020 10:31:31 +0000 (10:31 +0000)] 
debian: Correctly define runtime dependencies for all packages

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodebian: Rename main package to "location"
Michael Tremer [Thu, 4 Jun 2020 09:54:18 +0000 (09:54 +0000)] 
debian: Rename main package to "location"

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodebian: Update rootfiles
Michael Tremer [Thu, 4 Jun 2020 08:39:02 +0000 (08:39 +0000)] 
debian: Update rootfiles

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agopo: Import translation strings
Michael Tremer [Wed, 3 Jun 2020 19:08:00 +0000 (19:08 +0000)] 
po: Import translation strings

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoMerge location-exporter(8) into location(8)
Michael Tremer [Wed, 3 Jun 2020 18:36:28 +0000 (18:36 +0000)] 
Merge location-exporter(8) into location(8)

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoRename location-query(8) to location(8)
Michael Tremer [Wed, 3 Jun 2020 17:21:31 +0000 (17:21 +0000)] 
Rename location-query(8) to location(8)

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agodownloader: Change user-agent to location
Michael Tremer [Wed, 3 Jun 2020 17:15:27 +0000 (17:15 +0000)] 
downloader: Change user-agent to location

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agosystemd: Rename location-downloader to location-update
Michael Tremer [Wed, 3 Jun 2020 17:14:37 +0000 (17:14 +0000)] 
systemd: Rename location-downloader to location-update

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agolocation-downloader: Merge man page into location-query
Michael Tremer [Wed, 3 Jun 2020 17:10:35 +0000 (17:10 +0000)] 
location-downloader: Merge man page into location-query

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoMove location-downloader functionality into location-query
Michael Tremer [Wed, 3 Jun 2020 17:06:13 +0000 (17:06 +0000)] 
Move location-downloader functionality into location-query

The commands are very long and confusion. Hence we merge this
all into one command.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agolocation-exporter: Warn, but do not fail on invalid input
Michael Tremer [Wed, 3 Jun 2020 16:33:44 +0000 (16:33 +0000)] 
location-exporter: Warn, but do not fail on invalid input

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agolocation-exporter: Do not mistake country AS for an AS number
Michael Tremer [Wed, 3 Jun 2020 16:31:44 +0000 (16:31 +0000)] 
location-exporter: Do not mistake country AS for an AS number

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agolocation-query: Require at least one flag
Michael Tremer [Wed, 3 Jun 2020 16:15:24 +0000 (16:15 +0000)] 
location-query: Require at least one flag

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agoMakefile: Remove Python path overrides for Debian
Michael Tremer [Mon, 1 Jun 2020 18:23:50 +0000 (18:23 +0000)] 
Makefile: Remove Python path overrides for Debian

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
3 months agolocation-downloader: Do not change content of open database files
Michael Tremer [Mon, 1 Jun 2020 13:47:44 +0000 (13:47 +0000)] 
location-downloader: Do not change content of open database files

The database might be opened by another process. When modified,
it will return random results.

Fixes: #12420
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agotest: Generate random temporary files
Michael Tremer [Thu, 28 May 2020 14:17:00 +0000 (14:17 +0000)] 
test: Generate random temporary files

Debian runs the testsuite in parallel which fails when mutliple
process write to the same file at the same time.

This patch will now create and later delete a temporary file.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoBump version to 0.9.1 0.9.1
Michael Tremer [Mon, 25 May 2020 08:22:29 +0000 (08:22 +0000)] 
Bump version to 0.9.1

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoRevert "debian: Drop perl package"
Michael Tremer [Thu, 21 May 2020 18:11:32 +0000 (18:11 +0000)] 
Revert "debian: Drop perl package"

This reverts commit 3d26288681601b273f034de1f2241dc4342791b5.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodebian: Enable location-download.timer after installation
Stefan Schantl [Thu, 21 May 2020 18:09:55 +0000 (20:09 +0200)] 
debian: Enable location-download.timer after installation

This timer periodly executes the location-downloader and keeps
the location database up to date.

Fixes #12412.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodebian: Ship database signing key.
Stefan Schantl [Thu, 21 May 2020 17:38:11 +0000 (19:38 +0200)] 
debian: Ship database signing key.

This key is needed to download and verify the database.

Fixes #12410.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoexamples/create-database.py: Add hack to allow loading the module in build environment.
Stefan Schantl [Thu, 21 May 2020 17:15:19 +0000 (19:15 +0200)] 
examples/create-database.py: Add hack to allow loading the module in build environment.

This script is needed to generate the database which is used by the
testsuite of the perl binding of libloc.

This allows us to revert the following commits:

482eb94f165507ffcb6503e162535064d6dcecac
3d26288681601b273f034de1f2241dc4342791b5

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodebian: Do not add auto-generated files
Michael Tremer [Tue, 19 May 2020 17:56:53 +0000 (17:56 +0000)] 
debian: Do not add auto-generated files

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoman: Document quiet mode switch
Michael Tremer [Tue, 19 May 2020 17:54:47 +0000 (17:54 +0000)] 
man: Document quiet mode switch

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolocation: Print country name if possible
Michael Tremer [Tue, 19 May 2020 17:50:35 +0000 (17:50 +0000)] 
location: Print country name if possible

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolocation-importer: Implement importing/exporting countries
Michael Tremer [Tue, 19 May 2020 17:44:59 +0000 (17:44 +0000)] 
location-importer: Implement importing/exporting countries

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agolocation-query: Fix typo in "aut-num"
Michael Tremer [Tue, 19 May 2020 17:38:18 +0000 (17:38 +0000)] 
location-query: Fix typo in "aut-num"

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agostringpool: Always add an empty string
Michael Tremer [Tue, 19 May 2020 16:53:53 +0000 (16:53 +0000)] 
stringpool: Always add an empty string

This will create an empty string at the first byte of the pool
and is helpful for our database metadata (vendor, license, de-
scription) which can be zero and would therefore return the
first string in the pool.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agoformat: Reduce the length of the signature header
Michael Tremer [Tue, 19 May 2020 12:22:50 +0000 (12:22 +0000)] 
format: Reduce the length of the signature header

Since a single signature can only be up to 2048 bytes long,
we do not need 32 bits to tell us how many of those bytes
are being used.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agotest: Sign database twice with the same key
Michael Tremer [Tue, 19 May 2020 12:14:11 +0000 (12:14 +0000)] 
test: Sign database twice with the same key

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agopython: Support passing two signing keys
Michael Tremer [Tue, 19 May 2020 12:11:37 +0000 (12:11 +0000)] 
python: Support passing two signing keys

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodatabase: Add support for two signatures
Michael Tremer [Tue, 19 May 2020 12:03:05 +0000 (12:03 +0000)] 
database: Add support for two signatures

This allows us to sign the database with two different keys
in case the first key gets weakened or compromised in any other
way.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodebian: Build a source package, too
Michael Tremer [Tue, 19 May 2020 11:48:48 +0000 (11:48 +0000)] 
debian: Build a source package, too

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodebian: Remove code that would have built a native package
Michael Tremer [Tue, 19 May 2020 11:47:44 +0000 (11:47 +0000)] 
debian: Remove code that would have built a native package

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodebian: Build each build in their own directory
Michael Tremer [Tue, 19 May 2020 11:47:08 +0000 (11:47 +0000)] 
debian: Build each build in their own directory

Otherwise we will have all packages in one large directory

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodebian: Build for unstable
Michael Tremer [Tue, 19 May 2020 11:44:58 +0000 (11:44 +0000)] 
debian: Build for unstable

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodebian: Do not build for riscv64
Michael Tremer [Tue, 19 May 2020 11:33:29 +0000 (11:33 +0000)] 
debian: Do not build for riscv64

The build requirements could not be satisfied

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodebian: Setup build environment only once per release
Michael Tremer [Tue, 19 May 2020 11:28:11 +0000 (11:28 +0000)] 
debian: Setup build environment only once per release

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
4 months agodebian: Drop perl package
Michael Tremer [Tue, 19 May 2020 11:27:46 +0000 (11:27 +0000)] 
debian: Drop perl package

This has runtime requirements and won't build when there is
no functional Python module

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>