This is a lightweight and simple remote config server with a UI for management backed by AWS S3.
The backend API (Go) serves a frontend (Vue) and HTTP endpoints.
I wrote this because I don't want to pay for another service and Firebase doesn't work all the time in web extensions :/
- Create S3 Bucket
- Build the docker image
- Deploy the docker image
That's it!
You can create the S3 bucket however you like. Or you can use an existing one.
See AWS's docs if you've never done this before: https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-bucket.html
Eventually, I'm going to publish this image to docker hub. Until then, build and tag the image yourself:
git clone [email protected]:anime-skip/remote-config.git
docker build . -t my-remove-config
You will have to self host this docker image. AWS, Heroku, GoogleCloud, anywhere that supports deploying docker images will work.
Make sure you provide all the environment variables however your hosting provider allows.
Variable | Required | Default | Example | Description |
---|---|---|---|---|
PORT | ✅ | --- | 80 , 8080 |
The port to run the application on |
AUTH_TOKEN | ✅ | --- | password |
The token used to authenticate changes to the remove config. Config is viewable by everyone, but only writable if you know the token |
AWS_REGION | ✅ | --- | us-east-1 |
The AWS region your bucket is in |
AWS_ACCESS_KEY_ID | ✅ | --- | See AWS Docs | |
AWS_SECRET_ACCESS_KEY | ✅ | --- | See AWS Docs | |
S3_BUCKET | ✅ | --- | remote-config |
The name of the bucket used as storage |
S3_FILE_PATH | ✅ | --- | dev.json , prod.json , path/to/my-file.json |
The path to the file in your bucket. The file can be named whatever, as long as it ends with .json , and the path can excluded or point to any subdirectory. Missing directories will be created |
HTTPie is used for example calls because it's easier to read and understand compared to curl.
http -b
prints just the response body.
List all the apps you have created remote config for.
$ http -b "remote-config.anime-skip.com/api/apps"
[
"Anime Skip Player",
"anime-skip.com"
]
Get the current config for an app.
$ http -b "remote-config.anime-skip.com/api/config/anime-skip.com"
{
"array": [
1,
null,
"string"
],
"number": 69,
"object": {
"key": "value"
},
"optional": null,
"string": "test"
}
Create or update the config for a given app name, returning the updated config.
Requires Authorization: Bearer <token>
header
$ http -b -A bearer -a "<token>" PUT "remote-config.anime-skip.com/api/config/example" key=value
{
"key": "value"
}
Delete an app's config, returning the deleted config
Requires Authorization: Bearer <token>
header
$ http -b -A bearer -a "<token>" DELETE "remote-config.anime-skip.com/api/config/example"
{
"key": "value"
}
- JS client with caching and a synchronous API, based off Firebase: https://github.com/anime-skip/remote-config-client-ts