Skip to content

Commit

Permalink
panel: update backups config, add AWS_USE_PATH_STYLE_ENDPOINT (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxhoesel authored Nov 18, 2023
1 parent a13a023 commit cb74bd8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
30 changes: 21 additions & 9 deletions roles/pterodactyl_panel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,22 +138,34 @@ Prefix for all options: `pterodactyl_panel_admin_`

#### Backups

##### `pterodactyl_panel_backup_enable`
- Whether to enable the backup system for servers
- If disabled, no backup settings will be added to the panel configuration file
##### `pterodactyl_panel_backup_configure`
- Whether to configure the backup settings in the .env server settings file
- If disabled, the default panel configuration for backups (local backups on the `wings` nodes) will be used
- Default: `false`

##### `pterodactyl_panel_backup_driver`
- The driver to use for backups
- Only has an effect if `pterodactyl_panel_backup_configure` is set to `true`
- Choice of backup driver for the pterodactyl panel
- Choices are:
- `wings` (the default if `pterodactyl_panel_backup_configure` is `false`)
- `s3` for S3 backup storage
- Default: `s3`

##### S3 Storage
- `pterodactyl_panel_aws_endpoint: ""`
- `pterodactyl_panel_aws_default_region: ""`
- `pterodactyl_panel_aws_access_key_id: ""`
- `pterodactyl_panel_aws_secret_access_key: ""`
- `pterodactyl_panel_aws_backups_bucket: ""`

The following variables are available for configuring the S3 backup driver.
Adjust them as needed.

Prefix: `pterodactyl_panel_aws_`

| Name | Description | Default |
|------|-------------|---------|
| `endpoint` | S3 Endpoint | `""` |
| `default_region` | S3 region such as `us-east-1` | `""` |
| `access_key_id` | ID of your access key | `""` |
| `secret_access_key` | The secret belonging to your access key | `""` |
| `backups_bucket` | Name of the bucket to store the backups in | `""` |
| `use_path_style_endpoint` | Use `domain.com/bucket`-style endpoints instead of the default `bucket.domain.com` | `false` |

#### Other

Expand Down
3 changes: 2 additions & 1 deletion roles/pterodactyl_panel/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ pterodactyl_panel_admin_password: admin
pterodactyl_panel_admin_firstname: Admin
pterodactyl_panel_admin_lastname: Admin

pterodactyl_panel_backup_enable: no
# this var was renamed, preserve compatibility
pterodactyl_panel_backup_configure: "{{ pterodactyl_panel_backup_enable | default(false) }}"
pterodactyl_panel_backup_driver: s3

pterodactyl_panel_aws_endpoint: ""
Expand Down
3 changes: 2 additions & 1 deletion roles/pterodactyl_panel/templates/env.j2
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ QUEUE_HIGH=high
QUEUE_STANDARD=standard
QUEUE_LOW=low

{% if pterodactyl_panel_backup_enable %}
{% if pterodactyl_panel_backup_configure %}
APP_BACKUP_DRIVER={{ pterodactyl_panel_backup_driver | quote }}
AWS_DEFAULT_REGION={{ pterodactyl_panel_aws_default_region | quote }}
AWS_ACCESS_KEY_ID={{ pterodactyl_panel_aws_access_key_id | quote }}
AWS_SECRET_ACCESS_KEY={{ pterodactyl_panel_aws_secret_access_key | quote }}
AWS_BACKUPS_BUCKET={{ pterodactyl_panel_aws_backups_bucket | quote }}
AWS_ENDPOINT={{ pterodactyl_panel_aws_endpoint | quote }}
AWS_USE_PATH_STYLE_ENDPOINT={{ pterodactyl_panel_aws_use_path_style_endpoint }}
{% endif %}

0 comments on commit cb74bd8

Please sign in to comment.