Skip to content

Commit

Permalink
Merge pull request #124 from anarion80/add_rallly
Browse files Browse the repository at this point in the history
✨ Add Rallly
  • Loading branch information
anarion80 authored May 7, 2024
2 parents 437642d + 9757b54 commit cb741b8
Show file tree
Hide file tree
Showing 11 changed files with 265 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ If you have a spare domain name you can configure applications to be accessible
* [pyLoad](https://pyload.net/) - A download manager with a friendly web-interface
* [PyTivo](http://pytivo.org) - An HMO and GoBack server for TiVos.
* [Radarr](https://radarr.video/) - for organising and downloading movies
* [Rallly](https://github.com/lukevella/rallly/) - an open-source scheduling and collaboration tool
* [Romm](https://github.com/zurdi15/romm) - A game library manager focused on retro gaming
* [Releasebell](https://github.com/anarion80/releasebell) - Starred GitHub repositories notifications
* [Restic](https://restic.net/) - A modern backup program
Expand Down
4 changes: 4 additions & 0 deletions nas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,10 @@
tags:
- radarr

- role: rallly
tags:
- rallly

- role: rclone
tags:
- rclone
Expand Down
57 changes: 57 additions & 0 deletions roles/rallly/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
rallly_enabled: false
rallly_available_externally: false

# directories
rallly_data_directory: "{{ docker_home }}/rallly"

# network
rallly_port: "3018"
rallly_hostname: "rallly"
rallly_network_name: "rallly"

# specs
rallly_memory: 1g
rallly_db_memory: 1g

# docker
rallly_container_name: rallly
rallly_image_name: "lukevella/rallly"
rallly_image_version: latest
rallly_db_container_name: rallly-db
rallly_db_image_name: postgres
rallly_db_image_version: 14.2
rallly_user_id: "1000"
rallly_group_id: "1000"

# rallly
rallly_postgres_user: rallly
rallly_postgres_password: rallly
rallly_postgres_db: "rallly"
rallly_secret_password: abcdefghijklmnopqrstuvwxyz1234567890
rallly_next_public_base_url: "https://{{ rallly_hostname }}.{{ ansible_nas_domain }}"
rallly_next_public_app_base_url: "https://{{ rallly_hostname }}.{{ ansible_nas_domain }}"
# A connection string to your Postgres database
rallly_database_url: postgres://{{ rallly_postgres_user }}:{{ rallly_postgres_password }}@{{ rallly_db_container_name }}:5432/{{ rallly_postgres_db }}

# EMAIL CONFIG (required for sending emails)

# All outgoing emails will show this email as the sender's email address, which also serves as the support email.
rallly_support_email: "rallly@{{ ansible_nas_domain }}"
# The host address of your SMTP server
rallly_smtp_host: "localhost"
# The port of your SMTP server
rallly_smtp_port: "25"
# Set to "true" if SSL is enabled for your SMTP connection
rallly_smtp_secure: "false"
# The username (if auth is enabled on your SMTP server)
rallly_smtp_user: ""
# The password (if auth is enabled on your SMTP server)
rallly_smtp_pwd: ""

# OPTIONAL CONFIG

# Comma separated list of email addresses that are allowed to register and login.
# You can use wildcard syntax to match a range of email addresses.
# Example: "[email protected],[email protected]" or "*@example.com"
rallly_allowed_emails: ""
11 changes: 11 additions & 0 deletions roles/rallly/docs/rallly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Rallly

Homepage: [https://github.com/lukevella/rallly](https://github.com/lukevella/rallly)

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

## Usage

Set `rallly_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file.

rallly web interface can be found at [http://ansible_nas_host_or_ip:3018](http://ansible_nas_host_or_ip:3018).
6 changes: 6 additions & 0 deletions roles/rallly/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
rallly_enabled: true
10 changes: 10 additions & 0 deletions roles/rallly/molecule/default/side_effect.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
rallly_enabled: false
26 changes: 26 additions & 0 deletions roles/rallly/molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Get rallly db container state
community.docker.docker_container:
name: "{{ rallly_db_container_name }}"
register: result_db

- name: Get rallly container state
community.docker.docker_container:
name: "{{ rallly_container_name }}"
register: result

- name: Check if rallly containers are running
ansible.builtin.assert:
that:
- result_db.container['State']['Status'] == "running"
- result_db.container['State']['Restarting'] == false
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false
26 changes: 26 additions & 0 deletions roles/rallly/molecule/default/verify_stopped.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml

- name: Try and stop and remove rallly db
community.docker.docker_container:
name: "{{ rallly_db_container_name }}"
state: absent
register: result_db

- name: Try and stop and remove rallly
community.docker.docker_container:
name: "{{ rallly_container_name }}"
state: absent
register: result

- name: Check if rallly is stopped
ansible.builtin.assert:
that:
- not result_db.changed
- not result.changed
1 change: 1 addition & 0 deletions roles/rallly/requirements.yml
109 changes: 109 additions & 0 deletions roles/rallly/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
- name: Start Rallly
block:
- name: Create Rallly Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ rallly_data_directory }}"

- name: Create Rallly network
community.docker.docker_network:
name: "{{ rallly_network_name }}"

- name: Create Rallly Db Docker Container
community.docker.docker_container:
name: "{{ rallly_db_container_name }}"
image: "{{ rallly_db_image_name }}:{{ rallly_db_image_version }}"
pull: true
volumes:
- "{{ rallly_data_directory }}/postgres:/var/lib/postgresql/data:rw"
networks:
- name: "{{ rallly_network_name }}"
network_mode: "{{ rallly_network_name }}"
container_default_behavior: no_defaults
env:
POSTGRES_USER: "{{ rallly_postgres_user }}"
POSTGRES_PASSWORD: "{{ rallly_postgres_password }}"
POSTGRES_DB: "{{ rallly_postgres_db }}"
labels:
traefik.enable: "false"
restart_policy: always
memory: "{{ rallly_db_memory }}"
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U {{ rallly_postgres_user }}']
interval: 10s
timeout: 5s
retries: 5

- name: Create Rallly Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ rallly_container_name }}"
image: "{{ rallly_image_name }}:{{ rallly_image_version }}"
pull: true
volumes:
- "{{ rallly_data_directory }}/config:/root/.rallly/config:rw"
- "{{ rallly_data_directory }}/storage:/root/.rallly/storage:rw"
networks:
- name: "{{ rallly_network_name }}"
network_mode: "{{ rallly_network_name }}"
ports:
- "{{ rallly_port }}:3000"
env:
NODE_ENV: "production"
SELF_HOSTED: "true"
# A random 32-character secret key used to encrypt user sessions
SECRET_PASSWORD: "{{ rallly_secret_password }}"
# The base url where this instance is accessible, including the scheme.
# Example: https://example.com
NEXT_PUBLIC_BASE_URL: "{{ rallly_next_public_base_url }}"
NEXT_PUBLIC_APP_BASE_URL: "{{ rallly_next_public_app_base_url }}"
# A connection string to your Postgres database
DATABASE_URL: "{{ rallly_database_url }}"

# EMAIL CONFIG (required for sending emails)

# All outgoing emails will show this email as the sender's email address, which also serves as the support email.
SUPPORT_EMAIL: "{{ rallly_support_email }}"
# The host address of your SMTP server
SMTP_HOST: "{{ rallly_smtp_host }}"
# The port of your SMTP server
SMTP_PORT: "{{ rallly_smtp_port }}"
# Set to "true" if SSL is enabled for your SMTP connection
SMTP_SECURE: "{{ rallly_smtp_secure }}"
# The username (if auth is enabled on your SMTP server)
SMTP_USER: "{{ rallly_smtp_user }}"
# The password (if auth is enabled on your SMTP server)
SMTP_PWD: "{{ rallly_smtp_pwd }}"

# OPTIONAL CONFIG

# Comma separated list of email addresses that are allowed to register and login.
# You can use wildcard syntax to match a range of email addresses.
# Example: "[email protected],[email protected]" or "*@example.com"
ALLOWED_EMAILS: "{{ rallly_allowed_emails }}"
restart_policy: unless-stopped
memory: "{{ rallly_memory }}"
labels:
traefik.enable: "{{ rallly_available_externally | string }}"
traefik.http.routers.rallly.rule: "Host(`{{ rallly_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.rallly.tls.certresolver: "letsencrypt"
traefik.http.routers.rallly.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.rallly.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.rallly.loadbalancer.server.port: "3000"
when: rallly_enabled is true

- name: Stop Rallly
block:
- name: Stop Rallly db
community.docker.docker_container:
name: "{{ rallly_db_container_name }}"
state: absent

- name: Stop Rallly
community.docker.docker_container:
name: "{{ rallly_container_name }}"
state: absent
when: rallly_enabled is false
14 changes: 14 additions & 0 deletions website/docs/applications/other/rallly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "Rallly"
description: "Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier."
---

Homepage: [https://github.com/lukevella/rallly](https://github.com/lukevella/rallly)

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

## Usage

Set `rallly_enabled: true` in your `inventories/<your_inventory>/group_vars/nas.yml` file.

rallly web interface can be found at [http://ansible_nas_host_or_ip:3018](http://ansible_nas_host_or_ip:3018).

0 comments on commit cb741b8

Please sign in to comment.