This repository has been archived by the owner on Dec 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
258 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
# The MIT License (MIT) | ||
|
||
``` | ||
Copyright (c) 2015 - 2021 Dane Everitt <[email protected]> and Contributors | ||
Pterodactyl® | ||
Copyright © Dane Everitt <[email protected]> and contributors | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
/** | ||
* Pterodactyl - Panel | ||
* Copyright (c) 2015 - 2017 Dane Everitt <[email protected]>. | ||
|
@@ -62,7 +63,7 @@ public function handle($node) | |
|
||
$servers = $this->serverRepository->setColumns('id')->findCountWhere([['node_id', '=', $node]]); | ||
if ($servers > 0) { | ||
throw new HasActiveServersException($this->translator->trans('exceptions.node.servers_attached')); | ||
throw new HasActiveServersException($this->translator->get('exceptions.node.servers_attached')); | ||
} | ||
|
||
return $this->repository->delete($node); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
/** | ||
* Pterodactyl - Panel | ||
* Copyright (c) 2015 - 2017 Dane Everitt <[email protected]>. | ||
|
@@ -62,7 +63,7 @@ public function handle($user) | |
|
||
$servers = $this->serverRepository->setColumns('id')->findCountWhere([['owner_id', '=', $user]]); | ||
if ($servers > 0) { | ||
throw new DisplayException($this->translator->trans('admin/user.exceptions.user_has_servers')); | ||
throw new DisplayException($this->translator->get('admin/user.exceptions.user_has_servers')); | ||
} | ||
|
||
return $this->repository->delete($user); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
User-agent: * | ||
Disallow: | ||
Disallow: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
resources/scripts/components/server/features/PIDLimitModalFeature.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { ServerContext } from '@/state/server'; | ||
import Modal from '@/components/elements/Modal'; | ||
import tw from 'twin.macro'; | ||
import Button from '@/components/elements/Button'; | ||
import FlashMessageRender from '@/components/FlashMessageRender'; | ||
import useFlash from '@/plugins/useFlash'; | ||
import { SocketEvent } from '@/components/server/events'; | ||
import { useStoreState } from 'easy-peasy'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons'; | ||
|
||
const PIDLimitModalFeature = () => { | ||
const [ visible, setVisible ] = useState(false); | ||
const [ loading ] = useState(false); | ||
|
||
const status = ServerContext.useStoreState(state => state.status.value); | ||
const { clearFlashes } = useFlash(); | ||
const { connected, instance } = ServerContext.useStoreState(state => state.socket); | ||
const isAdmin = useStoreState(state => state.user.data!.rootAdmin); | ||
|
||
useEffect(() => { | ||
if (!connected || !instance || status === 'running') return; | ||
|
||
const errors = [ | ||
'pthread_create failed', | ||
'exception in thread "craft async scheduler management thread"', | ||
'unable to create new native thread', | ||
'unable to create native thread', | ||
]; | ||
|
||
const listener = (line: string) => { | ||
if (errors.some(p => line.toLowerCase().includes(p))) { | ||
setVisible(true); | ||
} | ||
}; | ||
|
||
instance.addListener(SocketEvent.CONSOLE_OUTPUT, listener); | ||
|
||
return () => { | ||
instance.removeListener(SocketEvent.CONSOLE_OUTPUT, listener); | ||
}; | ||
}, [ connected, instance, status ]); | ||
|
||
useEffect(() => { | ||
clearFlashes('feature:pidLimit'); | ||
}, []); | ||
|
||
return ( | ||
<Modal visible={visible} onDismissed={() => setVisible(false)} closeOnBackground={false} showSpinnerOverlay={loading}> | ||
<FlashMessageRender key={'feature:pidLimit'} css={tw`mb-4`} /> | ||
{isAdmin ? | ||
<> | ||
<div css={tw`mt-4 sm:flex items-center`}> | ||
<FontAwesomeIcon css={tw`pr-4`} icon={faExclamationTriangle} color={'orange'} size={'4x'}/> | ||
<h2 css={tw`text-2xl mb-4 text-neutral-100 `}>Memory or process limit reached...</h2> | ||
</div> | ||
<p css={tw`mt-4`}>This server has reached the maximum process or memory limit.</p> | ||
<p css={tw`mt-4`}>Increasing <code css={tw`font-mono bg-neutral-900`}>container_pid_limit</code> in the wings configuration, <code css={tw`font-mono bg-neutral-900`}>config.yml</code>, might help resolve this issue.</p> | ||
<p css={tw`mt-4`}><b>Note: Wings must be restarted for the configuration file changes to take effect</b></p> | ||
<div css={tw`mt-8 sm:flex items-center justify-end`}> | ||
<Button onClick={() => setVisible(false)} css={tw`w-full sm:w-auto border-transparent`}> | ||
Close | ||
</Button> | ||
</div> | ||
</> | ||
: | ||
<> | ||
<div css={tw`mt-4 sm:flex items-center`}> | ||
<FontAwesomeIcon css={tw`pr-4`} icon={faExclamationTriangle} color={'orange'} size={'4x'}/> | ||
<h2 css={tw`text-2xl mb-4 text-neutral-100`}>Possible resource limit reached...</h2> | ||
</div> | ||
<p css={tw`mt-4`}>This server is attempting to use more resources than allocated. Please contact the administrator and give them the error below.</p> | ||
<p css={tw`mt-4`}><code css={tw`font-mono bg-neutral-900`}>pthread_create failed, Possibly out of memory or process/resource limits reached</code></p> | ||
<div css={tw`mt-8 sm:flex items-center justify-end`}> | ||
<Button onClick={() => setVisible(false)} css={tw`w-full sm:w-auto border-transparent`}> | ||
Close | ||
</Button> | ||
</div> | ||
</> | ||
} | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default PIDLimitModalFeature; |
78 changes: 78 additions & 0 deletions
78
resources/scripts/components/server/features/SteamDiskSpaceFeature.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { ServerContext } from '@/state/server'; | ||
import Modal from '@/components/elements/Modal'; | ||
import tw from 'twin.macro'; | ||
import Button from '@/components/elements/Button'; | ||
import FlashMessageRender from '@/components/FlashMessageRender'; | ||
import useFlash from '@/plugins/useFlash'; | ||
import { SocketEvent } from '@/components/server/events'; | ||
import { useStoreState } from 'easy-peasy'; | ||
|
||
const SteamDiskSpaceFeature = () => { | ||
const [ visible, setVisible ] = useState(false); | ||
const [ loading ] = useState(false); | ||
|
||
const status = ServerContext.useStoreState(state => state.status.value); | ||
const { clearFlashes } = useFlash(); | ||
const { connected, instance } = ServerContext.useStoreState(state => state.socket); | ||
const isAdmin = useStoreState(state => state.user.data!.rootAdmin); | ||
|
||
useEffect(() => { | ||
if (!connected || !instance || status === 'running') return; | ||
|
||
const errors = [ | ||
'steamcmd needs 250mb of free disk space to update', | ||
'0x202 after update job', | ||
]; | ||
|
||
const listener = (line: string) => { | ||
if (errors.some(p => line.toLowerCase().includes(p))) { | ||
setVisible(true); | ||
} | ||
}; | ||
|
||
instance.addListener(SocketEvent.CONSOLE_OUTPUT, listener); | ||
|
||
return () => { | ||
instance.removeListener(SocketEvent.CONSOLE_OUTPUT, listener); | ||
}; | ||
}, [ connected, instance, status ]); | ||
|
||
useEffect(() => { | ||
clearFlashes('feature:steamDiskSpace'); | ||
}, []); | ||
|
||
return ( | ||
<Modal visible={visible} onDismissed={() => setVisible(false)} closeOnBackground={false} showSpinnerOverlay={loading}> | ||
<FlashMessageRender key={'feature:steamDiskSpace'} css={tw`mb-4`} /> | ||
{isAdmin ? | ||
<> | ||
<div css={tw`mt-4 sm:flex items-center`}> | ||
<h2 css={tw`text-2xl mb-4 text-neutral-100 `}>Out of available disk space...</h2> | ||
</div> | ||
<p css={tw`mt-4`}>This server has run out of available disk space and cannot complete the install or update process.</p> | ||
<p css={tw`mt-4`}>Ensure the machine has enough disk space by typing <code css={tw`font-mono bg-neutral-900 rounded py-1 px-2`}>df -h</code> on the machine hosting this server. Delete files or increase the available disk space to resolve the issue.</p> | ||
<div css={tw`mt-8 sm:flex items-center justify-end`}> | ||
<Button onClick={() => setVisible(false)} css={tw`w-full sm:w-auto border-transparent`}> | ||
Close | ||
</Button> | ||
</div> | ||
</> | ||
: | ||
<> | ||
<div css={tw`mt-4 sm:flex items-center`}> | ||
<h2 css={tw`text-2xl mb-4 text-neutral-100`}>Out of available disk space...</h2> | ||
</div> | ||
<p css={tw`mt-4`}>This server has run out of available disk space and cannot complete the install or update process. Please get in touch with the administrator(s) and inform them of disk space issues.</p> | ||
<div css={tw`mt-8 sm:flex items-center justify-end`}> | ||
<Button onClick={() => setVisible(false)} css={tw`w-full sm:w-auto border-transparent`}> | ||
Close | ||
</Button> | ||
</div> | ||
</> | ||
} | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default SteamDiskSpaceFeature; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.