sensorpush-proxy

command module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2023 License: ISC Imports: 2 Imported by: 0

README

sensorpush-proxy

A rate-limiting, authentication-hiding proxy for SensorPush data.

Usage

More than likely, you want to use the already-built Docker container for this, so that you can just throw your credentials and sensor config at it and go. The Docker image includes a helper query command so that you can more easily discover the IDs of your SensorPush sensors.

Uses the SensorPush API to fetch data.


(from puppycam-sensor...)

In order to get the config into the deployed container without putting it in plaintext in the source, we end-run through the Drone "encrypted secret" mechanism, and decode/expand it during the build.

  • config.yaml -> base64 encoded (one line) -> drone encrypt
drone encrypt JaredReisinger/puppycam-sensor $(cat config.yaml | base64 -w0)

This (as of this moment) results in:

0z6PxJVqtfoSWiUb+831gUC1jViO5zctZkwyqTJ7AfUY1c8Vmc1v3oiCgAWqAr/qH6ZXaC/H6CiOI9fjkVlOM6XafVeUi19kkq6dESzZxvdv1+y6MVA8jy9+7olrcQeagu4PQ0JjtbYdgIUTuPpBT5LR2lQEPKZqJHGVYeAzLsSOwIastH/M8oLihGbDYTu/cBsCxAEgAMTq11jz4vn9/eThEZQ5PbkmglP1ww==

Then, in the drone file, we include the above string as a secret, put the value into an environment variable (called CONFIG_YAML), and re-hydrate as a local file:

printf "$${CONFIG_YAML}" | base64 -d > config.yaml

Note that the double-$ is needed to prevent Drone from attempting to expand the value itself.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
config
Package config provides common config and CLI support for the sensorpush proxy and tools, so that each tool does not need to duplicate the common settings and config parsing logic.
Package config provides common config and CLI support for the sensorpush proxy and tools, so that each tool does not need to duplicate the common settings and config parsing logic.
jsonapi
Package jsonapi provides a very basic JSON REST-like API client.
Package jsonapi provides a very basic JSON REST-like API client.
sensorpush
Package sensorpush provides a wrapper for accessing the SensorPush API.
Package sensorpush provides a wrapper for accessing the SensorPush API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL