moving things arround and rephrasing

This commit is contained in:
Jakob Schrettenbrunner 2021-01-17 15:36:13 +00:00
parent 38c8125e22
commit e08c8f4cd0
6 changed files with 153 additions and 137 deletions

View File

@ -210,14 +210,12 @@ module.exports = {
children: [
'/tutorials/mysql_setup.md',
'/tutorials/creating_ssl_certificates.md',
'/community/about.md',
],
},
{
title: 'Guides',
collapsable: false,
children: [
'/guides/disabling-reCAPTCHA.md',
'/guides/mounts.md',
],
},

View File

@ -1,32 +1,43 @@
# Panel
The official [BUILDING.md](https://github.com/pterodactyl/panel/blob/develop/BUILDING.md)
# Rebuild panel assets
## Install Dependencies
The following commands will install the necessary dependencies for building your panel.
### Install NodeJS
::: tip
You may have to add sudo to the following commands if you are not root.
# Building Panel Assets
:::warning
Do **not** run the following steps on your production nodes.
:::
Instructions on how to build the panel are also available in the [BUILDING.md](https://github.com/pterodactyl/panel/blob/develop/BUILDING.md) file.
The frontend of the Panel is built with React. Any changes to the source files require to recompile it.
This also applies to style sheets. The following sections explain how to do so.
## Install Dependencies
The following commands will install the necessary dependencies for building the Panel assets.
The build tools require NodeJS, yarn is used as the package manager.
```bash
# Ubuntu/Debian
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
apt install -y nodejs
apt install -y nodejs yarn
# CentOS
curl -sL https://rpm.nodesource.com/setup_12.x | sudo -E bash -
yum install -y nodejs # CentOS 7
dnf install -y nodejs # CentOS 8
sudo yum install -y nodejs yarn # CentOS 7
sudo dnf install -y nodejs yarn # CentOS 8
```
By now, you should have NodeJS 12 installed. Make sure this is the case by checking `node -v`
### Install Yarn and Panel Dependencies
Install required javascript packages.
```bash
npm i -g yarn # Installs yarn
# Now you need to make sure you are in the panel directory
cd /var/www/pterodactyl
yarn install # Installs panel build dependencies
yarn # Installs panel build dependencies
```
## Build Panel
Run this in your panel directory to apply changes (usually `/var/www/pterodactyl`)
## Build Panel Assets
The following command will rebuild the Panel frontend.
```bash
cd /var/www/pterodactyl
yarn build:production # Build panel
```

View File

@ -1,42 +1,66 @@
# Customizing Wings
:::warning Production
We highly recommend **NOT** performing these actions on the production
# Building Wings
:::warning
Do **not** run the following steps on your production nodes.
:::
We recommend creating a fork of the repo before making changes to wings to make future upgrades easier. <br />
:::tip Editing Files
We do not provide a guide at the current time on what files to edit to get certain results. This guide expects a basic knowledge of the `Go` language
:::
Wings is written in Go. This makes it very easy to modify and compile it on your own, and distribute your own binaries.
This guide will cover the steps necessary to build it yourself.
## Building Wings
:::tip
By default, Go targets the system it is executed on. Therefore, the easiest way of building binaries for Linux is to execute the following steps on a Linux system.
:::
It will not, however, explain where to look for certain aspects of Wings and which changes are necessary to achieve specific results. Knowledge of the Go language is required if you want to modify it.
### Build Requirements
You need to have an up-to-date version of the Go tools installed. See the [official instructions](https://golang.org/doc/install) for help with setting those up.
Building Go programs is very easy, and the same also applies to Wings. Go is cross-platform, but Wings only supports Linux at the moment. The easiest way to compile it for Linux is to run the commands on a Linux machine.
## Build Requirements
An up to date version of Go is required to compile Wings. The minimum version can be found at the top of the [go.mod](https://github.com/pterodactyl/wings/blob/develop/go.mod) file. See the [official instructions](https://golang.org/doc/install) for help with installing Go.
## Building
Execute the following command in your local clone of the repository to compile Wings into a binary.
### Building
Execute the following command in your local clone of the repository to compile wings into a binary.
```bash
go build
```
You should now have a `wings` binary file in your wings directory.
## Install the new binary
:::tip Root required
To execute the next few commands, you will need root permissions. If you are not logged in as root, either use `sudo` in front of each command, or run `sudo -i` to switch to a root session.
Some the following commands require root permissions. Prepend them with `sudo` if you are not logged in as root.
:::
1. Backup the current installation of wings
```bash
# Stop Wings
systemctl stop wings
# Backup Wings
mv /usr/local/bin/wings /usr/local/bin/wings-backup
```
2. Place the new binary in `/usr/local/bin`
3. Ensure appropriate permissions on the binary `chmod u+x /usr/local/bin/wings`
4. Try running the updated binary from the console `wings --debug`
5. Restore normal operation of Wings `systemctl enable wings --now`
```
cp ./wings /usr/local/bin
```
3. Restart wings
```
systemctl restart wings
```
## Troubleshooting
If the wings service does not start properly, you can try to start Wings in a console window.
```
wings --debug
```
Remember to stop the system service before, and re-enable it afterwards.
```
systemctl stop wings
systemctl start wings
```

View File

@ -1,62 +0,0 @@
# Disabling reCAPTCHA
:::warning SECURITY WARNING
It is highly recommended to keep reCAPTCHA enabled, as reCAPTCHA is a security method that can protect your site from some methods of attack!
Only continue if you intend to re-enable reCAPTCHA after fixing whatever issue you may have!
:::
## Disabling via .env
To disable reCAPTCHA using this method, you need to find and edit your `.env` file, It is usually located at `/var/www/pterodactyl/.env`
:::tip Hidden Files
In linux, files starting with a `.` are considered to be hidden, so most FTP software may not show it by default. You can see the file by using `ls -a`
:::
First, lets back up the `.env` file. If you are not already, now is a good time to make sure you are in the `/var/www/pterodactyl` directory
```bash
cp .env .env.bkp
```
You can now edit the `.env` file using your favorite editor to set the fields below
:::tip Missing Values
If any of the below values are missing from your `.env` file you can add them yourself
:::
```bash
# Ignores database settings
APP_ENVIRONMENT_ONLY=true
# Disable reCAPTCHA. You may need to add this to the end of your file.
RECAPTCHA_ENABLED=false
```
### Restoring Functionality
After fixing your issue, it is **Highly** recommended to re-enable reCAPTCHA in order to protect your panel. This is achived by restoring the previous settings in the `.env` as follows
```bash
# Allows updating panel configuration via the panel (optional)
APP_ENVIRONMENT_ONLY=false
# Ensures reCAPTCHA is enabled
RECAPTCHA_ENABLED=true
```
## Editing your database
:::danger DANGEROUS: Not Recommended
While faster, this method should only be used if the `.env` method fails or you know what you are doing! We do not take responsibility if you manage to corrupt your database using this method!
:::
```sql
mysql -u root -p
USE panel;
UPDATE settings SET value = 'false' WHERE 'key' = 'settings::recaptcha:enabled';
```
If the command returns with `Query OK, 0 rows affected (0.000 sec)` you need to use the `.env` method to disable reCAPTCHA
Again, it is **Highly** recommended to re-enable reCAPTCHA after you fix your issue, whether through the `.env` above or in the panel!

View File

@ -1,51 +1,52 @@
# Using Mounts
A mount in pterodactyl follows similar principles to a docker mount. Pterodactyl already uses the `/home/container` mount thus it or any of it's sub directories can not be used as a different or nested mount.
Mounts can be used to make directories on a node available to servers running on it.
## Wings Configuration
To use a mount you need to permit wings to use the selected mount path, this is done by editing mounts in `/etc/pterodactyl/config.yml`
For security reasons it is not possible to mount direcotries on a node by default. Directories that should be mountable have to be specified explicitly in the Wings configuration.
In the Wings configuration file (`/etc/pterodactyl/config.yml`) the `allowed_mounts` field is used to list mountable directories. The listed directories and all their subdirectories can be mounted.
```yml
allowed_mounts:
- /example
```
where `example` is a path on your system, Mounts allow anything within that path to be used as a mount.
## Panel Configuration
In the pterodactyl panel you need to create and assign a mount.
You have to configure mounts in admin panel in order to use them with your servers. They consist of a source pad on the node and a target path where it will be mounted in the container.
### Creating a mount
:::tip Mount Paths
Mounts can not use any path of `/home/container` and its subdirectories due to docker limitations
:::warning Path in the container
Mounts can not be mounted at `/home/container` or any subdirectory of it, as mounts cannot overlap and the server specific files are mounted at that location.
:::
1. In the admin panel go to **Mounts**
2. Use the create mount option
3. Fill in the details as required
- **Name**: Name for your mount
- **Description**: Description for your mount
- **Source**: File path on your system to where mount files should be stored
- **Target**: File path where the mount will be placed inside of your server, Can NOT be `/home/container`
- **Read Only**: Whether to allow servers to write to the directory
- **User Mountable**: Whether to allow users to self mount this mount
4. After creating the mount you are required to add **Eggs** and **Nodes** that this mount may be used on
:::danger Mount Logic
Mounts do not share data across servers, They only can share paths not files!
### Creating a Mount
1. In the admin panel go to **Mounts**.
2. Create a new mount.
3. Fill in the details as required.
- **Name**: Name for your mount.
- **Description**: Description for your mount.
- **Source**: The directory where files are stored on the node.
- **Target**: The directory where the mount will be placed inside of your server, can **not** be `/home/container`.
- **Read Only**: Whether the mount will be read-only for the servers using it.
- **User Mountable**: Whether to allow users to self mount this mount.
4. After creating the mount you are required to add **Eggs** and **Nodes** that this mount may be used on.
:::warning Mounts used by multiple servers
All servers using the same mounts will **only** share its contents when they are on the same node. Mounts are not synchronized between servers.
:::
### Assigning a mount
### Assigning a Mount to a Server
1. In the admin panel go to the server you would like to use a mount with
1. In the admin panel navigate to the server you would like to use a mount with
2. Go to the mounts page
3. Click the button
3. Click the **+** button
4. Restart the server
The files of the mount should become available in the target path in the container.
:::warning Disclaimer
Mounts do not show in the panel's file manager, nor will they be accessible via sFTP
:::warning Mounts cannot be Accessed
Mounts do not appear in the Panel's file manager, nor are they accessible via SFTP.
:::

View File

@ -2,28 +2,72 @@
[[toc]]
## Backup Configuration
## Backups
Pterodactyl Panel allows users to create backups of their servers. In order to create backups, backup storage has to be configured.
### Using S3 Backups
<!--Might need to expand a bit more on here-->
To use S3 backups you may use the following `.env` variables
AWS S3 (or compatible storage) can be used to store backups. The following configuration options have to be set in the `.env` file in order to enable it.
```bash
# Sets your panel to use s3 for backups
APP_BACKUP_DRIVER=s3
# Info to actually use s3
AWS_DEFAULT_REGION=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_BACKUPS_BUCKET=
AWS_ENDPOINT=
AWS_BACKUPS_USE_ACCELERATE=false
# This was/is planned to be depreciated by AWS thus if set to true it will fail the request.
AWS_USE_PATH_STYLE_ENDPOINT=false
```
## reCAPTCHA
The Panel uses invisible reCAPTCHA to secure the login page from brute-force attacks. If the login attempt is considered suspicious, users may be required to perform a reCAPTCHA challenge.
### Configuring reCAPTCHA
While we provide a global Site Key and Secret Key by default, we highly recommend changing it for your own setup.
You can generate your own keys in the [reCAPTCHA Admin Console](https://www.google.com/recaptcha/admin).
The keys can then be applied using the Settings in the admin panel. The reCAPTCHA settings can be found on the **Advanced**
### Disabling reCAPTCHA
:::warning SECURITY WARNING
We do not recommend disabling reCAPTCHA. It is a security mechanism that makes it harder to perform brute-force attacks on user accounts.
:::
If users have trouble logging in, or your Panel isn't exposed to the internet, in can make sense to disable reCAPTCHA.
reCAPTCHA can easily be disabled using the admin panel. In the Settings, select the **Advanced** tab and set the **Status** of reCAPTCHA to **disabled**.
#### Using the .env file
If you cannot access the panel yourself, you can also disable reCAPTCHA using the `.env` file.
```
RECAPTCHA_ENABLED=false
```
#### Editing your database
:::danger DANGEROUS: Not Recommended
Proceed carefully. By running queries on your database directly, you can easily break your setup.
:::
If you cannot access your panel, but have used the web panel based settings already, you can modify the database directly using the following commands.
```sql
mysql -u root -p
USE panel;
UPDATE settings SET value = 'false' WHERE 'key' = 'settings::recaptcha:enabled';
```
If the command returns with `Query OK, 0 rows affected (0.000 sec)` you need to use the `.env` method to disable reCAPTCHA