Docker repo: https://hub.docker.com/repository/docker/downey/web-monetization-proxy
Simple proxy for injecting Web Monetization meta
tags. Intended to be deployed as a sidecar process alongside Web Monetization unaware webapps.
This proof-of-concept project was created for fun as part of the DEV "Grant For The Web" Hackathon. It should not be relied on for production use cases and merely exists to demonstrate what is possible. In the future it might be worth exploring doing something similar using Envoy proxies and a WASM plugin that implements this functionality.
The proxy relies on the following environment variables:
PROXY_PORT
-- the port the proxy listens onBACKEND_PORT
-- the port of the backend application that requests are forwarded toPAYMENT_POINTER
-- an Interledger Payment Pointer string
Reference the example Deployment to see how you might configure these in Kubernetes.
This project uses Go modules which work best with Golang 1.13+. To run the project's tests, run go test ./...
from the root directory.
This project uses Cloud Native Buildpacks and the pack
cli in lieu of a Dockerfile
. New images can be built by running the following:
pack build <image-name-here> -B cloudfoundry/cnb:bionic
To ease development and deployment to Kubernetes, it also includes some kbld
configuration in the build
directory and a sample Kubernetes Deployment
in the hack
directory.
To quickly build, push, and deploy to Kubernetes run1:
kbld -f hack -f build | kubectl apply -f -
1 - You will need to update build/destinations.yaml
to refer to an OCI image registry you have permission to push to and replace hack/example-ingress.yaml
with Ingress
configuration that is valid for your cluster.