import { Handlers, PageProps } from "$fresh/server.ts"; import { Button } from "../../components/Button.tsx"; import { Content } from "../../components/Content.tsx"; import { SERVER_STATE } from "../../state/serverState.ts"; export const handler: Handlers = { async POST(req, _ctx) { const url = new URL(req.url); SERVER_STATE.acceptEULA(); return Response.redirect(url.origin + '/setup/start'); } }; export default async function EULA({url}: PageProps) { // TODO: this does not respect instances and needs to once they are supported const eulaText = await Deno.readTextFileSync("./server/eula.txt"); return (

Minecraft EULA

This page is provided as a courtesy. The text below is the contents of "eula.txt," a file that is generated by the server the first time it runs. In order to run the server, you must agree to the EULA by changing "false" to "true."

To make this easier, there is a button below. The one and only action this button takes is to change the value in the text file to true, this is not an agreement between you and CyborgGrizzly Games.

If you are unsure of the contents of the EULA, you are encouraged to read it by following the link in the text file.

{eulaText}
); }