Plausible (Analytics Platform)
-
Update: I'm almost done packaging the app! This one was quite difficult! I've managed to make Clickhouse available in a secure, and reasonably elegant fashion, and I've gotten to the point where I can get Plausible working within my Cloudron setup.
Right now, the only task I have left is to use supervisord to manage the Clickhouse and Plausible processes within the same Docker container. Once I complete this, I will release a repository for testing.
-
It works! After a final afternoon learning about Supervisord and multi-process Docker containerization, I was able to create a working Cloudron app package for Plausible! It was a very challenging, but enjoyable process - a journey where I learned how to use multiple tools, such as docker-based build environments, Elixir, Clickbase, and Supervisord. All that remains now is for me to write the documentation and end-to-end unit tests!
I will release a git repository with the unstable app package once I finish writing the documentation. In the meantime, I am going to do some additional testing on my own, including testing of the sendmail addon configuration. In particular, I want to make that the plausible database is properly backed up and restorable, prior to releasing a git repository. I hope to get this done in the next few days!
In the meantime, if you want to help me out, please help me test Plausible! Come visit my website with your ad-blocker disabled, so I can generate some test data. I can't figure out how to work the upstream Elixir test harness, so instead of synthetic data you can provide me with some real data
-
@Sydney great progress. Some questions about clickhouse: my understanding is that clickhouse is a database. This means that it's not "safe" to backup raw files and instead one needs to save/restore clickhouse dumps. Is my understanding correct ? If so, we might have to make clickhouse as an addon.
And along those lines, if clickhouse is to be made an addon, do you know if clickhouse supports multi-tenancy? Similar to postgresql/mysql ? In those databases, you can have a single postgres instance and create multiple databases. Each app's database is completely isolated and you can create credentials for an app and set permissions in such a way that it cannot access another app's database. The other side of this is caches like redis. We spin a redis instance per app since back in the day redis did not support multi-tenancy (maybe this has changed now with redis 6 and ACL).
-
@girish Great questions!
Best Practices for Backing-up Clickhouse
Clickhouse is a database, and you're absolutely right that the best practice for backing up databases would be to save and restore dumps. Right now, for the minimal viable prototype I've simply installed Clickhouse in the read-only Docker image, and then used a customclickhouse-config.xml
file to set it's data directory to/app/data/clickhouse/
. Right now, this seems to work, but a more mature implementation would ideally dump backups to /app/data, and then load them in upon restore. I'll have to do further research to see what's the best way to do this, so please allow me to get back to you with more information.Clickhouse Multi-tenancy and Potential Addon support
Clickhouse does support multi-tenancy. From my understanding, it is a full featured database system that allows you to define multiple users with complex access-control-lists and create multiple independent databases. It even offers a MYSQL-compatible interface for legacy applications. Hence, I believe it will absolutely be possible to implement Clickhouse as a first-class Cloudron addon. It would likewise simplify the backup and restore process as well.I am interested in implementing Clickhouse as a potential addon, for the future. I actually looked into it at the start of the packaging process, but I wasn't able to make much headway because I couldn't find a lot of documentation on how to create Cloudron addons. Where could I find the source code for some of Cloudron's existing addons? If you could direct me to the source code for Cloudron's MySQL, MongoDB, and PostgreSQL addons, I am confident I figure something out by comparing and contrasting the code.
-
Cloudron App Package for Plausible Analytics Released
Hello everyone! Final update for the year of 2023. I have finished writing the initial documentation for my plausible app package, and I am now releasing the git repository for public testing. You may find the link to it below:Please note that the plausible-app package depends upon pre-built Ubuntu binaries. These un-official binaries are built directly from the upstream source at Plausible Analytics, are are compiled automatically using Github Actions. You may find the build environment used to build these binaries below:
Please be advised that while the app package works, it has not been extensively tested. This app package is not ready for production use, and using it may incurr data loss.
-
@girish I've released the beta app package for plausible. Please let me know if you have any feedback: this app package is still very much a work in progress, and I hope to improve it, particularly in regards to the database backup concerns that you outlined earlier.
In particular, I hope to work with you to create a Clickbase addon so we can support Clickbase natively within Cloudron. I think this might be the best way forwards to take care of the backups issue.
-
@Sydney thanks for the work and notes on clickhouse! For addons, I think it's best that we do the work instead of getting this contributed. Mostly because of issues around Cloudron licensing (copyright assignment) and as well as writing tests etc which is not straightforward since we haven't really documented all this. The (platform) project is not set up for contributions unlike app packages. I will look into your clickhouse work and see how easy this is to make it an addon.
-
Thank you for the feedback. I am very excited for Plausible to be a part of the Cloudron app store, and I wish you the best of luck in packaging Clickbase for Cloudron.
For backing up and restoring the Clickbase database, you may reference the
clickbase-backup.sh
andclickbase-restore.sh
scripts in my repository.Should you use any of my code in the Clickhouse addon, I am happy to assign copyright to you - just send me a release form.
In the meantime, for those who are not willing to wait for @girish , feel free to use the code in my repository - it provisions a fully working installation of Plausible with a local Clickhouse db.
-
@Sydney , thank you very much, indeed!
I really hope an app will make to Cloudron sooner, rather than later!
-
Bump on this. I can see it being another one that will bring in new Cloudron users.
-
-
@LoudLemur said in Plausible (Analytics Platform):
It seemed Plausible is a proprietary solution
?
What do you mean? it's AGPL https://github.com/plausible/analytics/blob/master/LICENSE.md