Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add GEOTMPDIR env #258

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,18 @@ geoip.startWatchingDataUpdate();

This tool can be used with `npm run-script updatedb` to periodically update geo data on a running server.

#### Environment variables

The following environment variables can be set.

```bash
# Override the default node_modules/geoip-lite/data dir
GEOTMPDIR=/some/path

# Override the default node_modules/geoip-lite/tmp dir
GEODATADIR=/some/path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit too late (since the PR has already been merged), but still: comments and vars are mixed up

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feel free to submit a new MR. I haven't made a new release yet.

```

Caveats
-------

Expand Down
2 changes: 1 addition & 1 deletion scripts/updatedb.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if (typeof geodatadir !== 'undefined') {
process.exit(1);
}
}
var tmpPath = path.resolve(__dirname, '..', 'tmp');
var tmpPath = process.env.GEOTMPDIR ? process.env.GEOTMPDIR : path.resolve(__dirname, '..', 'tmp');
var countryLookup = {};
var cityLookup = {};
var databases = [
Expand Down
Loading