mother-of-all-self-hosting / mash-playbook

🐋 Ansible playbook which helps you host various FOSS services as Docker containers on your own server
GNU Affero General Public License v3.0
457 stars 55 forks source link

Add asciinema service #157

Open Jacques-z opened 7 months ago

Jacques-z commented 7 months ago

Thx for the project and I enjoy it much! Today I found that asciinema's service looks worth adding to this book, too. Will anyone employ it?

moan0s commented 7 months ago

Looks cool! It really depends if someone is interested in this service and wants to do this. Generally, this service seems pretty straightforward and a good first service to add for anyone that wants to contribute to this playbook. You could for example copy ansible-role-gotosocial as it has the same requirements (one docker container, database, webserver).

If anyone wants to do this but needs help, we are happy to provide assistance!

Jacques-z commented 7 months ago

I tried to do this. Sorry as I'm quite new to these. Here are my questions:

moan0s commented 7 months ago

You have copied the gotosocial role and now have a role you adjust right?

I should read the docs of asciinema's and gotosocial's self-host doc, compare them and transform to asciinema's ansible-role?

I'd try to only look at the quick start guide of asciinema, that will be enough to get started. Your goal is to

Are there any tutorials of doing so? Or is it worth having one? No and while it's probably worth having one, it also is kinda hard to generalize.

seems variables like GTS_XXX are defined but never used? I didn't find anything refer to them in mash and gotosocial doc. So what do they do and how should I write asciinema's?

Can you provide an example for that? Usually all should be used

variables in the doc are like xyz-abc, but their equivalents in the mash yml are service_xyz_abc. So a tool translates it? What is it and why bother?

We don't make use of a configuration file but only use environment variables. All environment variables in gotosocial start with GTS_ as described here. For asciinema this is not the case, here you just use e.g. SMTP_HOST as shown in quick start. For the role variables this would be asciinema_smtp_host so we can use the role in mash without confusion.

Example of a templates/env (not complete)

URL_HOST={{ asciinema_hostname }}

{% if asciinema_smtp_host %}
SMTP_HOST={{ asciinema_smtp_host }}
SMTP_USERNAME={{ asciinema_smtp_username }}
SMTP_PASSWORD={{ asciinema_smtp_password }}
{% endif %}

{{ asciinema_environment_variables_extension }}

You'll also need to adjust templates/systemd/asciinema_.service and replace this line

                --mount type=bind,src={{ gotosocial_data_path }},dst=/gotosocial/storage \

with something like this

                --mount type=bind,src={{ asciinema_data_path }},dst=/var/opt/asciinema \