Compare commits

..

No commits in common. "master" and "v2.0.1" have entirely different histories.

25 changed files with 445 additions and 942 deletions

View file

@ -3,10 +3,10 @@
if test $TRAVIS_TAG
then
utils/make-package.sh pdnsmanager-${TRAVIS_TAG:1} ${TRAVIS_TAG:1}
utils/make-package.sh pdnsmanager-$TRAVIS_COMMIT $TRAVIS_COMMIT
utils/make-package.sh pdnsmanager-${TRAVIS_TAG:1}
utils/make-package.sh pdnsmanager-$TRAVIS_COMMIT
else
utils/make-package.sh pdnsmanager-$TRAVIS_COMMIT $TRAVIS_COMMIT
utils/make-package.sh pdnsmanager-$TRAVIS_COMMIT
fi
exit 0

View file

@ -1,3 +1,3 @@
#!/bin/bash
curl -F "file=@pdnsmanager-${TRAVIS_TAG:1}.tar.gz" -u "travis:$UPLOAD_PASS" "https://upload.pdnsmanager.org/?action=release&version=${TRAVIS_TAG:1}"
curl -F "file=@pdnsmanager-${TRAVIS_TAG:1}.tar.gz" -u "travis:$UPLOAD_PASS" 'https://upload.pdnsmanager.org/?action=release'

View file

@ -1,3 +1,3 @@
#!/bin/bash
curl -F "file=@pdnsmanager-$TRAVIS_COMMIT.tar.gz" -u "travis:$UPLOAD_PASS" "https://upload.pdnsmanager.org/?action=snapshot&version=$TRAVIS_COMMIT"
curl -F "file=@pdnsmanager-$TRAVIS_COMMIT.tar.gz" -u "travis:$UPLOAD_PASS" 'https://upload.pdnsmanager.org/?action=snapshot'

View file

@ -2,7 +2,8 @@
[PDNS Manager](https://pdnsmanager.org) is a simple yet powerful free administration tool for the Powerdns authoritative nameserver. It supports master, native and slave zones.
PDNS Manager was developed from scratch to achieve a user-friendly and pretty looking interface.
PNDS Manager was developed from scratch to achieve a user-friendly
and pretty looking interface.
PDNS Manager also features a powerful API to set records programatically.
This can be used e.g. for a dynamic DNS service, but also to obtain certificates from [Let's Encrypt](https://letsencrypt.org/) via the dns-01 challenge.

File diff suppressed because it is too large Load diff

View file

@ -31,14 +31,14 @@ $defaultConfig = [
'allowedTypes' => [
'A', 'A6', 'AAAA', 'AFSDB', 'ALIAS', 'CAA', 'CDNSKEY', 'CDS', 'CERT', 'CNAME', 'DHCID',
'DLV', 'DNAME', 'DNSKEY', 'DS', 'EUI48', 'EUI64', 'HINFO',
'IPSECKEY', 'KEY', 'KX', 'LOC', 'LUA', 'MAILA', 'MAILB', 'MINFO', 'MR',
'IPSECKEY', 'KEY', 'KX', 'LOC', 'MAILA', 'MAILB', 'MINFO', 'MR',
'MX', 'NAPTR', 'NS', 'NSEC', 'NSEC3', 'NSEC3PARAM', 'OPENPGPKEY',
'OPT', 'PTR', 'RKEY', 'RP', 'RRSIG', 'SIG', 'SPF',
'SRV', 'TKEY', 'SSHFP', 'TLSA', 'TSIG', 'TXT', 'WKS', 'MBOXFW', 'URL'
]
],
'proxys' => [],
'dbVersion' => 7
'dbVersion' => 6
];
if (file_exists('../config/ConfigOverride.php')) {

View file

@ -38,8 +38,9 @@ class ClientIp
$ip = $_SERVER['REMOTE_ADDR'];
for ($i = count($parts) - 1; $i >= 0; $i--) {
if (!in_array($parts[$i], $proxys)) {
$ip = $parts[$i];
if (in_array($parts[$i], $proxys) && $i > 0) {
$ip = $parts[$i - 1];
} else {
break;
}
}

View file

@ -283,12 +283,12 @@ class Users
}
if ($record['backend'] === 'native' && $name !== null) {
//Check if user with new name already exists
//Check if user already exists
$query = $this->db->prepare('SELECT id FROM users WHERE name=:name AND backend=\'native\'');
$query->bindValue(':name', $name);
$query->execute();
$recordTest = $query->fetch();
if ($recordTest !== false && intval($recordTest['id']) !== $userId) {
$record = $query->fetch();
if ($record !== false && intval($record['id']) !== $userId) {
throw new \Exceptions\AlreadyExistentException();
}
}

View file

@ -1,100 +0,0 @@
<?php
namespace Plugins\Sessionstorage;
require '../vendor/autoload.php';
/**
* Implements a session storage plugin for using PHPs APCu.
*/
class memcached implements InterfaceSessionstorage
{
/** @var \Monolog\Logger */
private $logger;
/** @var \Memcached */
private $memcached;
/**
* Construct the object
*
* @param $logger Monolog logger instance for error handling
* @param $config The configuration for the Plugin if any was provided
*/
public function __construct(\Monolog\Logger $logger, array $config = null)
{
$this->logger = $logger;
if (!class_exists('Memcached')) {
$this->logger->critical('PHP Memcached extension is not available but configured as session storage backend exiting now');
exit();
}
$this->memcached = new \Memcached();
if (!array_key_exists('host', $config) || !array_key_exists('port', $config)) {
$this->logger->critical('Memcached session configuration missing host or port value');
exit();
}
$this->memcached->addServer($config['host'], $config['port']);
}
/**
* Save new entry.
*
* @param $key The key for the entry
* @param $value The value for the entry
* @param $ttl The time (in s) for which this item should be available
*/
public function set(string $key, string $value, int $ttl) : void
{
$this->logger->debug('Storing data to Memcached', ['key' => $key, 'value' => $value, 'ttl' => $ttl]);
$this->memcached->set($key, $value, $ttl);
}
/**
* Queries the existence of some entry.
*
* @param $key The key to query
*/
public function exists(string $key) : bool
{
$this->logger->debug('Checking for Memcached key existence', ['key' => $key]);
$this->memcached->get($key);
return \Memcached::RES_NOTFOUND !== $this->memcached->getResultCode();
}
/**
* Get the value for a given key. This should also reset the ttl to the given value.
*
* @param $key The key for the entry to get
* @param $ttl The new ttl for the entry
*/
public function get(string $key, int $ttl) : string
{
$this->logger->debug('Getting data from Memcached', ['key' => $key, 'ttl' => $ttl]);
$value = $this->memcached->get($key);
if ($value == false) {
$this->logger->error('Non existing key was queried from Memcached', ['key' => $key]);
throw new \InvalidArgumentException('The requested key was not in the database!');
}
$this->memcached->touch($key, $ttl);
return $value;
}
/**
* Delete the value for a given key.
*
* @param $key The key to delete
*/
public function delete(string $key) : void
{
$this->logger->debug('Deleting key from Memcached', ['key' => $key]);
$this->memcached->delete($key);
}
}

View file

@ -1,10 +0,0 @@
ALTER TABLE `remote`
DROP FOREIGN KEY remote_ibfk_1;
ALTER TABLE records MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
ALTER TABLE remote MODIFY record BIGINT;
ALTER TABLE `remote`
ADD CONSTRAINT remote_ibfk_1 FOREIGN KEY(record) REFERENCES `records`(id);
UPDATE options SET value=7 WHERE name='schema_version';

View file

@ -80,7 +80,7 @@ CREATE TABLE `permissions` (
--
CREATE TABLE `records` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`id` int(11) NOT NULL AUTO_INCREMENT,
`domain_id` int(11) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`type` varchar(10) DEFAULT NULL,
@ -102,7 +102,7 @@ CREATE TABLE `records` (
CREATE TABLE `remote` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`record` bigint(20) NOT NULL,
`record` int(11) NOT NULL,
`description` varchar(255) NOT NULL,
`type` varchar(20) NOT NULL,
`security` varchar(2000) NOT NULL,
@ -169,7 +169,7 @@ CREATE TABLE `options` (
--
INSERT INTO `options` (`name`, `value`) VALUES
('schema_version', '7');
('schema_version', '5');
-- --------------------------------------------------------

View file

@ -3,15 +3,13 @@
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 25. Dez 2019 um 23:22
-- Server-Version: 5.7.23-0ubuntu0.16.04.1
-- PHP-Version: 7.0.30-0ubuntu0.16.04.1
-- Generation Time: Mar 31, 2018 at 12:51 PM
-- Server version: 5.7.21-0ubuntu0.16.04.1
-- PHP Version: 7.0.28-0ubuntu0.16.04.1
SET FOREIGN_KEY_CHECKS=0;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
DROP TABLE IF EXISTS `comments`, `cryptokeys`, `domainmetadata`, `domains`, `options`, `permissions`, `records`, `remote`, `supermasters`, `tsigkeys`, `users`;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@ -19,13 +17,13 @@ DROP TABLE IF EXISTS `comments`, `cryptokeys`, `domainmetadata`, `domains`, `opt
/*!40101 SET NAMES utf8mb4 */;
--
-- Datenbank: `pdnsnew`
-- Database: `pdnsnew`
--
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `comments`
-- Table structure for table `comments`
--
DROP TABLE IF EXISTS `comments`;
@ -42,7 +40,7 @@ CREATE TABLE `comments` (
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `cryptokeys`
-- Table structure for table `cryptokeys`
--
DROP TABLE IF EXISTS `cryptokeys`;
@ -57,7 +55,7 @@ CREATE TABLE `cryptokeys` (
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `domainmetadata`
-- Table structure for table `domainmetadata`
--
DROP TABLE IF EXISTS `domainmetadata`;
@ -71,7 +69,7 @@ CREATE TABLE `domainmetadata` (
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `domains`
-- Table structure for table `domains`
--
DROP TABLE IF EXISTS `domains`;
@ -86,7 +84,7 @@ CREATE TABLE `domains` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Daten für Tabelle `domains`
-- Dumping data for table `domains`
--
INSERT INTO `domains` (`id`, `name`, `master`, `last_check`, `type`, `notified_serial`, `account`) VALUES
@ -99,26 +97,7 @@ INSERT INTO `domains` (`id`, `name`, `master`, `last_check`, `type`, `notified_s
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `options`
--
DROP TABLE IF EXISTS `options`;
CREATE TABLE `options` (
`name` varchar(255) NOT NULL,
`value` varchar(2000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Daten für Tabelle `options`
--
INSERT INTO `options` (`name`, `value`) VALUES
('schema_version', '7');
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `permissions`
-- Table structure for table `permissions`
--
DROP TABLE IF EXISTS `permissions`;
@ -128,7 +107,7 @@ CREATE TABLE `permissions` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Daten für Tabelle `permissions`
-- Dumping data for table `permissions`
--
INSERT INTO `permissions` (`domain_id`, `user_id`) VALUES
@ -138,7 +117,7 @@ INSERT INTO `permissions` (`domain_id`, `user_id`) VALUES
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `records`
-- Table structure for table `records`
--
DROP TABLE IF EXISTS `records`;
@ -157,7 +136,7 @@ CREATE TABLE `records` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Daten für Tabelle `records`
-- Dumping data for table `records`
--
INSERT INTO `records` (`id`, `domain_id`, `name`, `type`, `content`, `ttl`, `prio`, `change_date`, `disabled`, `ordername`, `auth`) VALUES
@ -170,13 +149,13 @@ INSERT INTO `records` (`id`, `domain_id`, `name`, `type`, `content`, `ttl`, `pri
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `remote`
-- Table structure for table `remote`
--
DROP TABLE IF EXISTS `remote`;
CREATE TABLE `remote` (
`id` int(11) NOT NULL,
`record` bigint(20) DEFAULT NULL,
`record` int(11) NOT NULL,
`description` varchar(255) NOT NULL,
`type` varchar(20) NOT NULL,
`security` varchar(2000) NOT NULL,
@ -184,7 +163,7 @@ CREATE TABLE `remote` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Daten für Tabelle `remote`
-- Dumping data for table `remote`
--
INSERT INTO `remote` (`id`, `record`, `description`, `type`, `security`, `nonce`) VALUES
@ -195,7 +174,7 @@ INSERT INTO `remote` (`id`, `record`, `description`, `type`, `security`, `nonce`
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `supermasters`
-- Table structure for table `supermasters`
--
DROP TABLE IF EXISTS `supermasters`;
@ -208,7 +187,7 @@ CREATE TABLE `supermasters` (
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `tsigkeys`
-- Table structure for table `tsigkeys`
--
DROP TABLE IF EXISTS `tsigkeys`;
@ -222,7 +201,26 @@ CREATE TABLE `tsigkeys` (
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `users`
-- Table structure for table `options`
--
DROP TABLE IF EXISTS `options`;
CREATE TABLE `options` (
`name` varchar(255) NOT NULL,
`value` varchar(2000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `options`
--
INSERT INTO `options` (`name`, `value`) VALUES
('schema_version', '5');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
@ -235,7 +233,7 @@ CREATE TABLE `users` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Daten für Tabelle `users`
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `backend`, `type`, `password`) VALUES
@ -244,11 +242,11 @@ INSERT INTO `users` (`id`, `name`, `backend`, `type`, `password`) VALUES
(3, 'configuser', 'config', 'user', NULL);
--
-- Indizes der exportierten Tabellen
-- Indexes for dumped tables
--
--
-- Indizes für die Tabelle `comments`
-- Indexes for table `comments`
--
ALTER TABLE `comments`
ADD PRIMARY KEY (`id`),
@ -256,40 +254,34 @@ ALTER TABLE `comments`
ADD KEY `comments_order_idx` (`domain_id`,`modified_at`);
--
-- Indizes für die Tabelle `cryptokeys`
-- Indexes for table `cryptokeys`
--
ALTER TABLE `cryptokeys`
ADD PRIMARY KEY (`id`),
ADD KEY `domainidindex` (`domain_id`);
--
-- Indizes für die Tabelle `domainmetadata`
-- Indexes for table `domainmetadata`
--
ALTER TABLE `domainmetadata`
ADD PRIMARY KEY (`id`),
ADD KEY `domainmetadata_idx` (`domain_id`,`kind`);
--
-- Indizes für die Tabelle `domains`
-- Indexes for table `domains`
--
ALTER TABLE `domains`
ADD PRIMARY KEY (`id`);
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `name_index` (`name`);
--
-- Indizes für die Tabelle `options`
--
ALTER TABLE `options`
ADD PRIMARY KEY (`name`);
--
-- Indizes für die Tabelle `permissions`
-- Indexes for table `permissions`
--
ALTER TABLE `permissions`
ADD PRIMARY KEY (`domain_id`,`user_id`),
ADD KEY `permissions_ibfk_2` (`user_id`);
ADD PRIMARY KEY (`user_id`,`domain_id`);
--
-- Indizes für die Tabelle `records`
-- Indexes for table `records`
--
ALTER TABLE `records`
ADD PRIMARY KEY (`id`),
@ -298,99 +290,74 @@ ALTER TABLE `records`
ADD KEY `ordername` (`ordername`);
--
-- Indizes für die Tabelle `remote`
-- Indexes for table `remote`
--
ALTER TABLE `remote`
ADD PRIMARY KEY (`id`),
ADD KEY `remote_ibfk_1` (`record`);
ADD PRIMARY KEY (`id`);
--
-- Indizes für die Tabelle `supermasters`
-- Indexes for table `supermasters`
--
ALTER TABLE `supermasters`
ADD PRIMARY KEY (`ip`,`nameserver`);
--
-- Indizes für die Tabelle `tsigkeys`
-- Indexes for table `tsigkeys`
--
ALTER TABLE `tsigkeys`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `namealgoindex` (`name`,`algorithm`);
--
-- Indizes für die Tabelle `users`
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT für exportierte Tabellen
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT für Tabelle `comments`
-- AUTO_INCREMENT for table `comments`
--
ALTER TABLE `comments`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `cryptokeys`
-- AUTO_INCREMENT for table `cryptokeys`
--
ALTER TABLE `cryptokeys`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `domainmetadata`
-- AUTO_INCREMENT for table `domainmetadata`
--
ALTER TABLE `domainmetadata`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `domains`
-- AUTO_INCREMENT for table `domains`
--
ALTER TABLE `domains`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT für Tabelle `records`
-- AUTO_INCREMENT for table `records`
--
ALTER TABLE `records`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT für Tabelle `remote`
-- AUTO_INCREMENT for table `remote`
--
ALTER TABLE `remote`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT für Tabelle `tsigkeys`
-- AUTO_INCREMENT for table `tsigkeys`
--
ALTER TABLE `tsigkeys`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT für Tabelle `users`
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- Constraints der exportierten Tabellen
--
--
-- Constraints der Tabelle `permissions`
--
ALTER TABLE `permissions`
ADD CONSTRAINT `permissions_ibfk_1` FOREIGN KEY (`domain_id`) REFERENCES `domains` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `permissions_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Constraints der Tabelle `records`
--
ALTER TABLE `records`
ADD CONSTRAINT `records_ibfk_1` FOREIGN KEY (`domain_id`) REFERENCES `domains` (`id`) ON DELETE CASCADE;
--
-- Constraints der Tabelle `remote`
--
ALTER TABLE `remote`
ADD CONSTRAINT `remote_ibfk_1` FOREIGN KEY (`record`) REFERENCES `records` (`id`);
SET FOREIGN_KEY_CHECKS=1;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

View file

@ -10,12 +10,12 @@
"integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y="
},
"axios": {
"version": "0.18.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.18.1.tgz",
"integrity": "sha512-0BfJq4NSfQXd+SkFdrvFbG7addhYSBA2mQwISr46pD6E5iqkWg02RAs8vyTT/j0RTnoYmeXauBuSv1qKwR179g==",
"version": "0.18.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz",
"integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=",
"requires": {
"follow-redirects": "1.5.10",
"is-buffer": "^2.0.2"
"follow-redirects": "1.4.1",
"is-buffer": "1.1.6"
}
},
"cartesian-product": {
@ -32,17 +32,17 @@
}
},
"follow-redirects": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
"integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.4.1.tgz",
"integrity": "sha512-uxYePVPogtya1ktGnAAXOacnbIuRMB4dkvqeNz2qTtTQsuzSfbDolV+wMMKxAmCx0bLgAKLbBOkjItMbbkR1vg==",
"requires": {
"debug": "=3.1.0"
"debug": "3.1.0"
}
},
"is-buffer": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz",
"integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A=="
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
},
"ms": {
"version": "2.0.0",

View file

@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "Dependencies for pdnsmanager test",
"dependencies": {
"axios": "^0.18.1",
"axios": "^0.18.0",
"cartesian-product": "^2.1.2",
"node-rsa": "^0.4.2"
}

View file

@ -41,6 +41,6 @@ test.run(async function () {
});
assert.equal(res.status, 200);
assert.equal(res.data, { ip: '1.2.3.4' }, 'X-Forwarded-For Test 3');
assert.equal(res.data, { ip: '127.0.0.1' }, 'X-Forwarded-For Test 3');
});
});

View file

@ -86,34 +86,12 @@ test.run(async function () {
assert.equal(res.data, { id: 4, name: 'newadmin', type: 'admin', native: true }, 'New user should not change by noop update.');
//Test user update
var res = await req({
url: '/users/4',
method: 'put',
data: {
name: 'foo1',
password: 'bar',
type: 'user'
}
});
assert.equal(res.status, 204, 'Update should succeed.');
//Test if updated user can log in
var res = await req({
url: '/sessions',
method: 'post',
data: {
username: 'foo1',
password: 'bar'
}
});
assert.equal(res.status, 201, 'Login with updated user should succeed.');
//Test user update without password
var res = await req({
url: '/users/4',
method: 'put',
data: {
name: 'foo',
password: 'bar',
type: 'user'
}
});

View file

@ -669,7 +669,6 @@
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz",
"integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==",
"dev": true,
"optional": true,
"requires": {
"es6-promisify": "5.0.0"
}
@ -703,7 +702,6 @@
"resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
"integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=",
"dev": true,
"optional": true,
"requires": {
"kind-of": "3.2.2",
"longest": "1.0.1",
@ -715,7 +713,6 @@
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
"integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
"dev": true,
"optional": true,
"requires": {
"is-buffer": "1.1.6"
}
@ -1053,27 +1050,12 @@
"dev": true
},
"axios": {
"version": "0.18.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.18.1.tgz",
"integrity": "sha512-0BfJq4NSfQXd+SkFdrvFbG7addhYSBA2mQwISr46pD6E5iqkWg02RAs8vyTT/j0RTnoYmeXauBuSv1qKwR179g==",
"version": "0.18.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz",
"integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=",
"requires": {
"follow-redirects": "1.5.10",
"is-buffer": "^2.0.2"
},
"dependencies": {
"follow-redirects": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
"integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
"requires": {
"debug": "=3.1.0"
}
},
"is-buffer": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz",
"integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A=="
}
"follow-redirects": "1.5.7",
"is-buffer": "1.1.6"
}
},
"babel-code-frame": {
@ -1486,7 +1468,6 @@
"resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz",
"integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=",
"dev": true,
"optional": true,
"requires": {
"hoek": "2.16.3"
}
@ -1671,8 +1652,7 @@
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/buffer-more-ints/-/buffer-more-ints-0.0.2.tgz",
"integrity": "sha1-JrOIXRD6E9t/wBquOquHAZngEkw=",
"dev": true,
"optional": true
"dev": true
},
"buffer-xor": {
"version": "1.0.3",
@ -3044,15 +3024,13 @@
"version": "4.2.4",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz",
"integrity": "sha512-/NdNZVJg+uZgtm9eS3O6lrOLYmQag2DjdEXuPaHlZ6RuVqgqaVZfgYCepEIKsLqwdQArOPtC3XzRLqGGfT8KQQ==",
"dev": true,
"optional": true
"dev": true
},
"es6-promisify": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
"integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=",
"dev": true,
"optional": true,
"requires": {
"es6-promise": "4.2.4"
}
@ -3677,7 +3655,6 @@
"version": "1.5.7",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.7.tgz",
"integrity": "sha512-NONJVIFiX7Z8k2WxfqBjtwqMifx7X42ORLFrOZ2LTKGj71G3C0kfdyTqGqr8fx5zSX6Foo/D95dgGWbPUiwnew==",
"dev": true,
"requires": {
"debug": "3.1.0"
}
@ -3797,8 +3774,7 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"aproba": {
"version": "1.2.0",
@ -3819,14 +3795,12 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "1.0.0",
"concat-map": "0.0.1"
@ -3841,20 +3815,17 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"core-util-is": {
"version": "1.0.2",
@ -3971,8 +3942,7 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"ini": {
"version": "1.3.5",
@ -3984,7 +3954,6 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "1.0.1"
}
@ -3999,7 +3968,6 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "1.1.11"
}
@ -4007,14 +3975,12 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "5.1.1",
"yallist": "3.0.2"
@ -4033,7 +3999,6 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -4114,8 +4079,7 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"object-assign": {
"version": "4.1.1",
@ -4127,7 +4091,6 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1.0.2"
}
@ -4213,8 +4176,7 @@
"safe-buffer": {
"version": "5.1.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"safer-buffer": {
"version": "2.1.2",
@ -4250,7 +4212,6 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "1.1.0",
"is-fullwidth-code-point": "1.0.0",
@ -4270,7 +4231,6 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "2.1.1"
}
@ -4314,14 +4274,12 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"yallist": {
"version": "3.0.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
}
}
},
@ -4330,7 +4288,6 @@
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz",
"integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=",
"dev": true,
"optional": true,
"requires": {
"graceful-fs": "4.1.11",
"inherits": "2.0.3",
@ -4833,8 +4790,7 @@
"version": "2.16.3",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz",
"integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=",
"dev": true,
"optional": true
"dev": true
},
"homedir-polyfill": {
"version": "1.0.1",
@ -5000,7 +4956,6 @@
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz",
"integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==",
"dev": true,
"optional": true,
"requires": {
"agent-base": "4.2.1",
"debug": "3.1.0"
@ -5034,7 +4989,6 @@
"resolved": "https://registry.npmjs.org/httpntlm/-/httpntlm-1.6.1.tgz",
"integrity": "sha1-rQFScUOi6Hc8+uapb1hla7UqNLI=",
"dev": true,
"optional": true,
"requires": {
"httpreq": "0.4.24",
"underscore": "1.7.0"
@ -5044,8 +4998,7 @@
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/httpreq/-/httpreq-0.4.24.tgz",
"integrity": "sha1-QzX/2CzZaWaKOUZckprGHWOTYn8=",
"dev": true,
"optional": true
"dev": true
},
"https-browserify": {
"version": "1.0.0",
@ -5058,7 +5011,6 @@
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz",
"integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==",
"dev": true,
"optional": true,
"requires": {
"agent-base": "4.2.1",
"debug": "3.1.0"
@ -5254,8 +5206,7 @@
"is-buffer": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==",
"dev": true
"integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
},
"is-builtin-module": {
"version": "1.0.0",
@ -6067,15 +6018,13 @@
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/libbase64/-/libbase64-0.1.0.tgz",
"integrity": "sha1-YjUag5VjrF/1vSbxL2Dpgwu3UeY=",
"dev": true,
"optional": true
"dev": true
},
"libmime": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/libmime/-/libmime-3.0.0.tgz",
"integrity": "sha1-UaGp50SOy9Ms2lRCFnW7IbwJPaY=",
"dev": true,
"optional": true,
"requires": {
"iconv-lite": "0.4.15",
"libbase64": "0.1.0",
@ -6086,8 +6035,7 @@
"version": "0.4.15",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.15.tgz",
"integrity": "sha1-/iZaIYrGpXz+hUkn6dBMGYJe3es=",
"dev": true,
"optional": true
"dev": true
}
}
},
@ -6095,8 +6043,7 @@
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/libqp/-/libqp-1.1.0.tgz",
"integrity": "sha1-9ebgatdLeU+1tbZpiL9yjvHe2+g=",
"dev": true,
"optional": true
"dev": true
},
"license-webpack-plugin": {
"version": "1.4.0",
@ -6439,8 +6386,7 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
"integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=",
"dev": true,
"optional": true
"dev": true
},
"loose-envify": {
"version": "1.4.0",
@ -7151,15 +7097,13 @@
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/nodemailer-fetch/-/nodemailer-fetch-1.6.0.tgz",
"integrity": "sha1-ecSQihwPXzdbc/6IjamCj23JY6Q=",
"dev": true,
"optional": true
"dev": true
},
"nodemailer-shared": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/nodemailer-shared/-/nodemailer-shared-1.1.0.tgz",
"integrity": "sha1-z1mU4v0mjQD1zw+nZ6CBae2wfsA=",
"dev": true,
"optional": true,
"requires": {
"nodemailer-fetch": "1.6.0"
}
@ -7192,8 +7136,7 @@
"version": "0.1.10",
"resolved": "https://registry.npmjs.org/nodemailer-wellknown/-/nodemailer-wellknown-0.1.10.tgz",
"integrity": "sha1-WG24EB2zDLRDjrVGc3pBqtDPE9U=",
"dev": true,
"optional": true
"dev": true
},
"nopt": {
"version": "3.0.6",
@ -9246,7 +9189,6 @@
"resolved": "https://registry.npmjs.org/smtp-connection/-/smtp-connection-2.12.0.tgz",
"integrity": "sha1-1275EnyyPCJZ7bHoNJwujV4tdME=",
"dev": true,
"optional": true,
"requires": {
"httpntlm": "1.6.1",
"nodemailer-shared": "1.1.0"
@ -10415,8 +10357,7 @@
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz",
"integrity": "sha1-a7rwh3UA02vjTsqlhODbn+8DUgk=",
"dev": true,
"optional": true
"dev": true
},
"union-value": {
"version": "1.0.0",

View file

@ -21,7 +21,7 @@
"@angular/platform-browser": "6.1.4",
"@angular/platform-browser-dynamic": "6.1.4",
"@angular/router": "6.1.4",
"axios": "^0.18.1",
"axios": "^0.18.0",
"bootstrap": "^4.1.3",
"core-js": "^2.5.7",
"font-awesome": "^4.7.0",

View file

@ -62,7 +62,7 @@ export class DomainsComponent implements OnInit {
try {
await this.modal.showMessage(new ModalOptionsDatatype({
heading: 'Confirm deletion',
body: 'Are you sure you want to delete ' + domain.name + '?',
body: 'Are you shure you want to delete ' + domain.name + '?',
acceptText: 'Delete',
dismisText: 'Cancel',
acceptClass: 'danger'

View file

@ -88,7 +88,7 @@ export class EditAuthLineComponent implements OnInit, OnChanges {
try {
await this.modal.showMessage(new ModalOptionsDatatype({
heading: 'Confirm deletion',
body: 'Are you sure you want to delete the ' + this.inputType.value +
body: 'Are you shure you want to delete the ' + this.inputType.value +
' record ' + this.fullName() + ' with content ' + this.inputContent.value + '?',
acceptText: 'Delete',
dismisText: 'Cancel',

View file

@ -145,7 +145,7 @@ export class EditCredentialsComponent implements OnInit {
try {
await this.modal.showMessage(new ModalOptionsDatatype({
heading: 'Confirm deletion',
body: 'Are you sure you want to delete the credential ' + credential.description + '?',
body: 'Are you shure you want to delete the credential ' + credential.description + '?',
acceptText: 'Delete',
dismisText: 'Cancel',
acceptClass: 'danger'

View file

@ -58,7 +58,7 @@ export class SetupComponent implements OnInit {
} catch (e) {
switch (e.response.status) {
case 404:
this.errorMessage = 'The backend seems to be misconfigured or the application has a config file already.';
this.errorMessage = 'The application has already been setup or the backend is misconfigured.';
break;
case 500:
this.errorMessage = e.response.data.error;

View file

@ -62,7 +62,7 @@ export class UsersComponent implements OnInit {
try {
await this.modal.showMessage(new ModalOptionsDatatype({
heading: 'Confirm deletion',
body: 'Are you sure you want to delete ' + user.name + '?',
body: 'Are you shure you want to delete ' + user.name + '?',
acceptText: 'Delete',
dismisText: 'Cancel',
acceptClass: 'danger'

View file

@ -57,7 +57,7 @@ export class StateService {
private _recordTypes = [
'A', 'A6', 'AAAA', 'AFSDB', 'ALIAS', 'CAA', 'CDNSKEY', 'CDS', 'CERT', 'CNAME', 'DHCID',
'DLV', 'DNAME', 'DNSKEY', 'DS', 'EUI48', 'EUI64', 'HINFO',
'IPSECKEY', 'KEY', 'KX', 'LOC', 'LUA', 'MAILA', 'MAILB', 'MINFO', 'MR',
'IPSECKEY', 'KEY', 'KX', 'LOC', 'MAILA', 'MAILB', 'MINFO', 'MR',
'MX', 'NAPTR', 'NS', 'NSEC', 'NSEC3', 'NSEC3PARAM', 'OPENPGPKEY',
'OPT', 'PTR', 'RKEY', 'RP', 'RRSIG', 'SIG', 'SPF',
'SRV', 'TKEY', 'SSHFP', 'TLSA', 'TSIG', 'TXT', 'WKS', 'MBOXFW', 'URL'

View file

@ -21,13 +21,6 @@ cd ..
cp LICENSE "$1"
cp README.md "$1"
# Add version info
cat << EOF > "$1"/version.json
{
"version": "$2"
}
EOF
# Create archive
tar -czf "$1".tar.gz "$1"