mirror of
https://github.com/VinylDNS/vinyldns
synced 2025-08-22 10:10:12 +00:00
Fix tests
Update query sorting for recordset search Update `How to Search` instructions
This commit is contained in:
parent
c49b74e1aa
commit
9ffef4aa80
@ -441,16 +441,7 @@ class MySqlRecordSetCacheRepositoryIntegrationSpec
|
|||||||
"return applicable recordsets in descending order when recordNameFilter is given and name sort is descending" in {
|
"return applicable recordsets in descending order when recordNameFilter is given and name sort is descending" in {
|
||||||
val existing = insert(okZone, 10).map(_.recordSet)
|
val existing = insert(okZone, 10).map(_.recordSet)
|
||||||
val found = recordSetCacheRepo
|
val found = recordSetCacheRepo
|
||||||
.listRecordSetData(None, None, None, Some("*.ok*"), None, None, NameSort.DESC)
|
.listRecordSetData(None, None, None, Some("*.recordsets."), None, None, NameSort.DESC)
|
||||||
.unsafeRunSync()
|
|
||||||
found.recordSets should contain theSameElementsAs existing
|
|
||||||
.map(r => recordSetDataWithFQDN(r, okZone))
|
|
||||||
.reverse
|
|
||||||
}
|
|
||||||
"return applicable recordsets in descending order when recordNameFilter supports full-text" in {
|
|
||||||
val existing = insert(okZone, 10).map(_.recordSet)
|
|
||||||
val found = recordSetCacheRepo
|
|
||||||
.listRecordSetData(None, None, None, Some("apply*test"), None, None, NameSort.DESC)
|
|
||||||
.unsafeRunSync()
|
.unsafeRunSync()
|
||||||
found.recordSets should contain theSameElementsAs existing
|
found.recordSets should contain theSameElementsAs existing
|
||||||
.map(r => recordSetDataWithFQDN(r, okZone))
|
.map(r => recordSetDataWithFQDN(r, okZone))
|
||||||
|
@ -314,11 +314,11 @@ class MySqlRecordSetCacheRepository
|
|||||||
)
|
)
|
||||||
case (false, NameSort.ASC) =>
|
case (false, NameSort.ASC) =>
|
||||||
pagingKey.as(
|
pagingKey.as(
|
||||||
sqls"((recordset_data.fqdn >= ${pagingKey.map(pk => pk.recordName)} AND recordset.type > ${pagingKey.map(pk => pk.recordType)}) OR recordset_data.fqdn > ${pagingKey.map(pk => pk.recordName)})"
|
sqls"((recordset.fqdn >= ${pagingKey.map(pk => pk.recordName)} AND recordset.type > ${pagingKey.map(pk => pk.recordType)}) OR recordset.fqdn > ${pagingKey.map(pk => pk.recordName)})"
|
||||||
)
|
)
|
||||||
case (false, NameSort.DESC) =>
|
case (false, NameSort.DESC) =>
|
||||||
pagingKey.as(
|
pagingKey.as(
|
||||||
sqls"((recordset_data.fqdn <= ${pagingKey.map(pk => pk.recordName)} AND recordset.type > ${pagingKey.map(pk => pk.recordType)}) OR recordset_data.fqdn < ${pagingKey.map(pk => pk.recordName)})"
|
sqls"((recordset.fqdn <= ${pagingKey.map(pk => pk.recordName)} AND recordset.type > ${pagingKey.map(pk => pk.recordType)}) OR recordset.fqdn < ${pagingKey.map(pk => pk.recordName)})"
|
||||||
)
|
)
|
||||||
case _ =>
|
case _ =>
|
||||||
pagingKey.as(
|
pagingKey.as(
|
||||||
@ -338,10 +338,10 @@ class MySqlRecordSetCacheRepository
|
|||||||
(zoneAndNameFilters ++ sortBy ++ typeFilter ++ ownerGroupFilter).toList
|
(zoneAndNameFilters ++ sortBy ++ typeFilter ++ ownerGroupFilter).toList
|
||||||
|
|
||||||
val qualifiers = if (nameSort == ASC) {
|
val qualifiers = if (nameSort == ASC) {
|
||||||
sqls"ORDER BY recordset_data.fqdn ASC, recordset.type ASC "
|
sqls"ORDER BY recordset.fqdn ASC, recordset.type ASC "
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sqls"ORDER BY recordset_data.fqdn DESC, recordset.type ASC "
|
sqls"ORDER BY recordset.fqdn DESC, recordset.type ASC "
|
||||||
}
|
}
|
||||||
|
|
||||||
val recordLimit = maxPlusOne match {
|
val recordLimit = maxPlusOne match {
|
||||||
@ -358,7 +358,6 @@ class MySqlRecordSetCacheRepository
|
|||||||
|
|
||||||
// Join query for data column from recordset table
|
// Join query for data column from recordset table
|
||||||
val recordsetDataJoin = sqls"RIGHT JOIN recordset ON recordset.id=recordset_data.recordset_id "
|
val recordsetDataJoin = sqls"RIGHT JOIN recordset ON recordset.id=recordset_data.recordset_id "
|
||||||
|
|
||||||
val recordsetDataJoinQuery = initialQuery.append(recordsetDataJoin)
|
val recordsetDataJoinQuery = initialQuery.append(recordsetDataJoin)
|
||||||
|
|
||||||
val appendOpts = if (opts.nonEmpty) {
|
val appendOpts = if (opts.nonEmpty) {
|
||||||
|
@ -39,25 +39,32 @@
|
|||||||
<div class="collapse" id="collapseInstruction">
|
<div class="collapse" id="collapseInstruction">
|
||||||
<div class="well">
|
<div class="well">
|
||||||
<p>The search is based on the fully qualified domain name (FQDN) of a record. You can do an exact match search or fuzzy match to lookup records.</p>
|
<p>The search is based on the fully qualified domain name (FQDN) of a record. You can do an exact match search or fuzzy match to lookup records.</p>
|
||||||
<p>A minimum of two alphanumeric characters for the record name is <i>required</i> for searching.</p>
|
<p>
|
||||||
<p><strong>Examples:</strong>
|
A minimum of <strong>two alphanumeric characters</strong> for the record name is <em>required</em> for searching. Also,
|
||||||
<ul>
|
a search term cannot <strong>both start and end</strong> with a wildcard character.
|
||||||
<li>test.example.com. -> test.example.com.</li>
|
</p>
|
||||||
<li>test.example.com -> test.example.com.</li>
|
<p>
|
||||||
<li>test.* -> test.example.com., test.example.net., test.net.</li>
|
<strong>Examples:</strong>
|
||||||
<li>*example.com -> one.example.com., test.example.com.</li>
|
<ul>
|
||||||
<li>*example* -> one.example.com., test.example.com., test.example.net.</li>
|
<li>test.example.com. -> test.example.com.</li>
|
||||||
</ul>
|
<li>test.example.com -> test.example.com.</li>
|
||||||
|
<li>test.* -> test.example.com., test.example.net., test.net.</li>
|
||||||
|
<li>*example.com -> one.example.com., test.example.com.</li>
|
||||||
|
<li>*example* -> <strong>INVALID</strong></li>
|
||||||
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
<hr/>
|
<hr/>
|
||||||
<h5>PTR Records</h5>
|
<h5>PTR Records</h5>
|
||||||
<p>For PTR records you can look up records by their IP address or by their FQDN. Compressed or expanded formats of IPv6 addresses are supported. Partial matching is not supported.</p>
|
<p>For PTR records you can look up records by their IP address or by their FQDN. Compressed or expanded formats of IPv6 addresses are supported. </p>
|
||||||
<p><strong>Examples:</strong>
|
<p>Partial matching of IP addresses is not supported, but partial matching of the FQDN is supported.</p>
|
||||||
<ul>
|
<p>
|
||||||
<li>4.4.8.8.in-addr.arpa. -> 4.4.8.8.in-addr.arpa.</li>
|
<strong>Examples:</strong>
|
||||||
<li>8.8.4.4 -> 4.4.8.8.in-addr.arpa.</li>
|
<ul>
|
||||||
<li>2001:db8::567:89ab -> b.a.9.8.7.6.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.</li>
|
<li>4.4.8.8.in-addr.arpa. -> 4.4.8.8.in-addr.arpa.</li>
|
||||||
</ul>
|
<li>*.4.8.8.in-addr.arpa. -> 2.4.8.8.in-addr.arpa., 3.4.8.8.in-addr.arpa., 4.4.8.8.in-addr.arpa.</li>
|
||||||
|
<li>8.8.4.4 -> 4.4.8.8.in-addr.arpa.</li>
|
||||||
|
<li>2001:db8::567:89ab -> b.a.9.8.7.6.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.</li>
|
||||||
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -167,8 +174,8 @@
|
|||||||
{{record.fqdn}}
|
{{record.fqdn}}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="wrap-long-text">{{record.type}}</td>
|
<td class="no-wrap">{{record.type}}</td>
|
||||||
<td class="wrap-long-text">{{record.ttl}}</td>
|
<td class="no-wrap">{{record.ttl}}</td>
|
||||||
<td class="record-data wrap-long-text">
|
<td class="record-data wrap-long-text">
|
||||||
<span ng-if="record.accessLevel != 'NoAccess'">
|
<span ng-if="record.accessLevel != 'NoAccess'">
|
||||||
<span ng-if="record.type == 'A'">
|
<span ng-if="record.type == 'A'">
|
||||||
|
@ -425,6 +425,11 @@ input[type="file"] {
|
|||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.no-wrap {
|
||||||
|
white-space: nowrap;
|
||||||
|
word-break: keep-all;
|
||||||
|
}
|
||||||
|
|
||||||
.record-data-label {
|
.record-data-label {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
@ -25,19 +25,19 @@ From a shell in the `quickstart/` directory, simply run:
|
|||||||
|
|
||||||
The `quickstart-vinyldns.sh` script takes a number of optional arguments:
|
The `quickstart-vinyldns.sh` script takes a number of optional arguments:
|
||||||
|
|
||||||
| Flag | Description |
|
| Flag | Description |
|
||||||
|:------------------|:----------------------------------------------------------------------------------------------------|
|
|:------------------|:-----------------------------------------------------------------------------------------------------------------------|
|
||||||
| -a, --api | start the API, but not the Portal and its dependencies (e.g., LDAP) |
|
| -a, --api | start the API, but not the Portal and its dependencies (e.g., LDAP) |
|
||||||
| -b, --build | force a rebuild of the Docker images with the local code |
|
| -b, --build | force a rebuild of the Docker images with the local code |
|
||||||
| -c, --clean | stops all VinylDNS containers and exits |
|
| -c, --clean | stops all VinylDNS containers and exits |
|
||||||
| -d, --deps | start up the dependencies, but not the API or Portal |
|
| -d, --deps | start up the dependencies, but not the API or Portal |
|
||||||
| -sh, --shell | loads the .env file into a new BASH shell. The .env file can be overridden with -e |
|
| -sh, --shell | loads the .env file into a new BASH shell. The .env file can be overridden with -e |
|
||||||
| -e, --env-file | specifies the path (relative to the docker-compose file) to the .env file to load (e.g., .env.dev). |
|
| -e, --env-file | specifies the suffix of the .env file (relative to the docker-compose file) to load (e.g., 'dev' - to load '.env.dev') |
|
||||||
| -r, --reset | stops any the running containers before starting new containers |
|
| -r, --reset | stops any the running containers before starting new containers |
|
||||||
| -s, --service | specify the service to run |
|
| -s, --service | specify the service to run |
|
||||||
| -t, --timeout | the time to wait (in seconds) for the Portal and API to start (default: 60) |
|
| -t, --timeout | the time to wait (in seconds) for the Portal and API to start (default: 60) |
|
||||||
| -u, --update | remove the local quickstart images to force a rebuild |
|
| -u, --update | remove the local quickstart images to force a rebuild |
|
||||||
| -v, --version-tag | specify Docker image tag version (default: latest) |
|
| -v, --version-tag | specify Docker image tag version (default: latest) |
|
||||||
|
|
||||||
## Environment Settings
|
## Environment Settings
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ Let's say you have a `.env.dev` file in the `quickstart/` directory. You can loa
|
|||||||
shell with
|
shell with
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ ./quickstart/quickstart.sh --env-file .env.dev --sh
|
$ ./quickstart/quickstart.sh -sh --env-file dev # To load .env.dev just specify the suffix - dev
|
||||||
Please wait.. creating a new shell with the environment variables set.
|
Please wait.. creating a new shell with the environment variables set.
|
||||||
To return, simply exit the new shell with 'exit' or ^D.
|
To return, simply exit the new shell with 'exit' or ^D.
|
||||||
$
|
$
|
||||||
|
@ -24,7 +24,7 @@ function usage() {
|
|||||||
echo -e "\t-c, --clean stops all VinylDNS containers and exits"
|
echo -e "\t-c, --clean stops all VinylDNS containers and exits"
|
||||||
echo -e "\t-d, --deps start up the dependencies, but not the API or Portal"
|
echo -e "\t-d, --deps start up the dependencies, but not the API or Portal"
|
||||||
echo -e "\t-sh, --shell loads the .env file into a new BASH shell. The .env file can be overridden with -e"
|
echo -e "\t-sh, --shell loads the .env file into a new BASH shell. The .env file can be overridden with -e"
|
||||||
echo -e "\t-e, --env-file specifies the path (relative to the docker-compose file) to the .env file to load (e.g., .env.dev)."
|
echo -e "\t-e, --env-file specifies the suffix of the .env file (relative to the docker-compose file) to load (e.g., 'dev' - to load '.env.dev')"
|
||||||
echo -e "\t-r, --reset stops any the running containers before starting new containers"
|
echo -e "\t-r, --reset stops any the running containers before starting new containers"
|
||||||
echo -e "\t-s, --service specify the service to run"
|
echo -e "\t-s, --service specify the service to run"
|
||||||
echo -e "\t-t, --timeout the time to wait (in seconds) for the Portal and API to start (default: 60)"
|
echo -e "\t-t, --timeout the time to wait (in seconds) for the Portal and API to start (default: 60)"
|
||||||
@ -84,6 +84,7 @@ RESET_DOCKER=0
|
|||||||
UPDATE=0
|
UPDATE=0
|
||||||
CLEAN=0
|
CLEAN=0
|
||||||
ENV_FILE="${DIR}/.env"
|
ENV_FILE="${DIR}/.env"
|
||||||
|
SHELL_REQUESTED=0
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-t | --timeout)
|
-t | --timeout)
|
||||||
@ -124,16 +125,16 @@ while [[ $# -gt 0 ]]; do
|
|||||||
RESET_DOCKER=1
|
RESET_DOCKER=1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-sh | --shell)
|
-sh | --shell)
|
||||||
# shellcheck disable=SC2046
|
SHELL_REQUESTED=1
|
||||||
export $(grep -Ev '^#' "${ENV_FILE}" | xargs)
|
shift
|
||||||
echo "Please wait.. creating a new shell with the environment variables set."
|
;;
|
||||||
echo "To return, simply exit the new shell with 'exit' or ^D."
|
|
||||||
bash
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
-e | --env-file)
|
-e | --env-file)
|
||||||
export ENV_FILE="${DIR}/$2"
|
if [ ! -f "${DIR}/.env.$2" ]; then
|
||||||
|
echo "Cannot load ${DIR}/.env.$2"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
export ENV_FILE="${DIR}/.env.$2"
|
||||||
shift
|
shift
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -151,12 +152,15 @@ while [[ $# -gt 0 ]]; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# Source customizable env files ('-a' causes all variables to be exported)
|
# Load environment variables
|
||||||
|
export $(echo $(cat "${ENV_FILE}" | sed 's/#.*//g'| xargs) | envsubst)
|
||||||
|
|
||||||
set -a
|
if [[ $SHELL_REQUESTED -eq 1 ]]; then
|
||||||
# shellcheck disable=SC1090
|
echo "Please wait.. creating a new shell with the environment variables set."
|
||||||
source "${ENV_FILE}"
|
echo "To return, simply exit the new shell with 'exit' or ^D."
|
||||||
set +a
|
bash
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# The version of VinylDNS docker image to run
|
# The version of VinylDNS docker image to run
|
||||||
export VINYLDNS_VERSION=latest
|
export VINYLDNS_VERSION=latest
|
||||||
|
Loading…
x
Reference in New Issue
Block a user