2020-03-26 03:26:45 +00:00
|
|
|
@use crate::{
|
2022-11-02 19:16:32 +00:00
|
|
|
config::{Config, UrlKind},
|
|
|
|
data::Node,
|
|
|
|
templates::{info, instance, statics::index_css},
|
2020-03-26 03:26:45 +00:00
|
|
|
};
|
2020-03-20 18:40:18 +00:00
|
|
|
|
2022-11-21 20:23:37 +00:00
|
|
|
@(local: &[Node], nodes: &[Node], config: &Config)
|
2020-03-20 18:40:18 +00:00
|
|
|
|
|
|
|
<!doctype html>
|
|
|
|
<html>
|
2022-11-02 19:16:32 +00:00
|
|
|
|
|
|
|
<head lang="en">
|
|
|
|
<meta charset="utf-8" />
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
|
|
<title>@config.hostname() | ActivityPub Relay</title>
|
|
|
|
<link rel="stylesheet" href="/static/@index_css.name" type="text/css" />
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<header>
|
|
|
|
<div class="header-text">
|
|
|
|
<h1>@Config::software_name()<span class="smaller">@Config::software_version()</span></h1>
|
|
|
|
<p>on @config.hostname()</p>
|
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
<main>
|
2022-11-21 20:23:37 +00:00
|
|
|
@if !local.is_empty() || config.local_blurb().is_some() {
|
|
|
|
<article>
|
|
|
|
<h3>About</h3>
|
|
|
|
<section class="local-explainer">
|
|
|
|
@if let Some(blurb) = config.local_blurb() {
|
|
|
|
@blurb
|
|
|
|
} else {
|
|
|
|
<p>These domains are run by the same admins as this relay.</p>
|
|
|
|
}
|
|
|
|
</section>
|
|
|
|
@if !local.is_empty() {
|
|
|
|
<ul>
|
|
|
|
@for node in local {
|
|
|
|
@if let Some(inst) = node.instance.as_ref() {
|
|
|
|
<li>
|
|
|
|
@:instance(inst, node.info.as_ref().map(|info| { info.software.as_ref() }), node.contact.as_ref(),
|
|
|
|
&node.base)
|
|
|
|
</li>
|
|
|
|
} else {
|
|
|
|
@if let Some(inf) = node.info.as_ref() {
|
|
|
|
<li>
|
|
|
|
@:info(inf, &node.base)
|
|
|
|
</li>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</ul>
|
|
|
|
}
|
|
|
|
</article>
|
|
|
|
}
|
|
|
|
<article>
|
2022-11-02 19:16:32 +00:00
|
|
|
<h3>Joining</h3>
|
2022-11-21 20:23:37 +00:00
|
|
|
<section class="joining">
|
2022-11-02 19:16:32 +00:00
|
|
|
@if config.restricted_mode() {
|
|
|
|
<h4>
|
|
|
|
This relay is Restricted
|
|
|
|
</h4>
|
|
|
|
<p>
|
|
|
|
This relay is currently in Restricted Mode, which means servers need to be approved ahead of time by the relay
|
|
|
|
administrator. Please contact the admin before attempting to join.
|
|
|
|
</p>
|
2022-11-02 19:56:49 +00:00
|
|
|
} else {
|
2022-11-02 19:16:32 +00:00
|
|
|
<p>
|
|
|
|
If you are the admin of a server that supports activitypub relays, you can add
|
|
|
|
this relay to your server.
|
|
|
|
</p>
|
2022-11-02 19:56:49 +00:00
|
|
|
}
|
2022-11-02 19:16:32 +00:00
|
|
|
<h4>Mastodon</h4>
|
|
|
|
<p>
|
|
|
|
Mastodon admins can add this relay by adding
|
|
|
|
<pre>@config.generate_url(UrlKind::Inbox)</pre> in their relay settings.
|
|
|
|
</p>
|
|
|
|
<h4>Pleroma</h4>
|
|
|
|
<p>
|
|
|
|
Pleroma admins can add this relay by adding
|
|
|
|
<pre>@config.generate_url(UrlKind::Actor)</pre>
|
|
|
|
to their relay settings (I don't actually know how pleroma handles adding
|
|
|
|
relays, is it still a mix command?).
|
|
|
|
</p>
|
|
|
|
<h4>Others</h4>
|
|
|
|
<p>
|
|
|
|
Consult the documentation for your server. It's likely that it follows either
|
|
|
|
Mastodon or Pleroma's relay formatting.
|
|
|
|
</p>
|
2022-11-21 20:23:37 +00:00
|
|
|
</section>
|
|
|
|
</article>
|
2022-11-23 17:52:05 +00:00
|
|
|
@if !nodes.is_empty() {
|
|
|
|
<article>
|
|
|
|
<h3>@nodes.len() Connected Servers</h3>
|
|
|
|
<ul>
|
|
|
|
@for node in nodes {
|
|
|
|
@if let Some(inst) = node.instance.as_ref() {
|
|
|
|
<li>
|
|
|
|
@:instance(inst, node.info.as_ref().map(|info| { info.software.as_ref() }), node.contact.as_ref(),
|
|
|
|
&node.base)
|
|
|
|
</li>
|
|
|
|
} else {
|
|
|
|
@if let Some(inf) = node.info.as_ref() {
|
|
|
|
<li>
|
|
|
|
@:info(inf, &node.base)
|
|
|
|
</li>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</ul>
|
|
|
|
</article>
|
|
|
|
}
|
2022-11-02 19:16:32 +00:00
|
|
|
</main>
|
|
|
|
<footer>
|
2022-11-21 17:16:21 +00:00
|
|
|
@if let Some(blurb) = config.footer_blurb() {
|
|
|
|
<div>@blurb</div>
|
|
|
|
}
|
2022-11-02 19:16:32 +00:00
|
|
|
<p>
|
|
|
|
The source code for this project can be found at
|
|
|
|
<a href="@config.source_code()">@config.source_code()</a>
|
|
|
|
</p>
|
|
|
|
</footer>
|
|
|
|
</body>
|
|
|
|
|
2020-03-20 18:40:18 +00:00
|
|
|
</html>
|