Unverified Commit c13acab1 authored by mats Dufberg's avatar mats Dufberg Committed by GitHub
Browse files

Merge pull request #941 from matsduf/merge-develop-into-master

Merge develop into master (Backend)
parents b8df4d0a 74906f08
Release history for Zonemaster component Zonemaster-Backend
v8.1.0 2021-12-20 (public fix release)
[Features]
- Adds support of Spanish language (#900)
- Adds Spanish translation of error messages (#936, #910)
- Adds Danish translation of error messages (#930, #909)
- Adds Norwegian translation of error messages (#935, #912)
[Fixes]
- Corrects installation instruction for FreeBSD (#926, #925)
- Fixes Perl code to be compatible with older versions of Perl (#929)
- Fixes inconsistency of test age definition (#928)
- Fixes handling of UTF-8 in PostgreSQL. The error made testing of IDN
names in U-label format break when PostgreSQL was database backend (#932,
#931)
v8.0.0 2021-12-03 (public release version)
[Breaking changes]
......
......@@ -35,7 +35,7 @@ requires
'Starman' => 0,
'String::ShellQuote' => 0,
'Try::Tiny' => 0.12,
'Zonemaster::Engine' => 4.003,
'Zonemaster::Engine' => 4.004,
'Zonemaster::LDNS' => 2.002,
'Plack::Middleware::ReverseProxy' => 0,
'Locale::TextDomain' => 1.20,
......
......@@ -240,6 +240,7 @@ Language | Preferred language tag | Deprecated language tag
---------|------------------------|------------------
Danish | da | da_DK
English | en | en_US
Spanish | es | es_ES
Finnish | fi | fi_FI
French | fr | fr_FR
Norwegian| nb | nb_NO
......@@ -520,6 +521,8 @@ Example response:
"da_DK",
"en",
"en_US",
"es",
"es_ES",
"fi",
"fi_FI",
"fr",
......
......@@ -282,6 +282,7 @@ Language | Locale tag value | Language code | Locale value used
---------|------------------|---------------|------------------
Danish | da_DK | da | da_DK.UTF-8
English | en_US | en | en_US.UTF-8
Spanish | es_ES | es | es_ES.UTF-8
Finnish | fi_FI | fi | fi_FI.UTF-8
French | fr_FR | fr | fr_FR.UTF-8
Norwegian| nb_NO | nb | nb_NO.UTF-8
......@@ -290,7 +291,7 @@ Swedish | sv_SE | sv | sv_SE.UTF-8
Setting in the default configuration file:
```
locale = da_DK en_US fi_FI fr_FR nb_NO sv_SE
locale = da_DK en_US es_ES fi_FI fr_FR nb_NO sv_SE
```
#### Installation considerations
......
......@@ -190,7 +190,7 @@ See the [post-installation] section for post-installation matters.
Install required locales:
```sh
sudo perl -pi -e 's/^# (da_DK\.UTF-8.*|en_US\.UTF-8.*|fi_FI\.UTF-8.*|fr_FR\.UTF-8.*|nb_NO\.UTF-8.*|sv_SE\.UTF-8.*)/$1/' /etc/locale.gen
sudo perl -pi -e 's/^# (da_DK\.UTF-8.*|en_US\.UTF-8.*|es_ES\.UTF-8.*|fi_FI\.UTF-8.*|fr_FR\.UTF-8.*|nb_NO\.UTF-8.*|sv_SE\.UTF-8.*)/$1/' /etc/locale.gen
sudo locale-gen
```
......@@ -198,6 +198,7 @@ After the update, `locale -a` should at least list the following locales:
```
da_DK.utf8
en_US.utf8
es_ES.utf8
fi_FI.utf8
fr_FR.utf8
nb_NO.utf8
......@@ -541,7 +542,10 @@ sed -i '' '/[[:<:]]engine[[:>:]]/ s/=.*/= MySQL/' /usr/local/etc/zonemaster/back
Install, configure and start database engine (and Perl bindings):
```sh
pkg install -y mysql57-server p5-DBD-mysql
pkg install mysql57-server p5-DBD-mysql
```
```sh
sysrc mysql_enable="YES"
service mysql-server start
```
......@@ -668,10 +672,29 @@ sed -i '' '/[[:<:]]engine[[:>:]]/ s/=.*/= PostgreSQL/' /usr/local/etc/zonemaster
```
> **Note:** See the [backend configuration] documentation for details.
Install, configure and start database engine (and Perl bindings):
Install, configure and start database engine and Perl bindings:
```sh
pkg install p5-DBD-Pg
```
The Perl bindings library (`p5-DBD-Pg`) has a dependency to a specific version
of `postgresql-client`. Determine what version was installed:
```sh
pkg info | grep postgresql | grep client
```
If the installed client is not version `13` then adjust the following command to
install `postgresql-server` with the same version as `postgresql-client`
installed.
```sh
pkg install postgresql13-server
```
Enable daemon, initiate and start:
```sh
pkg install -y postgresql12-server p5-DBD-Pg
sysrc postgresql_enable="YES"
service postgresql initdb
service postgresql start
......
......@@ -24,7 +24,7 @@ To upgrade Zonemaster::Backend perform the following tasks:
1. stop the `zm-rpcapi` and `zm-testagent` daemons (`zm_rpcapi` and
`zm_testagent` on FreeBSD)
2. remove old files with `cpanm --uninstall Zonemaster::Backend`
3. install any new dependencies (see corresponding upgrade document)
3. install any new dependencies (see corresponding upgrade document below)
4. install the latest version from CPAN with `cpanm Zonemaster::Backend`
5. apply any remaining instructions specific to this new release
6. start the `zm-rpcapi` and `zm-testagent` daemons (`zm_rpcapi` and
......@@ -40,8 +40,8 @@ and/or install new dependencies. Such instructions are available in the upgrade
document coming with the release. See table below to refer to the right
document.
When upgrading from an older version than the previous release, apply each
upgrade instructions one after another.
*When upgrading from an older version than the previous release, apply each
upgrade instructions one after another.*
Current Zonemaster::Backend version | Link to instructions | Comments
------------------------------------|----------------------|-----------------------
......@@ -50,7 +50,18 @@ Current Zonemaster::Backend version | Link to instructions | Comments
1.1.0 ≤ version < 5.0.0 | [Upgrade to 5.0.0] |
5.0.0 ≤ version < 5.0.2 | [Upgrade to 5.0.2] | For MySQL/MariaDB only
5.0.2 ≤ version < 8.0.0 | [Upgrade to 8.0.0] |
8.0.0 | - | No special steps needed for upgrade
## 4. Find current version
The following command will report the version of Zonemaster-Backend currently
installed. If an error is report Zonemaster-Backend is not installed or not
available for the user. If so, consider tunning the command as root or with
`sudo`.
```sh
perl -E 'use Zonemaster::Backend; say $Zonemaster::Backend::VERSION;'
```
[Installation instructions]: Installation.md
[Upgrade to 1.0.3]: upgrade/upgrade_zonemaster_backend_ver_1.0.3.md
......
package Zonemaster::Backend;
our $VERSION = '8.0.0';
our $VERSION = '8.1.0';
use strict;
use warnings;
......
......@@ -260,9 +260,11 @@ sub get_test_params {
my $result;
eval {
# TODO: do we use "encode_utf8" as this was the case in PostgreSQL
# (see commit diff)
$result = decode_json( $params_json );
if ( utf8::is_utf8( $params_json ) ) {
$result = decode_json( encode_utf8( $params_json ) );
} else {
$result = decode_json( $params_json );
}
};
die Zonemaster::Backend::Error::JsonError->new( reason => "$@", data => { test_id => $test_id } )
......
......@@ -128,7 +128,7 @@ sub recent_test_hash_id {
my $dbh = $self->dbh;
my ( $recent_hash_id ) = $dbh->selectrow_array(
"SELECT hash_id FROM test_results WHERE fingerprint = ? AND test_start_time > DATETIME('now', ?)",
"SELECT hash_id FROM test_results WHERE fingerprint = ? AND creation_time > DATETIME('now', ?)",
undef, $fingerprint, "-$age_reuse_previous_test seconds"
);
......
package Zonemaster::Backend::Metrics;
use strict;
use warnings;
use Log::Any qw($log);
eval("use Net::Statsd");
......@@ -32,26 +35,26 @@ sub setup {
sub code_to_status {
my ($cls, $code) = @_;
if (defined $code) {
return %CODE_STATUS_HASH{$code};
return $CODE_STATUS_HASH{$code};
} else {
return 'RPC_SUCCESS'
return 'RPC_SUCCESS';
}
}
sub increment {
if ( $enable_metrics ) {
Net::Statsd::increment(@_)
Net::Statsd::increment(@_);
}
}
sub gauge {
if ( $enable_metrics ) {
Net::Statsd::gauge(@_)
Net::Statsd::gauge(@_);
}
}
sub timing {
if ( $enable_metrics ) {
Net::Statsd::timing(@_)
Net::Statsd::timing(@_);
}
}
......@@ -34,7 +34,7 @@ database_file = /var/lib/zonemaster/db.sqlite
#enable_add_batch_job = no
[LANGUAGE]
locale = da_DK en_US fi_FI fr_FR nb_NO sv_SE
locale = da_DK en_US es_ES fi_FI fr_FR nb_NO sv_SE
[PUBLIC PROFILES]
#example_profile_1=/example/directory/test1_profile.json
......
......@@ -2,12 +2,71 @@ msgid ""
msgstr ""
"Project-Id-Version: 1.0.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-14 11:25+0200\n"
"POT-Creation-Date: 2021-12-07 15:34+0000\n"
"PO-Revision-Date: 2021-10-14 11:25+0200\n"
"Last-Translator: mats.dufberg@iis.se\n"
"Last-Translator: haarbo@dk-hostmaster.dk\n"
"Language-Team: Zonemaster project\n"
"Language: da\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "Domain name required"
msgstr "Domænenavn påkrævet"
msgid ""
"The domain name is not a valid IDNA string and cannot be converted to an A-"
"label"
msgstr ""
"Domænenavnet er ikke en valid IDNA-streng og kan ikke konverteres til en A-label"
msgid "The domain name contains non-ascii characters and IDNA is not installed"
msgstr "Domænenavnet indeholder ikke-ascii-tegn og IDNA er ikke installeret"
msgid "The domain name character(s) are not supported"
msgstr "Domænenavnets tegn er ikke understøttet"
msgid "The domain name or label is too long"
msgstr "Domænenavnet eller labelen er for lang"
msgid "Unknown profile"
msgstr "Ukendt profil"
msgid "Invalid IP address"
msgstr "Invalid IP-adresse"
msgid "Unkown language string"
msgstr "Ukendt sprogstreng"
msgid "Language string not unique"
msgstr "Sprogstreng ikke unik"
msgid "Invalid method parameter(s)."
msgstr "Invalid metodeparametre"
msgid "Missing property"
msgstr "Manglende egenskab"
msgid ""
"Warning: Zonemaster::LDNS not compiled with libidn, cannot handle non-ASCII "
"names correctly."
msgstr "Advarsel: Zonemaster::LDNS ikke kompileret med libidn - kan ikke "
"håndtere ikke-ascii-navne korrekt"
msgid "The domain name contains a character or characters not supported"
msgstr "Domænenavnet indeholder et eller flere ikke understøttede tegn"
msgid "Invalid digest format"
msgstr "Invalid digest format"
msgid "Algorithm must be a positive integer"
msgstr "Algoritmen skal være et positivt heltal"
msgid "Digest type must be a positive integer"
msgstr "Digest type skal være et positivt heltal"
msgid "Keytag must be a positive integer"
msgstr "Keytag skal være et positivt heltal"
msgid "Invalid language tag format"
msgstr "Invalidt sprogkodeformat"
......@@ -2,12 +2,75 @@ msgid ""
msgstr ""
"Project-Id-Version: 1.0.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-14 11:25+0200\n"
"PO-Revision-Date: 2021-10-14 11:25+0200\n"
"POT-Creation-Date: 2021-12-09 15:49-0300\n"
"PO-Revision-Date: 2021-12-09 15:56-0300\n"
"Last-Translator: mats.dufberg@iis.se\n"
"Language-Team: Zonemaster project\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.0\n"
msgid "Domain name required"
msgstr "Se necesita el nombre de dominio"
msgid ""
"The domain name is not a valid IDNA string and cannot be converted to an A-"
"label"
msgstr ""
"El nombre de dominio no es válido con IDNA, por lo que no puede ser "
"convertido a una etiqueta A-label"
msgid "The domain name contains non-ascii characters and IDNA is not installed"
msgstr ""
"El nombre de dominio contiene caracteres no-ascii, e IDNA no está instalado"
msgid "The domain name character(s) are not supported"
msgstr "Los caracteres del nombre de dominio no están soportados"
msgid "The domain name or label is too long"
msgstr "El nombre de dominio o la etiqueta es muy larga"
msgid "Unknown profile"
msgstr "Perfil desconocido"
msgid "Invalid IP address"
msgstr "Dirección IP inválida"
msgid "Unkown language string"
msgstr "Descriptor de idioma desconocido"
msgid "Language string not unique"
msgstr "Descriptor de idioma no es único"
msgid "Invalid method parameter(s)."
msgstr "Parámetro(s) de método inválido."
msgid "Missing property"
msgstr "Propiedad no incluída"
msgid ""
"Warning: Zonemaster::LDNS not compiled with libidn, cannot handle non-ASCII "
"names correctly."
msgstr ""
"Advertencia: Zonemaster::LDNS no fue compilado con libidn, no se puede "
"manejar correctamente los nombres no-ASCII."
msgid "The domain name contains a character or characters not supported"
msgstr "El nombre de dominio contiene un carácter o caracteres no soportados"
msgid "Invalid digest format"
msgstr "Formato de resumen (digest) inválido"
msgid "Algorithm must be a positive integer"
msgstr "El algoritmo debe ser un entero positivo"
msgid "Digest type must be a positive integer"
msgstr "El tipo de resumen (digest) debe ser un entero positivo"
msgid "Keytag must be a positive integer"
msgstr "El tag de llave debe ser un entero positivo"
msgid "Invalid language tag format"
msgstr "Formato de descriptor de idioma inválido"
......@@ -2,12 +2,73 @@ msgid ""
msgstr ""
"Project-Id-Version: 1.0.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-10-14 11:25+0200\n"
"PO-Revision-Date: 2021-10-14 11:25+0200\n"
"Last-Translator: mats.dufberg@iis.se\n"
"POT-Creation-Date: 2021-12-08 15:14+0100\n"
"PO-Revision-Date: 2021-12-09 09:06+0100\n"
"Last-Translator: richard.persson@norid.no\n"
"Language-Team: Zonemaster project\n"
"Language: nb\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "Domain name required"
msgstr "Domenenavn påkrevd"
msgid ""
"The domain name is not a valid IDNA string and cannot be converted to an A-"
"label"
msgstr ""
"Domenenavnet er ikke en gyldig IDNA streng og kan ikke konverteres til en "
"ACE-kode"
msgid "The domain name contains non-ascii characters and IDNA is not installed"
msgstr "Domenenavnet innholder non-ascii tegn og IDNA er ikke installert"
msgid "The domain name character(s) are not supported"
msgstr "Tegn i domenenavn er ikke supportert"
msgid "The domain name or label is too long"
msgstr "Domenenavn eller label er for lang"
msgid "Unknown profile"
msgstr "Ukjent profil"
msgid "Invalid IP address"
msgstr "Ugylding IP-adresse"
msgid "Unkown language string"
msgstr "Ukjent språk-tag"
msgid "Language string not unique"
msgstr "Språk er ikke unik"
msgid "Invalid method parameter(s)."
msgstr "Ugyldig metodeparameter."
msgid "Missing property"
msgstr "Mangler verdi"
msgid ""
"Warning: Zonemaster::LDNS not compiled with libidn, cannot handle non-ASCII "
"names correctly."
msgstr ""
"Advarsel: Zonemaster::LDNS som ikke er kompilert med libidn kan ikke "
"håndtere non-ASCII navn korrekt."
msgid "The domain name contains a character or characters not supported"
msgstr "Domenenavnet innholder et ugyldig tegn"
msgid "Invalid digest format"
msgstr "Ugyldig format på digest"
msgid "Algorithm must be a positive integer"
msgstr "Algoritme må være et positivt tall"
msgid "Digest type must be a positive integer"
msgstr "Algoritme-type må være et positivt tall"
msgid "Keytag must be a positive integer"
msgstr "Keytag må være et positivt tall"
msgid "Invalid language tag format"
msgstr "Ugyldig format på språk-tag"
......@@ -16,5 +16,5 @@ number_of_processes_for_batch_testing=20
#seconds
[LANGUAGE]
locale = da_DK en_US fi_FI fr_FR nb_NO sv_SE
locale = da_DK en_US es_ES fi_FI fr_FR nb_NO sv_SE
......@@ -16,5 +16,5 @@ number_of_processes_for_batch_testing=20
#seconds
[LANGUAGE]
locale = da_DK en_US fi_FI fr_FR nb_NO sv_SE
locale = da_DK en_US es_ES fi_FI fr_FR nb_NO sv_SE
......@@ -13,5 +13,5 @@ number_of_processes_for_batch_testing=20
#seconds
[LANGUAGE]
locale = da_DK en_US fi_FI fr_FR nb_NO sv_SE
locale = da_DK en_US es_ES fi_FI fr_FR nb_NO sv_SE
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment