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
Support for docker based self-hosting #64
Conversation
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
…testing Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Gitlab Migration: Adding test stage See merge request tckb-public/plausible!1
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Added Dockerfile and cleaned up configurations See merge request tckb-public/plausible!2
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Adding overlay scripts for Db migration on release artifacts See merge request tckb-public/plausible!3
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Something that came to mind as well: Currently, we get the visitor country code from the Since we don't control how Plausible will be deployed, we can't rely on custom headers set by the CDN. We probably need some sort of local geolocation database. There's also a feature request for more accurate location (I guess that means counties/cities). I'll research what the libraries/tools are available for this. EDIT: Based on some light research, it looks to me like using MaxMind's GeoIP database makes the most sense. They identify both countries and cities, there's a free version of the dataset and multiple libraries exist in Elixir that use their database. |
Funny I was actually on suggest MaxMind. I did use it before and does provide pretty accurate results; the free db can be sufficient for most cases. If you want more accurate results, you can subscribe to their enterprise db. We can have a separate discussion on it, if you want |
Awesome. I can pick this is up probably first week on June, after the Clickhouse migration is complete. Another thing that came to mind with Netlify: I use their custom header to get the remote client ip. See the code here: https://github.com/plausible-insights/plausible/blob/master/lib/plausible_web/controllers/api/external_controller.ex#L86 It's really hacky but it works for now. A more robust solution would be using the |
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Addressing PR comments on upstream Closes plausible#16 See merge request tckb-public/plausible!18
Using custom headers isn't necessarily hacky , with @ukutaht I cleaned up the PR, reverted the formatting change. I will add the formatting changes to a different PR. |
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
adding docker-compose.yml and related instructions See merge request tckb-public/plausible!19
this is because, it is much to test in local dev machines and in most cases there's already a layer above which is capable for `https` termination and http -> https upgrade Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
using `plausible_url` instead of base_domain See merge request tckb-public/plausible!20
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested things out locally
- Docker-compose works
-
mix phx.server
works - Running as Mix release works
I'm happy with the state of the PR. Today I'm planning to deploy a new release of Plausible using a Clickhouse database. I've been working with it for almost a month, I can help integrate the new database into this infra setup if needed.
@tckb let me know if you agree with the next steps:
- Resolve conflicts
- Integrate Clickhouse
- Merge this PR
- I will start using this setup locally (probably still running
mix phx.server
instead ofdocker-compose
to take advantage of code reloading) - I will set up Travis and DockerHub for this repository
- Deploy a staging version using DockerHub.
- Deploy a production release using DockerHub.
- Public alpha release of self-hosted Plausible. Going forward I will keep a proper Changelog/Release notes and conform to the release tagging system we agreed on.
I will look into the changes, it would definately require changes to Dockerfile and docker-compose. It would be helpful if you push all your changes and have code-freeze until I make the changes or have the release/changes fixed date for the next push. This will help in saving time for ping-pong updates and fix my timeline.
This is on my plate, I will take care of it. Need some time as I explained above.
Yes, that will be good idea.
I can help you in setting up CI/CD pipeline. We can discuss this offline.
Yes, a blog-post would be awesome!
I think this makes sense and provide more visibility and could also help in actually defining a timeline for your roadmap
I always like semantic versions |
Great! I'm pretty much in a code-freeze for a few days as I'm deploying the new database and working on other performance-related things. There may be some light changes but we should not conflict. As for Clickhouse, here's the configuration for it: Let me know if there's any way I can help with this. I'm available for Twitter DMs and a call if needed :) |
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me>
Resolve "Integrate Clickhouse" Closes plausible#17 See merge request tckb-public/plausible!21
# Conflicts: # config/config.exs # config/dev.exs # config/prod.exs # config/test.exs # lib/mix/tasks/hydrate_clickhouse.ex # lib/plausible_web/controllers/stats_controller.ex # lib/plausible_web/templates/auth/password_reset_request_success.html.eex # mix.lock # test/test_helper.exs
Resolve "Resolve upstream merge conflicts" Closes plausible#18 See merge request tckb-public/plausible!22
@ukutaht All requested changes are finished and is ready for review. I have integrated clickhouse and resolved the conflicts. There's still pending formatting PR . I will raise another one right after this one. |
In this PR, I made changes for making it easy for self-hosting.
Salient changes are listed below:
// Pending changes from review: