11 Commits

Author SHA1 Message Date
Slatian
f799927f90 Cargo update 2024-03-17 22:02:20 +01:00
Slatian
8695f0026f lib-humus is now on crates.io 2024-02-11 14:15:13 +01:00
Slatian
3b552dba8a Downgrade clap to 4.4.18 to support "older" rust versions 2024-02-11 12:38:33 +01:00
Slatian
1ce60d8291 to_trust_resolver_config() -> to_hickory_resolver_config() 2024-02-11 11:52:33 +01:00
Slatian
b5097b5a03 cargo update 2024-02-11 11:51:23 +01:00
Slatian
610842abac Remove unused import 2024-02-11 11:51:08 +01:00
Slatian
35c71aba64 Use absolute path for icons 2023-12-29 02:51:12 +01:00
Slatian
d79d949d65 Use the more efficient icon 2023-12-29 02:49:04 +01:00
Slatian
b3f94b0d90 cargo update 2023-12-29 02:41:33 +01:00
Slatian
96207f3960 Added a way to display the icon as part of the sitename 2023-12-29 02:37:22 +01:00
Slatian
cd7a7fbe05 Added a favicon 2023-12-29 02:26:32 +01:00
12 changed files with 366 additions and 299 deletions

584
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -7,12 +7,12 @@ authors = ["Slatian <baschdel@disroot.org>"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
lib-humus = { version="0.2", features=["axum-view+cookie"], git="https://codeberg.org/slatian/lib-humus.git" } lib-humus = { version="0.2", features=["axum-view+cookie"] }
axum = { version = "0.7", features = ["macros"] } axum = { version = "0.7", features = ["macros"] }
axum-extra = { version = "0.9", features = ["cookie", "typed-header"] } axum-extra = { version = "0.9", features = ["cookie", "typed-header"] }
axum-client-ip = "0.5" axum-client-ip = "0.5"
clap = { version = "4", features = ["derive"] } clap = { version = "4.4", features = ["derive"] }
governor = "0.6" governor = "0.6"
idna = "0.4" idna = "0.4"
lazy_static = "1.4.0" lazy_static = "1.4.0"

View File

@@ -86,7 +86,7 @@ impl Into<Protocol> for DnsProtocol {
} }
impl DnsResolverConfig { impl DnsResolverConfig {
pub fn to_trust_resolver_config( pub fn to_hickory_resolver_config(
&self &self
) -> HickoryResolverConfig { ) -> HickoryResolverConfig {
let mut resolver = HickoryResolverConfig::new(); let mut resolver = HickoryResolverConfig::new();

View File

@@ -6,7 +6,7 @@ use std::num::NonZeroU32;
mod dns; mod dns;
pub use crate::config::dns::{DnsConfig, DnsProtocol, DnsResolverConfig}; pub use crate::config::dns::{DnsConfig, DnsResolverConfig};
#[derive(Deserialize, Default, Clone)] #[derive(Deserialize, Default, Clone)]
pub struct EchoIpServiceConfig { pub struct EchoIpServiceConfig {

View File

@@ -227,7 +227,7 @@ async fn main() {
for (key, resolver_config) in &config.dns.resolver { for (key, resolver_config) in &config.dns.resolver {
println!("Initalizing {} resolver ...", key); println!("Initalizing {} resolver ...", key);
let resolver = TokioAsyncResolver::tokio( let resolver = TokioAsyncResolver::tokio(
resolver_config.to_trust_resolver_config(), resolver_config.to_hickory_resolver_config(),
Default::default() Default::default()
); );
dns_resolver_map.insert(key.clone(), resolver); dns_resolver_map.insert(key.clone(), resolver);

View File

@@ -24,7 +24,11 @@
<body> <body>
<header> <header>
<nav> <nav>
<a href="{{ extra.base_url }}" class="sitename">{{extra.site_name|default(value="echoip")}}</a> <a href="{{ extra.base_url }}" class="sitename">
{%- if extra.display_icon -%}
<img src="{{extra.display_icon}}" alt="">
{%- endif -%}
{{extra.site_name|default(value="echoip")}}</a>
<form class="search" method="GET" action="{{ extra.base_url }}"> <form class="search" method="GET" action="{{ extra.base_url }}">
<input type="search" name="query" autocomplete="on" maxlength="260" <input type="search" name="query" autocomplete="on" maxlength="260"
title="Search for an IP-Adress, Domain-Name, or ASN." title="Search for an IP-Adress, Domain-Name, or ASN."

View File

@@ -8,10 +8,14 @@ base_url="http://localhost:3000"
stylesheet = "/style.css" stylesheet = "/style.css"
# URL to and mimetype of your favicon # URL to and mimetype of your favicon
# favicon = "" favicon = "/icon_64.png"
# favicon_mimetype = "image/png" favicon_mimetype = "image/png"
# favicon_mimetype = "image/svg+xml"
# favicon_mimetype = "image/jpeg" # favicon_mimetype = "image/jpeg"
# Icon to display next to the title
display_icon = "/icon_64.png"
# URLs to look up v4 and v6 addresses explicitly # URLs to look up v4 and v6 addresses explicitly
# If you have not configured them, comment them out, the button will stay hidden # If you have not configured them, comment them out, the button will stay hidden
v4_url="http://v4.localhost:3000/" v4_url="http://v4.localhost:3000/"

50
templates/static/icon.svg Normal file
View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="48"
height="48"
viewBox="0 0 48 48"
version="1.1"
id="svg1"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1">
<linearGradient
id="linearGradient8">
<stop
style="stop-color:#fb9a00;stop-opacity:1;"
offset="0"
id="stop8" />
<stop
style="stop-color:#884f00;stop-opacity:1;"
offset="0.49966338"
id="stop10" />
<stop
style="stop-color:#be8700;stop-opacity:1;"
offset="1"
id="stop9" />
</linearGradient>
<linearGradient
xlink:href="#linearGradient8"
id="linearGradient9"
x1="10.202637"
y1="35.241699"
x2="39.21582"
y2="12.833984"
gradientUnits="userSpaceOnUse" />
</defs>
<g
id="layer1">
<path
id="path2"
style="fill:url(#linearGradient9);fill-opacity:1;stroke-width:3.15427;stroke-linejoin:round;paint-order:stroke markers fill"
d="m 2,7 v 33.767595 l 1.586,0.0021 L 8.299716,45.41681 12.826,40.767584 H 46 V 7 Z" />
<path
id="rect1"
style="fill:#111111;stroke-width:3;stroke-linejoin:round;paint-order:stroke markers fill"
d="M 3 8 L 3 40 L 4.0019531 40 L 4 40.001953 L 8.2792969 44.205078 L 12.412109 40 L 45 40 L 45 8 L 3 8 z M 35.671875 11.712891 L 39.357422 11.712891 L 39.357422 36.287109 L 35.671875 36.287109 L 35.671875 17.033203 L 31.494141 21.363281 L 28.839844 18.804688 C 31.107109 16.462871 35.671875 11.712891 35.671875 11.712891 z M 8.6425781 21.542969 L 12.328125 21.542969 L 12.328125 25.228516 L 8.6425781 25.228516 L 8.6425781 21.542969 z M 20.927734 21.542969 L 24.615234 21.542969 L 24.615234 25.228516 L 20.927734 25.228516 L 20.927734 21.542969 z M 8.6425781 32.599609 L 12.328125 32.599609 L 12.328125 36.287109 L 8.6425781 36.287109 L 8.6425781 32.599609 z M 20.927734 32.599609 L 24.615234 32.599609 L 24.615234 36.287109 L 20.927734 36.287109 L 20.927734 32.599609 z " />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 950 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -599,3 +599,10 @@ form.search {
background: var(--button-bg); background: var(--button-bg);
} }
/* Custom icon style for sitename*/
.sitename > img {
height: 1.2em;
padding: 0 0.3ch;
margin-bottom: -.2em;
}