import { useState } from 'react'; import { Copy } from 'lucide-react'; import { type DeployToken, generateAdminNodeDeployTokenInput, useAdminNodeConfiguration, useGenerateAdminNodeDeployToken, } from '@/api/admin/nodes/queries'; import { useNodeDetail } from '@/components/admin/nodes/useNodeDetail'; import TitledGreyBox from '@/components/elements/TitledGreyBox'; import Button from '@/components/elements/Button'; import { Dialog } from '@/components/elements/dialog'; import Spinner from '@/components/elements/Spinner'; import CopyOnClick from '@/components/elements/CopyOnClick'; import Icon from '@/components/elements/Icon'; import { Alert } from '@/components/elements/alert'; import { httpErrorToHuman } from '@/api/http'; import { toYaml } from '@/components/admin/nodes/nodeConfigurationYaml'; export default function NodeConfigurationTab() { const { node } = useNodeDetail(); const { attributes } = node; const [token, setToken] = useState(null); const generateDeployToken = useGenerateAdminNodeDeployToken(); const { data: config, error, isFetching, refetch } = useAdminNodeConfiguration(attributes.id); const generate = () => { generateDeployToken.mutate(generateAdminNodeDeployTokenInput(attributes.id), { onSuccess: setToken, }); }; const yaml = config ? toYaml(config) : ''; const insecureFlag = token?.allow_insecure ? ' --allow-insecure' : ''; const command = token ? `cd /etc/pterodactyl && sudo wings configure --panel-url ${token.panel_url} --token ${token.token} --node ${token.node}${insecureFlag}` : ''; return (
setToken(null)}>

Run the following command on the target machine to automatically configure Wings for this node.

                        {command}
                    
{error && !isFetching ? (
{httpErrorToHuman(error)} refetch()}> Retry
) : !config ? ( ) : (
config.yml
                                {yaml}
                            
)}

Place this file in your daemon's root directory (usually /etc/pterodactyl) in a file called config.yml.

Generate a custom deployment command that configures Wings on the target server with a single command.

); }