Skip to content

Configuration

paranarimasu edited this page Nov 30, 2022 · 38 revisions

Note: WIP. Please contact para in the Discord for corrections or missing information.


Here we will configure the application for our development environment.

This guide covers configurations that expose settings to the .env file. This guide does not provide an overview for all configuration files.

API

File: config/api.php

These properties pertain to how to interact with the AnimeThemes API.

API Domain

These properties represent the base URL that the API is served from.

API_URL

Set this value if the API should be served from a subdomain such as api.animethemes.test. Otherwise, leave this null.

API_PATH

Set this value if the API is served from the top-level domain such as animethemes.test/api. Otherwise, leave this null.

Audio

File: config/audio.php

These properties pertain to how audio files are stored and served.

Audio Disk

These properties define the filesystem disks where audio are hosted.

AUDIO_DEFAULT_DISK

The primary filesystem that audio will be served from. This disk is also used for validation and reconciliation.

AUDIO_DISKS

The list of filesystems that host audio. AnimeThemes hosts audio in each region where servers are hosted, so we need to perform storage operations against each configured filesystem. For local environments, this can be set to the same value as the default filesystem.

Audio Domain

These properties represent the base URL that audio is served from.

AUDIO_URL

Set this value if audio should be served from a subdomain such as a.animethemes.test. Otherwise, leave this null.

AUDIO_PATH

Set this value if audio should be served from the top-level domain such as animethemes.test/audio. Otherwise, leave this null.

Audio Streaming

These values represent the method by which audio is streamed.

AUDIO_STREAMING_METHOD

At the time of writing, AnimeThemes supports streaming audio through php (response) and nginx (nginx). For local environments, response should be sufficient. Nginx streaming is suitable for staging and production environments with higher amounts of traffic.

AUDIO_NGINX_REDIRECT

The location directive that nginx uses to handle the request and serve audio.

Dump

File: config/dump.php

These properties pertain to how dump files are stored and served.

Dump Disk

These properties define the filesystem disks where dumps are hosted.

DUMP_DISK

The filesystem that dumps will be served from.

Dump Domain

These properties represent the base URL that dumps are served from.

DUMP_URL

Set this value if dumps should be served from a subdomain such as dump.animethemes.test. Otherwise, leave this null.

DUMP_PATH

Set this value if dumps should be served from the top-level domain such as animethemes.test/dump. Otherwise, leave this null.

Feature Flags

File: config/flags.php

These properties are the flags that toggle application features.

ALLOW_VIDEO_STREAMS

When video streams are allowed, requests to the video.show route will stream video. If disabled, requests to the video.show route will raise a 403 Forbidden response.

ALLOW_AUDIO_STREAMS

When audio streams are allowed, requests to the audio.show route will stream video. If disabled, requests to the audio.show route will raise a 403 Forbidden response.

ALLOW_DISCORD_NOTIFICATIONS

When discord notifications are allowed, event listeners shall send discord notifications to the configured discord channel through the configured bot. If discord notifications are not allowed, event listeners shall not send discord notifications.

We may leave this as false if we do not want to dispatch discord notifications. If set to true, we need to ensure that we have configured the needed properties for the discord service in the config/services.php file AND the needed properties for our desired queue worker in config/queue.php to process the dispatched jobs to the configured service.

ALLOW_VIEW_RECORDING

When set to true, a view will be created for the viewable model in the show action of the resource controller. When set to false, a view will not be recorded. By default, this flag is set to false.

ALLOW_DUMP_DOWNLOADING

When dump downloads are allowed, requests to the dump.show route will download dumps. If disabled, requests to the dump.show route will raise a 403 Forbidden response.

ALLOW_SCRIPT_DOWNLOADING

When script downloads are allowed, requests to the videoscript.show route will download scripts. If disabled, requests to the videoscript.show route will raise a 403 Forbidden response.

Image

File: config/image.php

These properties pertain to how images are stored.

Image Disk

These properties define the filesystem disk where images are hosted.

IMAGE_DISK

The filesystem that images will be served from.

Services

File: config/services.php

These properties store credentials for third party services such as Mailgun, Postmark, AWS and more. We should review this file if configuring external services.

MAL_CLIENT_ID

Token used to identify AnimeThemes to MyAnimeList when making requests to the MAL API. This is used for backfilling actions. Unless work is being done for these actions, this can be left null.

DO_BEARER_TOKEN

Bearer HTTP authentication scheme token used for hosting API calls. This is needed for the transparency page, but can be left null unless work is being done specifically for this page.

Video

File: config/video.php

These properties pertain to how video files are stored and served.

Video Disk

These properties define the filesystem disks where video are hosted.

VIDEO_DEFAULT_DISK

The primary filesystem that video will be served from. This disk is also used for validation and reconciliation.

VIDEO_DISKS

The list of filesystems that host video. AnimeThemes hosts video in each region where servers are hosted, so we need to perform storage operations against each configured filesystem. For local environments, this can be set to the same value as the default filesystem.

Video Domain

These properties represent the base URL that video is served from.

VIDEO_URL

Set this value if video should be served from a subdomain such as v.animethemes.test. Otherwise, leave this null.

VIDEO_PATH

Set this value if video should be served from the top-level domain such as animethemes.test/video. Otherwise, leave this null.

Video Streaming

These values represent the method by which video is streamed.

VIDEO_STREAMING_METHOD

At the time of writing, AnimeThemes supports streaming video through php (response) and nginx (nginx). For local environments, response should be sufficient. Nginx streaming is suitable for staging and production environments with higher amounts of traffic.

VIDEO_NGINX_REDIRECT

The location directive that nginx uses to handle the request and serve video.

Web

File: config/web.php

These properties pertain to how to interact with web routes.

API Domain

These properties represent the base URL that web routes are served from.

WEB_URL

Set this value if web routes should be served from a subdomain such as app.animethemes.test. Otherwise, leave this null.

WEB_PATH

Set this value if web routes should be served from the top-level domain such as animethemes.test/app. Otherwise, leave this null.

Wiki

These properties pertain to configuration for integration with animethemes-web.

Featured Theme

On the home page of the wiki client, there is a component for a featured theme. The featured theme will showcase an OP/ED picked by staff or patrons. The video for the featured theme will play muted, blurred and looped in the background of the page. To resolve the featured theme, we need to provide the desired pivot row between entry and video. To resolve the desired pivot row, these values should correspond to the primary keys of the respective models.

WIKI_FEATURED_ENTRY

The Anime Theme Entry ID for the featured theme.

WIKI_FEATURED_VIDEO

The Video ID for the featured theme.

Wiki Routes

These properties pertain to routes needed for actions that are handled by animethemes-web.

WIKI_LOGIN

The address of the Login Page.

WIKI_RESET_PASSWORD

The address of the Reset Password Page.