drasl/view/root.tmpl
2025-07-26 12:31:22 -04:00

165 lines
6.2 KiB
Cheetah

{{ template "layout" . }}
{{ define "title" }}{{ .App.Config.ApplicationName }}{{ end }}
{{ define "content" }}
{{ template "header" . }}
{{ $authlibInjectorA := render `<a href="{{ index . 0}}">{{ index . 1}}</a>` .App.AuthlibInjectorURL .App.AuthlibInjectorURL }}
<h3>{{ call .T "Log in" }}</h3>
{{ $dividerNeeded := false }}
{{ if gt (len .WebOIDCProviders) 0 }}
{{ if $dividerNeeded }}
<div class="divider">or</div>
{{ $dividerNeeded = false }}
{{ end }}
<h3><img class="openid-logo" src="{{ .App.PublicURL }}/openid-logo.svg" alt="OpenID logo"></h3>
{{ range $provider := $.WebOIDCProviders }}
<p>
<a href="{{ $provider.AuthURL }}">{{ call $.T "Sign in with %s" $provider.Name }}</a>
</p>
{{ end }}
{{ $dividerNeeded = true }}
{{ end }}
{{ if .App.Config.AllowPasswordLogin }}
{{ if $dividerNeeded }}
<div class="divider">{{ call .T "or" }}</div>
{{ $dividerNeeded = false }}
{{ end }}
<form action="{{ .App.FrontEndURL }}/web/login" method="post">
<input type="text" name="username" placeholder="{{ call .T "Username" }}" required />
<input hidden name="returnUrl" value="{{ .URL }}" />
<input hidden name="destination" value="{{ .Destination }}" />
<input
class="long"
type="password"
name="password"
placeholder="{{ call .T "Password" }}"
required
/>
<input type="submit" value="{{ call .T "Log in" }}" />
</form>
{{ $dividerNeeded = true }}
{{ end }}
<h3>{{ call .T "Configuring your client" }}</h3>
<p>
{{ call .T "Using %s on the client requires a third-party launcher that supports custom API servers. %s, a fork of Prism Launcher, is recommended, but %s also works. Both are free/libre."
.App.Config.ApplicationName
(html `<a href="https://github.com/unmojang/FjordLauncher">Fjord Launcher</a>`)
(html `<a href="https://github.com/huanghongxun/HMCL">HMCL</a>`) }}
</p>
<h4>Fjord Launcher</h4>
<ol>
<li>{{ call .T "Click your account in the top right and select “Manage Accounts...”." }} </li>
<li>{{ call .T "Click “Add authlib-injector” in the right-hand sidebar." }}</li>
<li>{{ call .T
"Enter your player name and your %s password or Minecraft Token, and use %s for the URL. Click “OK”."
.App.Config.ApplicationName
$authlibInjectorA
}}</li>
</ol>
<h4>HMCL</h4>
<ol>
<li>{{ call .T "Go to the “Account List” view by clicking the account at the top of the sidebar." }}</li>
<li>
{{ call .T
"At the bottom left, click “New Auth Server” and enter %s. Click “Next” and then “Finish”."
$authlibInjectorA
}}
</li>
<li>
{{ call .T
"In the sidebar, click the newly-added authentication server, labeled “%s”. Enter your %s player name and password and click “Login”."
.App.Config.InstanceName
.App.Config.ApplicationName
}}
</li>
</ol>
<h4>{{ call .T "Other launchers" }}</h4>
<p>{{ call .T "Use the authlib-injector URL %s." $authlibInjectorA }}</p>
<p>{{ call .T "Or, if your launcher supports custom API servers but not via authlib-injector, use the following URLs:" }}</p>
<table>
<tr>
<td>{{ call .T "Authentication server:" }}</td>
<td>{{ .App.AuthURL }}</td>
</tr>
<tr>
<td>{{ call .T "Account server:" }}</td>
<td>{{ .App.AccountURL }}</td>
</tr>
<tr>
<td>{{ call .T "Session server:" }}</td>
<td>{{ .App.SessionURL }}</td>
</tr>
<tr>
<td>{{ call .T "Services server:" }}</td>
<td>{{ .App.ServicesURL }}</td>
</tr>
</table>
<h3>{{ call .T "Configuring your server" }}</h3>
<h4>{{ call .T "Minecraft 1.16 and later" }}</h4>
<p>{{ call .T "On recent versions of Minecraft, you can use %s on an unmodified Vanilla server. To do so, add the following arguments before you specify the jar file when you start the server:" }}</p>
<pre style="word-wrap: break-word; white-space: pre-wrap; overflow-x: auto">
-Dminecraft.api.env=custom
-Dminecraft.api.auth.host={{ .App.AuthURL }}
-Dminecraft.api.account.host={{ .App.AccountURL }}
-Dminecraft.api.session.host={{ .App.SessionURL }}
-Dminecraft.api.services.host={{ .App.ServicesURL }}</pre>
<p>{{call .T "For example, the full command you use to start the server might be:" }}</p>
<pre style="word-wrap: break-word; white-space: pre-wrap; overflow-x: auto">
java -Xmx1024M -Xms1024M \
-Dminecraft.api.env=custom \
-Dminecraft.api.auth.host={{ .App.AuthURL }} \
-Dminecraft.api.account.host={{ .App.AccountURL }} \
-Dminecraft.api.session.host={{ .App.SessionURL }} \
-Dminecraft.api.services.host={{ .App.ServicesURL }} \
-jar server.jar nogui</pre>
<h4>{{ call .T "Minecraft 1.7.2 through 1.15.2" }}</h4>
<p>{{ call .T
`Refer to <a href="%s">the authlib-injector documentation on setting up a server</a>.`
"https://github.com/yushijinhun/authlib-injector/blob/develop/README.en.md#deploy"
}}</p>
<p>{{ call .T
`Alternatively, you can patch your server to use a newer version of Mojang's authlib that supports the arguments for custom API servers. Replace the files under <code>com/mojang/authlib</code> in your <code>server.jar</code> with the files in <a href="%s">authlib-1.6.25.jar</a>.`
"https://libraries.minecraft.net/com/mojang/authlib/1.6.25/authlib-1.6.25.jar"
}}</p>
<h4>{{ call .T `<a href="%s">Late Classic</a>, Alpha, Beta, etc. through Minecraft 1.6.4` "https://minecraft.wiki/w/Java_Edition_Late_Classic" }}</h4>
<p>{{ call .T
`Use %s and start the server with the <code>-Dminecraft.api.session.host</code> argument described above. For example, the full command you use to start the server might be:`
(html `<a href="https://github.com/craftycodie/OnlineModeFix">OnlineModeFix</a>`)
}}
<pre style="word-wrap: break-word; white-space: pre-wrap; overflow-x: auto">
java -Xmx1024M -Xms1024M \
-Dminecraft.api.session.host={{ .App.SessionURL }} \
-Djava.protocol.handler.pkgs=gg.codie.mineonline.protocol \
-cp server.jar:OnlineModeFix.jar \
net.minecraft.server.MinecraftServer \
nogui</pre>
</p>
{{ template "footer" . }}
{{ end }}