Variabili Ambientali
Verdaccio fornisce una serie di variabili ambientali per modificare le autorizzazioni, la porta o il protocollo http. Ecco l'elenco completo:
Docker
Per modificare il comportamento all'esecuzione dell'immagine, ecco un elenco delle variabili disponibili.
| Variabile | Default | Descrizione |
|---|---|---|
| VERDACCIO_APPDIR | /opt/verdaccio | la cartella operativa del docker |
| VERDACCIO_USER_NAME | verdaccio | l'utente del sistema |
| VERDACCIO_USER_UID | 10001 | l'id utente usato per applicare le autorizzazioni della cartella |
| VERDACCIO_PORT | 4873 | la porta di Verdaccio |
| VERDACCIO_PROTOCOL | http | il protocollo http predefinito |
| VERDACCIO_ADDRESS | 0.0.0.0 | the default address to listen on 0.0.0.0 |
VERDACCIO_HANDLE_KILL_SIGNALS
Enables gracefully shutdown, more info at the pull request #2121.
VERDACCIO_PUBLIC_URL
Define a specific public url for your server, it overrules the Host and X-Forwarded-Proto header if a reverse proxy is being used, it takes in account the url_prefix if is defined.
Ciò è utile in quelle situazioni in cui è necessario un URL dinamico.
es.:
VERDACCIO_PUBLIC_URL='https://somedomain.org';
url_prefix: '/my_prefix'
// url -> https://somedomain.org/my_prefix/
VERDACCIO_PUBLIC_URL='https://somedomain.org';
url_prefix: '/'
// url -> https://somedomain.org/
VERDACCIO_PUBLIC_URL='https://somedomain.org/first_prefix';
url_prefix: '/second_prefix'
// url -> https://somedomain.org/second_prefix/'
VERDACCIO_FORWARDED_PROTO
The default header to identify the protocol is X-Forwarded-Proto, but there are some environments which uses something different, to change it use the variable VERDACCIO_FORWARDED_PROTO
$ VERDACCIO_FORWARDED_PROTO=CloudFront-Forwarded-Proto verdaccio --listen 5000
VERDACCIO_STORAGE_PATH
Di default, l'archiviazione è definita dal file di configurazione, ma utilizzare questa variabile consente di impostarla dalla variabile ambientale.
VERDACCIO_STORAGE_NAME
The database name for @verdaccio/local-storage is by default .verdaccio-db.json, but this can be update by using this variable.