Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
TelcoDB
Web Frontend
Commits
42258e9a
Verified
Commit
42258e9a
authored
Oct 21, 2019
by
Elias Ojala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parse SPF in TXT records
parent
4e31ba29
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
2 deletions
+19
-2
src/app.ts
src/app.ts
+3
-0
src/view-functions/txtParser.ts
src/view-functions/txtParser.ts
+14
-0
views/asn/index.twig
views/asn/index.twig
+1
-1
views/dns/show.twig
views/dns/show.twig
+1
-1
No files found.
src/app.ts
View file @
42258e9a
...
...
@@ -56,6 +56,9 @@ twig.extendFunction("portSizeProcessor", (rawSize: string) => {
}
});
import
txtParser
from
"
./view-functions/txtParser
"
;
twig
.
extendFunction
(
"
txtParser
"
,
txtParser
);
/**
* Is server in production mode?
*/
...
...
src/view-functions/txtParser.ts
0 → 100644
View file @
42258e9a
function
txtParser
(
record
:
string
):
string
{
if
(
record
.
includes
(
"
v=spf1
"
))
{
record
=
record
.
replace
(
/
(
include|ip4|ip6|a
)\:([^\s]
+
)
/g
,
'
$1:<a href="/search?q=$2">$2</a>
'
);
record
=
record
.
replace
(
/
(
redirect
)\=([^\s]
+
)
/g
,
'
$1=<a href="/search?q=$2">$2</a>
'
);
return
record
;
}
// Default
return
record
;
}
export
default
txtParser
;
\ No newline at end of file
views/asn/index.twig
View file @
42258e9a
...
...
@@ -82,7 +82,7 @@
<p>IRR Tab</p>
</div> #}
{%
if
pdb.netixlan_set
%}
<div
class=
"tab-pane fade pt-3"
id=
"ix"
role=
"tabpanel"
aria-labelledby=
"ix-tab"
>
<div
class=
"tab-pane fade pt-3
pb-2
"
id=
"ix"
role=
"tabpanel"
aria-labelledby=
"ix-tab"
>
<table
class=
"table"
id=
"ixTable"
>
<thead>
<tr>
...
...
views/dns/show.twig
View file @
42258e9a
...
...
@@ -69,7 +69,7 @@
<h2>
TXT records
</h2>
<ul
class=
"pl-0 list-unstyled"
>
{%
for
record
in
data.txt
%}
<li><code>
{{
record
}}
</code></li>
<li><code>
{{
txtParser
(
record
)
}}
</code></li>
{%
endfor
%}
</ul>
{%
endif
%}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment