diff --git a/.github/workflows/build-test-publish.yml b/.github/workflows/build-test-publish.yml index 2154a933..70c0ed9b 100644 --- a/.github/workflows/build-test-publish.yml +++ b/.github/workflows/build-test-publish.yml @@ -10,25 +10,25 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - name: Get Node.js uses: actions/setup-node@v1 with: - node-version: '12.x' + node-version: '16.x' - run: npm ci - run: npm run build python-test: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: matrix: - python-version: [2.7, 3.5, 3.6, 3.7, 3.8] + python-version: [3.8] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Test with unittest @@ -37,15 +37,15 @@ jobs: js-test: needs: [build, python-test] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: matrix: - node: [ '0.12', '4', '6', '8', '10', '12', '14' ] # Major releases as described in https://nodejs.org/en/download/releases/ + node: [ '10', '12', '14' , '16' ] # Major releases as described in https://nodejs.org/en/download/releases/ name: Node ${{ matrix.node }} sample steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup node - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - run: npm install @@ -54,18 +54,18 @@ jobs: publish: needs: [build, python-test, js-test] if: ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event_name == 'schedule' - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: - node-version: '12.x' + node-version: '16.x' registry-url: 'https://registry.npmjs.org' - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.8 - - run: npm ci + - run: npm ci - name: Build typescript files run: npm run build - name: Download csv databases @@ -80,15 +80,15 @@ jobs: mkdir old cd old npm init -y - npm install fast-geoip + npm install doc999tor-fast-geoip - name: Compare new and old data id: compare run: | - if ! diff -qrN ./data ./old/node_modules/fast-geoip/data; then + if ! diff -qrN ./data ./old/node_modules/doc999tor-fast-geoip/data; then echo "::set-output name=changed::true" git config user.email "$GITHUB_ACTOR@users.noreply.github.com" git config user.name "$GITHUB_ACTOR" - npm version patch + npm version patch else echo "::set-output name=changed::false" fi diff --git a/.gitignore b/.gitignore index 62678ae4..21634105 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ node_modules build tests/mock_data/*.js npm-debug.log +.env diff --git a/downloadDatabases.py b/downloadDatabases.py index 07c23e2b..d983739b 100644 --- a/downloadDatabases.py +++ b/downloadDatabases.py @@ -7,7 +7,7 @@ def rmtree(directory): shutil.rmtree(directory, ignore_errors=True) -urllib.request.urlretrieve ("https://geoip.maxmind.com/app/geoip_download?edition_id=GeoLite2-City-CSV&suffix=zip&license_key=" + os.environ["MAXMIND_LICENSE_KEY"], ZIP_FILENAME) +urllib.request.urlretrieve ("https://download.maxmind.com/app/geoip_download_by_token?edition_id=GeoLite2-City-CSV&suffix=zip&license_key=" + os.environ["MAXMIND_LICENSE_KEY"], ZIP_FILENAME) with zipfile.ZipFile(ZIP_FILENAME, 'r') as zip_ref: zip_ref.extractall(TEMPORAL_EXTRACTED_DIR) diff --git a/package-lock.json b/package-lock.json index cba3c60a..4ee26c07 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,19 +1,49 @@ { - "name": "fast-geoip", - "version": "1.1.88", - "lockfileVersion": 1, + "name": "doc999tor-fast-geoip", + "version": "1.1.288", + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "doc999tor-fast-geoip", + "version": "1.1.288", + "license": "MIT", + "devDependencies": { + "@types/node": "^18.7.23", + "typescript": "^4.8.3" + } + }, + "node_modules/@types/node": { + "version": "18.13.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz", + "integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg==", + "dev": true + }, + "node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + } + }, "dependencies": { "@types/node": { - "version": "14.0.20", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.20.tgz", - "integrity": "sha512-MRn/NP3dee8yL5QhbSA6riuwkS+UOcsPUMOIOG3KMUQpuor/2TopdRBu8QaaB4fGU+gz/bzyDWt0FtUbeJ8H1A==", + "version": "18.13.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz", + "integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg==", "dev": true }, "typescript": { - "version": "3.9.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.6.tgz", - "integrity": "sha1-jz4BmKNMOuFwkbNVcdOv0xmZNlo=", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true } } diff --git a/package.json b/package.json index e1199930..b9183a80 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "fast-geoip", - "version": "1.1.88", - "description": "A faster & low-memory replacement for geoip-lite, a node library that maps IPs to geographical information", + "name": "doc999tor-fast-geoip", + "version": "1.1.288", + "description": "Fork of a faster & low-memory replacement for geoip-lite, a node library that maps IPs to geographical information", "directories": { "test": "tests" }, @@ -17,9 +17,9 @@ ], "repository": { "type": "git", - "url": "git+https://github.com/corollari/fast-geoip.git" + "url": "git+https://github.com/Doc999tor/fast-geoip.git" }, - "author": "corollari", + "author": "doc999tor", "license": "MIT", "files": [ "data/*", @@ -31,7 +31,7 @@ "main": "build/index.js", "types": "build/index.d.ts", "devDependencies": { - "@types/node": "^14.0.20", - "typescript": "^3.9.6" + "@types/node": "^18.7.23", + "typescript": "^4.8.3" } }