Commit a05b1b74 authored by nono's avatar nono 💻
Browse files

Cleanup of role before publication

parent 06ef25de
This diff is collapsed.
HedgeDocs Role
=========
# HedgeDocs Role
Un rôle pour installer le servide de Pad HedgeDocs
> Un rôle pour installer le service de pad HedgeDocs
Requirements
------------
## Dépendances
Voir : https://github.com/hedgedoc/hedgedoc/blob/master/docs/setup/manual-setup.md
[Documentation officielle](https://github.com/hedgedoc/hedgedoc/blob/master/docs/setup/manual-setup.md)
Ce service à été écrit pour Debian GNU/Linux 10.
- Node.js 10.13 or up
- Database (PostgreSQL, MySQL, MariaDB, SQLite, MSSQL) The database must use charset utf8. This is typically the default in PostgreSQL and SQLite. In MySQL and MariaDB UTF-8 might need to be set with alter database <DBNAME> character set utf8 collate utf8_bin; Be aware of older MySQL and MariaDB versions which sometimes use shorter representations of UTF-8 than 4 bytes. This can break if symbols with more bytes are used. You can use alter database <DBNAME> character set utf8mb4 COLLATE utf8mb4_unicode_ci to be on the safe side.
- NPM (and its dependencies, node-gyp)
Ce service va se charger d'installer les dépendances nécessaires pour faire tourner tout le service. Vous n'avez qu'a remplir les variables décrites ci-dessous dans votre fichier de configuration.
En l'occurence ;
- Node.js 10.13+
- PostgreSQL
- NPM
- Yarn
- Bash (for the setup script)
- For building the HedgeDoc frontend you need a machine with at least 2 GB RAM. Starting with release 1.7 the release tarball includes the frontend, so building it yourself is not necessary.
Vous aurez besoin de gérer la configuration SSL par-vous même, en utilisant par exemple Let's Encrypt ou ZeroSSL. Si vous ne savez pas où mettre vos clés, regardez dans le fichier de configuration nginx.
Role Variables
--------------
## Variables
Voir les variables dans `vars/main.yml`
Dependencies
------------
## Dependencies
Nécessite le module https://docs.ansible.com/ansible/latest/collections/community/postgresql
Example Playbook
----------------
## Example Playbook
- hosts: hedgedocs-server
roles:
- { role: hedgedocs-pad-lqdn,
hedgedoc-version: "1.7.0-rc2",
hedgedoc-sql-password : "default password ITtHlXfTEBwcCypWPX07",
service_hedgedocs_domain : "https://pad.test.lqdn.fr"
hedgedoc_version: "1.7.0-rc2"
service_hedgedocs_domain : "pad.test.lqdn.fr"
hedgedoc_db_name : hedgedocs-user
hedgedoc_db_user : hedgedocs
hedgedoc_sql_password : "{{ vault_hedgedoc_sql_password }}"
hedgedoc_session_secret : "{{ vault_hedgedoc_session_secret }}"
}
License
-------
## Licence
hedgedocs-lqdn
Copyright (C) 2021 nono
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
BSD
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Author Information
## Author Information
------------------
Utilisation chez LQDN ( lqdn.fr )
Écrit par nono <np@laquadrature.net> en 2021, pour La Quadrature du Net ( lqdn.fr ).
# {{ ansible_managed }}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
......
galaxy_info:
author: your name
description: your role description
company: your company (optional)
author: nono
description: HedgeDoc
company: La Quadrature Du Net
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
......@@ -14,7 +14,7 @@ galaxy_info:
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
license: GPL-3.0-only
min_ansible_version: 2.1
......@@ -27,11 +27,10 @@ galaxy_info:
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
platforms:
- name: Debian
versions:
- 10
# - name: SomePlatform
# versions:
# - all
......@@ -47,6 +46,7 @@ galaxy_info:
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
dependencies:
- postgresql
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
......@@ -65,6 +65,6 @@
- name: Service running !
debug:
msg:
- "\n\e[42m;37m Le service Hedgedocs est maintenant en service sur : {{ service_hedgedocs_domain }} !\e[0m\n"
- "Le service Hedgedocs est maintenant en service sur : {{ service_hedgedocs_domain }} !"
# And we're done !
......@@ -6,16 +6,6 @@
state: started
enabled: yes
# - name: Creation de l'utilisateur pour pSQL
# community.general.postgresql_user:
# name: hedgedocs-user
# password: "{{ hedgedoc_sql_password }}"
# priv: "ALL" # NB: Est-ce que ce niveau de privilège est nécessire ?
# comment: "Utilisateur pSQL pour le service hedgedocs"
# db: hedgedoc
# state: present
# role_attr_flags: CREATEDB,NOSUPERUSER
- name: Creation de la base de donnée
become: true
become_user: postgres
......
......@@ -19,3 +19,8 @@
group: www-data
mode: 0740
remote_src: yes
- name: Suppression de l'archive
file:
src: /home/hedgedocs/hedgedoc-source.tar.gz
state: absent
......@@ -11,7 +11,7 @@
groups:
- hedgedocs
- www-data
password: '!' # Utilisateur disabled
password: '!' # Disabled user account
state: present
shell: /usr/sbin/nologin
system: yes
......
......@@ -3,12 +3,7 @@
hedgedoc-version: "1.7.0-rc2"
hedgedoc-sql-password : "{{ vault_service_hedgedocs_sql_password }}"
hedgedoc_session_secret : "{{ vault_hedgedoc_session_secret }}"
hedgedocs-domain: "{{ service_hedgedocs_domain }}"
# Variables pour la configuration du fichier
# Configuration SSL
hedgedocs-ssl-fullchain: "/path/to/ssl"
hedgedocs-ssl-privkey: "/path/to/ssl"
hedgedocs-ssl-dhparams: "/path/to/ssl"
hedgedoc_db_name : hedgedocs-user
hedgedoc_db_user : hedgedocs
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment