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

feat: local backend #20

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

feat: local backend #20

wants to merge 2 commits into from

Conversation

flavio
Copy link
Contributor

@flavio flavio commented Jun 28, 2024

Note: this PR builds on top of #19

I really love how easy it is to sunlight for testing/playing purposes. I've noticed however that sunlight requires access to a S3-compatible server to store the logs data. I've added the possibility to the local filesystem instead of relying on a S3 bucket.
This is not meant to be used in production, it just simplifies the setup for testing purposes.

I hope you like this change. Thanks again for the great tool!

Just for reference, this is the configuration file I used to spin up a local testing instance:

listen: ":8080"

checkpoints: checkpoints.db

logs:
  - name: sunlight.127.0.0.1.sslip.io/2024h1
    shortname: bergamo2024h1
    inception: 2024-06-28
    httpprefix: /2024h1
    roots: ./chain.pem
    key: ./key.pem
    cache: bergamo2024h1.db
    poolsize: 750
    notafterstart: 2024-06-26T00:00:00Z
    notafterlimit: 2024-07-01T00:00:00Z
    localbackend: local_backend

flavio added 2 commits June 28, 2024 14:09
Using sqlite to save checkpoints failed at runtime because:

* Internal Mutex was a nil pointer
* The help messages explaining how to create the sqlite3 database had
  the wrong CREATE statement
* The implementation of the `LockBackend` interface had the `Fetch`
  function return a wrong object (a `dynamoCheckpoint` instead of a
  `sqliteCheckpoint`)

Signed-off-by: Flavio Castelli <[email protected]>
Prior to this commit, sunlight required access to a S3-compatible server
to send backend data.

Now there's the possibility to store this data on the local filesystem.
This is not meant to be used in production, but it hugely simplifies
testing and local development.

Signed-off-by: Flavio Castelli <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant