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 I hate money #352

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions docs/services/ihatemoney.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# ihatemoney

[ihatemoney](https://github.com/spiral-project/ihatemoney) is a self-hosted shared budget manager, that this playbook can install, powered by the [ansible-role-ihatemoney](https://github.com/IUCCA/ansible-role-ihatemoney) Ansible role.


## Dependencies

This service requires the following other services:
- a [Postgres](postgres.md) database
- a [Traefik](traefik.md) reverse-proxy server


## Configuration

To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process:

```yaml
########################################################################
# #
# ihatemoney #
# #
########################################################################

ihatemoney_enabled: true

# To enable the Admin dashboard, first generate a hashed password with:
# docker run -it --rm --entrypoint ihatemoney ihatemoney/ihatemoney generate_password_hash
#ihatemoney_admin_password:
ihatemoney_environment_variable_public: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit unclear what ihatemoney_environment_variable_public actually does.

Should it be set to true at some point later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If your instance is meant to be open for everyone to freely create projects, you would set it to true.
If your instance is intended for private use, and you want to restrict project creation to users with the admin password, you would set it to false (or simply not set it, as false is the default).

I have adapted the documentation a little, now it should be clearer

ihatemoney_hostname: mash.example.com
ihatemoney_path_prefix: /ihatemoney

########################################################################
# #
# /ihatemoney #
# #
########################################################################
```

### URL

In the example configuration above, we configure the service to be hosted at `https://mash.example.com/ihatemoney`.

## Usage

After installation, you can go to the ihatemoney URL, as defined in `ihatemoney_hostname` and `ihatemoney_path_prefix`.
1 change: 1 addition & 0 deletions docs/supported-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
| [Headscale](https://headscale.net/) | A Tailscale-compatible control server for managing Tailscale devices | [Link](services/headscale.md) |
| [Healthchecks](https://healthchecks.io/) | A simple and Effective Cron Job Monitoring solution | [Link](services/healthchecks.md) |
| [Hubsite](https://github.com/moan0s/hubsite) | A simple, static site that shows an overview of the available services | [Link](services/hubsite.md) |
| [I hate money](https://github.com/spiral-project/ihatemoney) | An open source shared budget manager. | [Link](services/ihatemoney.md) |
| [ILMO](https://github.com/moan0s/ILMO2) | An open source library management tool. | [Link](services/ilmo.md) |
| [Infisical](https://infisical.com/) | An open-source end-to-end encrypted platform for securely managing secrets and configs across your team, devices, and infrastructure. | [Link](services/infisical.md) |
| [InfluxDB](https://www.influxdata.com/) | A self-hosted time-series database. | [Link](services/influxdb.md) |
Expand Down
103 changes: 103 additions & 0 deletions templates/group_vars_mash_servers
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,11 @@ mash_playbook_devture_systemd_service_manager_services_list_auto_itemized:
{{ ({'name': (healthchecks_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'healthchecks']} if healthchecks_enabled else omit) }}
# /role-specific:healthchecks

# role-specific:ihatemoney
- |-
{{ ({'name': (ihatemoney_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'ihatemoney']} if ihatemoney_enabled else omit) }}
# /role-specific:ihatemoney

# role-specific:ilmo
- |-
{{ ({'name': (ilmo_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'ilmo']} if ilmo_enabled else omit) }}
Expand Down Expand Up @@ -835,6 +840,17 @@ mash_playbook_postgres_managed_databases_auto_itemized:
}}
# /role-specific:gotosocial

# role-specific:ihatemoney
- |-
{{
({
'name': ihatemoney_database_name,
'username': ihatemoney_database_username,
'password': ihatemoney_database_password,
} if ihatemoney_enabled else omit)
}}
# /role-specific:ihatemoney

# role-specific:ilmo
- |-
{{
Expand Down Expand Up @@ -2774,6 +2790,16 @@ hubsite_service_healthchecks_description: "A simple and Effective Cron Job Monit
hubsite_service_healthchecks_priority: 1000
# /role-specific:healthchecks

# role-specific:ihatemoney
# ihatemoney
hubsite_service_ihatemoney_enabled: "{{ ihatemoney_enabled }}"
hubsite_service_ihatemoney_name: ihatemoney
hubsite_service_ihatemoney_url: "https://{{ ihatemoney_hostname }}{{ ihatemoney_path_prefix }}"
hubsite_service_ihatemoney_logo_location: "{{ role_path }}/assets/ihatemoney.png"
hubsite_service_ihatemoney_description: "Manage your shared expenses, easily"
hubsite_service_ihatemoney_priority: 1000
# /role-specific:ihatemoney

# role-specific:keycloak
# Keycloak
hubsite_service_keycloak_enabled: "{{ keycloak_enabled }}"
Expand Down Expand Up @@ -3106,6 +3132,19 @@ mash_playbook_hubsite_service_list_auto_itemized:
}}
# /role-specific:healthchecks

# role-specific:ihatemoney
- |-
{{
({
'name': hubsite_service_ihatemoney_name,
'url': hubsite_service_ihatemoney_url,
'logo_location': hubsite_service_ihatemoney_logo_location,
'description': hubsite_service_ihatemoney_description,
'priority': hubsite_service_ihatemoney_priority,
} if hubsite_service_ihatemoney_enabled else omit)
}}
# /role-specific:ihatemoney

# role-specific:keycloak
- |-
{{
Expand Down Expand Up @@ -3324,6 +3363,70 @@ hubsite_service_list_auto: "{{ mash_playbook_hubsite_service_list_auto_itemized
# /role-specific:hubsite


# role-specific:ihatemoney
########################################################################
# #
# ihatemoney #
# #
########################################################################

ihatemoney_enabled: false

ihatemoney_identifier: "{{ mash_playbook_service_identifier_prefix }}ihatemoney"

ihatemoney_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}ihatemoney"

ihatemoney_uid: "{{ mash_playbook_uid }}"
ihatemoney_gid: "{{ mash_playbook_gid }}"

ihatemoney_systemd_required_services_list_auto: |
{{
([postgres_identifier ~ '.service'] if postgres_enabled and ihatemoney_database_hostname == postgres_identifier else [])
}}

ihatemoney_systemd_wanted_services_list_auto: |
{{
([(exim_relay_identifier | default('mash-exim-relay')) ~ '.service'] if (exim_relay_enabled | default(false) and ihatemoney_email_host == exim_relay_identifier | default('mash-exim-relay')) else [])
}}

ihatemoney_container_additional_networks_auto: |
{{
(
([postgres_container_network] if postgres_enabled and ihatemoney_database_hostname == postgres_identifier and ihatemoney_container_network != postgres_container_network else [])
+
([exim_relay_container_network | default('mash-exim-relay')] if (exim_relay_enabled | default(false) and ihatemoney_email_host == exim_relay_identifier | default('mash-exim-relay') and ihatemoney_container_network != exim_relay_container_network) else [])
+
([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else [])
) | unique
}}


ihatemoney_container_labels_traefik_enabled: "{{ mash_playbook_traefik_labels_enabled }}"
ihatemoney_container_labels_traefik_docker_network: "{{ mash_playbook_reverse_proxyable_services_additional_network }}"
ihatemoney_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}"
ihatemoney_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}"

ihatemoney_database_hostname: "{{ postgres_identifier if postgres_enabled else '' }}"
ihatemoney_database_port: "{{ '5432' if postgres_enabled else '' }}"
ihatemoney_database_username: "ihatemoney"
ihatemoney_database_password: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'db.ihatemoney', rounds=655555) | to_uuid }}"

ihatemoney_environment_variable_secret: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'secret.imoney', rounds=655555) | to_uuid }}"

# role-specific:exim_relay
ihatemoney_email_host: "{{ exim_relay_identifier if exim_relay_enabled else '' }}"
ihatemoney_email_port: "{{ 8025 if exim_relay_enabled else '' }}"
ihatemoney_default_from_email: "{{ exim_relay_sender_address if exim_relay_enabled else '' }}"
# /role-specific:exim_relay

########################################################################
# #
# /ihatemoney #
# #
########################################################################
# /role-specific:ihatemoney



# role-specific:ilmo
########################################################################
Expand Down
4 changes: 4 additions & 0 deletions templates/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@
version: v1.27.2-0
name: hubsite
activation_prefix: hubsite_
- src: git+https://github.com/IUCCA/ansible-role-ihatemoney.git
version: v6.1.5-1
name: ihatemoney
activation_prefix: ihatemoney_
- src: git+https://github.com/moan0s/ansible-role-ilmo.git
version: v1.0.4-0
name: ilmo
Expand Down
4 changes: 4 additions & 0 deletions templates/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@
- role: galaxy/hubsite
# /role-specific:hubsite

# role-specific:ihatemoney
- role: galaxy/ihatemoney
# /role-specific:ihatemoney

# role-specific:ilmo
- role: galaxy/ilmo
# /role-specific:ilmo
Expand Down