1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_etebase.git synced 2024-08-16 10:19:52 +02:00
ansible_role_etebase/README.md

96 lines
5.9 KiB
Markdown
Raw Normal View History

2022-11-14 01:42:00 +01:00
[![MIT License](https://raw.githubusercontent.com/roles-ansible/ansible_role_etebase/main/.github/license.svg)](https://github.com/roles-ansible/ansible_role_etebase/blob/main/LICENSE)
2022-11-15 20:42:10 +01:00
[![Galaxy](https://raw.githubusercontent.com/roles-ansible/ansible_role_etebase/main/.github/galaxy.svg)](https://galaxy.ansible.com/do1jlr/etebase)
2022-11-14 01:42:00 +01:00
2022-11-10 00:12:22 +01:00
Ansible role EteBase - EteSync 2.0 Server Backend
===================================================
2022-11-15 22:24:46 +01:00
Ansible role to Setup and Confugure Etebase - The Backend from [EteSync](https://www.etesync.com/) 2.0 -> [https://github.com/etesync/server](https://github.com/etesync/server.git).
2022-11-10 00:12:22 +01:00
2022-11-14 01:42:00 +01:00
Details
---------
This Ansible role installs and configures etebase, the backend of etesync. A piece of software to securely sync your contacts, calendars, tasks and notes!
2022-11-15 22:24:46 +01:00
In this Ansible role, a separate user is created for etebase. The latest release of etebase is downloaded to the home of this user. A configuration is created. The specified Python dependencies are installed in a venv. And optionally etebase can be started automatically via a systemd service and uvicorn.
2022-11-15 22:15:35 +01:00
This Ansible role does not create users in Etebase. And the configuration for the web server is not created either. More about this in the [Additional Information](#additional-information) section.
2022-11-14 01:42:00 +01:00
Default Variables
-----------
| variable | value | description |
| -------- | ----- | ----------- |
2022-11-15 02:03:33 +01:00
| etebase__user | ``etebase`` | The Unix User for etebase |
| etebase__group | ``etebase`` | The Unix Group for etebase |
| etebase__user_home | ``/var/lib/etebase`` | Etebase User Home |
| etebase__shell | ``/bin/false`` | Default Shell of Etebase User |
| etebase__venv_path | ``{{ etebase__user_home }}/venv`` | Etebase venv path |
2022-11-15 02:03:33 +01:00
| etebase__socket | ``/tmp/etebase_server.sock`` | Etebase Socket path *(only if ``etebase__systemd_setup`` is set to ``true``)* |
| etebase__package_state | ``present`` | Set to ``latest`` to upgrade all etebase required system and pip packages to the latest version |
| etebase__version | ``latest`` | Etebase Release Tag |
| etebase__secrets_dir | ``{{ etebase__user_home }}/secrets`` | Path to store etebase secrets |
| etebase__collectstatic | ``true`` | Generate static files for etebase |
| etebase__restart_webserver | ``false`` | Set to ``true`` to restart the webserver on config change *(etebase__systemd_setup needed)*|
| etebase__webserver_service | ``nginx.service`` | Which systemd unit should be restartet for the webserver |
| etebase__systemd_setup | ``false`` | Set to ``true`` to start etebase as systemd unit with the systemd socket configured above |
2022-11-17 01:53:50 +01:00
| etebase__create_backup | ``false`` | Should this role create a backup before upgrading etebase |
| etebase__backup_destionation | ``{{ etebase__user_home }}/backup`` | Destination directory for backup |
| etebase__backup_sqlite | ``true`` | If we do a backup we could skipping the sqlite3 database by flipping this |
2022-11-15 02:03:33 +01:00
| submodules_versioncheck | ``false`` | should we do a simple version check for this ansible role |
2022-11-14 01:42:00 +01:00
Options for etebase-server.ini
------------------------------
| variable | value | description |
| -------- | ----- | ----------- |
2022-11-15 02:03:33 +01:00
| etebase__global_secret_file | ``{{ etebase__secrets_dir }}/secret.txt`` | path of secret.txt
| etebase__global_debug | ``false`` | Set debug to true |
| etebase__global_static_root | ``{{ etebase__user_home }}/static_root`` | Path of static root |
| etebase__global_media_root | ``{{ etebase__user_home }}/media_root`` | Path for media |
| etebase__global_extra | | Variable for aditional parameter in the ``[global]`` section of the config file |
| etebase__allowed_hosts_allowed_host1 | ``*`` | The allowed Host for this etebase server |
| etebase__allowed_hosts_extra | |Variable for aditional parameter in the ``[allowed_hosts]`` section of the config file |
| etebase__database_engine | ``django.db.backends.sqlite3`` | Databse Engine |
2022-11-15 02:08:58 +01:00
| etebase__database_name | ``{{ etebase__secrets_dir }}/etebase.db.sqlite3`` | Path of the sqlite3 database |
2022-11-15 02:03:33 +01:00
| etebase__database_extra | | Variable for aditional parametet in the ``[database]`` section of the config file |
| etebase__database_options_extra | | Variable for aditional parameter in the ``[database_options]`` section of the config file |
| etebase__ldap_extra | | Variable for aditional parameter in the ``[ldap]`` section of the config file |
| etebase__config_extra | |Variable for aditional parameter at the end of the config file |
2022-11-14 01:42:00 +01:00
Additional Information
------------------------
2022-11-15 22:24:46 +01:00
You find more information about the webserver config at [github.com/etesync/server/wiki/Production-setup-using-Nginx](https://github.com/etesync/server/wiki/Production-setup-using-Nginx). Please remember the value you used for the ``etebase__socket`` variable, if you used this role to start the [uvicorn](https://www.uvicorn.org/) ASGI server via systemd. For this you have to set ``etebase__systemd_setup`` to ``true``.
2022-11-14 01:42:00 +01:00
2022-11-15 22:09:30 +01:00
You have to create a admin User by yourself. To do this, log in manually as priviledged user, change to the ``etebase__user_home``. Enter the downloaded etebase code direcotory and run the ``python3 ./manage.py createsuperuser`` command in the venv:
2022-11-14 01:42:00 +01:00
```bash
2022-11-15 22:24:46 +01:00
# go to etebase home
2022-11-14 01:42:00 +01:00
cd /var/lib/etebase/
2022-11-15 22:24:46 +01:00
# change to latest etebase version
ls -l etebase_*
2022-11-14 01:42:00 +01:00
cd etebase_v0.10.0 # example versiom
2022-11-15 22:24:46 +01:00
# enable latest venv
ls -l /var/lib/etebase/venv
source /var/lib/etebase/venv/v0.10.0/bin/activate # example version
2022-11-15 22:24:46 +01:00
# create new superuser
python3 ./manage.py createsuperuser
2022-11-14 01:42:00 +01:00
```
2022-11-15 02:03:33 +01:00
By the way, this role requires that the Ansible user be allowed to execute commands with sudo privileges.
2022-11-15 21:15:28 +01:00
Example Playbook
------------------
```yml
---
2022-11-15 22:15:35 +01:00
- name: Install etebase server at example.com
hosts: example.com
2022-11-15 21:15:28 +01:00
roles:
- {role: do1jlr.etebase, tags: etebase}
vars:
etebase__allowed_hosts_allowed_host1: 'example.com'
etebase__systemd_setup: true
submodules_versioncheck: true
```
2022-11-15 02:03:33 +01:00
Contributing
--------------
Don't hesitate to open a issue or *(even better)* create a pull request.