Add note about restricted mode on index page

This commit is contained in:
asonix 2022-11-02 14:16:32 -05:00
parent a2bd41a00f
commit 6125e5e63a

View file

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