Code Monkey home page Code Monkey logo

fastly-logging-proxy's Introduction

Fastly Log Streaming HTTPS Proxy

This proxy enables using Fastly's HTTPS log streaming with Compute@Edge support to services that cannot implement Fastly's challenge/response protocolo, like RequestBin, Zapier and others.

This small server supports the Fastly HTTPS logging challenge at /.well-known/fastly/logging/challenge and proxes to the server URL at the environment variable PROXY_URL without a challenge-response.

Note: It is configured to be deployed to Heroku's free tier for testing purposes. This can be adjusted by forking this repo and editing the app.json file.

See more here:

To Do

  • Proxy server-side logging from HTTPS log streaming
  • Heroku one button deployment (default to free tier)
  • Papertrail logging on Heroku (defaulls to free tier). Currently covers proxy service only
  • Proxy Fastly server-side logging directly to Papertrail
  • Fastly CLI Tail Logging support by implementing subscription service

Installation

Heroku

Deploy

During the installation process, set the following environment variables.

Variable Type Required Notes
PORT integer n auto-populated by Heroku
FASTLY_SERVICE_IDS string n a comma-delimited list of Service IDs. To support any Service ID, leave empty or explicitly set to *. Do not run the SHA256 checksum yourself, as the proxy service will automaticaly hash the Service IDs in the FASTLY_SERVICE_IDS environment variable.
PROXY_URL string y the URL where the incoming body should be posted to. Only HTTP POST method is supported for now.

Once this is set up, set your Heroku URL to be your Fastly logging endpoint, for example:

https://{my-log-proxy}.herokuapp.com

The challenge response will be automatically provided at:

https://{my-log-proxy}.herokuapp.com/.well-known/fastly/logging/challenge

Running locally

If you want to run this service locally, you can do this by running it behind a ngrok reverse proxy.

Other

For other deployment modes, this is a simple zero-dependency net/http server and should be easy to deploy.

fastly-logging-proxy's People

Contributors

dependabot[bot] avatar grokify avatar

Watchers

 avatar

fastly-logging-proxy's Issues

Heroku deploy results in errors

Deploying commit 0e107b7

results in the following error:

-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
-----> Go app detected
-----> Fetching jq... done
-----> Fetching stdlib.sh.v8... done
-----> 
       Detected go modules via go.mod
-----> 
       Detected Module Name: github.com/grokify/fastly-logging-proxy
-----> 
-----> New Go Version, clearing old cache
-----> Installing go1.18.3
-----> Fetching go1.18.3.linux-amd64.tar.gz... 
 !     Push failed due to an unrecognized error, and we've been notified.
 !     Please try pushing again.
 !     If the problem persists, see https://help.heroku.com/ and provide Request ID 7c45c0e1-4c24-72b3-4322-c179233b306a.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.