# Panel

Below you will find my live Pelican compose file. I recommend placing this in your Github repo and use [GitOps](/guides/installation-guides/gitops.md) to manage updating the container versions

## Deploy the Compose File

1. Combine the [Shared env file](/guides/installation-guides/pelican/shared-env-file.md) with below and fill the blanks

```dotenv
# --- Passwords ---
## The longer the better. Feel free to use passphrases
MYSQL_ROOT_PASS=
MYSQL_PASS=

# --- Mail Configuration ---
## Defaults to Gmail - you can review the compose file for the variables and edit for other SMTP servers if needed
MAIL_FROM=
MAIL_USERNAME=
MAIL_PASSWORD=
```

{% @github-files/github-code-block url="<https://github.com/trentnbauer/HomelabPublic/blob/main/docker-compose/pelican.yml>" %}

### Set and backup your app key

1. Open the logs for the Panel container
2. Take note of your App Key - save it into your password vault and add it to your .env as `APP_KEY=`
3. Restart the panel container

{% hint style="warning" %}
This is to reduce the risk of [Pterodactyl / Pelican](/guides/troubleshooting/pterodactyl-pelican.md#the-mac-key-is-invalid) bricking your panel - if its occurs and you don't have the key, you will need to reinstall Pelican
{% endhint %}

## Generate Database and Administrator account

1. Enter the Console for the Panel container, by using either docker exec or by using your flavour of Docker webUI
2. Run the below command to generate the database tables and a generic admin account

   ```bash
   php artisan p:environment:setup
   php artisan migrate --force
   php artisan p:user:make --email="noreply@example.com" --username="admin" --password="admin" --admin=1

   ```

{% hint style="warning" %}
These credentials need to be changed ASAP
{% endhint %}

3. Navigate to your panel URL
4. Log in with the generic admin credentials created above (admin/admin)
5. Click on the profile picture in the top right, then select profile
6. Update the username and password to be random generated
7. Save these in your password vault
8. Update the email address

{% hint style="info" %}
As the front end of the panel is public facing, it is best to randomly generate BOTH the username and password to reduce the risk of someone breaking in
{% endhint %}

## Panel Configuration

### Fix the proxy address

1. Click on the profile picture in the top right, then select admin
2. On the left, select settings
3. Under Trusted Proxies, click on 'Set to Cloudflare IPs'
4. Add `192.168.253.0/24`&#x20;

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>This is the IP range of the Pelican management network, which contains the Cloudflare tunnel container.</p><p>This resolves some upload failure errors</p></div>
5. Click on save

### Create your user roles

1. Navigate to your panel URL and access the admin side
2. On the left, select Roles

These are my settings:

{% tabs %}
{% tab title="Administrator" %}
Tick everything!
{% endtab %}

{% tab title="User" %}

<figure><img src="/files/P6sLK05vaegJX91y3PJ6" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

{% hint style="info" %}
My settings may not work for your use-case, but they will be a good starting point
{% endhint %}

### Set up Gmail SMTP

1. Create your Gmail SMTP credentials per [Gmail SMTP](/guides/other-guides/google/gmail-smtp.md)
2. Log into the Pelican admin panel
3. Select settings, the mail
   1. Set to STMP
   2. Add your details
   3. Click on test

### Set up OAuth

1. On the left, click on settings, then Oauth
2. Configure any OAuth methods you wish to use - Pelican will provide you with steps on how to configure each one.\
   \&#xNAN;*I recommend Discord and Steam*\
   *I would also recommend enabling automatic linking but not account creation*
3. Click on Save

### Cloudflare Turnstile (Captcha)

1. Click on the Captcha tab and expand turnstile
2. Navigate to <https://www.cloudflare.com/en-au/application-services/products/turnstile/#turnstile-pricing>
3. Select the free version\
   You may need to go through some sort of sign up process
4. Click on Add Widget
5. Name your widget (Pelican Panel is fine)
6. Click on Add hostname
   1. Add a custom hostname for your Panel domain
7. Widget mode: managed
8. Click on Create
9. Copy the site and secret key provided into Pelican Panel
10. Click on save

{% hint style="info" %}
Sometimes appears to not save the OAuth details - restart your panel if so
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.trentbauer.com/guides/installation-guides/pelican/panel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
