Skip to content

Environment Variables

NOTE

Ongakuvault uses ASP.NET Configuration providers to allow you to define application settings in multiple ways. This page lists all the available environment variables, but you can also configure the application using appsettings.json or by using cmd/bash arguments when starting the application.

TIP

Some variables have an additional detailed description. You can access them by clicking on the variable name.

Basic configuration

Environment VariableDescriptionDefault ValueDocker Default Value
ASPNETCORE_HTTP_PORTSPort used for HTTP connections.80808080
ASPNETCORE_HTTPS_PORTPort used for HTTPS connections.84438443
ASPNETCORE_Kestrel__Certificates__Default__PathPath to the SSL certificate for https.emptyempty
ASPNETCORE_Kestrel__Certificates__Default__PasswordPassword for the SSL certificate.emptyempty

Advanced configuration

Environment VariableDescriptionDefault ValueDocker Default Value
Ongaku__CLEAR_METADATA_NONSTANDARD_FIELDSRemoves additionals (non-standard) fields from your files metadata.falsefalse
Ongaku__DISABLE_WEBSITEDisables the website at root /, leaving only the API.falsefalse
Ongaku__ENABLE_SWAGGER_DOCEnables Swagger API doc at /swagger.falsefalse
Ongaku__ENFORCE_HTTPSIf true, redirects HTTP to HTTPS.falsefalse
Ongaku__LYRICS_LANGUAGE_PRIORITYLyrics/subtitle languages to prioritize when available. (IETF tags)empty, lyrics fetching disabled.empty
Ongaku__WEB_REQUEST_USERAGENTDefine the user-agent OngakuVault should use for all web requests.emptyempty
Ongaku__SCRAPER_USERAGENTDefine the user-agent the scraper (yt-dlp) should use for all web requests.emptyempty
Ongaku__OUTPUT_DIRECTORYOutput directory for downloaded audio files.empty, defaults to ./archived-audios/home/app/archived-audios
Ongaku__OUTPUT_FILE_FORMATDownloaded files naming templateemptyempty
Ongaku__OUTPUT_SUB_DIRECTORY_FORMATSub directory for downloaded audio files.emptyempty
Ongaku__PARALLEL_SCRAPER_PROCSet the number of parallel scraper processes allowed. (Max 100)88
Ongaku__PARALLEL_JOBSSet the number of download jobs allowed to run at the same time.
(Should be less than PARALLEL_SCRAPER_PROC to leave rooms for information scrapping processes.)
44
Ongaku__TMP_OUTPUT_DIRECTORYTemporary directory for downloading audio, ⚠️deleted at app closure.Temp directory created in OS Temp directoryTemp directory created in OS Temp directory

Detailed descriptions

If you are unsure about the usage of a variable and do not find a detailed description here, take a look at the descriptions in the source code.

CLEAR_METADATA_NONSTANDARD_FIELDS

The CLEAR_METADATA_NONSTANDARD_FIELDS variable allows you to remove every fields that are not part of the metadata specs (like ID3v2) standard format. They are also known as additionals fields. This project uses atldotnet to edit the files metadata, to learn more about what is considered a non-standard field, read the ATL wiki about non standard fields.

LYRICS_LANGUAGE_PRIORITY

The LYRICS_LANGUAGE_PRIORITY variable uses IETF tags returned by the scraper yt-dlp to select, if found, the lyrics language. You can define multiples languages by separating them of a PIPE (|) character.

For example, en-US|en|fr would prioritize en-US language, fallback to en, and finally fallback to fr. If left empty, the application will not fetch any lyrics/subtitle, even if yt-dlp found any.

You can find a list of all existing IETF tags here.

OUTPUT_FILE_FORMAT

The OUTPUT_FILE_FORMAT variable allow for the definition of a template that will be used to rename the downloaded file name. To set dynamic values, refer yourself to the values supported by the used replacing processors.

Values processors used with this parameter: DATE, TRACK

Example: |AUDIO_TITLE|-|AUDIO_YEAR| would result to My_Title-2020.

WARNING

The file format only concerns the file name, if you include a file extension it will only results in a file with "two" file extension. Example: processorsResults.mp3.mp3

OUTPUT_SUB_DIRECTORY_FORMAT

The OUTPUT_SUB_DIRECTORY_FORMAT variable allow for downloaded files to be organised by sub directory insead of beeing directly added to the base output directory. To set dynamic values, refer yourself to the values supported by the used replacing processors.

Values processors used with this parameter: DATE, TRACK

Example: |AUDIO_ARTIST|\|AUDIO_ALBUM| would result to BASE_OUTPUT_DIRECTORY > Artist > Album.

Value Replacing (Dynamic)

Value replacing is the name given to strings surrounded by two PIPE (|) character that get replaced with a specific value during runtime. You can see the helper class that manage value replacing in the source code here.

For example, the Date Processor would replace |NOW_YEAR| with the current year.

Date Processor

Dynamic ValueDescription
NOW_YEARCurrent year
NOW_MONTHCurrent month
NOW_DAYCurrent day
NOW_SECONDCurrent seconds
NOW_TICKSCurrent time in ticks (timestamp)

Track Processor

NOTE

Track is a class from the ATL library containing a file metadata.

Dynamic ValueDescription
AUDIO_TITLECurrent track title OR Unknown
AUDIO_ARTISTCurrent track artist OR Unknown
AUDIO_ALBUMCurrent track album OR Unknown
AUDIO_YEARCurrent track year OR 0
AUDIO_TRACK_NUMBERCurrent track number OR 0
AUDIO_LANGUAGECurrent track language OR Unknown
AUDIO_GENRECurrent track genre OR Unknown
AUDIO_COMPOSERCurrent track composer OR Unknown