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

Add asciinema service #157

Open
Jacques-z opened this issue Mar 4, 2024 · 4 comments
Open

Add asciinema service #157

Jacques-z opened this issue Mar 4, 2024 · 4 comments
Labels
good first issue Good for newcomers New Service Adds a new service to the playbook

Comments

@Jacques-z
Copy link
Contributor

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 moan0s added New Service Adds a new service to the playbook good first issue Good for newcomers labels Mar 4, 2024
@moan0s
Copy link
Member

moan0s commented Mar 4, 2024

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
Copy link
Contributor Author

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

  • I should read the docs of asciinema's and gotosocial's self-host doc, compare them and transform to asciinema's ansible-role?
  • Are there any tutorials of doing so? Or is it worth having one?
  • 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?
  • 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?

@moan0s
Copy link
Member

moan0s commented Mar 4, 2024

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

  • identify which image you need to use (ghcr.io/asciinema/asciinema-server:20240203) and put it in the defaults/main.yml
  • identify which environment settings you need, you need to adjust these in the templates/env file and set everything you need in defaults/main.yml. Some things like the postgres connection will later be set by the mash playbook so leave placeholders for this (gotosocial will have the same)

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 \

@Jacques-z
Copy link
Contributor Author

I've adjusted gts template to make it run atuin service on my own server.
Run sub.sh should substitute gotosocials with atuin.
But seems there's other stuff to be done(e.g. editing some yml files in the mash repo) before we can use it as other services.
Also, there're some details I can't deal with, such as ownership transfer. Please help me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers New Service Adds a new service to the playbook
Projects
None yet
Development

No branches or pull requests

2 participants