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

Get geolocation about a given IP address #138

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
28779ba
Get geolocation about a given IP address
cegerhardson Jun 2, 2023
23df1d1
Add necessary bits to run test locally, and move to new location.
cegerhardson Jun 6, 2023
fc08d73
Add Github Actions to deploy Fastly's Compute@Edge: getGeolocationFor…
cegerhardson Jun 6, 2023
0b966f4
Place deploy-geoip.yaml in the correct location to be triggered
cegerhardson Jun 6, 2023
7224f68
Prepare for testing, and delete old file paths.
cegerhardson Jun 6, 2023
e70054b
Add project_directory value
cegerhardson Jun 6, 2023
97c4ec6
Move project_diretory value
cegerhardson Jun 6, 2023
f7246fc
Trying to fix path bug.
cegerhardson Jun 7, 2023
5a3506c
Trying again
cegerhardson Jun 7, 2023
37271a3
Just trying
cegerhardson Jun 7, 2023
4473889
Fingers-crossed
cegerhardson Jun 7, 2023
5a97097
Testing for auth
cegerhardson Jun 7, 2023
77ca319
Maybe?
cegerhardson Jun 7, 2023
6f4f8be
Update fastly-compute/geoip/fastly.toml
cegerhardson Jun 8, 2023
84bd996
Update fastly-compute/geoip/fastly.toml
cegerhardson Jun 8, 2023
3cd7cf2
Add Github Actions to deploy Fastly's Compute@Edge: getGeolocationFor…
cegerhardson Jun 6, 2023
1dc6920
Include region in geolocation return values.
cegerhardson Jun 8, 2023
5ec7b1b
Merge branch 'ComputeAtEdge_Test' of https://github.com/python/pypi-i…
cegerhardson Jun 9, 2023
9616015
Add Service ID
cegerhardson Jun 13, 2023
2a83ae9
Add authentication configuration via Fastly's ConfigStore.
cegerhardson Jun 15, 2023
9c5177e
Add necessary file for configuation
cegerhardson Jun 15, 2023
629c057
Update fastly-compute/geoip/.secret.json
ewdurbin Jun 15, 2023
665dd7d
Update README
cegerhardson Jun 27, 2023
44347b6
Update service description
cegerhardson Jun 27, 2023
d9f1270
Reconfigure authentication and prettify
cegerhardson Jun 27, 2023
f284d67
Update
cegerhardson Jun 28, 2023
262f214
Update references
cegerhardson Jun 29, 2023
9d67bc5
change config store name
cegerhardson Jun 30, 2023
bbafc46
get rid of try/catch
cegerhardson Jun 30, 2023
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
22 changes: 22 additions & 0 deletions .github/workflows/deploy-geoip.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Deploy Compute@Edge GeoIp
on:
push:
# branches: [main]
## Note: by removing the branches value, the workflow will run when a push is made to any branch. This is to serve for testing.
Comment on lines +4 to +5
Copy link
Member

Choose a reason for hiding this comment

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

We likely want to restore this behavior

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed 👍


jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install project dependencies
run: npm install
working-directory: fastly-compute/geoip

- name: Deploy to Compute@Edge
uses: fastly/compute-actions@v5
with:
project_directory: ./fastly-compute/geoip
env:
FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}
3 changes: 3 additions & 0 deletions fastly-compute/geoip/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules
/bin
/pkg
3 changes: 3 additions & 0 deletions fastly-compute/geoip/.secret.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"sup3rs3cr3t" : "true"
}
13 changes: 13 additions & 0 deletions fastly-compute/geoip/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Get Geolocation Information About a Given IP Address

This service using [Fastly's Compute@Edge](https://developer.fastly.com/learning/compute/) to get specific geolcation information about a given IP address, and deploys automagically using Github Actions.

## Getting started

- Be sure to install [Fastly's CLI](https://developer.fastly.com/learning/tools/cli/)
- As well as the dependencies: `npm install`

## Try it out locally

`fastly compute serve --watch`
- This application should now be running on http://localhost:7676
19 changes: 19 additions & 0 deletions fastly-compute/geoip/fastly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This file describes a Fastly Compute@Edge package. To learn more visit:
# https://developer.fastly.com/reference/fastly-toml/

authors = ["[email protected]"]
description = "geoip"
language = "javascript"
manifest_version = 3
name = "geoip"
service_id = "CnsNqIdpSj1tZNLTl6PUi4"

[scripts]
build = "npm run build"

[local_server]
[local_server.config_stores]
[local_server.config_stores.geoip_auth]
file = ".secret.json"
format = "json"

ewdurbin marked this conversation as resolved.
Show resolved Hide resolved
Loading