Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ log stdout
errors stdout


header / Content-Security-Policy "default-src 'self' ; media-src https://storage.theel0ja.info; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://www1.theel0ja.info https://www0.theel0ja.info https://cdnjs.cloudflare.com https://cdn.theel0ja.info; style-src 'self' data: 'unsafe-inline' https://cdnjs.cloudflare.com https://getbootstrap.com https://cdn.theel0ja.info; img-src 'self' data: https://www0.theel0ja.info blob: https://cdn.rawgit.com; font-src data: ; connect-src https://sentry.io https://*.tiles.mapbox.com https://api.mapbox.com; child-src data: blob:; report-uri https://sentry.io/api/942255/csp-report/?sentry_key=87c404ea730a4a0cb596ca0caec20bbb;"
header / Content-Security-Policy "default-src 'self' ; media-src https://storage.theel0ja.info; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://www1.theel0ja.info https://www0.theel0ja.info https://cdnjs.cloudflare.com https://cdn.theel0ja.info; style-src 'self' data: 'unsafe-inline' https://cdnjs.cloudflare.com https://getbootstrap.com https://cdn.theel0ja.info; img-src 'self' data: https://www0.theel0ja.info https://assets.theel0ja.info https://api.mapbox.com blob:; font-src data: ; connect-src https://sentry.io https://*.tiles.mapbox.com https://api.mapbox.com; child-src data: blob:; report-uri https://sentry.io/api/942255/csp-report/?sentry_key=87c404ea730a4a0cb596ca0caec20bbb;"
header / X-Frame-Options "DENY"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

-->

<a href="https://iplookup.theel0ja.info/?host=hel03-fi.theel0ja.info"><img src="https://storage.theel0ja.info/pub/Screen%20Shot%202018-06-07%20at%2012.12.26.png" width="640" /></a>
<a href="https://iplookup.theel0ja.info/"><img src="https://storage.theel0ja.info/pub/Screen%20Shot%202018-06-07%20at%2012.12.26.png" width="640" /></a>

## Development server
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

```bash
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
build: .
#image: abiosoft/caddy:php
ports:
- 172.19.5.1:30005:2015
- 37391:2015
volumes:
- ./Caddyfile:/etc/Caddyfile
- ./src:/app/src
Expand Down
2 changes: 2 additions & 0 deletions src/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
RewriteEngine On
RewriteRule ^([^/.]+)$ $1.php [L]
6 changes: 3 additions & 3 deletions src/add-to-flagfox.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<title>Add to Flagfox - IPLookup</title>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.theel0ja.info/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin="anonymous" />

<style>
#videoPlayer {
Expand Down Expand Up @@ -38,7 +38,7 @@

<hr>

<a href="https://iplookup.theel0ja.info">Back to IPLookup</a>
<a href="/">Back to IPLookup</a>

</body>
</html>
</html>
52 changes: 26 additions & 26 deletions src/templates/base.html.twig
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
{# Required meta tags #}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="format-detection" content="telephone=no">

<!-- Raven.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/raven.js/3.24.0/raven.min.js" integrity="sha256-C0v6xCW0XKv2zJSWSiNl920zYMsEWWLUvysjc48qp88=" crossorigin="anonymous"></script>
{# Raven.js #}
{# <script src="https://cdnjs.theel0ja.info/ajax/libs/raven.js/3.24.0/raven.min.js" integrity="sha256-C0v6xCW0XKv2zJSWSiNl920zYMsEWWLUvysjc48qp88=" crossorigin="anonymous"></script> #}

{% if debug_mode %}
<script>
var debug_mode = true;
console.log("Debug mode enabled");
</script>
{% else %}
<!-- Debug mode disabled -->
<script>
{# Debug mode disabled #}
{# <script>
var debug_mode = false;
Raven.config('https://87c404ea730a4a0cb596ca0caec20bbb@sentry.io/942255').install();
</script>
</script> #}
{% endif %}


<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin="anonymous" />
{# Bootstrap CSS #}
<link rel="stylesheet" href="https://cdnjs.theel0ja.info/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha256-LA89z+k9fjgMKQ/kq4OO2Mrf8VltYml/VES+Rg0fh20=" crossorigin="anonymous" />

<!-- Custom styles for this template -->
{# Custom styles for this template #}
<link href="/assets/css/upstream-bootstrap/narrow-jumbotron.css" rel="stylesheet">

<!-- Mapbox-gl.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mapbox-gl/0.43.0/mapbox-gl.js" integrity="sha256-Q64EiAD5SpPHnfdgHNmDFZ2uvMtYDTqhTGZmBE87140=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mapbox-gl/0.43.0/mapbox-gl.css" integrity="sha256-vHJouzrJVgw4jSXJxXbfMWTbhAt/bGGGxVyFDSin518=" crossorigin="anonymous" />
{# Mapbox-gl.js #}
<script src="https://cdnjs.theel0ja.info/ajax/libs/mapbox-gl/0.43.0/mapbox-gl.js" integrity="sha256-Q64EiAD5SpPHnfdgHNmDFZ2uvMtYDTqhTGZmBE87140=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdnjs.theel0ja.info/ajax/libs/mapbox-gl/0.43.0/mapbox-gl.css" integrity="sha256-vHJouzrJVgw4jSXJxXbfMWTbhAt/bGGGxVyFDSin518=" crossorigin="anonymous" />

<script>
mapboxgl.accessToken = '{{mapbox_key}}';
</script>

{% block stylesheets %}{% endblock %}

<!-- Matomo -->
{# Matomo #}
{% if not debug_mode %}
<script type="text/javascript">
{#<script type="text/javascript">
var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
Expand All @@ -53,9 +53,9 @@
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src='https://www1.theel0ja.info/a.js'; /* g.src=u+'piwik.js'; */ s.parentNode.insertBefore(g,s);
})();
</script>
</script>#}
{% endif %}
<!-- End Matomo Code -->
{# End Matomo Code #}

<title>{% block title %}{{project_name}}{% endblock %}</title>
</head>
Expand Down Expand Up @@ -86,25 +86,25 @@

<footer class="footer">
<p>
&copy; <a href="https://www.eliasojala.me/">Elias Ojala</a> 2017-2018
- Data from <a href="https://ipinfo.io/">ipinfo.io</a>
{#&copy; <a href="https://www.eliasojala.me/">Elias Ojala</a> 2017-2018
- #}Data from <a href="https://ipinfo.io/">ipinfo.io</a>
{% if debug_mode %}
- <a id="viewProdVersion" target="_blank">View production version</a>
{% endif %}
</p>
</footer>
</div> <!-- /.container -->
</div> {# /.container #}

<!-- Optional JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.slim.min.js" integrity="sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E=" crossorigin="anonymous"></script>
<!--
{# Optional JavaScript #}
<script src="https://cdnjs.theel0ja.info/ajax/libs/jquery/3.3.1/jquery.slim.min.js" integrity="sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E=" crossorigin="anonymous"></script>
{#

<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha256-5+02zu5UULQkO7w1GIr6vftCgMfFdZcAHeDtFnKZsBs=" crossorigin="anonymous"></script>
<script src="https://cdnjs.theel0ja.info/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
<script src="https://cdnjs.theel0ja.info/ajax/libs/twitter-bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha256-5+02zu5UULQkO7w1GIr6vftCgMfFdZcAHeDtFnKZsBs=" crossorigin="anonymous"></script>

-->
#}

<!-- BSMenu.js -->
{# BSMenu.js #}
<script src="/assets/js/bsmenu.js"></script>

{% block javascripts %}{% endblock %}
Expand Down
56 changes: 35 additions & 21 deletions src/templates/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,25 @@
{% block content %}
<div class="card">
<div class="card-body" style="padding: 0px;" id="map-card-body">
<div id="map"></div>
<div id="map">
<noscript>
<img src="https://api.mapbox.com/styles/v1/mapbox/streets-v10/static/pin-s+3FB1CE({{lon}},{{lat}})/{{lon}},{{lat}},6.0,0,0/704x304@2x?access_token=pk.eyJ1IjoidGhlZWwwamEiLCJhIjoiY2piOW1xeTg5MGRpZTJxbm92ZDltZ3l4ZiJ9.2QVq7PY5YiaHrz1ib_oWTg"
alt="Map" class="img-fluid">
<style>
#map {
height: auto;
}
/* Hide layer chooser, if no JS */
#menu {
display: none;
}
</style>
</noscript>
</div>
<div id="menu" class="btn-group-toggle" data-toggle="buttons">
<label class="btn btn-primary active" id="streets-btn">
<input id="streets" type="radio" name="rtoggle" checked=""> Streets
</label><label class="btn btn-primary" id="satellite-streets-btn"><!-- TODO: Try to set them to different lines -->
</label><label class="btn btn-primary" id="satellite-streets-btn">{# TODO: Try to set them to different lines #}
<input id='satellite-streets' type='radio' name='rtoggle'> Satellite
</label>
</div>
Expand All @@ -38,22 +52,22 @@

<div>
<table class="table">
<!--<thead>
{#<thead>
<tr>
<th scope="col">#</th>
<th scope="col">First Name</th>
<th scope="col">Last Name</th>
<th scope="col">Username</th>
</tr>
</thead>-->
</thead>#}
<tbody>
<tr>
<th>Hostname</th>
<td>
{% if hostname %}
<a href="https://www.robtex.com/dns-lookup/{{hostname}}">{{hostname}}</a>
<a href="https://telcodb.net/dns/{{hostname}}">{{hostname}}</a>
{% else %}
Unknown<!-- TODO: add styles, etc. to this -->
Unknown{# TODO: add styles, etc. to this #}
{% endif %}
</td>

Expand All @@ -62,10 +76,10 @@
{% if isp %}
{{isp}}
{% else %}
Unknown<!-- TODO: add styles, etc. to this -->
Unknown{# TODO: add styles, etc. to this #}
{% endif %}
{% if asn and isp %}
(<a href="https://bgp.he.net/AS{{asn}}">AS{{asn}}</a>)
(<a href="https://bgp.he.net/AS{{asn}}" target="_blank">AS{{asn}}</a>)
{% endif %}
</td>
</tr>
Expand All @@ -75,7 +89,7 @@
{% if continent %}
{{continent}}
{% else %}
Unknown<!-- TODO: add styles, etc. to this -->
Unknown{# TODO: add styles, etc. to this #}
{% endif %}
</td>

Expand All @@ -99,16 +113,16 @@
{% if country %}
{{country_name}}
{% else %}
Unknown<!-- TODO: add styles, etc. to this -->
Unknown{# TODO: add styles, etc. to this #}
{% endif %}
</td>

<th>Country Code</th>
<td>
{% if country %}
{{country}}{# (ISO 3166-1 alpha-3) #}<!-- (TODO: set ISO 3166-1 alpha-3 here) -->
{{country}}{# (ISO 3166-1 alpha-3) #}{# (TODO: set ISO 3166-1 alpha-3 here) #}
{% else %}
Unknown<!-- TODO: add styles, etc. to this -->
Unknown{# TODO: add styles, etc. to this #}
{% endif %}
</td>
</tr>
Expand All @@ -118,7 +132,7 @@
{% if region %}
{{region}}
{% else %}
Unknown<!-- TODO: add styles, etc. to this -->
Unknown{# TODO: add styles, etc. to this #}
{% endif %}
</td>

Expand All @@ -127,7 +141,7 @@
{% if local_time %}
{{local_time}}
{% else %}
Unknown<!-- TODO: add styles, etc. to this -->
Unknown{# TODO: add styles, etc. to this #}
{% endif %}
</td>
</tr>
Expand All @@ -137,7 +151,7 @@
{% if city %}
{{city}}
{% else %}
Unknown<!-- TODO: add styles, etc. to this -->
Unknown{# TODO: add styles, etc. to this #}
{% endif %}
</td>

Expand All @@ -146,17 +160,17 @@
{% if lat %}
{{lat}}
{% else %}
Unknown<!-- TODO: add styles, etc. to this -->
Unknown{# TODO: add styles, etc. to this #}
{% endif %}
</td>
</tr>
<tr>
<th>IP Address<!-- (IPv4)--></th>
<th>IP Address{# (IPv4)#}</th>
<td>
{% if ip %}
{{ip}}
{% else %}
Unknown<!-- TODO: add styles, etc. to this -->
Unknown{# TODO: add styles, etc. to this #}
{% endif %}
</td>

Expand All @@ -165,7 +179,7 @@
{% if lat %}
{{lon}}
{% else %}
Unknown<!-- TODO: add styles, etc. to this -->
Unknown{# TODO: add styles, etc. to this #}
{% endif %}
</td>
</tr>
Expand All @@ -179,7 +193,7 @@
</div>
<div class="col-md-9 row">
<div class="col-md-9">
<input name="host" type="text" class="form-control" id="exampleInputEmail1" aria-describedby="exampleInputEmail1">
<input required name="host" type="text" class="form-control" id="exampleInputEmail1" aria-describedby="exampleInputEmail1">
</div>
<div class="col-md-3">
<button type="submit" class="btn btn-primary">Submit</button>
Expand Down Expand Up @@ -212,7 +226,7 @@
</script>
<script src="/assets/js/templates/index.js"></script>

<!-- Add zoom controls to map. -->
{# Add zoom controls to map. #}
<script src="https://cdn.theel0ja.info/libs/mapbox-gl-disable-map-rotation/dist/script.js"></script>
<link rel="stylesheet" href="https://cdn.theel0ja.info/libs/mapbox-gl-disable-map-rotation/dist/style.css">
<script>
Expand Down