diff --git a/docs/src/content/docs/guides/self-hosting-registries.mdx b/docs/src/content/docs/guides/self-hosting-registries.mdx index 7c92a06..c856d4d 100644 --- a/docs/src/content/docs/guides/self-hosting-registries.mdx +++ b/docs/src/content/docs/guides/self-hosting-registries.mdx @@ -113,6 +113,10 @@ for this purpose. index repository.\ Example: `pesde@localhost` +- **DATA_DIR**: The directory where the registry stores miscellaneous data. + This value can use `{CWD}` to refer to the current working directory.\ + Default: `{CWD}/data` + - **ADDRESS**: The address to bind the server to.\ Default: `127.0.0.1` diff --git a/registry/.env.example b/registry/.env.example index f4600d1..8c9c0e2 100644 --- a/registry/.env.example +++ b/registry/.env.example @@ -1,11 +1,13 @@ INDEX_REPO_URL = # url of the index repository -GIT_USERNAME= # username of a Git account with push access to the index repository -GIT_PASSWORD= # password of the account (PAT for GitHub) +GIT_USERNAME= # username of a Git account with push access to the index repository +GIT_PASSWORD= # password of the account (PAT for GitHub) COMMITTER_GIT_NAME= # name of the committer used for index updates COMMITTER_GIT_EMAIL= # email of the committer used for index updates +DATA_DIR= # directory where miscellaneous data is stored + # AUTHENTICATION CONFIGURATION # Set the variables of the authentication you want to use in order to enable it diff --git a/registry/src/main.rs b/registry/src/main.rs index faca878..8ce2f67 100644 --- a/registry/src/main.rs +++ b/registry/src/main.rs @@ -85,7 +85,7 @@ async fn run() -> std::io::Result<()> { let port: u16 = benv!(parse "PORT" => "8080"); let cwd = current_dir().unwrap(); - let data_dir = cwd.join("data"); + let data_dir = PathBuf::from(benv!("DATA_DIR" => "{CWD}/data").replace("{CWD}", cwd.to_str().unwrap())); fs_err::create_dir_all(&data_dir).unwrap(); let project = Project::new(