import { Tab } from '@headlessui/react' import { BeakerIcon, CubeTransparentIcon, EyeIcon, PencilSquareIcon } from '@heroicons/react/24/outline' import { type ActionFunctionArgs, json } from '@remix-run/node' import { useLoaderData } from '@remix-run/react' import clsx from 'clsx' import { useState } from 'react' import { Fragment } from 'react/jsx-runtime' import { ClientOnly } from 'remix-utils/client-only' import Notice from '~/components/Notice' import { getAcl, getContext, patchAcl } from '~/utils/config' import { sighupHeadscale } from '~/utils/docker' import { getSession } from '~/utils/sessions' import Editor from './editor' import Fallback from './fallback' export async function loader() { const context = await getContext() if (!context.hasAcl) { throw new Error('No ACL configuration is available') } const { data, type } = await getAcl() return { hasAclWrite: context.hasAclWrite, currentAcl: data, aclType: type } } export async function action({ request }: ActionFunctionArgs) { const session = await getSession(request.headers.get('Cookie')) if (!session.has('hsApiKey')) { return json({ success: false }, { status: 401 }) } const context = await getContext() if (!context.hasAclWrite) { return json({ success: false }, { status: 403 }) } const data = await request.json() as { acl: string } await patchAcl(data.acl) await sighupHeadscale() return json({ success: true }) } export default function Page() { const data = useLoaderData() const [acl, setAcl] = useState(data.currentAcl) return (
{data.hasAclWrite ? undefined : (
The ACL policy file is readonly to Headplane. You will not be able to make changes here.
)}

Access Control List (ACL)

The ACL file is used to define the access control rules for your network. You can find more information about the ACL file in the Tailscale documentation. {' '} More information

{({ selected }) => ( )} {({ selected }) => ( )} {({ selected }) => ( )} }> {() => ( )} }> {() => ( )}

The Preview rules is very much still a work in progress. It is a bit complicated to implement right now but hopefully it will be available soon.

) }