From c88e8b630308cbb15dff93596944d3ceba90eff0 Mon Sep 17 00:00:00 2001 From: Florian Rey Date: Mon, 12 Jun 2023 09:17:29 +0200 Subject: [PATCH] [Elao - App] Remove --- elao.app/.manala.yaml | 230 ------ elao.app/.manala.yaml.tmpl | 121 --- elao.app/.manala/.dockerignore | 2 - elao.app/.manala/.gitignore | 2 - elao.app/.manala/Dockerfile.tmpl | 94 --- elao.app/.manala/Jenkinsfile.tmpl | 321 -------- elao.app/.manala/Makefile.tmpl | 168 ---- elao.app/.manala/Vagrantfile.tmpl | 83 -- elao.app/.manala/ansible/ansible.cfg | 63 -- .../ansible/collections/requirements.yaml | 5 - elao.app/.manala/ansible/deploy.yaml | 7 - .../ansible/inventories/deploy.yaml.tmpl | 48 -- .../ansible/inventories/release.yaml.tmpl | 36 - .../ansible/inventories/system.yaml.tmpl | 254 ------ elao.app/.manala/ansible/release.yaml | 6 - .../roles/certificates/defaults/main.yml | 5 - .../roles/certificates/tasks/main.yaml | 93 --- .../roles/deploy/callback_plugins/.gitignore | 1 - .../roles/deploy/callback_plugins/log.py | 73 -- .../ansible/roles/deploy/defaults/main.yml | 49 -- .../roles/deploy/lookup_plugins/.gitignore | 1 - .../deploy/lookup_plugins/deploy_tasks.py | 59 -- .../lookup_plugins/deploy_writable_dirs.py | 53 -- .../ansible/roles/deploy/tasks/main.yml | 84 -- .../ansible/roles/deploy/tasks/shared.yml | 47 -- .../roles/deploy/tasks/strategy/git.yml | 31 - .../deploy/tasks/strategy/synchronize.yml | 10 - .../roles/deploy/tasks/strategy/unarchive.yml | 14 - .../ansible/roles/deploy/tasks/task/shell.yml | 11 - .../roles/deploy/tasks/writable/dirs.yml | 19 - .../roles/release/callback_plugins/.gitignore | 1 - .../roles/release/callback_plugins/log.py | 73 -- .../ansible/roles/release/defaults/main.yml | 22 - .../roles/release/lookup_plugins/.gitignore | 1 - .../release/lookup_plugins/release_tasks.py | 51 -- .../ansible/roles/release/tasks/main.yml | 114 --- .../roles/release/tasks/task/shell.yml | 11 - elao.app/.manala/ansible/system.yaml | 634 --------------- .../ansible/templates/apt/sources.list.j2 | 5 - .../ansible/templates/git/gitconfig.j2 | 23 - .../.manala/ansible/templates/motd/cow.j2 | 33 - .../.manala/ansible/templates/motd/elao.j2 | 53 -- .../.manala/ansible/templates/motd/yoda.j2 | 44 -- .../templates/mysql/zz-mysqld.cnf.j2.tmpl | 6 - .../.manala/ansible/templates/nginx/cors.j2 | 8 - .../ansible/templates/nginx/default.conf.j2 | 8 - .../.manala/ansible/templates/nginx/gzip.j2 | 7 - .../ansible/templates/nginx/html/404.html.j2 | 36 - .../ansible/templates/nginx/nginx.conf.j2 | 67 -- .../ansible/templates/nginx/no_index.j2 | 1 - .../ansible/templates/nginx/php_fpm_app.j2 | 6 - .../templates/nginx/ssl_offloading.conf.j2 | 18 - .../ansible/templates/ngrok/ngrok.yml.j2 | 1 - .../ansible/templates/ohmyzsh/.zshrc.j2 | 147 ---- .../ansible/templates/ohmyzsh/functions/ip.j2 | 7 - .../ohmyzsh/functions/nginx_timeout.j2 | 9 - .../templates/ohmyzsh/functions/ngrok_http.j2 | 7 - .../templates/ohmyzsh/functions/php_xdebug.j2 | 31 - .../templates/ohmyzsh/theme.zsh-theme.j2 | 36 - .../ansible/templates/php/5.6/app.ini.j2 | 37 - .../ansible/templates/php/50-xdebug.ini.j2 | 19 - .../ansible/templates/php/7.0/app.ini.j2 | 65 -- .../ansible/templates/php/7.1/app.ini.j2 | 41 - .../.manala/ansible/templates/php/app.ini.j2 | 49 -- .../ansible/templates/php/opcache.ini.j2 | 15 - .../templates/ssh/development/ssh_config.j2 | 9 - .../templates/ssh/integration/ssh_config.j2 | 11 - .../ansible/templates/ssh/keys/git.elao.com | 1 - .../ansible/templates/ssh/sshd_config.j2 | 25 - .../ansible/templates/supervisor/app.conf.j2 | 40 - .../ansible/templates/vim/vimrc.local.j2 | 17 - elao.app/.manala/certificates/README.md | 16 - elao.app/.manala/certificates/ca.crt | 29 - elao.app/.manala/certificates/ca.key | 54 -- elao.app/.manala/docker/bin/entrypoint.sh | 26 - elao.app/.manala/docker/make.mk.tmpl | 49 -- .../.manala/github/docker-compose.yaml.tmpl | 60 -- elao.app/.manala/make/git.mk | 30 - elao.app/.manala/make/help.mk | 68 -- elao.app/.manala/make/os.mk | 21 - elao.app/.manala/make/semver.mk | 23 - elao.app/.manala/make/text.mk | 139 ---- elao.app/.manala/make/try.mk | 23 - elao.app/.manala/vagrant/bin/setup.sh.tmpl | 146 ---- elao.app/.manala/vagrant/make.mk | 14 - elao.app/MIGRATION.2021-04.md | 272 ------- elao.app/Makefile.dist | 68 -- elao.app/README.md | 720 ------------------ elao.app/_helpers.tmpl | 44 -- 89 files changed, 5581 deletions(-) delete mode 100644 elao.app/.manala.yaml delete mode 100644 elao.app/.manala.yaml.tmpl delete mode 100644 elao.app/.manala/.dockerignore delete mode 100644 elao.app/.manala/.gitignore delete mode 100644 elao.app/.manala/Dockerfile.tmpl delete mode 100644 elao.app/.manala/Jenkinsfile.tmpl delete mode 100644 elao.app/.manala/Makefile.tmpl delete mode 100644 elao.app/.manala/Vagrantfile.tmpl delete mode 100644 elao.app/.manala/ansible/ansible.cfg delete mode 100644 elao.app/.manala/ansible/collections/requirements.yaml delete mode 100644 elao.app/.manala/ansible/deploy.yaml delete mode 100644 elao.app/.manala/ansible/inventories/deploy.yaml.tmpl delete mode 100644 elao.app/.manala/ansible/inventories/release.yaml.tmpl delete mode 100644 elao.app/.manala/ansible/inventories/system.yaml.tmpl delete mode 100644 elao.app/.manala/ansible/release.yaml delete mode 100644 elao.app/.manala/ansible/roles/certificates/defaults/main.yml delete mode 100644 elao.app/.manala/ansible/roles/certificates/tasks/main.yaml delete mode 100644 elao.app/.manala/ansible/roles/deploy/callback_plugins/.gitignore delete mode 100644 elao.app/.manala/ansible/roles/deploy/callback_plugins/log.py delete mode 100644 elao.app/.manala/ansible/roles/deploy/defaults/main.yml delete mode 100644 elao.app/.manala/ansible/roles/deploy/lookup_plugins/.gitignore delete mode 100644 elao.app/.manala/ansible/roles/deploy/lookup_plugins/deploy_tasks.py delete mode 100644 elao.app/.manala/ansible/roles/deploy/lookup_plugins/deploy_writable_dirs.py delete mode 100644 elao.app/.manala/ansible/roles/deploy/tasks/main.yml delete mode 100644 elao.app/.manala/ansible/roles/deploy/tasks/shared.yml delete mode 100644 elao.app/.manala/ansible/roles/deploy/tasks/strategy/git.yml delete mode 100644 elao.app/.manala/ansible/roles/deploy/tasks/strategy/synchronize.yml delete mode 100644 elao.app/.manala/ansible/roles/deploy/tasks/strategy/unarchive.yml delete mode 100644 elao.app/.manala/ansible/roles/deploy/tasks/task/shell.yml delete mode 100644 elao.app/.manala/ansible/roles/deploy/tasks/writable/dirs.yml delete mode 100644 elao.app/.manala/ansible/roles/release/callback_plugins/.gitignore delete mode 100644 elao.app/.manala/ansible/roles/release/callback_plugins/log.py delete mode 100644 elao.app/.manala/ansible/roles/release/defaults/main.yml delete mode 100644 elao.app/.manala/ansible/roles/release/lookup_plugins/.gitignore delete mode 100644 elao.app/.manala/ansible/roles/release/lookup_plugins/release_tasks.py delete mode 100644 elao.app/.manala/ansible/roles/release/tasks/main.yml delete mode 100644 elao.app/.manala/ansible/roles/release/tasks/task/shell.yml delete mode 100644 elao.app/.manala/ansible/system.yaml delete mode 100644 elao.app/.manala/ansible/templates/apt/sources.list.j2 delete mode 100644 elao.app/.manala/ansible/templates/git/gitconfig.j2 delete mode 100755 elao.app/.manala/ansible/templates/motd/cow.j2 delete mode 100755 elao.app/.manala/ansible/templates/motd/elao.j2 delete mode 100755 elao.app/.manala/ansible/templates/motd/yoda.j2 delete mode 100644 elao.app/.manala/ansible/templates/mysql/zz-mysqld.cnf.j2.tmpl delete mode 100644 elao.app/.manala/ansible/templates/nginx/cors.j2 delete mode 100644 elao.app/.manala/ansible/templates/nginx/default.conf.j2 delete mode 100644 elao.app/.manala/ansible/templates/nginx/gzip.j2 delete mode 100644 elao.app/.manala/ansible/templates/nginx/html/404.html.j2 delete mode 100644 elao.app/.manala/ansible/templates/nginx/nginx.conf.j2 delete mode 100644 elao.app/.manala/ansible/templates/nginx/no_index.j2 delete mode 100644 elao.app/.manala/ansible/templates/nginx/php_fpm_app.j2 delete mode 100644 elao.app/.manala/ansible/templates/nginx/ssl_offloading.conf.j2 delete mode 100644 elao.app/.manala/ansible/templates/ngrok/ngrok.yml.j2 delete mode 100644 elao.app/.manala/ansible/templates/ohmyzsh/.zshrc.j2 delete mode 100644 elao.app/.manala/ansible/templates/ohmyzsh/functions/ip.j2 delete mode 100644 elao.app/.manala/ansible/templates/ohmyzsh/functions/nginx_timeout.j2 delete mode 100644 elao.app/.manala/ansible/templates/ohmyzsh/functions/ngrok_http.j2 delete mode 100644 elao.app/.manala/ansible/templates/ohmyzsh/functions/php_xdebug.j2 delete mode 100644 elao.app/.manala/ansible/templates/ohmyzsh/theme.zsh-theme.j2 delete mode 100644 elao.app/.manala/ansible/templates/php/5.6/app.ini.j2 delete mode 100644 elao.app/.manala/ansible/templates/php/50-xdebug.ini.j2 delete mode 100644 elao.app/.manala/ansible/templates/php/7.0/app.ini.j2 delete mode 100644 elao.app/.manala/ansible/templates/php/7.1/app.ini.j2 delete mode 100644 elao.app/.manala/ansible/templates/php/app.ini.j2 delete mode 100644 elao.app/.manala/ansible/templates/php/opcache.ini.j2 delete mode 100644 elao.app/.manala/ansible/templates/ssh/development/ssh_config.j2 delete mode 100644 elao.app/.manala/ansible/templates/ssh/integration/ssh_config.j2 delete mode 100644 elao.app/.manala/ansible/templates/ssh/keys/git.elao.com delete mode 100644 elao.app/.manala/ansible/templates/ssh/sshd_config.j2 delete mode 100644 elao.app/.manala/ansible/templates/supervisor/app.conf.j2 delete mode 100644 elao.app/.manala/ansible/templates/vim/vimrc.local.j2 delete mode 100644 elao.app/.manala/certificates/README.md delete mode 100644 elao.app/.manala/certificates/ca.crt delete mode 100644 elao.app/.manala/certificates/ca.key delete mode 100755 elao.app/.manala/docker/bin/entrypoint.sh delete mode 100644 elao.app/.manala/docker/make.mk.tmpl delete mode 100644 elao.app/.manala/github/docker-compose.yaml.tmpl delete mode 100644 elao.app/.manala/make/git.mk delete mode 100644 elao.app/.manala/make/help.mk delete mode 100644 elao.app/.manala/make/os.mk delete mode 100644 elao.app/.manala/make/semver.mk delete mode 100644 elao.app/.manala/make/text.mk delete mode 100644 elao.app/.manala/make/try.mk delete mode 100755 elao.app/.manala/vagrant/bin/setup.sh.tmpl delete mode 100644 elao.app/.manala/vagrant/make.mk delete mode 100644 elao.app/MIGRATION.2021-04.md delete mode 100644 elao.app/Makefile.dist delete mode 100644 elao.app/README.md delete mode 100644 elao.app/_helpers.tmpl diff --git a/elao.app/.manala.yaml b/elao.app/.manala.yaml deleted file mode 100644 index 95974b35..00000000 --- a/elao.app/.manala.yaml +++ /dev/null @@ -1,230 +0,0 @@ -manala: - description: Elao - Generic application with PHP and Node.js support - template: .manala.yaml.tmpl - sync: - - .manala/ansible - - .manala/certificates/ca.crt - - .manala/certificates/ca.key - - .manala/docker - - .manala/github - - .manala/make - - .manala/vagrant - - .manala/.dockerignore - - .manala/.gitignore - - .manala/Dockerfile.tmpl - - .manala/Jenkinsfile.tmpl - - .manala/Makefile.tmpl - - .manala/Vagrantfile.tmpl - - Makefile.dist - - README.md .manala/README.md - -########## -# System # -########## - -system: - # @option {"label": "System version"} - # @schema {"enum": [10, 9, 8]} - version: ~ - # @option {"label": "Hostname"} - # @schema {"type": "string", "format": "domain"} - hostname: ~ - # @schema {"type": ["integer"]} - memory: 2048 - # @schema {"type": ["integer"]} - cpus: 1 - motd: - # @schema {"type": ["string"]} - template: motd/elao.j2 - # @schema {"type": ["string", "array"]} - message: - - A curl vaillant, rien d'impossible ! - - --force et owner ! - - Il n'y pas de question cron, juste des réponses mal timé ! — Cronfucius - # @schema {"type": ["string"], "pattern": "^[a-zA-Z]+/[a-zA-Z]+$"} - timezone: Etc/UTC - locales: - # @schema {"type": ["string"]} - default: C.UTF-8 - # @schema {"items": {"type": "string"}} - codes: [] - # @schema { - # "additionalProperties": {"type": ["string", "integer"]}, - # "propertyNames": {"pattern": "^[A-Z_]+$"} - # } - env: {} - apt: - # @schema {"items": {"type": "string"}} - repositories: [] - # @schema {"items": {"type": "string"}} - preferences: [] - # @schema {"items": {"type": "string"}} - packages: [] - # @schema {"items": {"type": "string"}} - holds: [] - # @schema {"items": {"type": "object"}} - files: [] - network: - hosts: {} - nginx: - # @schema { - # "items": {"type": "object", - # "additionalProperties": false, - # "properties": { - # "template": {"type": "string"}, - # "file": {"type": "string"}, - # "config": {"type": "string"} - # } - # } - # } - configs: [] - php: - # @option {"label": "Php version"} - # @schema {"enum": [null, 8.1, "8.0", 7.4, 7.3, 7.2, 7.1, "7.0", 5.6]} - version: ~ - # @schema {"items": {"type": "string"}} - extensions: [] - # @schema { - # "items": {"type": "object", - # "additionalProperties": false, - # "properties": { - # "template": {"type": "string"}, - # "file": {"type": "string"}, - # "config": {"type": ["object", "string"]} - # } - # } - # } - configs: [] - composer: - # @schema {"enum": [null, 1]} - version: ~ - cron: - # @schema {"items": {"type": "object"}} - files: [] - supervisor: - # @schema {"items": {"type": "object"}} - configs: [] - nodejs: - # @option {"label": "Nodejs version"} - # @schema {"enum": [null, 16, 14, 12, 10, 8, 6]} - version: ~ - # @schema {"items": {"type": "object"}} - packages: [] - mariadb: - # @option {"label": "MariaDB version"} - # @schema {"enum": [null, 10.6, 10.5, 10.4, 10.3, 10.2, 10.1, "10.0"]} - version: ~ - mysql: - # @option {"label": "MySQL version"} - # @schema {"enum": [null, "8.0", 5.7, 5.6]} - version: ~ - redis: - # @option {"label": "Redis version"} - # @schema {"enum": [null, "*", "5.0", "6.0"]} - version: ~ - config: {} - phpredisadmin: true - elasticsearch: - # @option {"label": "Elasticsearch version"} - # @schema {"enum": [null, 7, 6, 5, 2, 1.7, 1.6, 1.5]} - version: ~ - # @schema {"items": {"type": "string"}} - plugins: [] - influxdb: - # @option {"label": "InfluxDB version"} - # @schema {"enum": [null, "*"]} - version: ~ - config: {} - # @schema {"items": {"type": "string"}} - databases: [] - # @schema {"items": {"type": "object"}} - users: [] - # @schema {"items": {"type": "object"}} - privileges: [] - ssh: - client: - # @schema {"type": ["null", "string"]} - config: ~ - docker: - # @schema {"items": {"type": "object"}} - containers: [] - -############### -# Integration # -############### - -# @schema { -# "definitions": { -# "integration": {"type": "object", "$id": "#integration", -# "additionalProperties": false, -# "properties": { -# "label": {"type": "string"}, -# "parallel": {"type": "boolean"}, -# "app": {"type": "string", "pattern": "^[a-z]+$"}, -# "env": {"type": "object", -# "additionalProperties": {"type": ["string", "integer"]}, -# "propertyNames": {"pattern": "^[A-Z_]+$"} -# }, -# "junit": {"type": "string"}, -# "artifacts": {"type": ["string", "array"]}, -# "shell": {"type": "string"}, -# "warn": {"type": "boolean"}, -# "tasks": {"type": "array", "items": {"$ref": "#integration"}} -# } -# } -# }, -# "$ref": "#integration" -# } -integration: {} - -############ -# Releases # -############ - -# @schema { -# "definitions": { -# "release": {"type": "object", "$id": "#release", -# "additionalProperties": false, -# "properties": { -# "app": {"type": "string", "pattern": "^[a-z]+$"}, -# "mode": {"type": "string", "pattern": "^[\\w-/]+$"}, -# "repo": {"type": "string"}, -# "ref": {"type": "string", "pattern": "^[\\w-/]+$"}, -# "release_tasks": {"type": "array", "items": {"$ref": "#release_task"}}, -# "release_add": {"type": "array", "items": {"type": "string"}}, -# "release_removed": {"type": "array", "items": {"type": "string"}}, -# "deploy_hosts": {"type": "array", "items": {"$ref": "#release_host"}}, -# "deploy_dir": {"type": "string"}, -# "deploy_releases": {"type": "integer"}, -# "deploy_tasks": {"type": "array", "items": {"$ref": "#release_task"}}, -# "deploy_post_tasks": {"type": "array", "items": {"$ref": "#release_task"}}, -# "deploy_shared_files": {"type": "array", "items": {"type": "string"}}, -# "deploy_shared_dirs": {"type": "array", "items": {"type": "string"}}, -# "deploy_writable_dirs": {"type": "array", "items": {"type": "string"}}, -# "deploy_removed": {"type": "array", "items": {"type": "string"}} -# }, -# "dependencies": { -# "deploy_hosts": ["deploy_dir"] -# }, -# "required": ["mode", "repo"] -# }, -# "release_task": {"type": "object", "$id": "#release_task", -# "additionalProperties": false, -# "properties": { -# "shell": {"type": "string"}, -# "when": {"type": "string"} -# } -# }, -# "release_host": {"type": "object", "$id": "#release_host", -# "additionalProperties": true, -# "properties": { -# "ssh_host": {"type": "string", "format": "hostname"}, -# "ssh_user": {"type": "string"}, -# "ssh_args": {"type": "string"} -# }, -# "required": ["ssh_host"] -# } -# }, -# "items": {"$ref": "#release"} -# } -releases: [] diff --git a/elao.app/.manala.yaml.tmpl b/elao.app/.manala.yaml.tmpl deleted file mode 100644 index f64eaab5..00000000 --- a/elao.app/.manala.yaml.tmpl +++ /dev/null @@ -1,121 +0,0 @@ -{{- with .Vars.system -}} - -#################################################################### -# !!! REMINDER !!! # -# Don't forget to run `manala up` each time you update this file ! # -#################################################################### - -manala: - recipe: elao.app - -########## -# System # -########## - -system: - version: {{ .version | toYaml }} - hostname: {{ .hostname | toYaml }} - nginx: - configs: - - template: nginx/gzip.j2 - {{- if .php.version }} - - template: nginx/php_fpm_app.j2 - {{- end }} - # App - - file: app.conf - config: | - server { - server_name ~.; - root /srv/app/public; - access_log /srv/log/nginx.access.log; - error_log /srv/log/nginx.error.log; - include conf.d/gzip; - {{- if .php.version }} - location / { - try_files $uri /index.php$is_args$args; - } - location ~ ^/index\.php(/|$) { - include conf.d/php_fpm_app; - internal; - } - {{- end }} - } - {{- if .php.version }} - php: - version: {{ .php.version | toYaml }} - extensions: - # Symfony - - intl - - curl - - mbstring - - xml - # App - {{- if or (not (empty .mysql.version)) (not (empty .mariadb.version)) }} - - mysql - {{- end }} - configs: - - template: php/opcache.ini.j2 - - template: php/app.ini.j2 - config: - date.timezone: UTC - {{- end }} - - {{- if .nodejs.version }} - nodejs: - version: {{ .nodejs.version | toYaml }} - {{- end }} - - {{- if .mariadb.version }} - mariadb: - version: {{ .mariadb.version | toYaml }} - {{- end }} - - {{- if .mysql.version }} - mysql: - version: {{ .mysql.version | toYaml }} - {{- end }} - - {{- if .redis.version }} - redis: - version: {{ .redis.version | toYaml }} - {{- end }} - - {{- if .elasticsearch.version }} - elasticsearch: - version: {{ .elasticsearch.version | toYaml }} - {{- end }} - - {{- if .influxdb.version }} - influxdb: - version: {{ .influxdb.version | toYaml }} - {{- end }} - - # files: - # # Single symfony app - # # ------------------ - # - path: /srv/app/var/log - # src: /srv/log - # state: link_directory - # force: true - # - path: /srv/app/var/cache - # src: /srv/cache - # state: link_directory - # force: true - # # Multi apps - # # ---------- - # - path: /srv/app/foo/var/log - # src: /srv/log/foo - # state: link_directory - # force: true - # - path: /srv/app/foo/var/cache - # src: /srv/cache/foo - # state: link_directory - # force: true - # ssh: - # client: - # config: | - # Host *.elao.run - # User app - # ForwardAgent yes - -{{- end }} diff --git a/elao.app/.manala/.dockerignore b/elao.app/.manala/.dockerignore deleted file mode 100644 index ed1d155a..00000000 --- a/elao.app/.manala/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -/.cache/ -/.vagrant/ diff --git a/elao.app/.manala/.gitignore b/elao.app/.manala/.gitignore deleted file mode 100644 index ed1d155a..00000000 --- a/elao.app/.manala/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/.cache/ -/.vagrant/ diff --git a/elao.app/.manala/Dockerfile.tmpl b/elao.app/.manala/Dockerfile.tmpl deleted file mode 100644 index 900d27cd..00000000 --- a/elao.app/.manala/Dockerfile.tmpl +++ /dev/null @@ -1,94 +0,0 @@ -{{- with .Vars.system -}} - -FROM debian:{{ .version }}-slim - -LABEL maintainer="Elao " - -ARG UID=1000 -ARG GID=1000 - -######### -# Setup # -######### - -# The 'container' environment variable tells systemd that it's running inside a -# Docker container environment. -# It's also internally used for checking we're running inside a container too. -ENV \ - container="docker" - -RUN \ - # Disable irrelevants apt-key warnings - export APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE="1" \ - # Disable all debian user interaction - && export DEBIAN_FRONTEND="noninteractive" \ - && apt-get update \ - && apt-get install --yes --no-install-recommends \ - bash-completion \ - gnupg dirmngr \ - ca-certificates \ - sudo \ - # Srv - && mkdir -p /srv \ - && chmod 777 /srv \ - # User - && addgroup --gid ${GID} docker \ - && adduser --disabled-password --gecos "" docker --uid ${UID} --ingroup docker \ - # Bash - && sed -i 's/^#force_color_prompt=yes/force_color_prompt=yes/' \ - /home/docker/.bashrc \ - # Sudo - && echo "docker ALL=(ALL) NOPASSWD:ALL" \ - > /etc/sudoers.d/docker \ - # Ansible - {{- if eq (.version|int) 8 }} - && echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main" \ - {{- else if eq (.version|int) 9 }} - && echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main" \ - {{- else if eq (.version|int) 10 }} - && echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main" \ - {{- end }} - > /etc/apt/sources.list.d/ppa_launchpad_net_ansible_ansible_ubuntu.list \ - && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 \ - && apt-get update \ - && apt-get install --yes --no-install-recommends \ - {{- if eq (.version|int) 8 }} - ansible python python-apt - {{- else }} - ansible python3 python3-apt - {{- end }} - -COPY docker/bin/entrypoint.sh /usr/local/bin/entrypoint.sh - -ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] - -########## -# System # -########## - -COPY ansible/collections /tmp/ansible/collections/ -COPY ansible/inventories/system.yaml /tmp/ansible/inventories/ -COPY ansible/roles/certificates /tmp/ansible/roles/certificates/ -COPY ansible/templates /tmp/ansible/templates/ -COPY ansible/ansible.cfg ansible/system.yaml /tmp/ansible/ - -RUN \ - cd /tmp/ansible \ - && ansible-galaxy collection install \ - --requirements-file collections/requirements.yaml \ - --force \ - && ansible-playbook system.yaml \ - --inventory-file inventories \ - --limit integration \ - && rm -Rf /tmp/ansible - -RUN \ - # NodeJs - mkdir -p /usr/etc \ - && echo "cache=\${XDG_CACHE_HOME}/npm" > /usr/etc/npmrc - -WORKDIR /srv/app - -USER docker - -{{- end }} diff --git a/elao.app/.manala/Jenkinsfile.tmpl b/elao.app/.manala/Jenkinsfile.tmpl deleted file mode 100644 index e3629e82..00000000 --- a/elao.app/.manala/Jenkinsfile.tmpl +++ /dev/null @@ -1,321 +0,0 @@ -{{- define "pod_label" -}} - {{- $system := . -}} - {{- $label := list "integration" "app" -}} - {{- if $system.mysql.version -}} - {{- $label = concat $label (list "mysql" $system.mysql.version) -}} - {{- else if $system.mariadb.version -}} - {{- $label = concat $label (list "mariadb" $system.mariadb.version) -}} - {{- end -}} - {{- if $system.elasticsearch.version -}} - {{- $elasticsearch := mergeOverwrite (dict "plugins" list) $system.elasticsearch -}} - {{- $label = concat $label (list "elasticsearch" $system.elasticsearch.version) $elasticsearch.plugins -}} - {{- end -}} - {{- regexReplaceAll "[^[:alnum:]-]" ($label | join "-") "-" -}} -{{- end -}} - -{{- define "node" -}} - {{- $node := mergeOverwrite (dict "label" "" "env" dict "app" "" "junit" "" "artifacts" "" "tasks" list "parallel" false "shell" "" "warn" false) .node -}} - {{- $parallel_task := get . "parallel_task" -}} - - {{- /* --- Cache dir by app --- */ -}} - {{- if not (empty $node.app) -}} - {{- $node = mergeOverwrite $node (dict "env" (set $node.env "XDG_CACHE_HOME" (printf "${appCache}/%s" $node.app))) -}} - {{- end -}} - - {{- $indent := 0 -}} - {{- $indent_parallel_task := 0 -}} - {{- $indent_env := 0 -}} - {{- $indent_dir := 0 -}} - {{- $indent_try := 0 -}} - - {{- /* --- Parallel Task / Open --- */ -}} - {{- if not (empty $parallel_task) -}} - {{- $indent_parallel_task = $indent -}} - {{- $indent = (add $indent 4 | int) -}} - {{- include "node_parallel_task_open" $node | nindent $indent_parallel_task -}} - {{- end -}} - - {{- /* --- Env / Open --- */ -}} - {{- if not (empty $node.env) -}} - {{- $indent_env = $indent -}} - {{- $indent = (add $indent 4 | int) -}} - {{- include "node_env_open" $node | nindent $indent_env -}} - {{- end -}} - - {{- /* --- Dir / Open --- */ -}} - {{- if not (empty $node.app) -}} - {{- $indent_dir = $indent -}} - {{- $indent = (add $indent 4 | int) -}} - {{- include "node_dir_open" $node | nindent $indent_dir -}} - {{- end -}} - - {{- /* --- Try / Open --- */ -}} - {{- if or (not (empty $node.junit)) (not (empty $node.artifacts)) -}} - {{- $indent_try = $indent -}} - {{- $indent = (add $indent 4 | int) -}} - {{- include "node_try_open" $node | nindent $indent_try -}} - {{- end -}} - - {{- if not (empty $node.tasks) -}} - {{- include "node_tasks" $node | trim | nindent $indent -}} - {{- else if not (empty $node.shell) -}} - {{- include "node_shell" $node | nindent $indent -}} - {{- end -}} - - {{- /* --- Try / Close --- */ -}} - {{- if or (not (empty $node.junit)) (not (empty $node.artifacts)) }} - {{- include "node_try_close" $node | nindent $indent_try }} - {{- end -}} - - {{- /* --- Dir / Close --- */ -}} - {{- if not (empty $node.app) }} - {{- include "node_dir_close" $node | nindent $indent_dir }} - {{- end -}} - - {{- /* --- Env / Close --- */ -}} - {{- if not (empty $node.env) }} - {{- include "node_env_close" $node | nindent $indent_env }} - {{- end -}} - - {{- /* --- Parallel Task / Close --- */ -}} - {{- if not (empty $parallel_task) }} - {{- include "node_parallel_task_close" $node | nindent $indent_parallel_task }} - {{- end -}} - -{{- end -}} - -{{- define "node_parallel_task_open" -}} - {{- $node := . -}} -'{{ include "node_label" $node }}': { -{{- end -}} - -{{- define "node_parallel_task_close" -}} -} -{{- end -}} - -{{- define "node_env_open" -}} - {{- $node := . -}} - {{- $env := list -}} -withEnv([ - {{- range $key, $value := $node.env -}} - {{- if not (kindIs "invalid" $value) -}} - {{- $env = append $env (print "\"" $key "=" ($value | toString) "\"") -}} - {{- end -}} - {{- end -}} - {{- $env | join ", " -}} -]) { -{{- end -}} - -{{- define "node_env_close" -}} -} -{{- end -}} - -{{- define "node_dir_open" -}} - {{- $node := . -}} -dir('{{ $node.app }}') { -{{- end -}} - -{{- define "node_dir_close" -}} -} -{{- end -}} - -{{- define "node_try_open" -}} -try { -{{- end -}} - -{{- define "node_try_close" -}} - {{- $node := . -}} -} finally { - {{- if not (empty $node.junit) }} - junit allowEmptyResults: true, testResults: '{{ $node.junit }}' - {{- end }} - {{- if not (empty $node.artifacts) }} - archiveArtifacts allowEmptyArchive: true, artifacts: ' - {{- if kindIs "slice" $node.artifacts -}} - {{ $node.artifacts | join "," }} - {{- else -}} - {{ $node.artifacts }} - {{- end -}} - ' - {{- end }} -} -{{- end -}} - -{{- define "node_tasks" -}} - {{- $node := . -}} -{{- if $node.parallel -}} -stage('{{ include "node_label" $node }}') { - parallel( - {{- range $i, $task := $node.tasks }}{{ if $i }},{{ end }} - {{- include "node" (dict "node" (mergeOverwrite (dict "warn" $node.warn) $task) "parallel_task" true) | trim | nindent 8 }} - {{- end }} - ) -} -{{- else -}} - {{- range $i, $task := $node.tasks }} - {{- include "node" (dict "node" (mergeOverwrite (dict "warn" $node.warn) $task)) -}} - {{- end -}} -{{- end -}} -{{- end -}} - -{{- define "node_shell" -}} - {{- $node := . -}} -stage('{{ include "node_label" $node }}') { - {{- if $node.warn }} - warnError('{{ include "node_label" $node }}') { - sh ''' - {{ $node.shell }} - ''' - } - {{- else }} - sh ''' - {{ $node.shell }} - ''' - {{- end }} -} -{{- end -}} - -{{- define "node_label" -}} - {{- $node := . -}} - {{- if not (empty $node.label) -}} - {{- $node.label -}} - {{- else if not (empty $node.app) -}} - {{- $node.app | title -}} - {{- else if and (not (empty $node.shell)) (regexMatch "^make .+@integration$" $node.shell) -}} - {{- (regexReplaceAll "^make (.+)@integration$" $node.shell "${1}") | replace "." " - " | title -}} - {{- else -}} - Task - {{- end -}} -{{- end -}} - -#!/usr/bin/env groovy - -{{- if not .Vars.integration }} - -stage('¯\\_(ツ)_/¯') { - echo 'Because testing is doubting...' -} - -{{- else }} - -def app = env.JOB_NAME.split('/')[1].replaceAll('[^a-zA-Z0-9-]', '-') -def hash - -podTemplate( - inheritFrom: 'buildkit', - label: 'buildkit', -) { - node('buildkit') { - stage('System') { - checkout scm - container('buildkit') { - hash = sh(label: 'Get hash', script: 'find .manala -type f -exec md5sum {} + | LC_ALL=C sort | md5sum', returnStdout: true).take(8) - if ( - sh(label: 'Check system image', script: """ - wget \ - --spider -q \ - http://${env.DOCKER_REGISTRY_PUSH}/v2/app/manifests/${app}-${hash} - """, returnStatus: true) != 0 - ) { - sh label: 'Build system image', script: """ - buildctl build \ - --frontend dockerfile.v0 \ - --local context=.manala \ - --local dockerfile=.manala \ - --export-cache type=registry,ref=${env.DOCKER_REGISTRY_PUSH}/app:cache,mode=max \ - --import-cache type=registry,ref=${env.DOCKER_REGISTRY_PUSH}app:cache \ - --output type=image,name=${env.DOCKER_REGISTRY_PUSH}/app:${app}-${hash},push=true - """ - } - } - } - } -} - -podTemplate( - inheritFrom: 'app', - label: "app-${app}-${hash}", - containers: [ - containerTemplate( - name: 'app', - image: "${env.DOCKER_REGISTRY_PULL}/app:${app}-${hash}", - command: 'sleep', - args: '9999999', - ), - {{- if .Vars.system.mysql.version -}} - {{- $mysql := .Vars.system.mysql }} - containerTemplate( - name: 'mysql', - image: 'mysql:{{ $mysql.version }}', - envVars: [ - envVar(key: 'MYSQL_ALLOW_EMPTY_PASSWORD', value: 'yes') - ] - ), - {{- else if .Vars.system.mariadb.version -}} - {{- $mariadb := .Vars.system.mariadb }} - containerTemplate( - name: 'mariadb', - image: 'mariadb:{{ $mariadb.version }}', - envVars: [ - envVar(key: 'MYSQL_ALLOW_EMPTY_PASSWORD', value: 'yes') - ] - ), - {{- end }} - {{- if .Vars.system.elasticsearch.version -}} - {{- $elasticsearch := mergeOverwrite (dict "plugins" list) .Vars.system.elasticsearch }} - containerTemplate( - name: 'elasticsearch', - image: 'docker.elastic.co/elasticsearch/elasticsearch:{{ include "elasticsearch_version" $elasticsearch }}', - envVars: [ - envVar(key: 'discovery.type', value: 'single-node') - ], - command: 'sh -c " - {{- range $plugin := $elasticsearch.plugins }}elasticsearch-plugin install --batch --verbose {{ $plugin }} && {{ end -}} - exec docker-entrypoint.sh"' - ), - {{- end }} - ] -) { - node("app-${app}-${hash}") { - def appCache = env.XDG_CACHE_HOME ? "${XDG_CACHE_HOME}" : '/home/docker/.cache' - stage('Setup') { - checkout scm - {{- if or .Vars.system.mysql.version .Vars.system.mariadb.version }} - // Setup MySQL/MariaDB service - // - Wait until service is up - // - Drop databases - container('{{ if .Vars.system.mysql.version }}mysql{{ else }}mariadb{{ end }}') { - sh label: 'Setup MySQL/MariaDB service', script: ''' - while ! mysqladmin ping --host 0.0.0.0 --silent; do - sleep 0.25 - done - for database in $(mysql --execute "SHOW DATABASES" | egrep --invert-match "Database|mysql|information_schema|performance_schema"); do - mysql --execute "DROP DATABASE ${database}" - done - ''' - } - {{- end }} - {{- if .Vars.system.elasticsearch.version }} - {{- $elasticsearch := .Vars.system.elasticsearch }} - // Setup Elasticsearch service - // - Wait until service is up - // - Delete indexes - container('elasticsearch') { - sh label: 'Setup Elasticsearch service', script: ''' - while ! [ $(curl --write-out %{http_code} --silent --output /dev/null http://127.0.0.1:9200/_cat/health?h=st) = 200 ]; do - sleep 0.25 - done - curl --silent --request DELETE http://127.0.0.1:9200/_all - ''' - } - {{- end }} - } - container('app') { - withEnv(["XDG_CACHE_HOME=${appCache}/app"]) { - {{- include "node" (dict "node" .Vars.integration) | trim | nindent 16 }} - } - } - } -} - -{{- end }} diff --git a/elao.app/.manala/Makefile.tmpl b/elao.app/.manala/Makefile.tmpl deleted file mode 100644 index 78be39bf..00000000 --- a/elao.app/.manala/Makefile.tmpl +++ /dev/null @@ -1,168 +0,0 @@ -# Relative root dir ("."|".."|"../.."|…) -_DIR := $(patsubst ./%,%,$(patsubst %/.manala/Makefile,%,./$(filter %.manala/Makefile,$(MAKEFILE_LIST)))) -# Is current dir root ? (""|"1") -_ROOT = $(if $(filter .,$(_DIR)),1) -# Relative current dir ("."|"foo"|"foo/bar"|…) -_CURRENT_DIR = $(patsubst ./%,%,.$(patsubst $(realpath $(CURDIR)/$(_DIR))%,%,$(CURDIR))) -# Relative cache dir ("./.manala/.cache"|"../.manala/.cache"|"../../.manala/.cache"|…) -_CACHE_DIR = $(shell dir=$(_DIR)/.manala/.cache ; mkdir -p $${dir} ; echo $${dir}) - -include $(_DIR)/.manala/make/text.mk -include $(_DIR)/.manala/make/help.mk -include $(_DIR)/.manala/make/os.mk -include $(_DIR)/.manala/make/try.mk -include $(_DIR)/.manala/make/git.mk -include $(_DIR)/.manala/make/semver.mk - -############### -# Environment # -############### - -include $(_DIR)/.manala/vagrant/make.mk - -# Vagrant commands only available *OUTSIDE* vagrant environment -ifndef VAGRANT - -export VAGRANT_CWD = $(_DIR)/.manala - -HELP += $(call help_section, Environment) - -# Setup commands only available *IN* root directory -ifdef _ROOT -HELP += $(call help,setup, Setup environment) -setup: - vagrant up --provision - $(setup) -endif - -HELP += $(call help,up, Start the environment) -up: - vagrant up - -HELP += $(call help,halt, Stop the environment) -halt: - vagrant halt - -HELP += $(call help,reload, Restart the environment) -reload: - vagrant reload - -HELP += $(call help,ssh, Connect to the environment via SSH) -ssh: export DIR = /srv/app/$(_CURRENT_DIR) -ssh: - vagrant ssh - -HELP += $(call help,destroy, Stop and delete environment) -destroy: - vagrant destroy - -HELP += $(call help,provision, Provision the environment (TAGS|DIFF|VERBOSE)) -provision: - vagrant provision --provision-with system - -else - -HELP += $(call help_section, Environment) - -HELP += $(call help,provision, Provision the environment (TAGS|DIFF|VERBOSE)) -provision: - $(call log, Install ansible galaxy collection) - cd $(_DIR)/.manala/ansible \ - && ansible-galaxy collection install \ - --requirements-file collections/requirements.yaml \ - --force - $(call log, Run ansible playbook) - cd $(_DIR)/.manala/ansible \ - && ansible-playbook system.yaml \ - --inventory-file inventories \ - --limit development \ - --become \ - $(if $(TAGS),--tags $(TAGS)) \ - $(if $(VARS),--extra-vars '$(VARS)') \ - $(if $(VERBOSE),-vvv) \ - $(if $(DIFF),--check --diff) - -endif - -HELP += $(call help,provision.apt, Provision the environment - Apt (DIFF|VERBOSE)) -provision.apt: export TAGS = apt -provision.apt: provision - -HELP += $(call help,provision.files, Provision the environment - Files (DIFF|VERBOSE)) -provision.files: export TAGS = files -provision.files: provision - -HELP += $(call help,provision.nginx, Provision the environment - Nginx (DIFF|VERBOSE)) -provision.nginx: export TAGS = nginx -provision.nginx: provision - -HELP += $(call help,provision.supervisor, Provision the environment - Supervisor (DIFF|VERBOSE)) -provision.supervisor: export TAGS = supervisor -provision.supervisor: provision - -HELP += $(call help,provision.php, Provision the environment - Php (DIFF|VERBOSE)) -provision.php: export TAGS = php -provision.php: provision - -HELP += $(call help,provision.certificates,Provision the environment - Certificates (DIFF|VERBOSE)) -ifdef VAGRANT -provision.certificates: export TAGS = certificates -provision.certificates: export VARS = certificates_prompt=true -provision.certificates: provision -else -provision.certificates: - $(call message_warning, Command only available *INSIDE* vagrant environment) -endif - -########## -# Docker # -########## - -include $(_DIR)/.manala/docker/make.mk - -# Docker commands only available *OUTSIDE* docker environment -ifndef DOCKER - -HELP += $(call help_section, Docker) - -HELP += $(call help,docker,Run docker container) -docker: - $(call docker_run) - -endif - -{{ if .Vars.releases -}} -############ -# Releases # -############ - -HELP += $(call help_section, Releases) - -{{ range $release := .Vars.releases }} - -{{- if or (hasKey $release "release_tasks") (hasKey $release "release_add") (hasKey $release "release_removed") -}} -HELP += $(call help,release{{ include "release_target" $release }},Release {{ include "release_help" $release }}) -release{{ include "release_target" $release }}: SHELL := $(or $(DOCKER_SHELL),$(SHELL)) -release{{ include "release_target" $release }}: - $(call log, Run ansible playbook) - ansible-playbook $(_DIR)/.manala/ansible/release.yaml \ - --inventory $(_DIR)/.manala/ansible/inventories/release.yaml \ - --limit {{ include "release_group" . }} - -{{ end -}} - -{{- if hasKey $release "deploy_hosts" -}} -HELP += $(call help,deploy{{ include "release_target" $release }},Deploy {{ include "release_help" $release }} (REF)) -deploy{{ include "release_target" $release }}: SHELL := $(or $(DOCKER_SHELL),$(SHELL)) -deploy{{ include "release_target" $release }}: - $(call log, Run ansible playbook) - ansible-playbook $(_DIR)/.manala/ansible/deploy.yaml \ - --inventory $(_DIR)/.manala/ansible/inventories/deploy.yaml \ - --limit {{ include "release_group" $release }} \ - $(if $(REF),--extra-vars '{"deploy_strategy_git_ref": "$(REF)"}') - -{{ end -}} - -{{ end }} - -{{- end -}} diff --git a/elao.app/.manala/Vagrantfile.tmpl b/elao.app/.manala/Vagrantfile.tmpl deleted file mode 100644 index 75737a84..00000000 --- a/elao.app/.manala/Vagrantfile.tmpl +++ /dev/null @@ -1,83 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.require_version '>= 2.2.10' - -Vagrant.configure('2') do |config| - - # Ssh - config.ssh.forward_agent = true - config.ssh.insert_key = false - config.ssh.extra_args = ['-q'] # Quiet mode - config.ssh.forward_env = ['DIR'] - - # Vm - config.vm.box = 'bento/debian-{{ .Vars.system.version }}' - config.vm.hostname = '{{ .Vars.system.hostname }}' - config.vm.network 'private_network', type: 'dhcp' - config.vm.define 'development' do |development| end - config.vm.synced_folder '..', '/srv/app', - type: 'nfs', - mount_options: ['tcp', 'nolock', 'actimeo=1'] - - # Vm - Virtualbox - config.vm.provider 'virtualbox' # Force provider - config.vm.provider :virtualbox do |virtualbox| - virtualbox.name = '{{ regexReplaceAll "^(.*)\\.[^.]*$" .Vars.system.hostname "${1}" }}' - virtualbox.memory = {{ .Vars.system.memory }} - virtualbox.cpus = {{ .Vars.system.cpus }} - virtualbox.customize ['modifyvm', :id, '--natdnshostresolver1', 'on'] - end - - # Plugins - Landrush - config.vagrant.plugins = ['landrush'] - config.landrush.enabled = true - config.landrush.tld = config.vm.hostname - config.landrush.guest_redirect_dns = false - - # Vm - Provision - Dotfiles - for dotfile in ['.gitconfig', '.gitignore'] - if File.exists?(File.join(Dir.home, dotfile)) then - config.vm.provision dotfile, type: 'file', run: 'always' do |file| - file.source = '~/' + dotfile - file.destination = dotfile - end - end - end - - # Vm - Provision - Setup - config.vm.provision 'setup', type: 'shell' do |setup| - setup.keep_color = true - setup.privileged = true - setup.reset = true - setup.path = 'vagrant/bin/setup.sh' - end - - # Vm - Provision - System - config.vm.provision 'system', type: 'ansible_local' do |system| - system.provisioning_path = '/vagrant/ansible' - system.playbook = 'system.yaml' - system.inventory_path = 'inventories' - system.become = true - system.galaxy_role_file = 'collections/requirements.yaml' - system.galaxy_command = 'ansible-galaxy collection install --requirements-file=%{role_file} --force' - system.tags = ENV['TAGS'] - system.extra_vars = JSON.parse(ENV['VARS'] || '{}') - system.verbose = ENV['VERBOSE'] ? 'vvv' : false - system.raw_arguments = ENV['DIFF'] ? ['--check', '--diff'] : [] - end - - config.trigger.after :up do |trigger| - trigger.ruby do |env,machine| - puts " \e[32m,\e[0m" - puts " \e[31m\\\e[0m \e[32m:\e[0m \e[31m/\e[0m MailHog: http://{{ .Vars.system.hostname }}:8025" - puts "\e[32m`.\e[0m \e[33m__/ \\__\e[0m \e[32m.'\e[0m{{ if or .Vars.system.mysql.version .Vars.system.mariadb.version }} PhpMyAdmin: http://{{ .Vars.system.hostname }}:1979{{ end }}" - puts "\e[31m_ _\e[0m\e[33m\\ /\e[0m\e[31m_ _\e[0m{{ if .Vars.system.supervisor.configs }} Supervisor: http://{{ .Vars.system.hostname }}:9001{{ end }}" - puts " \e[33m/_ _\\\e[0m{{ if .Vars.system.redis.version }} PhpRedisAdmin: http://{{ .Vars.system.hostname }}:1981{{ end }}" - puts " \e[32m.'\e[0m \e[33m\\ /\e[0m \e[32m`.\e[0m" - puts " \e[31m/\e[0m \e[32m:\e[0m \e[31m\\\e[0m" - puts " \e[32m'\e[0m" - end - end - -end diff --git a/elao.app/.manala/ansible/ansible.cfg b/elao.app/.manala/ansible/ansible.cfg deleted file mode 100644 index be5e9e33..00000000 --- a/elao.app/.manala/ansible/ansible.cfg +++ /dev/null @@ -1,63 +0,0 @@ -# Config file for ansible -- https://ansible.com/ -# =============================================== - -# For a full list of available options, run ansible-config list or see the -# documentation: https://docs.ansible.com/ansible/latest/reference_appendices/config.html. - -[defaults] - -force_color = True - -# This only affects the gathering done by a play's gather_facts directive, -# by default gathering retrieves all facts subsets -# all - gather all subsets -# network - gather min and network facts -# hardware - gather hardware facts (longest facts to retrieve) -# virtual - gather min and virtual facts -# facter - import facts from facter -# ohai - import facts from ohai -# You can combine them using comma (ex: network,virtual) -# You can negate them using ! (ex: !hardware,!facter,!ohai) -# A minimal set of facts is always gathered. - -gather_subset = all,!hardware - -# By default, ansible-playbook will display "Skipping [host]" if it determines a task -# should not be run on a host. Set this to "False" if you don't want to see these "Skipping" -# messages. NOTE: the task header will still be shown regardless of whether or not the -# task is skipped. - -display_skipped_hosts = False - -# If set to a persistent type (not 'memory', for example 'redis') fact values -# from previous runs in Ansible will be stored. This may be useful when -# wanting to use, for example, IP information from one group of servers -# without having to talk to them in the same playbook run to get their -# current IP information. - -fact_caching = jsonfile - -# This option tells Ansible where to cache facts. The value is plugin dependent. -# For the jsonfile plugin, it should be a path to a local directory. -# For the redis plugin, the value is a host:port:database triplet: fact_caching_connection = localhost:6379:0 - -fact_caching_connection = /tmp - -# retry files -# When a playbook fails a .retry file can be created that will be placed in ~/ -# You can enable this feature by setting retry_files_enabled to True -# and you can change the location of the files by setting retry_files_save_path - -retry_files_enabled = False - -[ssh_connection] - -# Enabling pipelining reduces the number of SSH operations required to -# execute a module on the remote server. This can result in a significant -# performance improvement when enabled, however when using "sudo:" you must -# first disable 'requiretty' in /etc/sudoers -# -# By default, this option is disabled to preserve compatibility with -# sudoers configurations that have requiretty (the default on many distros). - -pipelining = True diff --git a/elao.app/.manala/ansible/collections/requirements.yaml b/elao.app/.manala/ansible/collections/requirements.yaml deleted file mode 100644 index 5b9868d6..00000000 --- a/elao.app/.manala/ansible/collections/requirements.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- - -collections: - - name: manala.roles - version: <2.0.0 diff --git a/elao.app/.manala/ansible/deploy.yaml b/elao.app/.manala/ansible/deploy.yaml deleted file mode 100644 index 93e4f914..00000000 --- a/elao.app/.manala/ansible/deploy.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -- hosts: deploy - any_errors_fatal: true - tasks: - - import_role: - name: deploy diff --git a/elao.app/.manala/ansible/inventories/deploy.yaml.tmpl b/elao.app/.manala/ansible/inventories/deploy.yaml.tmpl deleted file mode 100644 index cc3e003b..00000000 --- a/elao.app/.manala/ansible/inventories/deploy.yaml.tmpl +++ /dev/null @@ -1,48 +0,0 @@ -deploy: - children: - {{- range $release := .Vars.releases }} - {{- if hasKey $release "deploy_hosts" }} - - {{ include "release_group" $release }}: - hosts: - {{- range $index, $host := $release.deploy_hosts }} - {{ (add $index 1) | printf "%02d" }}{{ include "release_host" $release }}: - # Ansible - ansible_host: {{ $host.ssh_host }} - {{- if hasKey $host "ssh_user" }} - ansible_ssh_user: {{ $host.ssh_user }} - {{- end }} - {{- if hasKey $host "ssh_args" }} - ansible_ssh_extra_args: {{ $host.ssh_args }} - {{- end }} - ansible_python_interpreter: auto_silent - {{- $host = omit $host "ssh_host" "ssh_user" "ssh_args" }} - {{- if $host }} - # Host - {{- $host | toYaml | nindent 20 }} - {{- end }} - {{- end }} - vars: - deploy_releases: {{ if hasKey $release "deploy_releases" }}{{ $release.deploy_releases }}{{ else }}3{{ end }} - deploy_strategy: git - deploy_strategy_git_repo: {{ $release.repo }} - deploy_strategy_git_ref: {{ if hasKey $release "ref" }} - {{- $release.ref }} - {{- else }} - {{- if hasKey $release "app" }}{{ $release.app }}/{{ end }}{{ $release.mode }} - {{- end }} - deploy_dir: {{ $release.deploy_dir }} - {{- if hasKey $release "deploy_tasks" }} - deploy_tasks: - {{- include "release_tasks" $release.deploy_tasks | nindent 20 }} - {{- end }} - {{- if hasKey $release "deploy_post_tasks" }} - deploy_post_tasks: - {{- include "release_tasks" $release.deploy_post_tasks | nindent 20 }} - {{- end }} - {{- $release = pick $release "deploy_shared_files" "deploy_shared_dirs" "deploy_writable_dirs" "deploy_removed" -}} - {{- if $release }} - {{- $release | toYaml | nindent 16 }} - {{- end }} - {{- end }} - {{- end }} diff --git a/elao.app/.manala/ansible/inventories/release.yaml.tmpl b/elao.app/.manala/ansible/inventories/release.yaml.tmpl deleted file mode 100644 index c5645fc4..00000000 --- a/elao.app/.manala/ansible/inventories/release.yaml.tmpl +++ /dev/null @@ -1,36 +0,0 @@ -release: - children: - {{- range $release := .Vars.releases }} - {{- if or (hasKey $release "release_tasks") (hasKey $release "release_add") (hasKey $release "release_removed") }} - - {{ include "release_group" $release }}: - hosts: - localhost{{ include "release_host" $release }}: - ansible_connection: local - {{- if eq ($.Vars.system.version|int) 8 }} - ansible_python_interpreter: /usr/bin/python - {{- else }} - ansible_python_interpreter: /usr/bin/python3 - {{- end }} - vars: - release_dir: /srv/release/{{ if hasKey $release "app" }}{{ $release.app }}/{{ end }}{{ $release.mode }} - release_git_dir: /srv/app - {{- if hasKey $release "app" }} - release_target_dir: {{ $release.app }} - {{- end }} - release_repo: {{ $release.repo }} - release_version: {{ if hasKey $release "ref" }} - {{- $release.ref }} - {{- else }} - {{- if hasKey $release "app" }}{{ $release.app }}/{{ end }}{{ $release.mode }} - {{- end }} - {{- if hasKey $release "release_tasks" }} - release_tasks: - {{- include "release_tasks" $release.release_tasks | nindent 18 }} - {{- end }} - {{- $release = pick $release "release_removed" "release_add" -}} - {{- if $release }} - {{- $release | toYaml | nindent 16 }} - {{- end }} - {{- end }} - {{- end }} diff --git a/elao.app/.manala/ansible/inventories/system.yaml.tmpl b/elao.app/.manala/ansible/inventories/system.yaml.tmpl deleted file mode 100644 index eb164863..00000000 --- a/elao.app/.manala/ansible/inventories/system.yaml.tmpl +++ /dev/null @@ -1,254 +0,0 @@ -{{- with .Vars.system -}} - -system: - - vars: - - # Ansible - ansible_connection: local - ansible_python_interpreter: /usr/bin/python{{ if gt (.version|int) 8 }}3{{ end }} - - # Accounts - system_accounts: false - # Alternatives - system_alternatives: false - # App - system_app: false - system_app_dir: /srv/app - system_app_log_dir: /srv/log - system_app_cache_dir: /srv/cache - system_app_sessions_dir: /srv/sessions - # Apt - system_apt: false - {{- dict "system_apt_repositories" .apt.repositories | toYaml | nindent 8 }} - {{- dict "system_apt_preferences" .apt.preferences | toYaml | nindent 8 }} - {{- dict "system_apt_holds" .apt.holds | toYaml | nindent 8 }} - # Certificates - system_certificates: false - system_certificates_name: {{ .hostname | toYaml }} - # Cron - system_cron: false - {{- dict "system_cron_files" .cron.files | toYaml | nindent 8 }} - # Docker - system_docker: false - {{- dict "system_docker_containers" .docker.containers | toYaml | nindent 8 }} - # Elasticsearch - system_elasticsearch: false - system_elasticsearch_version: {{ .elasticsearch.version | toYaml }} - {{- dict "system_elasticsearch_plugins" .elasticsearch.plugins | toYaml | nindent 8 }} - # Environment - system_environment: false - {{- dict "system_env" .env | toYaml | nindent 8 }} - # Files - system_files: false - {{- dict "system_files_attributes" .files | toYaml | nindent 8 }} - # Git - system_git: false - # Gomplate - system_gomplate: false - # InfluxDB - system_influxdb: false - {{- dict "system_influxdb_config" .influxdb.config | toYaml | nindent 8 }} - {{- dict "system_influxdb_databases" .influxdb.databases | toYaml | nindent 8 }} - {{- dict "system_influxdb_users" .influxdb.users | toYaml | nindent 8 }} - {{- dict "system_influxdb_privileges" .influxdb.privileges | toYaml | nindent 8 }} - # Java - system_java: {{ `"{{ system_elasticsearch }}"` }} - # Locales - system_locales: false - system_locales_default: {{ .locales.default }} - {{- dict "system_locales_codes" .locales.codes | toYaml | nindent 8 }} - # MariaDB - system_mariadb: false - system_mariadb_version: {{ .mariadb.version | toYaml }} - system_mariadb_install_packages: - - mariadb-server - - mariadb-client - system_mariadb_configs_dir: {{ ge (.mariadb.version|float64) 10.5 | ternary - "/etc/mysql/mariadb.conf.d" - "/etc/mysql/conf.d" - }} - # Motd - system_motd: false - system_motd_template: {{ .motd.template }} - {{- dict "system_motd_message" .motd.message | toYaml | nindent 8 }} - # MySQL - system_mysql: false - system_mysql_version: {{ .mysql.version | toYaml }} - system_mysql_install_packages: null - system_mysql_configs_dir: /etc/mysql/mysql.conf.d - # Network - system_network: false - # Nginx - system_nginx: false - {{- dict "system_nginx_configs" .nginx.configs | toYaml | nindent 8 }} - # Ngrok - system_ngrok: false - # NodeJS - system_nodejs: false - system_nodejs_version: {{ .nodejs.version | toYaml }} - system_nodejs_npm: {{ `"{{ system_nodejs }}"` }} - {{- dict "system_nodejs_packages" .nodejs.packages | toYaml | nindent 8 }} - system_nodejs_yarn: {{ `"{{ system_nodejs }}"` }} - # Oh my zsh - system_ohmyzsh: false - # Php - system_php: false - system_php_version: {{ .php.version }} - system_php_composer: {{ `"{{ system_php }}"` }} - system_php_composer_version: {{ .php.composer.version | toYaml }} - system_php_sapis: - - cli - - fpm - {{- dict "system_php_extensions" .php.extensions | toYaml | nindent 8 }} - {{- dict "system_php_configs" .php.configs | toYaml | nindent 8 }} - # Redis - system_redis: false - system_redis_version: {{ .redis.version | toYaml }} - system_redis_phpredisadmin: {{ .redis.phpredisadmin | toYaml }} - {{- dict "system_redis_server_config" .redis.config | toYaml | nindent 8 }} - # Ssh - system_ssh: false - system_ssh_server: false - {{- dict "system_ssh_client_config" .ssh.client.config | toYaml | nindent 8 }} - # Supervisor - system_supervisor: false - {{- dict "system_supervisor_configs" .supervisor.configs | toYaml | nindent 8 }} - # Symfony Cli - system_symfony_cli: {{ `"{{ system_php }}"` }} - # Timezone - system_timezone: false - system_timezone_default: {{ .timezone | toYaml }} - # Vim - system_vim: false - # Zsh - system_zsh: false - - hosts: - - ############### - # Development # - ############### - - development: - - # Accounts - system_accounts: true - # Alternatives - system_alternatives: true - # App - system_app: true - system_app_group: vagrant - system_app_user: vagrant - # Apt - system_apt: true - system_apt_packages: - - xz-utils - - rsync - - wget - - curl - - make - - less - - ssl-cert - - htop - - pv # for real-time progress on streams (e.g mysql import) - - tcpdump - {{- if .apt.packages }} - # App - {{- .apt.packages | toYaml | nindent 16 }} - {{- end }} - # Certificates - system_certificates: true - # Cron - system_cron: {{ not (empty .cron.files) | ternary "true" "false" }} - # Docker - system_docker: true - # Elasticsearch - system_elasticsearch: {{ not (empty .elasticsearch.version) | ternary "true" "false" }} - # Environment - system_environment: true - # Files - system_files: true - # Git - system_git: true - # Gomplate - system_gomplate: true - # InfluxDB - system_influxdb: {{ not (empty .influxdb.version) | ternary "true" "false" }} - # Locales - system_locales: true - # MariaDB - system_mariadb: {{ not (empty .mariadb.version) | ternary "true" "false" }} - # Motd - system_motd: true - # MySQL - system_mysql: {{ not (empty .mysql.version) | ternary "true" "false" }} - # Network - system_network: {{ not (empty .network.hosts) | ternary "true" "false" }} - {{- dict "system_network_hosts" .network.hosts | toYaml | nindent 12 }} - # Nginx - system_nginx: {{ not (empty .nginx.configs) | ternary "true" "false" }} - # Ngrok - system_ngrok: true - # NodeJS - system_nodejs: {{ not (empty .nodejs.version) | ternary "true" "false" }} - # Oh my zsh - system_ohmyzsh: true - # Php - system_php: {{ not (empty .php.version) | ternary "true" "false" }} - # Redis - system_redis: {{ not (empty .redis.version) | ternary "true" "false" }} - # Ssh - system_ssh: true - system_ssh_server: true - system_ssh_client_config_template: ssh/development/ssh_config.j2 - # Supervisor - system_supervisor: {{ not (empty .supervisor.configs) | ternary "true" "false" }} - # Timezone - system_timezone: true - # Vim - system_vim: true - # Zsh - system_zsh: true - - ############### - # Integration # - ############### - - integration: - - # App - system_app: true - system_app_group: docker - system_app_user: docker - # Apt - system_apt: true - system_apt_packages: - - xz-utils - - rsync - - wget - - curl - - make - - less - - ssl-cert - - procps - - vim-tiny - {{- if .apt.packages }} - # App - {{- .apt.packages | toYaml | nindent 16 }} - {{- end }} - # Git - system_git: true - # Locales - system_locales: true - # NodeJS - system_nodejs: {{ not (empty .nodejs.version) | ternary "true" "false" }} - # Php - system_php: {{ not (empty .php.version) | ternary "true" "false" }} - system_php_sapis: - - cli - # Ssh - system_ssh: true - system_ssh_client_config_template: ssh/integration/ssh_config.j2 - -{{- end }} diff --git a/elao.app/.manala/ansible/release.yaml b/elao.app/.manala/ansible/release.yaml deleted file mode 100644 index 53a94166..00000000 --- a/elao.app/.manala/ansible/release.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- - -- hosts: release - tasks: - - import_role: - name: release diff --git a/elao.app/.manala/ansible/roles/certificates/defaults/main.yml b/elao.app/.manala/ansible/roles/certificates/defaults/main.yml deleted file mode 100644 index 5cc74bd7..00000000 --- a/elao.app/.manala/ansible/roles/certificates/defaults/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- - -certificates_name: ~ -certificates_ca_key_passphrase: ~ -certificates_prompt: false diff --git a/elao.app/.manala/ansible/roles/certificates/tasks/main.yaml b/elao.app/.manala/ansible/roles/certificates/tasks/main.yaml deleted file mode 100644 index a687b165..00000000 --- a/elao.app/.manala/ansible/roles/certificates/tasks/main.yaml +++ /dev/null @@ -1,93 +0,0 @@ ---- - -# Install packages -- name: certificates > Install packages - apt: - name: - - "{{ (ansible_python.version.major == 2) | ternary('python-cryptography', 'python3-cryptography') }}" - install_recommends: false - update_cache: true - cache_valid_time: 3600 - -# Ca certificate key passphrase prompt -- block: - - name: certificates > Prompt ca key passphrase - pause: - prompt: Enter ca key passphrase - echo: false - register: __certificates_ca_key_passphrase - - name: certificates > Assign ca key passphrase - set_fact: - certificates_ca_key_passphrase: "{{__certificates_ca_key_passphrase.user_input}}" - when: certificates_prompt - -# Generate ssl certificate from ca certificate -- block: - - name: certificates > Generate ssl private key - openssl_privatekey: - path: "{{ playbook_dir }}/../certificates/ssl.key" - force: true - type: RSA - size: 4096 - - name: certificates > Generate ssl certificate signing request - openssl_csr: - path: "{{ playbook_dir }}/../certificates/ssl.csr" - privatekey_path: "{{ playbook_dir }}/../certificates/ssl.key" - force: true - common_name: |- - {{ certificates_name }} - subject_alt_name: |- - DNS:{{ certificates_name }},DNS:*.{{ certificates_name }} - - name: certificates > Generate ssl certificate - openssl_certificate: - path: "{{ playbook_dir }}/../certificates/ssl.pem" - csr_path: "{{ playbook_dir }}/../certificates/ssl.csr" - force: true - provider: ownca - ownca_path: "{{ playbook_dir }}/../certificates/ca.crt" - ownca_privatekey_path: "{{ playbook_dir }}/../certificates/ca.key" - ownca_privatekey_passphrase: "{{ certificates_ca_key_passphrase }}" - ownca_not_after: +825d - when: (certificates_ca_key_passphrase) - -# Copy ssl certificate -- block: - - name: certificates > Copy ssl certificate - copy: - src: "{{ playbook_dir }}/../certificates/{{ item[0] }}" - dest: /etc/ssl/{{ item[1] }}/{{ item[0] }} - loop: - - [ssl.pem, certs] - - [ssl.key, private] - notify: - - nginx restart - when: ((playbook_dir ~ '/../certificates/ssl.key') is file) - and ((playbook_dir ~ '/../certificates/ssl.pem') is file) - -# Generate self signed ssl certificate -- block: - - name: certificates > Generate self signed ssl private key - openssl_privatekey: - path: /etc/ssl/private/ssl.key - type: RSA - size: 4096 - notify: - - nginx restart - - name: certificates > Generate self signed ssl certificate signing request - openssl_csr: - path: /etc/ssl/certs/ssl.csr - privatekey_path: /etc/ssl/private/ssl.key - common_name: |- - {{ certificates_name }} - subject_alt_name: |- - DNS:{{ certificates_name }},DNS:*.{{ certificates_name }} - - name: certificates > Generate self signed ssl certificate - openssl_certificate: - path: /etc/ssl/certs/ssl.pem - csr_path: /etc/ssl/certs/ssl.csr - privatekey_path: /etc/ssl/private/ssl.key - provider: selfsigned - notify: - - nginx restart - when: ((playbook_dir ~ '/../certificates/ssl.key') is not file) - or ((playbook_dir ~ '/../certificates/ssl.pem') is not file) diff --git a/elao.app/.manala/ansible/roles/deploy/callback_plugins/.gitignore b/elao.app/.manala/ansible/roles/deploy/callback_plugins/.gitignore deleted file mode 100644 index 0d20b648..00000000 --- a/elao.app/.manala/ansible/roles/deploy/callback_plugins/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.pyc diff --git a/elao.app/.manala/ansible/roles/deploy/callback_plugins/log.py b/elao.app/.manala/ansible/roles/deploy/callback_plugins/log.py deleted file mode 100644 index bac150ac..00000000 --- a/elao.app/.manala/ansible/roles/deploy/callback_plugins/log.py +++ /dev/null @@ -1,73 +0,0 @@ -from ansible import constants as C -from ansible.plugins.callback import CallbackBase - -class CallbackModule(CallbackBase): - CALLBACK_VERSION = 2.0 - CALLBACK_TYPE = 'notification' - CALLBACK_NAME = 'log' - CALLBACK_NEEDS_WHITELIST = False - - def _std(self, result): - stderr = result._result.get('stderr') - if stderr: - self._display.display('<<< stderr', color=C.COLOR_WARN) - self._display.display(stderr) - self._display.display('>>> stderr' + "\r\n", color=C.COLOR_WARN) - - stdout = result._result.get('stdout') - if stdout: - self._display.display('<<< stdout', color=C.COLOR_DEBUG) - self._display.display(stdout) - self._display.display('>>> stdout' + "\r\n", color=C.COLOR_DEBUG) - - def v2_runner_on_ok(self, result): - # No loop - if result._task_fields.get('loop'): - return - - # Command module - if not result._task_fields.get('action') == 'command': - return - - # Tags - if not any(tag in result._task_fields.get('tags') for tag in ('log', 'log_ok')): - return - - self._std(result) - - def v2_runner_item_on_ok(self, result): - # Command module - if not result._task_fields.get('action') == 'command': - return - - # Tags - if not any(tag in result._task_fields.get('tags') for tag in ('log', 'log_ok')): - return - - self._std(result) - - def v2_runner_on_failed(self, result, ignore_errors=False): - # No loop - if result._task_fields.get('loop'): - return - - # Command module - if not result._task_fields.get('action') == 'command': - return - - # Tags - if not any(tag in result._task_fields.get('tags') for tag in ('log', 'log_failed')): - return - - self._std(result) - - def v2_runner_item_on_failed(self, result): - # Command module - if not result._task_fields.get('action') == 'command': - return - - # Tags - if not any(tag in result._task_fields.get('tags') for tag in ('log', 'log_failed')): - return - - self._std(result) diff --git a/elao.app/.manala/ansible/roles/deploy/defaults/main.yml b/elao.app/.manala/ansible/roles/deploy/defaults/main.yml deleted file mode 100644 index fff70046..00000000 --- a/elao.app/.manala/ansible/roles/deploy/defaults/main.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- - -# Dirs -deploy_dir: ~ -deploy_current_dir: current -deploy_releases_dir: releases -deploy_shared_dir: shared - -# Releases -deploy_releases: 5 - -# Strategy -deploy_strategy: git - -# Strategy - Git -deploy_strategy_git_repo: ~ -deploy_strategy_git_ref: master - -# [READ-ONLY] This variable will be filled with the head commit hash -deploy_strategy_git_head: ~ - -# Strategy - Synchronize -deploy_strategy_synchronize_src: ~ -deploy_strategy_synchronize_dst: ~ -deploy_strategy_synchronize_rsync_options: [] - -# Strategy - Unarchive -deploy_strategy_unarchive_src: ~ - -# Shared -deploy_shared_files: [] -deploy_shared_dirs: [] - -# Copied -deploy_copied: [] - -# Removed -deploy_removed: [] - -# Writable -deploy_writable_dirs_default: # Ensure backward compatibility - mode: "{{ deploy_writable_dirs_mode|default('ug=rwx,o=rx') }}" - follow: true - recurse: true -deploy_writable_dirs: [] - -# Tasks -deploy_tasks: [] -deploy_post_tasks: [] diff --git a/elao.app/.manala/ansible/roles/deploy/lookup_plugins/.gitignore b/elao.app/.manala/ansible/roles/deploy/lookup_plugins/.gitignore deleted file mode 100644 index 0d20b648..00000000 --- a/elao.app/.manala/ansible/roles/deploy/lookup_plugins/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.pyc diff --git a/elao.app/.manala/ansible/roles/deploy/lookup_plugins/deploy_tasks.py b/elao.app/.manala/ansible/roles/deploy/lookup_plugins/deploy_tasks.py deleted file mode 100644 index 5a81de40..00000000 --- a/elao.app/.manala/ansible/roles/deploy/lookup_plugins/deploy_tasks.py +++ /dev/null @@ -1,59 +0,0 @@ -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -from ansible.plugins.lookup import LookupBase -from ansible.module_utils.six import string_types -from ansible.errors import AnsibleError - -class LookupModule(LookupBase): - - def run(self, terms, variables=None, **kwargs): - - results = [] - - itemDefault = { - 'options': None, - 'when': True, - 'dir': - (variables['deploy_helper']['new_release_path']) - if 'deploy_helper' in variables else - (variables['deploy_dir'] + '/' + variables['deploy_current_dir']), - 'shared_dir': - (variables['deploy_helper']['shared_path']) - if 'deploy_helper' in variables else - (variables['deploy_dir'] + '/' + variables['deploy_shared_dir']) - } - - for term in self._flatten(terms): - - items = [] - - # Task as a single line - if isinstance(term, string_types): - item = itemDefault.copy() - item.update({ - 'task': term - }) - items.append(item) - else: - # Guess task (first one not in blacklist) - item = None - for termKey, termValue in term.items(): - if termKey not in ['when']: - item = itemDefault.copy() - item.update({ - 'task': termKey, - 'options': termValue - }) - break - if item: - item.update({ - 'when': term.get('when') if 'when' in term else True - }) - items.append(item) - - # Merge - for item in items: - results.append(item) - - return results diff --git a/elao.app/.manala/ansible/roles/deploy/lookup_plugins/deploy_writable_dirs.py b/elao.app/.manala/ansible/roles/deploy/lookup_plugins/deploy_writable_dirs.py deleted file mode 100644 index 43e738db..00000000 --- a/elao.app/.manala/ansible/roles/deploy/lookup_plugins/deploy_writable_dirs.py +++ /dev/null @@ -1,53 +0,0 @@ -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -from ansible.plugins.lookup import LookupBase -from ansible.module_utils.six import string_types -from ansible.errors import AnsibleError - -class LookupModule(LookupBase): - - def run(self, terms, variables=None, **kwargs): - - results = [] - - dirs = self._flatten(terms[0]) - default = terms[1] - - for dir in dirs: - - items = [] - - # Dir as a single line - if isinstance(dir, string_types): - item = default.copy() - item.update({ - 'dir': dir - }) - items.append(item) - else: - - # Must be a dict - if not isinstance(dir, dict): - raise AnsibleError('Expect a dict') - - # Check index key - if 'dir' not in dir: - raise AnsibleError('Expect "dir" key') - - item = default.copy() - item.update(dir) - items.append(item) - - # Merge by index key - for item in items: - itemFound = False - for i, result in enumerate(results): - if result['dir'] == item['dir']: - results[i] = item - itemFound = True - break - if not itemFound: - results.append(item) - - return results diff --git a/elao.app/.manala/ansible/roles/deploy/tasks/main.yml b/elao.app/.manala/ansible/roles/deploy/tasks/main.yml deleted file mode 100644 index 399f9dff..00000000 --- a/elao.app/.manala/ansible/roles/deploy/tasks/main.yml +++ /dev/null @@ -1,84 +0,0 @@ ---- - -# Setup -- name: setup > Create structure - deploy_helper: - path: "{{ deploy_dir }}" - current_path: "{{ deploy_current_dir }}" - releases_path: "{{ deploy_releases_dir }}" - shared_path: "{{ deploy_shared_dir }}" - keep_releases: "{{ deploy_releases }}" - state: present - -# Strategy -- name: strategy - include_tasks: "strategy/{{ deploy_strategy }}.yml" - -# Unfinished -- name: unfinished > Add an unfinished file, to allow cleanup on successful finalize - file: - path: "{{ deploy_helper.new_release_path }}/{{ deploy_helper.unfinished_filename }}" - state: touch - -# Shared -- import_tasks: shared.yml - -# Copied -- name: copied > Stat - stat: - path: "{{ deploy_helper.previous_release_path ~ '/' ~ item }}" - register: __deploy_copied_stats_output - with_items: "{{ deploy_copied }}" - -- name: copied > Copy - shell: > - cp -R {{ deploy_helper.previous_release_path ~ '/' ~ item.1 ~ (__deploy_copied_stats_output.results[item.0].stat.isdir|ternary('/', '')) }} - {{ deploy_helper.new_release_path ~ '/' ~ item.1 }} - delegate_to: "{{ inventory_hostname }}" - with_indexed_items: "{{ deploy_copied }}" - when: __deploy_copied_stats_output.results[item.0].stat.exists - tags: log_failed - -# Writable - Dirs -- import_tasks: writable/dirs.yml - -# Tasks -- name: tasks - include_tasks: task/{{ item.task }}.yml - loop: "{{ query('deploy_tasks', deploy_tasks) }}" - when: item.when - -# Removed -- name: removed > Files - file: - path: "{{ deploy_helper.new_release_path ~ '/' ~ item }}" - state: absent - with_items: "{{ deploy_removed }}" - -# Finalize -- name: finalize > Remove the unfinished file and create a symlink to the newly deployed release - deploy_helper: - path: "{{ deploy_dir }}" - current_path: "{{ deploy_current_dir }}" - releases_path: "{{ deploy_releases_dir }}" - release: "{{ deploy_helper.new_release }}" - keep_releases: "{{ deploy_releases }}" - state: finalize - clean: false - -# Clean -- name: clean > Remove failed and old releases, keeping "{{ deploy_releases }}" releases - deploy_helper: - path: "{{ deploy_dir }}" - current_path: "{{ deploy_current_dir }}" - releases_path: "{{ deploy_releases_dir }}" - release: "{{ deploy_helper.new_release }}" - keep_releases: "{{ deploy_releases }}" - state: clean - ignore_errors: true - -# Post tasks -- name: post tasks - include_tasks: task/{{ item.task }}.yml - loop: "{{ query('deploy_tasks', deploy_post_tasks) }}" - when: item.when diff --git a/elao.app/.manala/ansible/roles/deploy/tasks/shared.yml b/elao.app/.manala/ansible/roles/deploy/tasks/shared.yml deleted file mode 100644 index 948b88b2..00000000 --- a/elao.app/.manala/ansible/roles/deploy/tasks/shared.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- - -- name: shared > Ensure release targets are absent - file: - path: "{{ deploy_helper.new_release_path ~ '/' ~ item }}" - state: absent - with_items: "{{ deploy_shared_files + deploy_shared_dirs }}" - -- name: shared > Stat shared files - stat: - path: "{{ deploy_helper.shared_path ~ '/' ~ item }}" - register: __deploy_shared_files_stats_output - with_items: "{{ deploy_shared_files }}" - -- name: shared > Ensure shared directories files are present - file: - path: "{{ (deploy_helper.shared_path ~ '/' ~ item.1)|dirname }}" - state: directory - with_indexed_items: "{{ deploy_shared_files }}" - when: not __deploy_shared_files_stats_output.results[item.0].stat.exists - -- name: shared > Ensure shared files are present - file: - path: "{{ deploy_helper.shared_path ~ '/' ~ item.1 }}" - state: touch - with_indexed_items: "{{ deploy_shared_files }}" - when: not __deploy_shared_files_stats_output.results[item.0].stat.exists - -- name: shared > Ensure shared dirs are present - file: - path: "{{ deploy_helper.shared_path ~ '/' ~ item }}" - state: directory - follow: true - with_items: "{{ deploy_shared_dirs }}" - -- name: shared > Ensure directories links are present - file: - path: "{{ (deploy_helper.new_release_path ~ '/' ~ item)|dirname }}" - state: directory - with_items: "{{ deploy_shared_files + deploy_shared_dirs }}" - -- name: shared > Links - file: - path: "{{ deploy_helper.new_release_path ~ '/' ~ item }}" - src: "{{ (deploy_helper.shared_path ~ '/' ~ item)|relpath((deploy_helper.new_release_path ~ '/' ~ item)|dirname) }}" - state: link - with_items: "{{ deploy_shared_files + deploy_shared_dirs }}" diff --git a/elao.app/.manala/ansible/roles/deploy/tasks/strategy/git.yml b/elao.app/.manala/ansible/roles/deploy/tasks/strategy/git.yml deleted file mode 100644 index 83e4dfaf..00000000 --- a/elao.app/.manala/ansible/roles/deploy/tasks/strategy/git.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- - -- name: strategy/git - block: - - - name: strategy/git > Repository - git: - repo: "{{ deploy_strategy_git_repo }}" - dest: "{{ deploy_dir ~ '/repo' }}" - version: "{{ deploy_strategy_git_ref }}" - accept_hostkey: true - update: true - - - name: strategy/git > Get head - shell: > - git rev-parse --short HEAD - args: - chdir: "{{ deploy_dir ~ '/repo' }}" - tags: log_failed - register: __deploy_strategy_git_head_result - - - name: strategy/git > Set head - set_fact: - deploy_strategy_git_head: "{{ __deploy_strategy_git_head_result.stdout }}" - - - name: strategy/git > Export repository - shell: > - git checkout-index -f -a --prefix="{{ deploy_helper.new_release_path }}/" - args: - chdir: "{{ deploy_dir ~ '/repo' }}" - tags: log_failed diff --git a/elao.app/.manala/ansible/roles/deploy/tasks/strategy/synchronize.yml b/elao.app/.manala/ansible/roles/deploy/tasks/strategy/synchronize.yml deleted file mode 100644 index e12fa50f..00000000 --- a/elao.app/.manala/ansible/roles/deploy/tasks/strategy/synchronize.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- - -- name: strategy/synchronize - block: - - - name: strategy/synchronize > Synchronize - synchronize: - src: "{{ deploy_strategy_synchronize_src }}" - dest: "{{ deploy_helper.new_release_path }}/" - rsync_opts: "{{ deploy_strategy_synchronize_rsync_options }}" diff --git a/elao.app/.manala/ansible/roles/deploy/tasks/strategy/unarchive.yml b/elao.app/.manala/ansible/roles/deploy/tasks/strategy/unarchive.yml deleted file mode 100644 index 5c0aa2d9..00000000 --- a/elao.app/.manala/ansible/roles/deploy/tasks/strategy/unarchive.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- - -- name: strategy/unarchive - block: - - - name: strategy/unarchive > Create dir - file: - path: "{{ deploy_helper.new_release_path }}/" - state: directory - - - name: strategy/unarchive > Unarchive - unarchive: - src: "{{ deploy_strategy_unarchive_src }}" - dest: "{{ deploy_helper.new_release_path }}" diff --git a/elao.app/.manala/ansible/roles/deploy/tasks/task/shell.yml b/elao.app/.manala/ansible/roles/deploy/tasks/task/shell.yml deleted file mode 100644 index 4cc676e5..00000000 --- a/elao.app/.manala/ansible/roles/deploy/tasks/task/shell.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- - -- name: task/shell - block: - - - name: task/shell > "{{ item.options }}" in "{{ item.dir }}" - shell: > - {{ item.options }} - args: - chdir: "{{ item.dir }}" - tags: log diff --git a/elao.app/.manala/ansible/roles/deploy/tasks/writable/dirs.yml b/elao.app/.manala/ansible/roles/deploy/tasks/writable/dirs.yml deleted file mode 100644 index 55dd2d79..00000000 --- a/elao.app/.manala/ansible/roles/deploy/tasks/writable/dirs.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- - -- name: writable/dirs > "{{ item.dir }}" - file: - path: "{{ deploy_helper.new_release_path ~ '/' ~ item.dir }}" - recurse: "{{ item.recurse|default(omit) }}" - follow: "{{ item.follow|default(omit) }}" - mode: "{{ item.mode|default(omit) }}" - state: directory - with_deploy_writable_dirs: - - "{{ deploy_writable_dirs }}" - - "{{ deploy_writable_dirs_default }}" - -- name: writable/dirs > Raw "{{ item.dir }}" - raw: "{{ item.raw|format(dir=deploy_helper.new_release_path ~ '/' ~ item.dir) }}" - when: item.raw is defined - with_deploy_writable_dirs: - - "{{ deploy_writable_dirs }}" - - "{{ deploy_writable_dirs_default }}" diff --git a/elao.app/.manala/ansible/roles/release/callback_plugins/.gitignore b/elao.app/.manala/ansible/roles/release/callback_plugins/.gitignore deleted file mode 100644 index 0d20b648..00000000 --- a/elao.app/.manala/ansible/roles/release/callback_plugins/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.pyc diff --git a/elao.app/.manala/ansible/roles/release/callback_plugins/log.py b/elao.app/.manala/ansible/roles/release/callback_plugins/log.py deleted file mode 100644 index bac150ac..00000000 --- a/elao.app/.manala/ansible/roles/release/callback_plugins/log.py +++ /dev/null @@ -1,73 +0,0 @@ -from ansible import constants as C -from ansible.plugins.callback import CallbackBase - -class CallbackModule(CallbackBase): - CALLBACK_VERSION = 2.0 - CALLBACK_TYPE = 'notification' - CALLBACK_NAME = 'log' - CALLBACK_NEEDS_WHITELIST = False - - def _std(self, result): - stderr = result._result.get('stderr') - if stderr: - self._display.display('<<< stderr', color=C.COLOR_WARN) - self._display.display(stderr) - self._display.display('>>> stderr' + "\r\n", color=C.COLOR_WARN) - - stdout = result._result.get('stdout') - if stdout: - self._display.display('<<< stdout', color=C.COLOR_DEBUG) - self._display.display(stdout) - self._display.display('>>> stdout' + "\r\n", color=C.COLOR_DEBUG) - - def v2_runner_on_ok(self, result): - # No loop - if result._task_fields.get('loop'): - return - - # Command module - if not result._task_fields.get('action') == 'command': - return - - # Tags - if not any(tag in result._task_fields.get('tags') for tag in ('log', 'log_ok')): - return - - self._std(result) - - def v2_runner_item_on_ok(self, result): - # Command module - if not result._task_fields.get('action') == 'command': - return - - # Tags - if not any(tag in result._task_fields.get('tags') for tag in ('log', 'log_ok')): - return - - self._std(result) - - def v2_runner_on_failed(self, result, ignore_errors=False): - # No loop - if result._task_fields.get('loop'): - return - - # Command module - if not result._task_fields.get('action') == 'command': - return - - # Tags - if not any(tag in result._task_fields.get('tags') for tag in ('log', 'log_failed')): - return - - self._std(result) - - def v2_runner_item_on_failed(self, result): - # Command module - if not result._task_fields.get('action') == 'command': - return - - # Tags - if not any(tag in result._task_fields.get('tags') for tag in ('log', 'log_failed')): - return - - self._std(result) diff --git a/elao.app/.manala/ansible/roles/release/defaults/main.yml b/elao.app/.manala/ansible/roles/release/defaults/main.yml deleted file mode 100644 index dc413a0b..00000000 --- a/elao.app/.manala/ansible/roles/release/defaults/main.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- - -# Dirs -release_dir: ~ -release_target_dir: ~ - -# Git -release_git_dir: ~ -release_repo: ~ -release_version: master - -# Tasks -release_tasks: [] - -# Removed -release_removed: [] - -# Add -release_add: [] - -# Regex (protocol|host|user|repository) -release_git_url_regex: '^(?Phttps|git)(:\/\/|@)(?P[^\/:]+)[\/:](?P[^\/:]+)\/(?P.+).git$' diff --git a/elao.app/.manala/ansible/roles/release/lookup_plugins/.gitignore b/elao.app/.manala/ansible/roles/release/lookup_plugins/.gitignore deleted file mode 100644 index 0d20b648..00000000 --- a/elao.app/.manala/ansible/roles/release/lookup_plugins/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.pyc diff --git a/elao.app/.manala/ansible/roles/release/lookup_plugins/release_tasks.py b/elao.app/.manala/ansible/roles/release/lookup_plugins/release_tasks.py deleted file mode 100644 index 97b37be7..00000000 --- a/elao.app/.manala/ansible/roles/release/lookup_plugins/release_tasks.py +++ /dev/null @@ -1,51 +0,0 @@ -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -from ansible.plugins.lookup import LookupBase -from ansible.module_utils.six import string_types -from ansible.errors import AnsibleError - -class LookupModule(LookupBase): - - def run(self, terms, variables=None, **kwargs): - - results = [] - - itemDefault = { - 'options': None, - 'when': True - } - - for term in self._flatten(terms): - - items = [] - - # Task as a single line - if isinstance(term, string_types): - item = itemDefault.copy() - item.update({ - 'task': term - }) - items.append(item) - else: - # Guess task (first one not in blacklist) - item = None - for termKey, termValue in term.items(): - if termKey not in ['when']: - item = itemDefault.copy() - item.update({ - 'task': termKey, - 'options': termValue - }) - break - if item: - item.update({ - 'when': term.get('when') if 'when' in term else True - }) - items.append(item) - - # Merge - for item in items: - results.append(item) - - return results diff --git a/elao.app/.manala/ansible/roles/release/tasks/main.yml b/elao.app/.manala/ansible/roles/release/tasks/main.yml deleted file mode 100644 index eb555859..00000000 --- a/elao.app/.manala/ansible/roles/release/tasks/main.yml +++ /dev/null @@ -1,114 +0,0 @@ ---- - -- name: git > Get url - shell: > - git config --get remote.origin.url - args: - chdir: "{{ release_git_dir }}" - tags: log_failed - register: __release_git_url - -- name: git > Get informations - git: - repo: "{{ __release_git_url.stdout }}" - dest: "{{ release_git_dir }}" - clone: false - update: false - register: __release_git - -- name: Release directory "{{ release_dir }}" - shell: > - rm --recursive --force {{ release_dir }} - && mkdir -p {{ release_dir }} - args: - warn: false - tags: log_failed - -- name: git > Export repository - shell: > - git archive HEAD{{ - ' ' ~ release_target_dir if (release_target_dir) else '' - }} - | tar -x -C {{ release_dir }}{{ - ' ' ~ release_target_dir - ~ ' --strip-components=' ~ release_target_dir.split('/')|length - if (release_target_dir) else - '' - }} - args: - chdir: "{{ release_git_dir }}" - tags: log_failed - -- name: tasks - include_tasks: task/{{ item.task }}.yml - loop: "{{ query('release_tasks', release_tasks) }}" - when: item.when - -- name: git > Init "{{ release_repo }}" on branch "{{ release_version }}" - shell: > - git init - && git checkout -b {{ release_version }} - && git remote add origin {{ release_repo }} - && git fetch - && ( - git show-ref -q origin/{{ release_version }} ; rc=$? ; - if [ $rc -eq 0 -o $rc -eq 1 ] ; then - if [ $rc -eq 0 ] ; then - git update-ref HEAD origin/{{ release_version }} ; - fi ; - else - return $rc ; - fi - ) - args: - chdir: "{{ release_dir }}" - tags: log_failed - -- name: Remove - shell: > - rm --recursive --force {{ [release_dir, item]|join('/') }} - args: - warn: false - tags: log_failed - loop: "{{ release_removed }}" - -- name: git > Add all - shell: > - git add --force --all - args: - chdir: "{{ release_dir }}" - when: release_add|length == 0 - tags: log_failed - -- name: git > Add - shell: > - git add --force {{ item }} - args: - chdir: "{{ release_dir }}" - loop: "{{ release_add }}" - tags: log_failed - -- name: git > Commit - shell: | - git commit --allow-empty -m "{{ - ansible_date_time.year - ~ ansible_date_time.month - ~ ansible_date_time.day - ~ ansible_date_time.hour - ~ ansible_date_time.minute - ~ ansible_date_time.second - }} - Original commit: https://{{ - __release_git_url.stdout|regex_replace(release_git_url_regex, '\g/\g/\g') - }}/commit/{{ __release_git.after }}" - args: - chdir: "{{ release_dir }}" - tags: log_failed - -- name: git > Push "{{ release_version }}" - shell: > - git push --set-upstream origin {{ release_version }} - && git push origin HEAD - args: - chdir: "{{ release_dir }}" - tags: log_failed diff --git a/elao.app/.manala/ansible/roles/release/tasks/task/shell.yml b/elao.app/.manala/ansible/roles/release/tasks/task/shell.yml deleted file mode 100644 index 997b4222..00000000 --- a/elao.app/.manala/ansible/roles/release/tasks/task/shell.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- - -- name: task/shell - block: - - - name: task/shell > "{{ item.options }}" - shell: > - {{ item.options }} - args: - chdir: "{{ release_dir }}" - tags: log diff --git a/elao.app/.manala/ansible/system.yaml b/elao.app/.manala/ansible/system.yaml deleted file mode 100644 index ffb17398..00000000 --- a/elao.app/.manala/ansible/system.yaml +++ /dev/null @@ -1,634 +0,0 @@ ---- - -- hosts: system - - collections: - - manala.roles - - vars: - - ############ - # Accounts # - ############ - - manala_accounts_groups: - - group: docker - system: true - state: "{{ 'present' if (system_docker) else 'absent' }}" - - manala_accounts_users: - - user: "{{ system_app_user }}" - group: "{{ system_app_group }}" - groups: "{{ - ['docker'] if (system_docker) else [] - }}" - state: "{{ 'present' if (system_app) else 'absent' }}" - - ################ - # Alternatives # - ################ - - manala_alternatives_selections: - - selection: editor - path: "{{ manala_vim_bin }}" - - ####### - # Apt # - ####### - - manala_apt: - update: true - - manala_apt_configs: - - file: archive - config: | - Acquire::Check-Valid-Until "false"; - state: "{{ 'present' if (ansible_distribution_release in ['jessie']) else 'ignore' }}" - - manala_apt_components: - - main - - manala_apt_sources_list_template: apt/sources.list.j2 - - manala_apt_repositories_exclusive: true - manala_apt_repositories: "{{ system_apt_repositories }}" - - manala_apt_preferences_exclusive: true - manala_apt_preferences: - # Jessie - - preference: git@backports - state: "{{ 'present' if (system_git and (ansible_distribution_release in ['jessie'])) else 'ignore' }}" - - preference: python-websocket@manala - state: "{{ 'present' if (ansible_distribution_release in ['jessie']) else 'ignore' }}" - - preference: python-ipaddress@manala - state: "{{ 'present' if (ansible_distribution_release in ['jessie']) else 'ignore' }}" - - preference: python-backports.ssl-match-hostname@manala - state: "{{ 'present' if (ansible_distribution_release in ['jessie']) else 'ignore' }}" - - preference: python-docker@manala - state: "{{ 'present' if (ansible_distribution_release in ['jessie']) else 'ignore' }}" - - preference: python-httplib2@manala - state: "{{ 'present' if (ansible_distribution_release in ['jessie']) else 'ignore' }}" - - preference: python-jinja2@manala - state: "{{ 'present' if (ansible_distribution_release in ['jessie']) else 'ignore' }}" - # Jessie - Python Cryptography - - preference: python-cryptography@backports - state: "{{ 'present' if (ansible_distribution_release in ['jessie']) else 'ignore' }}" - - preference: python-pyasn1@backports - state: "{{ 'present' if (ansible_distribution_release in ['jessie']) else 'ignore' }}" - - preference: python-setuptools@backports - state: "{{ 'present' if (ansible_distribution_release in ['jessie']) else 'ignore' }}" - - preference: python-pkg-resources@backports - state: "{{ 'present' if (ansible_distribution_release in ['jessie']) else 'ignore' }}" - # Ansible - - ansible@ansible - # NodeJS - - preference: "nodejs@{{ - 'nodesource_' ~ system_nodejs_version|string|replace('.', '_') if (system_nodejs) else - 'default' - }}" - state: "{{ 'present' if (system_nodejs) else 'ignore' }}" - # Yarn - - preference: yarn@yarn - state: "{{ 'present' if (system_nodejs_yarn) else 'ignore' }}" - # Php - - preference: php@sury_php - state: "{{ 'present' if (system_php) else 'ignore' }}" - # Elasticsearch - - preference: "elasticsearch@{{ - 'elasticsearch_' ~ system_elasticsearch_version|string|replace('.', '_') if (system_elasticsearch) else - 'default' - }}" - state: "{{ 'present' if (system_elasticsearch) else 'ignore' }}" - # Docker - - preference: docker@docker - state: "{{ 'present' if (system_docker) else 'ignore' }}" - # InfluxDB - - preference: influxdb@influxdata - state: "{{ 'present' if (system_influxdb) else 'ignore' }}" - # Nginx - - preference: nginx@nginx - state: "{{ 'present' if (system_nginx) else 'ignore' }}" - # Supervisor - - preference: "supervisor@{{ - 'manala' if (ansible_distribution_release in ['jessie']) else - 'backports' if (ansible_distribution_release in ['stretch']) else - 'default' - }}" - state: "{{ 'present' if (system_supervisor and (ansible_distribution_release in ['jessie', 'stretch'])) else 'ignore' }}" - # MySQL - - preference: "mysql@{{ - 'mysql_' ~ system_mysql_version|string|replace('.', '_') if (system_mysql) else - 'default' - }}" - state: "{{ 'present' if (system_mysql) else 'ignore' }}" - # MariaDB - - preference: "mariadb@{{ - 'mariadb_' ~ system_mariadb_version|string|replace('.', '_') if (system_mariadb) else - 'default' - }}" - state: "{{ 'present' if (system_mariadb) else 'ignore' }}" - # Redis - - preference: redis@backports - state: "{{ 'present' if ( - (system_redis_version|string == '5.0') and (ansible_distribution_release in ['stretch']) - or (system_redis_version|string == '6.0') and (ansible_distribution_release in ['buster']) - ) else 'ignore' }}" - - "{{ system_apt_preferences }}" - - manala_apt_holds_exclusive: true - manala_apt_holds: - - "{{ system_apt_holds }}" - - manala_apt_packages: - - "{{ system_apt_packages }}" - - ################ - # Certificates # - ################ - - certificates_name: "{{ system_certificates_name }}" - - ############ - # Composer # - ############ - - manala_composer_version: "{{ system_php_composer_version }}" - - ######## - # Cron # - ######## - - manala_cron_files_defaults: - user: "{{ system_app_user }}" - manala_cron_files: "{{ system_cron_files }}" - - ########## - # Docker # - ########## - - manala_docker_containers: - - name: mailhog - image: mailhog/mailhog:v1.0.1 - state: started - restart_policy: unless-stopped - ports: - - 25:1025 - - 8025:8025 - - name: phpmyadmin - image: phpmyadmin/phpmyadmin - state: "{{ 'started' if (system_mysql or system_mariadb) else 'absent' }}" - restart_policy: unless-stopped - env: - PMA_USER: root - # Default docker host ip - PMA_HOST: 172.17.0.1 - UPLOAD_LIMIT: 64M - ports: - - 1979:80 - - name: phpredisadmin - image: erikdubbelboer/phpredisadmin - state: "{{ 'started' if ((system_redis) and (system_redis_phpredisadmin)) else 'absent' }}" - restart_policy: unless-stopped - env: - # Default docker host ip - REDIS_1_HOST: 172.17.0.1 - ports: - - 1981:80 - - "{{ system_docker_containers }}" - - ################# - # Elasticsearch # - ################# - - manala_elasticsearch_version: "{{ system_elasticsearch_version }}" - - manala_elasticsearch_plugins: "{{ system_elasticsearch_plugins }}" - - ############### - # Environment # - ############### - - manala_environment_files: - - zsh - - manala_environment_variables: "{{ {}|combine( - system_env, - system_php_composer|ternary( - {'COMPOSER_MEMORY_LIMIT': -1,}, - {} - ) - ) }}" - - ######### - # Files # - ######### - - manala_files_attributes_defaults: - - parents: true - force: true - - path: "^{{ system_app_log_dir }}" - user: "{{ system_app_user }}" - group: "{{ system_app_group }}" - - path: "^{{ system_app_cache_dir }}" - user: "{{ system_app_user }}" - group: "{{ system_app_group }}" - - path: "^{{ system_app_sessions_dir }}" - user: "{{ system_app_user }}" - group: "{{ system_app_group }}" - manala_files_attributes: - - path: "{{ system_app_log_dir }}" - state: directory - - path: "{{ system_app_cache_dir }}" - state: directory - - path: "{{ system_app_sessions_dir }}" - state: directory - - path: /usr/share/nginx/html/404.html - template: nginx/html/404.html.j2 - mode: "0644" - - "{{ system_files_attributes }}" - - ####### - # Git # - ####### - - manala_git_config_template: git/gitconfig.j2 - - ############ - # Gomplate # - ############ - - manala_gomplate_version: 3.11.1 - - ############ - # InfluxDB # - ############ - - manala_influxdb_config_template: config/influxdata/influxdb.conf.j2 - manala_influxdb_config: "{{ system_influxdb_config }}" - - manala_influxdb_databases: "{{ system_influxdb_databases }}" - - manala_influxdb_users: "{{ system_influxdb_users }}" - - manala_influxdb_privileges: "{{ system_influxdb_privileges }}" - - ######## - # Java # - ######## - - manala_java_version: "{{ { - 'jessie': '8', - 'stretch': '8', - 'buster': '11', - }[ansible_distribution_release] - }}" - - ########### - # Locales # - ########### - - manala_locales_codes_default: "{{ system_locales_default }}" - manala_locales_codes: "{{ system_locales_codes }}" - - ######## - # Motd # - ######## - - manala_motd_scripts_exclusive: true - manala_motd_scripts: - - file: 10-motd - template: "{{ system_motd_template }}" - message: "{{ system_motd_message }}" - - ################### - # MySQL / MariaDB # - ################### - - manala_mysql_install_packages: "{{ - system_mariadb_install_packages - if (system_mariadb) else - system_mysql_install_packages - }}" - - manala_mysql_configs_dir: "{{ - system_mariadb_configs_dir - if (system_mariadb) else - system_mysql_configs_dir - }}" - manala_mysql_configs: - - template: mysql/zz-mysqld.cnf.j2 - - manala_mysql_users: - # Create a password-less/any-host root user... - - name: root - password: ~ - host: "%" - priv: "*.*:ALL,GRANT" - # ...then remove anonymous localhost user (MySQL 5.6) - - name: '' - host: localhost - state: absent - # ...then remove root localhost user (socket based authentication on MySQL 5.7+/MariaDB) - - name: root - host: localhost - state: absent - - ########### - # Network # - ########### - - manala_network_hosts: "{{ system_network_hosts }}" - - ######### - # Nginx # - ######### - - manala_nginx_config_template: nginx/nginx.conf.j2 - - manala_nginx_configs_exclusive: true - manala_nginx_configs: - - template: nginx/default.conf.j2 - - template: nginx/ssl_offloading.conf.j2 - - "{{ system_nginx_configs }}" - - ######### - # Ngrok # - ######### - - manala_ngrok_configs_exclusive: true - manala_ngrok_configs: - - template: ngrok/ngrok.yml.j2 - - ####### - # Npm # - ####### - - manala_npm_packages: "{{ system_nodejs_packages }}" - - ############# - # Oh my zsh # - ############# - - manala_ohmyzsh_custom_themes_exclusive: true - manala_ohmyzsh_custom_themes: - - template: ohmyzsh/theme.zsh-theme.j2 - - manala_ohmyzsh_users: - - user: "{{ system_app_user }}" - group: "{{ system_app_group }}" - template: ohmyzsh/.zshrc.j2 - state: "{{ 'present' if (system_app) else 'ignore' }}" - - ####### - # Php # - ####### - - manala_php_version: "{{ system_php_version }}" - - manala_php_sapis_exclusive: true - manala_php_sapis: "{{ system_php_sapis }}" - - manala_php_fpm_pools_exclusive: true - manala_php_fpm_pools: - - file: app.conf - template: fpm_pools/sury/pools.conf.j2 - config: - app: - user: "{{ system_app_user }}" - group: "{{ system_app_group }}" - listen: /run/php-fpm.app.sock - pm.max_children: 20 - env: "{{ system_env }}" - php_admin_value: - error_log: "{{ system_app_log_dir }}/php.error.log" - - manala_php_extensions_exclusive: true - manala_php_extensions: - - opcache - - readline - - extension: json - state: "{{ 'present' if (manala_php_version and manala_php_version|string is version('8.0', '<')) else 'ignore' }}" - - extension: xdebug - enabled: false - - "{{ system_php_extensions }}" - manala_php_extensions_pecl_versioned: "{{ (ansible_distribution_release not in ['jessie']) or system_php_dotdeb }}" - - manala_php_configs_exclusive: true - manala_php_configs: - - template: php/50-xdebug.ini.j2 - - "{{ system_php_configs }}" - - ######### - # Redis # - ######### - - manala_redis_server_config_template: config/debian/redis.conf.j2 - manala_redis_server_config: "{{ { - 'bind': '0.0.0.0', - }|combine(system_redis_server_config) }}" - - ####### - # Ssh # - ####### - - manala_ssh_server: "{{ system_ssh_server }}" - manala_ssh_server_config_template: ssh/sshd_config.j2 - manala_ssh_server_config: - AcceptEnv: DIR - - manala_ssh_client_config_template: "{{ system_ssh_client_config_template }}" - manala_ssh_client_config: "{{ system_ssh_client_config }}" - - manala_ssh_known_hosts: - - github.com - - host: git.elao.com - file: "{{ playbook_dir ~ '/templates/ssh/keys/git.elao.com' }}" - - ############## - # Supervisor # - ############## - - manala_supervisor_config_template: config/debian/supervisord.conf.j2 - - manala_supervisor_configs_exclusive: true - manala_supervisor_configs_defaults: - template: supervisor/app.conf.j2 - manala_supervisor_configs: - - template: configs/inet_http_server.conf.j2 - config: - port: "*:9001" - - "{{ system_supervisor_configs }}" - - ############ - # Timezone # - ############ - - manala_timezone_default: "{{ system_timezone_default }}" - - ####### - # Vim # - ####### - - manala_vim_config_template: vim/vimrc.local.j2 - - tasks: - - - import_role: - name: zsh - when: system_zsh - tags: [zsh] - - - import_role: - name: environment - when: system_environment - tags: [environment, env] - - - import_role: - name: apt - when: system_apt - tags: [apt] - - - import_role: - name: network - when: system_network - tags: [network] - - - import_role: - name: accounts - when: system_accounts - tags: [accounts] - - - import_role: - name: locales - when: system_locales - tags: [locales] - - - import_role: - name: ssh - when: system_ssh - tags: [ssh] - - - import_role: - name: motd - when: system_motd - tags: [motd] - - - import_role: - name: timezone - when: system_timezone - tags: [timezone] - - - import_role: - name: vim - when: system_vim - tags: [vim] - - - import_role: - name: git - when: system_git - tags: [git] - - - import_role: - name: ohmyzsh - when: system_ohmyzsh - tags: [ohmyzsh] - - - import_role: - name: alternatives - when: system_alternatives - tags: [alternatives] - - - import_role: - name: files - when: system_files - tags: [files] - - - import_role: - name: nodejs - when: system_nodejs - tags: [nodejs, node] - - - import_role: - name: npm - when: system_nodejs_npm - tags: [npm, nodejs, node] - - - import_role: - name: yarn - when: system_nodejs_yarn - tags: [yarn, nodejs, node] - - - import_role: - name: php - when: system_php - tags: [php] - - - import_role: - name: composer - when: system_php_composer - tags: [composer] - - - import_role: - name: symfony_cli - when: system_symfony_cli - tags: [symfony] - - - import_role: - name: certificates - when: system_certificates - tags: [certificates, nginx] - - - import_role: - name: nginx - when: system_nginx - tags: [nginx, certificates] - - - import_role: - name: redis - when: system_redis - tags: [redis] - - - import_role: - name: cron - when: system_cron - tags: [cron] - - - import_role: - name: supervisor - when: system_supervisor - tags: [supervisor] - - - import_role: - name: mysql - when: system_mysql or system_mariadb - tags: [mysql, mariadb] - - - import_role: - name: java - when: system_java - tags: [java] - - - import_role: - name: elasticsearch - when: system_elasticsearch - tags: [elasticsearch] - - - import_role: - name: docker - when: system_docker - tags: [docker] - - - import_role: - name: influxdb - when: system_influxdb - tags: [influxdb] - - - import_role: - name: gomplate - when: system_gomplate - tags: [gomplate] - - - import_role: - name: ngrok - when: system_ngrok - tags: [ngrok] diff --git a/elao.app/.manala/ansible/templates/apt/sources.list.j2 b/elao.app/.manala/ansible/templates/apt/sources.list.j2 deleted file mode 100644 index 59bbe803..00000000 --- a/elao.app/.manala/ansible/templates/apt/sources.list.j2 +++ /dev/null @@ -1,5 +0,0 @@ -deb http://deb.debian.org/debian {{ ansible_distribution_release }} {{ manala_apt_components|flatten|join(' ') }} -{% if ansible_distribution_release not in ['jessie'] -%} -deb http://deb.debian.org/debian {{ ansible_distribution_release }}-updates {{ manala_apt_components|flatten|join(' ') }} -{% endif %} -deb http://security.debian.org/debian-security {{ ansible_distribution_release }}/updates {{ manala_apt_components|flatten|join(' ') }} diff --git a/elao.app/.manala/ansible/templates/git/gitconfig.j2 b/elao.app/.manala/ansible/templates/git/gitconfig.j2 deleted file mode 100644 index 1f7962e2..00000000 --- a/elao.app/.manala/ansible/templates/git/gitconfig.j2 +++ /dev/null @@ -1,23 +0,0 @@ -{%- set config = { - 'core': {}, - 'oh-my-zsh': {}, -} | combine(manala_git_config|default({}, true)) -%} - -[core] - ; See: http://git.661346.n2.nabble.com/git-status-takes-30-seconds-on-Windows-7-Why-td7580816.html - {{ config.core | manala.roles.git_config_parameter('preloadindex', default=true) | indent(4) }} - ; See: https://news.ycombinator.com/item?id=11388479 - {{ config.core | manala.roles.git_config_parameter('untrackedCache', default=true) | indent(4) }} - {{- config.core | manala.roles.git_config_section(exclude=[ - 'preloadindex', - 'untrackedCache' - ]) }} - -[oh-my-zsh] - ; See: http://marc-abramowitz.com/archives/2012/04/10/fix-for-oh-my-zsh-git-svn-prompt-slowness/ - {{ config['oh-my-zsh'] | manala.roles.git_config_parameter('hide-status', default=1) | indent(4) }} - {{- config['oh-my-zsh'] | manala.roles.git_config_section(exclude=[ - 'hide-status' - ]) }} - -{{ config | manala.roles.git_config(exclude=['core', 'oh-my-zsh']) }} diff --git a/elao.app/.manala/ansible/templates/motd/cow.j2 b/elao.app/.manala/ansible/templates/motd/cow.j2 deleted file mode 100755 index c1c81120..00000000 --- a/elao.app/.manala/ansible/templates/motd/cow.j2 +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -{% if item.message is iterable and item.message is not string -%} -MESSAGE="$(printf '%s\n' {% for message in item.message %}{{ message | quote }} {% endfor %}| shuf -n1)" -{% else -%} -MESSAGE={{ item.message | quote }} -{% endif %} -LINE=$(printf "%{{ '${#MESSAGE}' }}s" | sed 's/ /-/g') - -cat < - -$LINE- - \ /; ;\\ - \ __ \\\____// - /{_\_/ \`'\____ - \___ (o) (o } - _____________________________/ :--' - ,-,'\`@@@@@@@@ @@@@@@ \_ \`__\\ - ;:( @@@@@@@@@ @@@ \___(o'o) - :: ) @@@@ @@@@@@ ,'@@( \`====' - :: : @@@@@: @@@@ \`@@@: - :: \ @@@@@: @@@@@@@) ( '@@@' - ;; /\ /\`, @@@@@@@@@\ :@@@@@) - ::/ ) {_----------------: :~\`,~~; - ;;'\`; : ) : / \`; ; - ;;;; : : ; : ; ; : - \`'\`' / : : : : : : - )_ \__; ";" :_ ; \_\ \`,',' - :__\ \ * \`,'* \ \ : \ * 8\`;'* * - \`^' \ :/ \`^' \`-^-' \v/ : \/ - -EOF diff --git a/elao.app/.manala/ansible/templates/motd/elao.j2 b/elao.app/.manala/ansible/templates/motd/elao.j2 deleted file mode 100755 index 618aa3f2..00000000 --- a/elao.app/.manala/ansible/templates/motd/elao.j2 +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -{% if item.message is iterable and item.message is not string -%} -MESSAGE="$(printf '%s\n' {% for message in item.message %}{{ message | center(80) | quote }} {% endfor %}| shuf -n1)" -{% else -%} -MESSAGE={{ item.message | center(80) | quote }} -{% endif %} - -MOTD=$(cat <\` ..--""j.' \`; - \`:-.._J '-.-'L__ \`-- ' L_..-;' - "-.__ ; .-" "-. : __.-" - L ' /.------.\ ' J - "-. "--" .-" - __.l"-:_JL_;-";.__ - .-j/'.; ;"""" / .'\"-. - .' /:\`. "-.: :.-" .'; \`. - .-" / ; "-. "-..-" .-" : "-. - .+"-. : :  "-.__.-" ;-._ \ - ; \ \`.; ; : : "+. ; - : ; ; ; : ; : \: - : \`."-; ; ; : ; ,/; - ; -: ; : ; : .-"' : - :\ \ : ; : \.-" : - ;\`. \ ; : ;.'_..-- / ; - : "-. "-: ; :/." .' : - \ .-\`.\ /t-"" ":-+. : - \`. .-" \`l __/ /\`. : ; ; \ ; - \ .-" .-"-.-" .' .'j \ / ;/ - \ / .-" /. .'.' ;_:' ; - :-""-.\`./-.' / \`.___.' - \ \`t ._ / - "-.t-._:' - -$MESSAGE -EOF -) - -printf "%s\n" "$MOTD" diff --git a/elao.app/.manala/ansible/templates/mysql/zz-mysqld.cnf.j2.tmpl b/elao.app/.manala/ansible/templates/mysql/zz-mysqld.cnf.j2.tmpl deleted file mode 100644 index 2cd0a4e1..00000000 --- a/elao.app/.manala/ansible/templates/mysql/zz-mysqld.cnf.j2.tmpl +++ /dev/null @@ -1,6 +0,0 @@ -[mysqld] -bind-address = 0.0.0.0 -{{- if eq (.Vars.system.mysql.version|float64) 8.0 }} -# Use native authentication plugin -default-authentication-plugin = mysql_native_password -{{- end }} diff --git a/elao.app/.manala/ansible/templates/nginx/cors.j2 b/elao.app/.manala/ansible/templates/nginx/cors.j2 deleted file mode 100644 index 0f859d89..00000000 --- a/elao.app/.manala/ansible/templates/nginx/cors.j2 +++ /dev/null @@ -1,8 +0,0 @@ -add_header Access-Control-Allow-Origin "*" always; -add_header Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS" always; -add_header Access-Control-Allow-Headers "Authorization, Content-Type, Accept-Encoding, Cache-Control" always; -add_header Access-Control-Allow-Credentials "true" always; -add_header Access-Control-Expose-Headers "Content-Disposition" always; -if ($request_method = OPTIONS) { - return 204; -} diff --git a/elao.app/.manala/ansible/templates/nginx/default.conf.j2 b/elao.app/.manala/ansible/templates/nginx/default.conf.j2 deleted file mode 100644 index 434627a7..00000000 --- a/elao.app/.manala/ansible/templates/nginx/default.conf.j2 +++ /dev/null @@ -1,8 +0,0 @@ -server { - listen * default_server; - error_page 404 /404.html; - location /404.html { - root /usr/share/nginx/html; - internal; - } -} diff --git a/elao.app/.manala/ansible/templates/nginx/gzip.j2 b/elao.app/.manala/ansible/templates/nginx/gzip.j2 deleted file mode 100644 index 556b46e7..00000000 --- a/elao.app/.manala/ansible/templates/nginx/gzip.j2 +++ /dev/null @@ -1,7 +0,0 @@ -gzip off; -gzip_disable msie6; -gzip_vary on; -gzip_proxied expired no-cache no-store private auth; -gzip_comp_level 6; -gzip_min_length 1000; -gzip_types text/css text/javascript text/xml text/plain application/javascript application/x-javascript application/json application/xml application/rss+xml font/truetype application/x-font-ttf font/opentype application/vnd.ms-fontobject image/svg+xml; diff --git a/elao.app/.manala/ansible/templates/nginx/html/404.html.j2 b/elao.app/.manala/ansible/templates/nginx/html/404.html.j2 deleted file mode 100644 index e8433345..00000000 --- a/elao.app/.manala/ansible/templates/nginx/html/404.html.j2 +++ /dev/null @@ -1,36 +0,0 @@ - - - - Error 404 - - - - - - - - - - - -
-

Error 404

-

Oops. We can't find the page you're looking for. Please try again.

-
- - diff --git a/elao.app/.manala/ansible/templates/nginx/nginx.conf.j2 b/elao.app/.manala/ansible/templates/nginx/nginx.conf.j2 deleted file mode 100644 index 4900a0e6..00000000 --- a/elao.app/.manala/ansible/templates/nginx/nginx.conf.j2 +++ /dev/null @@ -1,67 +0,0 @@ -{%- set config = { - 'events': {}, - 'http': {}, -} | combine(manala_nginx_config|default({}, true)) -%} - -user www-data; -{{ config | manala.roles.nginx_config_parameter('worker_processes', default=1) }} - -error_log /var/log/nginx/error.log warn; -pid /var/run/nginx.pid; - -{{ config | manala.roles.nginx_config_parameter('load_module', default=[]) }} - -events { - {{ config.events | manala.roles.nginx_config_parameter('worker_connections', default=1024) }} -} - -http { - server_tokens on; - default_type application/octet-stream; - - {{ config.http | manala.roles.nginx_config_parameter('log_format', default='main \'$remote_addr - $remote_user [$time_local] "$request" \' - \'$status $body_bytes_sent "$http_referer" \' - \'"$http_user_agent" "$http_x_forwarded_for"\'') }} - - access_log /var/log/nginx/access.log; - - # See: http://jeremyfelt.com/code/2013/01/08/clear-nginx-cache-in-vagrant/ - sendfile off; - #tcp_nopush on; - - {{ config.http | manala.roles.nginx_config_parameter('keepalive_timeout', default=65) }} - - # See: http://www.nicogiraud.com/blog/nginx-erreur-502-bad-gateway-sur-les-requetes-en-post.html - {{ config.http | manala.roles.nginx_config_parameter('fastcgi_buffer_size', default='128k') }} - {{ config.http | manala.roles.nginx_config_parameter('fastcgi_buffers', default='4 256k') }} - {{ config.http | manala.roles.nginx_config_parameter('fastcgi_busy_buffers_size', default='256k') }} - - # See: http://charles.lescampeurs.org/2008/11/14/fix-nginx-increase-server_names_hash_bucket_size - {{ config.http | manala.roles.nginx_config_parameter('server_names_hash_bucket_size', default=128) }} - - include mime.types; - include /etc/nginx/conf.d/*.conf; - {{- ('\n' ~ config.http | manala.roles.nginx_config(exclude=[ - 'server_tokens', - 'default_type', - 'log_format', - 'access_log', - 'sendfile', - 'tcp_nopush', - 'keepalive_timeout', - 'fastcgi_buffer_size', - 'fastcgi_buffers', - 'fastcgi_busy_buffers_size', - 'server_names_hash_bucket_size', - 'include', - ])).rstrip() | indent(4) }} -} -{{ config | manala.roles.nginx_config(exclude=[ - 'user', - 'worker_processes', - 'error_log', - 'pid', - 'load_module', - 'events', - 'http', -]) }} diff --git a/elao.app/.manala/ansible/templates/nginx/no_index.j2 b/elao.app/.manala/ansible/templates/nginx/no_index.j2 deleted file mode 100644 index 1d7ddd56..00000000 --- a/elao.app/.manala/ansible/templates/nginx/no_index.j2 +++ /dev/null @@ -1 +0,0 @@ -add_header X-Robots-Tag "noindex"; diff --git a/elao.app/.manala/ansible/templates/nginx/php_fpm_app.j2 b/elao.app/.manala/ansible/templates/nginx/php_fpm_app.j2 deleted file mode 100644 index bc9975e2..00000000 --- a/elao.app/.manala/ansible/templates/nginx/php_fpm_app.j2 +++ /dev/null @@ -1,6 +0,0 @@ -fastcgi_pass unix:/run/php-fpm.app.sock; -fastcgi_split_path_info ^(.+\.php)(/.*)$; -fastcgi_read_timeout 60s; -include fastcgi_params; -fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; -fastcgi_param DOCUMENT_ROOT $realpath_root; diff --git a/elao.app/.manala/ansible/templates/nginx/ssl_offloading.conf.j2 b/elao.app/.manala/ansible/templates/nginx/ssl_offloading.conf.j2 deleted file mode 100644 index e4f829a5..00000000 --- a/elao.app/.manala/ansible/templates/nginx/ssl_offloading.conf.j2 +++ /dev/null @@ -1,18 +0,0 @@ -server { - - listen 443 ssl; - server_name _; - - ssl_certificate /etc/ssl/certs/ssl.pem; - ssl_certificate_key /etc/ssl/private/ssl.key; - - location / { - proxy_set_header Host $host; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_http_version 1.1; - proxy_set_header Connection ""; - proxy_pass http://127.0.0.1; - client_max_body_size 0; - } -} diff --git a/elao.app/.manala/ansible/templates/ngrok/ngrok.yml.j2 b/elao.app/.manala/ansible/templates/ngrok/ngrok.yml.j2 deleted file mode 100644 index 6480f004..00000000 --- a/elao.app/.manala/ansible/templates/ngrok/ngrok.yml.j2 +++ /dev/null @@ -1 +0,0 @@ -web_addr: 0.0.0.0:4040 diff --git a/elao.app/.manala/ansible/templates/ohmyzsh/.zshrc.j2 b/elao.app/.manala/ansible/templates/ohmyzsh/.zshrc.j2 deleted file mode 100644 index 29711c59..00000000 --- a/elao.app/.manala/ansible/templates/ohmyzsh/.zshrc.j2 +++ /dev/null @@ -1,147 +0,0 @@ -{%- set config = item.config|default({}) -%} - -# If you come from bash you might have to change your $PATH. -{{ config | manala.roles.zsh_config_parameter('export PATH', comment='# export PATH=$HOME/bin:/usr/local/bin:$PATH') }} - -# Path to your oh-my-zsh installation. -{{ config | manala.roles.zsh_config_parameter('export ZSH', default=manala_ohmyzsh_dir) }} - -# Ensure per-user cache -{{ config | manala.roles.zsh_config_parameter('ZSH_CACHE_DIR', default='$HOME/.oh-my-zsh/cache') }} - -if [[ ! -d $ZSH_CACHE_DIR ]]; then - mkdir -p $ZSH_CACHE_DIR -fi - -# Set name of the theme to load --- if set to "random", it will -# load a random theme each time oh-my-zsh is loaded, in which case, -# to know which specific one was loaded, run: echo $RANDOM_THEME -# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes -{{ config | manala.roles.zsh_config_parameter('ZSH_THEME', default='theme') }} - -# Set list of themes to pick from when loading at random -# Setting this variable when ZSH_THEME=random will cause zsh to load -# a theme from this variable instead of looking in $ZSH/themes/ -# If set to an empty array, this variable will have no effect. -{{ config | manala.roles.zsh_config_parameter('ZSH_THEME_RANDOM_CANDIDATES', comment='# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )') }} - -# Uncomment the following line to use case-sensitive completion. -{{ config | manala.roles.zsh_config_parameter('CASE_SENSITIVE', default=true, comment=true) }} - -# Uncomment the following line to use hyphen-insensitive completion. -# Case-sensitive completion must be off. _ and - will be interchangeable. -{{ config | manala.roles.zsh_config_parameter('HYPHEN_INSENSITIVE', default=true, comment=true) }} - -# Uncomment the following line to disable bi-weekly auto-update checks. -{{ config | manala.roles.zsh_config_parameter('DISABLE_AUTO_UPDATE', default=true, comment=true) }} - -# Uncomment the following line to automatically update without prompting. -{{ config | manala.roles.zsh_config_parameter('DISABLE_UPDATE_PROMPT', default=true, comment=true) }} - -# Uncomment the following line to change how often to auto-update (in days). -{{ config | manala.roles.zsh_config_parameter('export UPDATE_ZSH_DAYS', default=13, comment=true) }} - -# Uncomment the following line if pasting URLs and other text is messed up. -{{ config | manala.roles.zsh_config_parameter('DISABLE_MAGIC_FUNCTIONS', default=true, comment=true) }} - -# Uncomment the following line to disable colors in ls. -{{ config | manala.roles.zsh_config_parameter('DISABLE_LS_COLORS', default=true, comment=true) }} - -# Uncomment the following line to disable auto-setting terminal title. -{{ config | manala.roles.zsh_config_parameter('DISABLE_AUTO_TITLE', default=true, comment=true) }} - -# Uncomment the following line to enable command auto-correction. -{{ config | manala.roles.zsh_config_parameter('ENABLE_CORRECTION', default=true, comment=true) }} - -# Uncomment the following line to display red dots whilst waiting for completion. -# Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work) -# See https://github.com/ohmyzsh/ohmyzsh/issues/5765 -{{ config | manala.roles.zsh_config_parameter('COMPLETION_WAITING_DOTS', default=true, comment=true) }} - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -{{ config | manala.roles.zsh_config_parameter('DISABLE_UNTRACKED_FILES_DIRTY', default=true, comment=true) }} - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. -# You can set one of the optional three formats: -# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" -# or set a custom format using the strftime function format specifications, -# see 'man strftime' for details. -{{ config | manala.roles.zsh_config_parameter('HIST_STAMPS', default='mm/dd/yyyy', comment=true) }} - -# Would you like to use another custom folder than $ZSH/custom? -{{ config | manala.roles.zsh_config_parameter('ZSH_CUSTOM', comment='# ZSH_CUSTOM=/path/to/new-custom-folder') }} - -# Which plugins would you like to load? -# Standard plugins can be found in $ZSH/plugins/ -# Custom plugins may be added to $ZSH_CUSTOM/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. -{{ config | manala.roles.zsh_config_parameter('plugins', default=['git', 'debian', 'common-aliases', 'history', 'history-substring-search']) }} - -source $ZSH/oh-my-zsh.sh - -# User configuration - -{{ config | manala.roles.zsh_config_parameter('export MANPATH', default='/usr/local/man:$MANPATH', comment=true) }} - -# You may need to manually set your language environment -{{ config | manala.roles.zsh_config_parameter('export LANG', comment='# export LANG=en_US.UTF-8') }} - -# Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -# export EDITOR='vim' -# else -# export EDITOR='mvim' -# fi - -# Compilation flags -{{ config | manala.roles.zsh_config_parameter('export ARCHFLAGS', default='-arch x86_64', comment=true) }} - -# Set personal aliases, overriding those provided by oh-my-zsh libs, -# plugins, and themes. Aliases can be placed here, though oh-my-zsh -# users are encouraged to define aliases within the ZSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. -{{ config | manala.roles.zsh_config_parameter('alias', comment='#\n# Example aliases\n# alias zshconfig="mate ~/.zshrc"\n# alias ohmyzsh="mate ~/.oh-my-zsh"') }} - -{{ config | manala.roles.zsh_config(exclude=[ - 'export PATH', - 'export ZSH', - 'ZSH_CACHE_DIR', - 'ZSH_THEME', - 'ZSH_THEME_RANDOM_CANDIDATES', - 'CASE_SENSITIVE', - 'HYPHEN_INSENSITIVE', - 'DISABLE_AUTO_UPDATE', - 'DISABLE_UPDATE_PROMPT', - 'UPDATE ZSH_DAYS', - 'DISABLE_MAGIC_FUNCTIONS', - 'DISABLE_LS_COLORS', - 'DISABLE_AUTO_TITLE', - 'ENABLE_CORRECTION', - 'COMPLETION_WAITING_DOTS', - 'DISABLE_UNTRACKED_FILES_DIRTY', - 'HIST_STAMPS', - 'ZSH_CUSTOM', - 'plugins', - 'export MANPATH', - 'export LANG', - 'export ARCHFLAGS', - 'alias' -]) }} - -echo - -{% include 'functions/ip.j2' %} - -{% include 'functions/php_xdebug.j2' %} - -{% include 'functions/nginx_timeout.j2' %} - -{% include 'functions/ngrok_http.j2' %} - -if [ -d ${DIR:-{{ system_app_dir }}} ]; then - cd ${DIR:-{{ system_app_dir }}} -fi diff --git a/elao.app/.manala/ansible/templates/ohmyzsh/functions/ip.j2 b/elao.app/.manala/ansible/templates/ohmyzsh/functions/ip.j2 deleted file mode 100644 index b2ce5895..00000000 --- a/elao.app/.manala/ansible/templates/ohmyzsh/functions/ip.j2 +++ /dev/null @@ -1,7 +0,0 @@ -manala_ip () { - wget http://ipecho.net/plain -O - -q ; echo -} - -echo -e " \e[36m‣\e[0m \e[36mSHOW PUBLIC IP\e[0m - manala_ip -" diff --git a/elao.app/.manala/ansible/templates/ohmyzsh/functions/nginx_timeout.j2 b/elao.app/.manala/ansible/templates/ohmyzsh/functions/nginx_timeout.j2 deleted file mode 100644 index 846fd456..00000000 --- a/elao.app/.manala/ansible/templates/ohmyzsh/functions/nginx_timeout.j2 +++ /dev/null @@ -1,9 +0,0 @@ -manala_nginx_timeout () { - if [[ $1 == off ]]; then sudo sed -ri 's/fastcgi_read_timeout (.*);$/fastcgi_read_timeout 999s;#origin\1/' /etc/nginx/conf.d/php_fpm_app - else sudo sed -ri 's/^fastcgi_read_timeout 999s;#origin(.*)/fastcgi_read_timeout \1;/' /etc/nginx/conf.d/php_fpm_app; fi - sudo /etc/init.d/nginx restart -} - -echo -e " \e[36m‣\e[0m \e[36mENABLE/DISABLE NGINX TIMEOUT\e[0m - manala_nginx_timeout [on|off] -" diff --git a/elao.app/.manala/ansible/templates/ohmyzsh/functions/ngrok_http.j2 b/elao.app/.manala/ansible/templates/ohmyzsh/functions/ngrok_http.j2 deleted file mode 100644 index e9c794c5..00000000 --- a/elao.app/.manala/ansible/templates/ohmyzsh/functions/ngrok_http.j2 +++ /dev/null @@ -1,7 +0,0 @@ -manala_ngrok_http () { - ngrok http -config=/etc/ngrok/config.yml 80 -} - -echo -e " \e[36m‣\e[0m \e[36mSTART NGROK HTTP\e[0m - manala_ngrok_http -" diff --git a/elao.app/.manala/ansible/templates/ohmyzsh/functions/php_xdebug.j2 b/elao.app/.manala/ansible/templates/ohmyzsh/functions/php_xdebug.j2 deleted file mode 100644 index d3d7431d..00000000 --- a/elao.app/.manala/ansible/templates/ohmyzsh/functions/php_xdebug.j2 +++ /dev/null @@ -1,31 +0,0 @@ -manala_php_xdebug () { - if [[ $1 == on ]]; then - if [ -f /usr/sbin/php5enmod ]; then - sudo php5enmod xdebug; - sudo service php5-fpm restart; - else - PHP_VERSION=`php -v | head -n 1 | cut -d ' ' -f 2 | cut -c 1-3` - sudo phpenmod -v ${PHP_VERSION} -s ALL xdebug; - sudo service php${PHP_VERSION}-fpm restart; - fi - elif [[ $1 == off ]]; then - if [ -f /usr/sbin/php5dismod ]; then - sudo php5dismod xdebug; - sudo service php5-fpm restart; - else - PHP_VERSION=`php -v | head -n 1 | cut -d ' ' -f 2 | cut -c 1-3` - sudo phpdismod -v ${PHP_VERSION} -s ALL xdebug; - sudo service php${PHP_VERSION}-fpm restart; - fi - else - if [[ $(/usr/bin/php -v 2>/dev/null) != *Xdebug* ]]; then - echo off - else - echo on - fi - fi -} - -echo -e " \e[36m‣\e[0m \e[36mENABLE/DISABLE PHP XDEBUG\e[0m - manala_php_xdebug [on|off] -" diff --git a/elao.app/.manala/ansible/templates/ohmyzsh/theme.zsh-theme.j2 b/elao.app/.manala/ansible/templates/ohmyzsh/theme.zsh-theme.j2 deleted file mode 100644 index 6d711117..00000000 --- a/elao.app/.manala/ansible/templates/ohmyzsh/theme.zsh-theme.j2 +++ /dev/null @@ -1,36 +0,0 @@ -{%- set config = item.config|default({}, true) -%} - -# Inspired by Pygmalion: https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/pygmalion.zsh-theme - -prompt_setup_theme(){ - setopt localoptions extendedglob - - ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}" - ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " - ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}" - ZSH_THEME_GIT_PROMPT_CLEAN="" - - FULL_HOSTNAME=`hostname -f` - - base_prompt='%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}$FULL_HOSTNAME%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}' - post_prompt='%{$fg[cyan]%}⇒%{$reset_color%} ' - - base_prompt_nocolor=${base_prompt//\%\{[^\}]##\}} - post_prompt_nocolor=${post_prompt//\%\{[^\}]##\}} - - autoload -U add-zsh-hook - add-zsh-hook precmd prompt_theme_precmd -} - -prompt_theme_precmd(){ - setopt localoptions extendedglob - - local gitinfo=$(git_prompt_info) - local gitinfo_nocolor=${gitinfo//\%\{[^\}]##\}} - local exp_nocolor="$(print -P \"$base_prompt_nocolor$gitinfo_nocolor$post_prompt_nocolor\")" - local prompt_length={% raw %}${#exp_nocolor}{% endraw %} - - PROMPT="%{$bg[green]%}%{$fg[black]%}❱Dev❰%{$reset_color%} ${base_prompt}${gitinfo}${post_prompt}" -} - -prompt_setup_theme diff --git a/elao.app/.manala/ansible/templates/php/5.6/app.ini.j2 b/elao.app/.manala/ansible/templates/php/5.6/app.ini.j2 deleted file mode 100644 index 3e21523a..00000000 --- a/elao.app/.manala/ansible/templates/php/5.6/app.ini.j2 +++ /dev/null @@ -1,37 +0,0 @@ -{%- set config = item.config|default({}) -%} - -{# Upstream - [PHP] - Error handling and logging #} -{{ config | manala.roles.php_config_parameter('error_reporting', default='E_ALL') }} -{{ config | manala.roles.php_config_parameter('display_errors', default=True) }} -{{ config | manala.roles.php_config_parameter('display_startup_errors', default=True) }} -{{ config | manala.roles.php_config_parameter('track_errors', default=True) }} - -{# [PHP] - Miscellaneous #} -{{ config | manala.roles.php_config_parameter('expose_php', default=True) }} - -{# [PHP] - Resource Limits #} -{{ config | manala.roles.php_config_parameter('memory_limit', default='512M') }} - -{# [PHP] - Error handling and logging #} -{{ config | manala.roles.php_config_parameter('error_log', default='/var/log/php' ~ manala_php_version|string ~ '/error.log') }} - -{# Enable apc on cli as soon as apcu/apcu-bc extension is installed #} -{{ config | manala.roles.php_config_parameter('apc.enable_cli', default=True) }} - -{# [PHP] - Language Options - Dev #} -{# See: http://stackoverflow.com/questions/12905404/symfony2-slow-initialization-time #} -{{ config | manala.roles.php_config_parameter('realpath_cache_size', default='4096k') }} -{{ config | manala.roles.php_config_parameter('realpath_cache_ttl', default=7200) }} - -{{ config | manala.roles.php_config(exclude=[ - 'error_reporting', - 'display_errors', - 'display_startup_errors', - 'track_errors', - 'expose_php', - 'memory_limit', - 'error_log', - 'apc.enable_cli', - 'realpath_cache_size', - 'realpath_cache_ttl', -]) -}} diff --git a/elao.app/.manala/ansible/templates/php/50-xdebug.ini.j2 b/elao.app/.manala/ansible/templates/php/50-xdebug.ini.j2 deleted file mode 100644 index 76d21d33..00000000 --- a/elao.app/.manala/ansible/templates/php/50-xdebug.ini.j2 +++ /dev/null @@ -1,19 +0,0 @@ -{%- set config = item.config|default({}) -%} - -{{ config | manala.roles.php_config_parameter('xdebug.mode', default='develop,debug,coverage') }} -{{ config | manala.roles.php_config_parameter('xdebug.discover_client_host', default=1) }} -{{ config | manala.roles.php_config_parameter('xdebug.max_nesting_level', default=300) }} -{{ config | manala.roles.php_config_parameter('xdebug.var_display_max_children', default=128) }} -{{ config | manala.roles.php_config_parameter('xdebug.var_display_max_data', default=512) }} -{{ config | manala.roles.php_config_parameter('xdebug.var_display_max_depth', default=4) }} -{{ config | manala.roles.php_config_parameter('xdebug.cli_color', default=1) }} - -{{ config | manala.roles.php_config(exclude=[ - 'xdebug.mode', - 'xdebug.discover_client_host', - 'xdebug.max_nesting_level', - 'xdebug.var_display_max_children', - 'xdebug.var_display_max_data', - 'xdebug.var_display_max_depth', - 'xdebug.cli_color' -]) }} diff --git a/elao.app/.manala/ansible/templates/php/7.0/app.ini.j2 b/elao.app/.manala/ansible/templates/php/7.0/app.ini.j2 deleted file mode 100644 index 917d6705..00000000 --- a/elao.app/.manala/ansible/templates/php/7.0/app.ini.j2 +++ /dev/null @@ -1,65 +0,0 @@ -{%- set config = item.config|default({}) -%} - -{{ config | manala.roles.php_config_parameter('display_errors', default=True) }} -{{ config | manala.roles.php_config_parameter('display_startup_errors', default=True) }} -{{ config | manala.roles.php_config_parameter('error_reporting', default='E_ALL') }} -{{ config | manala.roles.php_config_parameter('html_errors', default=True) }} -{{ config | manala.roles.php_config_parameter('log_errors', default=True) }} -{{ config | manala.roles.php_config_parameter('max_input_time', default=60) }} -{{ config | manala.roles.php_config_parameter('output_buffering', default=4096) }} -{{ config | manala.roles.php_config_parameter('register_argc_argv', default=False) }} -{{ config | manala.roles.php_config_parameter('request_order', default='GP') }} -{{ config | manala.roles.php_config_parameter('short_open_tag', default=False) }} -{{ config | manala.roles.php_config_parameter('track_errors', default=True) }} -{{ config | manala.roles.php_config_parameter('variables_order', default='GPCS') }} -{{ config | manala.roles.php_config_parameter('expose_php', default=True) }} -{{ config | manala.roles.php_config_parameter('memory_limit', default='512M') }} -{{ config | manala.roles.php_config_parameter('session.gc_divisor', default=1000) }} -{{ config | manala.roles.php_config_parameter('session.hash_bits_per_character', default=5) }} -{{ config | manala.roles.php_config_parameter('url_rewriter.tags', default='\'a=href,area=href,frame=src,input=src,form=fakeentry\'') }} - -{# Error log #} -{{ config | manala.roles.php_config_parameter('error_log', default='/var/log/php' ~ manala_php_version|string ~ '/error.log') }} - -{# Enable apc in cli as soon as apcu/apcu-bc extension is installed #} -{{ config | manala.roles.php_config_parameter('apc.enable_cli', default=True) }} - -; Switch whether to compile assertions at all (to have no overhead at run-time) -; -1: Do not compile at all -; 0: Jump over assertion at run-time -; 1: Execute assertions -; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) -; Default Value: 1 -; Development Value: 1 -; Production Value: -1 -; http://php.net/zend.assertions -{{ config | manala.roles.php_config_parameter('zend.assertions', default=1) }} - -{# See: http://stackoverflow.com/questions/12905404/symfony2-slow-initialization-time #} -{{ config | manala.roles.php_config_parameter('realpath_cache_size', default='4096k') }} -{{ config | manala.roles.php_config_parameter('realpath_cache_ttl', default=7200) }} - -{{ config | manala.roles.php_config(exclude=[ - 'display_errors', - 'display_startup_errors', - 'error_reporting', - 'html_errors', - 'log_errors', - 'max_input_time', - 'output_buffering', - 'register_argc_argv', - 'request_order', - 'short_open_tag', - 'track_errors', - 'variables_order', - 'expose_php', - 'memory_limit', - 'session.gc_divisor', - 'session.hash_bits_per_character', - 'url_rewriter.tags', - 'error_log', - 'apc.enable_cli', - 'zend.assertions', - 'realpath_cache_size', - 'realpath_cache_ttl', -]) -}} diff --git a/elao.app/.manala/ansible/templates/php/7.1/app.ini.j2 b/elao.app/.manala/ansible/templates/php/7.1/app.ini.j2 deleted file mode 100644 index 78177a93..00000000 --- a/elao.app/.manala/ansible/templates/php/7.1/app.ini.j2 +++ /dev/null @@ -1,41 +0,0 @@ -{%- set config = item.config|default({}) -%} - -{# Upstream - [PHP] - Error handling and logging #} -{{ config | manala.roles.php_config_parameter('error_reporting', default='E_ALL') }} -{{ config | manala.roles.php_config_parameter('display_errors', default=True) }} -{{ config | manala.roles.php_config_parameter('display_startup_errors', default=True) }} -{{ config | manala.roles.php_config_parameter('track_errors', default=True) }} - -{# Upstream - [Assertion] #} -{{ config | manala.roles.php_config_parameter('zend.assertions', default=1) }} - -{# [PHP] - Miscellaneous #} -{{ config | manala.roles.php_config_parameter('expose_php', default=True) }} - -{# [PHP] - Resource Limits #} -{{ config | manala.roles.php_config_parameter('memory_limit', default='512M') }} - -{# [PHP] - Error handling and logging #} -{{ config | manala.roles.php_config_parameter('error_log', default='/var/log/php' ~ manala_php_version|string ~ '/error.log') }} - -{# Enable apc in cli as soon as apcu/apcu-bc extension is installed #} -{{ config | manala.roles.php_config_parameter('apc.enable_cli', default=True) }} - -{# [PHP] - Language Options - Dev #} -{# See: http://stackoverflow.com/questions/12905404/symfony2-slow-initialization-time #} -{{ config | manala.roles.php_config_parameter('realpath_cache_size', default='4096k') }} -{{ config | manala.roles.php_config_parameter('realpath_cache_ttl', default=7200) }} - -{{ config | manala.roles.php_config(exclude=[ - 'error_reporting', - 'display_errors', - 'display_startup_errors', - 'track_errors', - 'zend.assertions', - 'expose_php', - 'memory_limit', - 'error_log', - 'apc.enable_cli', - 'realpath_cache_size', - 'realpath_cache_ttl', -]) -}} diff --git a/elao.app/.manala/ansible/templates/php/app.ini.j2 b/elao.app/.manala/ansible/templates/php/app.ini.j2 deleted file mode 100644 index 36c1ddc0..00000000 --- a/elao.app/.manala/ansible/templates/php/app.ini.j2 +++ /dev/null @@ -1,49 +0,0 @@ -{%- if manala_php_version is version('5.6', '=') %} - {%- include'5.6/app.ini.j2' %} -{%- elif manala_php_version is version('7.0', '=') %} - {%- include'7.0/app.ini.j2' %} -{%- elif manala_php_version is version('7.1', '=') %} - {%- include'7.1/app.ini.j2' %} -{%- else %} - -{%- set config = item.config|default({}) -%} - -{# Upstream - [PHP] - Error handling and logging #} -{{ config | manala.roles.php_config_parameter('error_reporting', default='E_ALL') }} -{{ config | manala.roles.php_config_parameter('display_errors', default=True) }} -{{ config | manala.roles.php_config_parameter('display_startup_errors', default=True) }} - -{# Upstream - [Assertion] #} -{{ config | manala.roles.php_config_parameter('zend.assertions', default=1) }} - -{# [PHP] - Miscellaneous #} -{{ config | manala.roles.php_config_parameter('expose_php', default=True) }} - -{# [PHP] - Resource Limits #} -{{ config | manala.roles.php_config_parameter('memory_limit', default='512M') }} - -{# [PHP] - Error handling and logging #} -{{ config | manala.roles.php_config_parameter('error_log', default='/var/log/php' ~ manala_php_version|string ~ '/error.log') }} - -{# Enable apc in cli as soon as apcu/apcu-bc extension is installed #} -{{ config | manala.roles.php_config_parameter('apc.enable_cli', default=True) }} - -{# [PHP] - Language Options - Dev #} -{# See: http://stackoverflow.com/questions/12905404/symfony2-slow-initialization-time #} -{{ config | manala.roles.php_config_parameter('realpath_cache_size', default='4096k') }} -{{ config | manala.roles.php_config_parameter('realpath_cache_ttl', default=7200) }} - -{{ config | manala.roles.php_config(exclude=[ - 'error_reporting', - 'display_errors', - 'display_startup_errors', - 'zend.assertions', - 'expose_php', - 'memory_limit', - 'error_log', - 'apc.enable_cli', - 'realpath_cache_size', - 'realpath_cache_ttl', -]) }} - -{%- endif %} diff --git a/elao.app/.manala/ansible/templates/php/opcache.ini.j2 b/elao.app/.manala/ansible/templates/php/opcache.ini.j2 deleted file mode 100644 index 7369b36b..00000000 --- a/elao.app/.manala/ansible/templates/php/opcache.ini.j2 +++ /dev/null @@ -1,15 +0,0 @@ -{%- set config = item.config|default({}) -%} - -{{ config | manala.roles.php_config_parameter('opcache.memory_consumption', default=128) }} -{{ config | manala.roles.php_config_parameter('opcache.interned_strings_buffer', default=8) }} -{{ config | manala.roles.php_config_parameter('opcache.max_accelerated_files', default=4000) }} -{{ config | manala.roles.php_config_parameter('opcache.revalidate_freq', default=2) }} -{{ config | manala.roles.php_config_parameter('opcache.fast_shutdown', default=1) }} - -{{ config | manala.roles.php_config(exclude=[ - 'opcache.memory_consumption', - 'opcache.interned_strings_buffer', - 'opcache.max_accelerated_files', - 'opcache.revalidate_freq', - 'opcache.fast_shutdown', -]) -}} diff --git a/elao.app/.manala/ansible/templates/ssh/development/ssh_config.j2 b/elao.app/.manala/ansible/templates/ssh/development/ssh_config.j2 deleted file mode 100644 index 0e65a47b..00000000 --- a/elao.app/.manala/ansible/templates/ssh/development/ssh_config.j2 +++ /dev/null @@ -1,9 +0,0 @@ -{%- set config = manala_ssh_client_config|default('', True) -%} - -Host * - HashKnownHosts yes - GSSAPIAuthentication yes - GSSAPIDelegateCredentials no - StrictHostKeyChecking no - -{{ config }} diff --git a/elao.app/.manala/ansible/templates/ssh/integration/ssh_config.j2 b/elao.app/.manala/ansible/templates/ssh/integration/ssh_config.j2 deleted file mode 100644 index 390191bb..00000000 --- a/elao.app/.manala/ansible/templates/ssh/integration/ssh_config.j2 +++ /dev/null @@ -1,11 +0,0 @@ -{%- set config = manala_ssh_client_config|default('', True) -%} - -Host * - HashKnownHosts no - GSSAPIAuthentication yes - GSSAPIDelegateCredentials no - StrictHostKeyChecking no - UserKnownHostsFile /dev/null - LogLevel ERROR - -{{ config }} diff --git a/elao.app/.manala/ansible/templates/ssh/keys/git.elao.com b/elao.app/.manala/ansible/templates/ssh/keys/git.elao.com deleted file mode 100644 index 0c2b5543..00000000 --- a/elao.app/.manala/ansible/templates/ssh/keys/git.elao.com +++ /dev/null @@ -1 +0,0 @@ -git.elao.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCT21UxvHdQ3VLGoPDFYt9BFwKOaNpxEWjh913y+UtbOWrobSAdAth6wMiA9yNC3xmctAo8ctfYSZ7Nt9VFxTlpXNpdYeMmQnyjgiN/yzYdMzKFWJCMh35O1HbhBeTpnkcxbQiyVdrg+9nK4ACqlgzRlEoaQciW7NShqz04UnfIEDN8AgekY8HGBa7TpgaZDxjhZznrWSAT0C/S7+tYrnvS9kMuHo03LWA7B95Vwev/sQrjQNmdIykbjKpP1ljs7b5UkGSynWMWbO45sLzLrvlFjNztevzF2vRF1muMb7A3nk9NU7jkRZ+1BIsL5/cK4SjrQCINxxaAT8sOYzUYou21 diff --git a/elao.app/.manala/ansible/templates/ssh/sshd_config.j2 b/elao.app/.manala/ansible/templates/ssh/sshd_config.j2 deleted file mode 100644 index 74535806..00000000 --- a/elao.app/.manala/ansible/templates/ssh/sshd_config.j2 +++ /dev/null @@ -1,25 +0,0 @@ -{%- set config = manala_ssh_server_config|default({}, True) -%} - -{{ config | manala.roles.ssh_config_parameter('PermitRootLogin', default=True) }} -{{ config | manala.roles.ssh_config_parameter('PermitEmptyPasswords', default=True) }} -{{ config | manala.roles.ssh_config_parameter('ChallengeResponseAuthentication', default=False) }} -{{ config | manala.roles.ssh_config_parameter('PasswordAuthentication', default=True) }} -{{ config | manala.roles.ssh_config_parameter('X11Forwarding', default=True) }} -{{ config | manala.roles.ssh_config_parameter('PrintMotd', default=False) }} -{{ config | manala.roles.ssh_config_parameter('Subsystem', default='sftp /usr/lib/openssh/sftp-server') }} -{{ config | manala.roles.ssh_config_parameter('UsePAM', default=True) }} -{{ config | manala.roles.ssh_config_parameter('UseDNS', default=False) }} -{{ config | manala.roles.ssh_config_parameter('PrintLastLog', default=False) }} - -{{ config | manala.roles.ssh_config(exclude=[ - 'PermitRootLogin', - 'PermitEmptyPasswords', - 'ChallengeResponseAuthentication', - 'PasswordAuthentication', - 'X11Forwarding', - 'PrintMotd', - 'Subsystem', - 'UsePAM', - 'UseDNS', - 'PrintLastLog', -]) }} diff --git a/elao.app/.manala/ansible/templates/supervisor/app.conf.j2 b/elao.app/.manala/ansible/templates/supervisor/app.conf.j2 deleted file mode 100644 index 8ac99763..00000000 --- a/elao.app/.manala/ansible/templates/supervisor/app.conf.j2 +++ /dev/null @@ -1,40 +0,0 @@ -{%- set config = item.config|default('') -%} - -{%- if config -%} - -{{ config }} - -{%- else -%} - -{%- set groups = item.groups|default({}) -%} - -{% for group, parameters in groups|dictsort %} -[group:{{ group }}] -{{- parameters | manala.roles.supervisor_config_section() }} - -{% endfor %} - -{%- set programs = item.programs|default({}) -%} - -{% for program, parameters in programs|dictsort %} -[program:{{ program }}] -{{ parameters | manala.roles.supervisor_config_parameter('autorestart', default=True) }} -{{ parameters | manala.roles.supervisor_config_parameter('autostart', default=False) }} -{{ parameters | manala.roles.supervisor_config_parameter('redirect_stderr', default=True) }} -{{ parameters | manala.roles.supervisor_config_parameter('startretries', default=20) }} -{{ parameters | manala.roles.supervisor_config_parameter('stderr_logfile_maxbytes', default=0) }} -{{ parameters | manala.roles.supervisor_config_parameter('stdout_logfile_maxbytes', default=0) }} -{{ parameters | manala.roles.supervisor_config_parameter('user', default='vagrant') }} -{{- parameters | manala.roles.supervisor_config_section(exclude=[ - 'autorestart', - 'autostart', - 'redirect_stderr', - 'startretries', - 'stderr_logfile_maxbytes', - 'stdout_logfile_maxbytes', - 'user', -]) }} - -{% endfor %} - -{%- endif -%} diff --git a/elao.app/.manala/ansible/templates/vim/vimrc.local.j2 b/elao.app/.manala/ansible/templates/vim/vimrc.local.j2 deleted file mode 100644 index d29cb392..00000000 --- a/elao.app/.manala/ansible/templates/vim/vimrc.local.j2 +++ /dev/null @@ -1,17 +0,0 @@ -{%- set config = manala_vim_config|default({}, true) -%} - -syntax on - -{{ config | manala.roles.vim_config_parameter('encoding', default='utf8') }} -{{ config | manala.roles.vim_config_parameter('expandtab', default=True) }} -{{ config | manala.roles.vim_config_parameter('smarttab', default=True) }} -{{ config | manala.roles.vim_config_parameter('shiftwidth', default=4) }} -{{ config | manala.roles.vim_config_parameter('tabstop', default=4) }} - -{{ config | manala.roles.vim_config(exclude=[ - 'encoding', - 'expandtab', - 'smarttab', - 'shiftwidth', - 'tabstop' -]) }} diff --git a/elao.app/.manala/certificates/README.md b/elao.app/.manala/certificates/README.md deleted file mode 100644 index 5d3f978f..00000000 --- a/elao.app/.manala/certificates/README.md +++ /dev/null @@ -1,16 +0,0 @@ -## CA Certificate - -It's possible to simulate TLS termination by providing a self generated certificate AND by embeding CA certificate used to signed it into the system authority keychain. -⚠️ DO NOT use self signed certificates for production purposes. - -Generate private key: -``` -openssl genpkey -aes-256-cbc -algorithm RSA -pkeyopt rsa_keygen_bits:4096 -out ca.key -``` - -Generate self signed certificate: -``` -openssl req -new -x509 -sha256 -days 825 -subj "/O=Elao/CN=Elao Development Only - 2021" -key ca.key -out ca.crt -``` - -⚠️ No more than 825 days of validity for OSX based systems (https://support.apple.com/en-us/HT210176). diff --git a/elao.app/.manala/certificates/ca.crt b/elao.app/.manala/certificates/ca.crt deleted file mode 100644 index 383c1da2..00000000 --- a/elao.app/.manala/certificates/ca.crt +++ /dev/null @@ -1,29 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIE6DCCAtACCQDyl2RWgrfvXjANBgkqhkiG9w0BAQsFADA2MQ0wCwYDVQQKDARF -bGFvMSUwIwYDVQQDDBxFbGFvIERldmVsb3BtZW50IE9ubHkgLSAyMDIxMB4XDTIx -MDYyMzA3MjEyMVoXDTIzMDkyNjA3MjEyMVowNjENMAsGA1UECgwERWxhbzElMCMG -A1UEAwwcRWxhbyBEZXZlbG9wbWVudCBPbmx5IC0gMjAyMTCCAiIwDQYJKoZIhvcN -AQEBBQADggIPADCCAgoCggIBAKcrvyChJ0MWvYMGrfIeE1CYLNATIApLJAxCyroW -sE77gi2swuyMPmijrSCdEkjZ+xtZFBCsuC+MfXrzApdJHEiTQFVOrewcvn2iPnPa -qMCeXOCaaoPl8KLxlwo5s4U77Y7izNSpq3tPrxtSZIZYLiQCTI6g/g0G62mk+4tr -if6oLSbo/GssCdUaXZCwiz8BnAPnaXnT0lO7iIHtehkeCfDinLA6MvSw9+dTSVl3 -mRTsfQt+X+RNfnMBI0NvB9Ju4cbvmwJCNKsb0K2RYFKtYWWfwOYLirZ8aGpGO/Lw -tOuvVlMyHwtrojuGt55/ULZoj+Fb00gGkGyk1XyJSNlzi1jE8gxL7ABm2K68BxVH -dAE4DM4JvSwFgXv/Wmv17N7SAhILHktOYBLOlfLt9Sdr+3eiJndLX3UtYPllrFRB -RH2s0MYKn79QWdkMx2bFKtAOQDpO3WH5+xG3gSH7Ojoyf+b2whUpDhjGfMTVZwms -qe+A084gvTJc10T5GcvaBU7RXqo7+AiiLnWN5QjthBts3ydlEdHGb2+xZG5mKh6G -EAtwWKmR88rggqHKCMI98cTXtZRWuo0GitJS9oAd0FQr0w8g3eQzWArags1YrTGq -W0it/yCaI4nfpBo7i1NRQzuNPZb2Fyxgy5jqF2dFDI7HS5qkKfbT4SAGWABGlpOT -4LNzAgMBAAEwDQYJKoZIhvcNAQELBQADggIBAJc1TCdDbBMG/SyqypH2wKbu/+/U -qKuw+jYzKlan4bKk7CcEGBQELjpTSibPSAKn5Q/3IgX4DX4uBzKQuwfjBMLF0yGS -HKaX+aBjD3y7ugQaKJMHE01q1STNDhJGCJAnju8mzPI1R8UXsCnf3sJWzNQA186W -AVyOOFAZuulNbqwimnJmraQxuhwdcTX02va7Z2M2Ettlfg3phEa9cKhkdktDrW5o -yJEhqtJQb1rh3BCQK6lrLQlCq1p/1czx4FaxDs05QzCU0kz92G1+HOrLZ8dqI9vZ -NvcP9ETiDrtL17Azg4jhiXDd/C9gWaB6iGuyNMmI6I1pBez+hBaEGijoTYRFa+1y -ctk/kqApti5zfSyp169PzyqUqqUuDystcmWLvgm2ldFruSFXxmKlOHALwFmMicjl -0k7jkcCg94RYlI/zyIYOmWdVyNCbj5Y6+zJu3tXRMKTpnfyQl0Fpu8uwl46uzMjP -UY0HxADr4KQwWtRFJWFS7e0uyoGSAnxlHMmuigbZKoynRRE8XHdOYTQvrCNOmvap -GJZc5EAkkmDBnf3sQJTGHC50b5+EWA6QLsqXCK8DSUY8jEgbgp3x8ntFgjds3RtN -FKLZNMqM1GZps3FN8rF2I62bbcOrd9sr+1m46hbYPhT0nvfpexAbloJFM76q48+l -YnUFLkP235xp77jj ------END CERTIFICATE----- diff --git a/elao.app/.manala/certificates/ca.key b/elao.app/.manala/certificates/ca.key deleted file mode 100644 index f2f49c1e..00000000 --- a/elao.app/.manala/certificates/ca.key +++ /dev/null @@ -1,54 +0,0 @@ ------BEGIN ENCRYPTED PRIVATE KEY----- -MIIJnzBJBgkqhkiG9w0BBQ0wPDAbBgkqhkiG9w0BBQwwDgQIo5JdOGAMOhACAggA -MB0GCWCGSAFlAwQBKgQQRN/loFLkUi3ex30DWxJE/QSCCVBCdRqjHlgHWJN0cIJe -MtSGOYwhWPxZJKAERf/Dh9v3p/iXatTSxTShwRSNwz0Xd0QUEwfqg1U+E+lceBIq -8/3u1quGEiMZm7hATz6nk/OCPyckJCjH4aOwhPILRcAehXv2pPegG1wxhVLRNAem -rl7GjlMl5JIap8Yz3hod+hXaRcENO/61j4g4UYUsrAIYk2ODuYrXImIKEtGvYMg6 -WWfiAMU73PPcSqH1P0XHan5otAreKdGHxT8ai6zdIXwUklGs3sn1HT+7fAcpQzU/ -CX7pEAVktAUchslwdut4C9pwh1JXD+YZvJwdQnliqPo4tpgyC6kjuikvr/IElUha -IbCPZJ3gZ9FJcVEJv51JbXzFgMdV6dLoIbzDI+B2+HtSbYg7MFdNhZ+BQdX77cqZ -aOwfzpUA/czWU8bqn2Jkwh3hj9XXZTrsmtMNIK1PY3b55pDm9O71195QAbKqd3Wl -BVvgxPhcQhxtitgY7+fZFi6uIk3pDIP4rWaK9SnMrU0wW4aT97Hc+qgaZfKV7Mab -vFHy2bu5QxZRg70mERtVijvH0X63D6EsHwCmESeEuIlLOL49y+hGQ3NmyQywtLIa -Pb7WzeRVvKPQcnUnJnpCeVlzM3oyNXApWNJDJgLVVCiiyKTOoCryRyV+zkTFKmeL -nK9SlxWmoWoqDK5Z4/UNn2peRQtxhGplHTNHbcYOTKuLOvWAqc32BM089t6oUxi8 -uAoHke2Iq7GxFJneLh5kenJZAlwVfw0EcauGyGqBzcoNHtJ8Nt28XEN7cCAtJ9Mz -4PYbjfL0aFBbfWEBq510Q5PEL2qt+DTkTh6/Np4ItQczFnMrmw7LV0eR08nyVkwv -sVH8eAUgjVin+H7KZmd296dcBKSmADZE6IReoxERD5P4SmqBPnHguy1obU6GkwDK -mhVezDHaBGfdzIzBZYoiNjGnYW/iev/MSWNLXuwvp1pZKyjaf/Xo6qSFUXYfys+6 -wmqJ7mPUVsEnNfMPKl5m2EheB7pZWAI6k+XvpPkZHxz3dXo7yQPt9N9cnmZdg0HS -RO776Au8Z84WitfDptlHUtrlg4hTMDnK9pLaqhY06eWQLTX2X2U90HmcV9tClvDg -SA8+8q0aJhjcXjAnstN85zn7PJFgtYTPO5/axPIC/MgAl9hE1OclQJaIbGJ2akuc -4izSwRs1woJTpAXpGfzoMCDoCmv3CbGvWOT7oMcUJSdvO7P+FOfWybcdycCWte1c -jDqUeRuws/6mES7fI0c5pMdvcGZThZMGgsPPRQoCzXURMRvfF+4/i7Dk9f6QN0qM -kcwnN/3+KHwt09GKLpT4dF2jcdar7PMIWjPsLraCObROlasmI/aKVCI928EpXTUK -CYS/UoWfv1CYRbGxEQV79+1uZa5HKdF3brD60f9htD5ANBawmFzz+HkiTCUe5YuE -N3Ey1z6624flkUG/WMaKAT7ZhijeAphBlm3WU9NRwWtMs997NipnfWTcAhF3ucif -ZT4Ce1cMy8DUTgSUi5fpBcrhRGnsEsLhDAn/bIUibLxNzB7WtPA4XBxTwvD/kUCF -ITUn6rQyArQq8g0WDA8r32Ho8/oId+ZNMx+ZZu1o7zw5EmW/E20gqSId9w0pSx6w -7+wX76+FSSOeJ2sxZ1Ap6r2EBZW7OSAWA+a3l1C0ToFB89PEHUjC8eRTuOksC/rH -QNhFQVqqEd49kT59tI3c+/RLYAbuzcZQvlNzIKFe0POErtZZxthHv9tEzfbkG8Y5 -X40Z9wCCwUmTmIfIA2gTUJGvbCNbotZoPBsjd6w0Fz2CTeRIXyaHNrC8TwqTnyMt -DDRPOOqxbTOz5Ukoy58mS7KIu8rKpmkgTUrTSyFTv5iUpYj1EvAzUgVUlwH0CKqq -/VLsXh/aB9QOR5dBm/b0v+rVR42sMQBsn+t65Y0yFHqbUvFtK88BSB4aAJSedVDe -5/ZwsG1Ib1xthgoTmVMuAX70OcuUDNrLVFBoGA384Bzgf77yuqvho7GPmpDuZWV+ -xI9jbZDTjq/bHxEqjHn9iYt57TSYF9gOJtwrCmcOE3x8jWF9iF871h5eXJ8Yx5Zd -Teo6VVkDikrUqEHuzZCUH4zmGBNm/shb4SZKF9r6gkSEjv2eevPB/p5Jl7GK66ZP -COeegWncHimseciLkoY9D0e7pw/FMp3ygBuCN2mr9hr2MB4qLHeBAUKXUm5VvTUb -bNzr10T1peuykZhEl6s62X5dQz87vjg/mZwO0W1la7dJgQCbWP8U7giGe3EZjGhW -UhRhFvXwttbdslEZqFGq0RniWjk5CqAVTiKqYfmXf0G1XnyDFI+m9BcEQ6T0cfn4 -zauGv0lV9Oo/Qa/k/oVxaPMfnB/HWL0Z+HK9C9jHrf+eJWbCVgtwqvyMcYEskx5l -NFtFJo9zwQjGxi0aGkyCP9hOsz17ptvdWQYwN0s89CxjFlT+Gsrgn1tXXbrspnCN -FCzwiMhWJMRH+Vdcr/lKOTjpzF8QX1X8NfWW1hpfChIMHjXJ3P0ALwto7PoMhW3l -fDc8RL2Zaj1LxSnzFbQ2VE3OFntQ5vn/KzpI3PucqWah6ry14hV0bnucs54/zqF5 -LjHeECkfmPkqjHSMJUVRwQfPX0hTszgnIL8eyc2zBpA9pXAxaQX0ySLlEKqvFao9 -EWPadBzFFiO2XZ8dmuI5rq9kppMTc2HjHLfKWg7+8S574YWZ49/JrqOo0W0QMx4S -rQhBiJHGC2iTxa3GLFKii3eF/HwRWEH3RtyS7tW2Wv4ip4luooKu+S4JxgJTNwX+ -vlJnMWGZPiSbq8OYAYHStvW8y4i1fg3jCtr3q0PwbQi7BXheozIx37tsQcgbblZi -d2JtZiwaZbqK8PdS8F5loNYG/DiJWrkEnSJKesHx7qIiCUbvX57RGplaeafJrj7i -bGu6q0kQUN0/Puyl/7p3ZR1wiVfgP0t5Zm7Yk5jDR7iwzp5M4E09LIybB8Io2xXg -aM5g1DzEWnsdg4pQwf8z104npEEh/WwEq3sMCL7pRpTiq79a0VhH3HxmYbRVaMm/ -c1FkOiPxcAFZwxLo9VV3yIz+e1zd+Plb2fxi2n8Sd8szJjTizQWY9L+Y1QUdV5LO -Mm29tsH5ahPIKXyEBNa7mtHsFU2+JdvSTPJC82lqiL8aLHknqFhFUEMXPCuQLvpJ -6TYZa5g1tQMM3rxgzcpXjqS8jg== ------END ENCRYPTED PRIVATE KEY----- diff --git a/elao.app/.manala/docker/bin/entrypoint.sh b/elao.app/.manala/docker/bin/entrypoint.sh deleted file mode 100755 index f384c070..00000000 --- a/elao.app/.manala/docker/bin/entrypoint.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# Cache (Composer and Yarn both follows XDG Base Directory Specification. For -# the others, related environment variables must be expanded at runtime) -if [ -n "${XDG_CACHE_HOME}" ]; then - mkdir -p ${XDG_CACHE_HOME} - # Bash - export HISTFILE="${XDG_CACHE_HOME}/.bash_history" - # Ansible - export ANSIBLE_CACHE_PLUGIN_CONNECTION="${XDG_CACHE_HOME}/ansible" -fi - -# Ssh authorization socket -if [ -n "${SSH_AUTH_SOCK}" ]; then - sudo chmod 777 ${SSH_AUTH_SOCK} -fi - -# Ssh key -if [ -n "${SSH_KEY}" ]; then - eval `ssh-agent` 1>/dev/null - ssh-add ${SSH_KEY} 2>/dev/null -fi - -exec "$@" diff --git a/elao.app/.manala/docker/make.mk.tmpl b/elao.app/.manala/docker/make.mk.tmpl deleted file mode 100644 index 737404ee..00000000 --- a/elao.app/.manala/docker/make.mk.tmpl +++ /dev/null @@ -1,49 +0,0 @@ -########## -# Docker # -########## - -# Run docker container. -# -# Examples: -# -# Example #1: -# -# $(call docker_run) -# -# Example #2: -# -# $(call docker_run, whoami) - -define docker_run - $(call message, Building docker image...) \ - && ID=$$( \ - docker build \ - --quiet \ - $(_DIR)/.manala \ - | head -n 1 \ - ) \ - && docker run \ - --rm \ - --tty \ - --interactive \ - --hostname {{ .Vars.system.hostname }} \ - --mount 'type=bind,consistency=delegated,source=$(realpath $(_DIR)),target=/srv/app' \ - --workdir /srv/app/$(_CURRENT_DIR) \ - --env XDG_CACHE_HOME=/docker/.cache/docker \ - --mount 'type=bind,consistency=delegated,source=$(realpath $(_DIR)/.manala),target=/docker' \ - $(if $(OS_DARWIN),\ - --env SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock \ - --volume /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock \ - --env SSH_KEY=/home/docker/.ssh/id_rsa \ - --mount 'type=bind$(,)consistency=cached$(,)source=$(HOME)/.ssh/id_rsa$(,)target=/home/docker/.ssh/id_rsa' \ - ) \ - --mount 'type=bind,consistency=cached,source=$(HOME)/.gitconfig,target=/home/docker/.gitconfig' \ - $${ID} \ - $(if $(1),$(strip $(1)),bash) -endef - -ifeq ($(container),docker) -DOCKER = 1 -else -DOCKER_SHELL = $(call docker_run,$(SHELL)) -endif diff --git a/elao.app/.manala/github/docker-compose.yaml.tmpl b/elao.app/.manala/github/docker-compose.yaml.tmpl deleted file mode 100644 index 835e9a72..00000000 --- a/elao.app/.manala/github/docker-compose.yaml.tmpl +++ /dev/null @@ -1,60 +0,0 @@ -version: '3.8' -services: - - manala_ci: - image: manala_ci - build: - context: ../ - args: - UID: ${MANALA_CI_UID} - GID: ${MANALA_CI_GID} - network_mode: 'host' - command: 'tail -f /dev/null' - environment: - XDG_CACHE_HOME: '/docker/.cache/docker' - SSH_AUTH_SOCK: ${SSH_AUTH_SOCK:-/ssh-agent} - volumes: - - type: bind - consistency: cached - source: ${GITHUB_WORKSPACE} - target: /srv/app - - type: bind - consistency: delegated - source: ${GITHUB_WORKSPACE}/.manala - target: /docker - - type: bind - source: ${SSH_AUTH_SOCK:-/home/runner/ssh-agent} - target: ${SSH_AUTH_SOCK:-/ssh-agent} - -{{- if .Vars.system.mysql.version -}} -{{- $mysql := .Vars.system.mysql }} - - mysql: - image: 'mysql:{{ $mysql.version }}' - network_mode: 'host' - command: '--port=3306' - environment: - MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' -{{- else if .Vars.system.mariadb.version -}} -{{- $mariadb := .Vars.system.mariadb }} - - mariadb: - image: 'mariadb:{{ $mariadb.version }}' - network_mode: 'host' - command: '--port=3306' - environment: - MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' -{{- end }} - -{{- if .Vars.system.elasticsearch.version -}} -{{- $elasticsearch := mergeOverwrite (dict "plugins" list) .Vars.system.elasticsearch }} - - elasticsearch: - image: 'docker.elastic.co/elasticsearch/elasticsearch:{{ include "elasticsearch_version" $elasticsearch }}' - network_mode: 'host' - environment: - 'discovery.type': 'single-node' - command: 'sh -c " - {{- range $plugin := $elasticsearch.plugins }}elasticsearch-plugin install --batch --verbose {{ $plugin }} && {{ end -}} - exec docker-entrypoint.sh"' -{{- end }} diff --git a/elao.app/.manala/make/git.mk b/elao.app/.manala/make/git.mk deleted file mode 100644 index 69b036d1..00000000 --- a/elao.app/.manala/make/git.mk +++ /dev/null @@ -1,30 +0,0 @@ -######## -# Diff # -######## - -# Returns the list of changed files for some given extensions and some given folders. -# -# @param $1 The file extensions of changed files -# @param $2 The relative folders to parse for changed files -# -# Examples: -# -# Example #1: list PHP and Javascript files changed in the src and test folders -# -# $(call git_diff, php js, src test) - -define git_diff -$(shell \ - for ext in $(if $(strip $(1)),$(strip $(1)),"") ; \ - do \ - for dir in $(if $(strip $(2)),$(strip $(2)),"") ; \ - do \ - git --no-pager diff --name-status "$$(git merge-base HEAD origin/master)" \ - | grep "$${ext}\$$" \ - | grep "\\s$${dir}" \ - | grep -v '^D' \ - | awk '{ print $$NF }' || true ; \ - done ; \ - done \ -) -endef diff --git a/elao.app/.manala/make/help.mk b/elao.app/.manala/make/help.mk deleted file mode 100644 index 172fa3b1..00000000 --- a/elao.app/.manala/make/help.mk +++ /dev/null @@ -1,68 +0,0 @@ -######## -# Help # -######## - -.DEFAULT_GOAL := help - -HELP = \ - \nUsage: make [$(COLOR_INFO)command$(COLOR_RESET)] \ - $(call help_section, Help) \ - $(call help,help,This help) - -define help_section - \n\n$(COLOR_COMMENT)$(strip $(1)):$(COLOR_RESET) -endef - -define help - \n $(COLOR_INFO)$(1)$(COLOR_RESET) $(2) -endef - -help: - @printf "$(HELP)$(HELP_SUFFIX)" - @awk ' \ - BEGIN { \ - sectionsName[1] = "Commands" ; \ - sectionsCount = 1 ; \ - } \ - /^[-a-zA-Z0-9_.@%\/+]+:/ { \ - if (match(lastLine, /^## (.*)/)) { \ - command = substr($$1, 1, index($$1, ":") - 1) ; \ - section = substr(lastLine, RSTART + 3, index(lastLine, " - ") - 4) ; \ - if (section) { \ - message = substr(lastLine, index(lastLine, " - ") + 3, RLENGTH) ; \ - sectionIndex = 0 ; \ - for (i = 1; i <= sectionsCount; i++) { \ - if (sectionsName[i] == section) { \ - sectionIndex = i ; \ - } \ - } \ - if (!sectionIndex) { \ - sectionIndex = sectionsCount++ + 1 ; \ - sectionsName[sectionIndex] = section ; \ - } \ - } else { \ - message = substr(lastLine, RSTART + 3, RLENGTH) ; \ - sectionIndex = 1 ; \ - } \ - if (length(command) > sectionsCommandLength[sectionIndex]) { \ - sectionsCommandLength[sectionIndex] = length(command) ; \ - } \ - sectionCommandIndex = sectionsCommandCount[sectionIndex]++ + 1; \ - helpsCommand[sectionIndex, sectionCommandIndex] = command ; \ - helpsMessage[sectionIndex, sectionCommandIndex] = message ; \ - } \ - } \ - { lastLine = $$0 } \ - END { \ - for (i = 1; i <= sectionsCount; i++) { \ - if (sectionsCommandCount[i]) { \ - printf "\n\n$(COLOR_COMMENT)%s:$(COLOR_RESET)", sectionsName[i] ; \ - for (j = 1; j <= sectionsCommandCount[i]; j++) { \ - printf "\n $(COLOR_INFO)%-" sectionsCommandLength[i] "s$(COLOR_RESET) %s", helpsCommand[i, j], helpsMessage[i, j] ; \ - } \ - } \ - } \ - } \ - ' $(MAKEFILE_LIST) - @printf "\n\n" -.PHONY: help diff --git a/elao.app/.manala/make/os.mk b/elao.app/.manala/make/os.mk deleted file mode 100644 index d7ff1e93..00000000 --- a/elao.app/.manala/make/os.mk +++ /dev/null @@ -1,21 +0,0 @@ -###### -# Os # -###### - -# Os detection helpers. -# -# Examples: -# -# Example #1: conditions on linux -# -# echo $(if $(OS_LINUX),Running on Linux,*NOT* running on Linux) - -ifeq ($(OS),Windows_NT) - OS = windows -else - OS = $(shell uname | tr '[:upper:]' '[:lower:]') -endif - -OS_LINUX = $(if $(findstring $(OS),linux),1,) -OS_DARWIN = $(if $(findstring $(OS),darwin),1,) -OS_WINDOWS = $(if $(findstring $(OS),windows),1,) diff --git a/elao.app/.manala/make/semver.mk b/elao.app/.manala/make/semver.mk deleted file mode 100644 index 5ce24005..00000000 --- a/elao.app/.manala/make/semver.mk +++ /dev/null @@ -1,23 +0,0 @@ -########## -# Semver # -########## - -define semver_bump - VERSION=$(2) ; \ - if [ -z "$${VERSION}" ]; then \ - printf "$(COLOR_INFO)What's the version number? (current: $(COLOR_COMMENT)`cat $(firstword $(1))`$(COLOR_INFO))$(COLOR_RESET)\n" ; \ - read VERSION ; \ - if [ -z $${VERSION} ]; then \ - printf "$(COLOR_ERROR) ❌ Version cannot be empty. Aborting$(COLOR_RESET)\n" ; \ - exit 128 ; \ - fi ; \ - fi ; \ - printf "$(COLOR_INFO)Bumping version $(COLOR_COMMENT)$${VERSION}$(COLOR_INFO)…$(COLOR_RESET)\n" ; \ - for file in $(1) ; \ - do \ - echo $${VERSION} > $${file} ; \ - done ; \ - git add $(1) ; \ - git commit -m "Bump version $${VERSION}" ; \ - git diff HEAD^ HEAD --color | cat -endef diff --git a/elao.app/.manala/make/text.mk b/elao.app/.manala/make/text.mk deleted file mode 100644 index 3ed10837..00000000 --- a/elao.app/.manala/make/text.mk +++ /dev/null @@ -1,139 +0,0 @@ -########## -# Colors # -########## - -COLOR_RESET := \033[0m -COLOR_ERROR := \033[31m -COLOR_INFO := \033[32m -COLOR_WARNING := \033[33m -COLOR_COMMENT := \033[36m - -###################### -# Special Characters # -###################### - -# Usage: -# $(call message, Foo$(,) bar) = Foo, bar -# $(call message, Foo$(rp) bar) = Foo) bar - -, := , -rp := ) - -######## -# Time # -######## - -# Usage: -# $(call time) = 11:06:20 - -define time -`date -u +%T` -endef - -########### -# Message # -########### - -# Usage: -# $(call message, Foo bar) = Foo bar -# $(call message_success, Foo bar) = (っ◕‿◕)っ Foo bar -# $(call message_warning, Foo bar) = ¯\_(ツ)_/¯ Foo bar -# $(call message_error, Foo bar) = (╯°□°)╯︵ ┻━┻ Foo bar - -define message - printf "$(COLOR_INFO)$(strip $(1))$(COLOR_RESET)\n" -endef - -define message_success - printf "$(COLOR_INFO)(っ◕‿◕)っ $(strip $(1))$(COLOR_RESET)\n" -endef - -define message_warning - printf "$(COLOR_WARNING)¯\_(ツ)_/¯ $(strip $(1))$(COLOR_RESET)\n" -endef - -define message_error - printf "$(COLOR_ERROR)(╯°□°)╯︵ ┻━┻ $(strip $(1))$(COLOR_RESET)\n" -endef - -####### -# Log # -####### - -# Usage: -# $(call log, Foo bar) = [11:06:20] [target] Foo bar -# $(call log_warning, Foo bar) = [11:06:20] [target] ¯\_(ツ)_/¯ Foo bar -# $(call log_error, Foo bar) = [11:06:20] [target] (╯°□°)╯︵ ┻━┻ Foo bar - -define log - printf "[$(COLOR_COMMENT)$(call time)$(COLOR_RESET)] [$(COLOR_COMMENT)$(@)$(COLOR_RESET)] " ; $(call message, $(1)) -endef - -define log_warning - printf "[$(COLOR_COMMENT)$(call time)$(COLOR_RESET)] [$(COLOR_COMMENT)$(@)$(COLOR_RESET)] " ; $(call message_warning, $(1)) -endef - -define log_error - printf "[$(COLOR_COMMENT)$(call time)$(COLOR_RESET)] [$(COLOR_COMMENT)$(@)$(COLOR_RESET)] " ; $(call message_error, $(1)) -endef - -########### -# Confirm # -########### - -# Usage: -# $(call confirm, Foo bar) = ༼ つ ◕_◕ ༽つ Foo bar (y/N): -# $(call confirm, Bar foo, y) = ༼ つ ◕_◕ ༽つ Foo bar (Y/n): - -define confirm - $(if $(CONFIRM),, \ - printf "$(COLOR_INFO) ༼ つ ◕_◕ ༽つ $(COLOR_WARNING)$(strip $(1)) $(COLOR_RESET)$(COLOR_WARNING)$(if $(filter y,$(2)),(Y/n),(y/N))$(COLOR_RESET): " ; \ - read CONFIRM ; \ - case $$CONFIRM in $(if $(filter y,$(2)), \ - [nN]$(rp) printf "\n" ; exit 1 ;; *$(rp) ;;, \ - [yY]$(rp) ;; *$(rp) printf "\n" ; exit 1 ;; \ - ) esac \ - ) -endef - -################ -# Conditionals # -################ - -# Usage: -# $(call error_if_not, $(FOO), FOO has not been specified) = (╯°□°)╯︵ ┻━┻ FOO has not been specified - -define error_if_not - $(if $(strip $(1)),, \ - $(call message_error, $(strip $(2))) ; exit 1 \ - ) -endef - -# Usage: -# $(call confirm_if, $(FOO), Foo bar) = ༼ つ ◕_◕ ༽つ Foo bar (y/N): - -define confirm_if - $(if $(strip $(1)), \ - $(call confirm, $(strip $(2))) - ) -endef - -# Usage: -# $(call confirm_if_not, $(FOO), Foo bar) = ༼ つ ◕_◕ ༽つ Foo bar (y/N): - -define confirm_if_not - $(if $(strip $(1)),, \ - $(call confirm, $(strip $(2))) - ) -endef - -########## -# Random # -########## - -# Usage: -# $(call rand, 8) = 8th56zp2 - -define rand -`cat /dev/urandom | LC_ALL=C tr -dc 'a-z0-9' | fold -w $(strip $(1)) | head -n 1` -endef diff --git a/elao.app/.manala/make/try.mk b/elao.app/.manala/make/try.mk deleted file mode 100644 index 32090fb9..00000000 --- a/elao.app/.manala/make/try.mk +++ /dev/null @@ -1,23 +0,0 @@ -####### -# Try # -####### - -# Execute first command (try), unconditionnaly run second command (finally), and -# exit with first command return code. -# -# @param $1 First command -# @param $2 Second command -# -# Examples: -# -# Example #1: Run tests and remove artefacts -# -# $(call try_finally, phpunit, rm -Rf artefacts) - -define try_finally -( \ - $(strip $(1)) \ -) ; RC=$${?} \ -; $(strip $(2)) \ -&& exit $${RC} -endef diff --git a/elao.app/.manala/vagrant/bin/setup.sh.tmpl b/elao.app/.manala/vagrant/bin/setup.sh.tmpl deleted file mode 100755 index 07e49bdb..00000000 --- a/elao.app/.manala/vagrant/bin/setup.sh.tmpl +++ /dev/null @@ -1,146 +0,0 @@ -{{- with .Vars.system -}} - -#!/usr/bin/env sh - -set -e - -export APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 -export DEBIAN_FRONTEND=noninteractive - -############### -# Environment # -############### - -printf "[\033[36mEnvironment\033[0m] \033[32mSetup...\033[0m\n" - -# Notes: -# - set `container` environment variable for environment checks -cat < /etc/environment -container="vagrant" -EOF - -######## -# Root # -######## - -printf "[\033[36mRoot\033[0m] \033[32mPassword...\033[0m\n" - -echo "root:root" | chpasswd - -########### -# Cleanup # -########### - -PACKAGES="" - -# `exim4` package comes pre-installed on jessie bento debian vagrant images -if dpkg -s exim4 > /dev/null 2>&1 ; then - PACKAGES="$PACKAGES exim4 exim4-base exim4-config exim4-daemon-light" -fi - -# `cryptsetup` package comes pre-installed in bento debian vagrant images -if dpkg -s cryptsetup > /dev/null 2>&1 ; then - PACKAGES="$PACKAGES cryptsetup" -fi - -if [ ! -z "$PACKAGES" ] ; then - printf "[\033[36mCleanup\033[0m] \033[32mPackages...\033[0m\n" - - apt-get --quiet --yes -o=Dpkg::Use-Pty=0 --purge autoremove \ - $PACKAGES -fi - -printf "[\033[36mCleanup\033[0m] \033[32mMails...\033[0m\n" - -rm -Rf /var/mail/* - -printf "[\033[36mCleanup\033[0m] \033[32mMotd...\033[0m\n" - -rm -Rf /etc/motd - -{{- if eq (.version|int) 8 }} - -########## -# Manala # -########## - -printf "[\033[36mManala\033[0m] \033[32mSetup...\033[0m\n" - -cat < /etc/apt/sources.list.d/debian_manala_io.list -deb [arch=amd64] http://debian.manala.io jessie main -EOF - -apt-key adv --quiet --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 1394DEA3 - -{{- end }} - -########## -# Update # -########## - -printf "[\033[36mApt\033[0m] \033[32mUpdate...\033[0m\n" - -{{ if le (.version|int) 9 -}} -apt-get --quiet update -{{- else -}} -apt-get --quiet --allow-releaseinfo-change update -{{- end }} - -########## -# System # -########## - -printf "[\033[36mSystem\033[0m] \033[32mInstall...\033[0m\n" - -apt-get --quiet --yes -o=Dpkg::Use-Pty=0 --no-install-recommends --verbose-versions install \ -{{- if eq (.version|int) 9 }} - dirmngr \ -{{- end }} - make \ - linux-image-amd64 linux-headers-amd64 - -######## -# Grub # -######## - -printf "[\033[36mGrub\033[0m] \033[32mSet device...\033[0m\n" - -# See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=982182 -echo 'grub-pc grub-pc/install_devices multiselect /dev/sda' | debconf-set-selections - -########### -# Upgrade # -########### - -printf "[\033[36mApt\033[0m] \033[32mUpgrade...\033[0m\n" - -apt-get --quiet --yes -o=Dpkg::Use-Pty=0 --purge --auto-remove dist-upgrade - -########### -# Ansible # -########### - -printf "[\033[36mAnsible\033[0m] \033[32mSetup...\033[0m\n" - -cat < /etc/apt/sources.list.d/ppa_launchpad_net_ansible_ansible_ubuntu.list -{{- if eq (.version|int) 8 }} -deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main -{{- else if eq (.version|int) 9 }} -deb http://ppa.launchpad.net/ansible/ansible/ubuntu xenial main -{{- else if eq (.version|int) 10 }} -deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main -{{- end }} -EOF - -apt-key adv --quiet --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 93C4A3FD7BB9C367 -apt-get --quiet update -apt-get --quiet --yes -o=Dpkg::Use-Pty=0 --no-install-recommends --verbose-versions install \ -{{- if eq (.version|int) 8 }} - python ansible -{{- else }} - python3 ansible -{{- end }} - -install --directory /root/.ansible/tmp --verbose - -{{- end }} diff --git a/elao.app/.manala/vagrant/make.mk b/elao.app/.manala/vagrant/make.mk deleted file mode 100644 index f899f725..00000000 --- a/elao.app/.manala/vagrant/make.mk +++ /dev/null @@ -1,14 +0,0 @@ -########### -# Vagrant # -########### - -define VAGRANT_SSH - vagrant ssh -- cd /srv/app/$(_CURRENT_DIR) \&\& -endef - -ifeq ($(container),vagrant) -VAGRANT = 1 -VAGRANT_MAKE = $(MAKE) -else -VAGRANT_MAKE = $(VAGRANT_SSH) make -endif diff --git a/elao.app/MIGRATION.2021-04.md b/elao.app/MIGRATION.2021-04.md deleted file mode 100644 index 8a53057c..00000000 --- a/elao.app/MIGRATION.2021-04.md +++ /dev/null @@ -1,272 +0,0 @@ -# Migration - 2021-04 - -## Jenkins - -- remove `.manala/jenkins` directory - -## Nginx configs - -### Cors - -Before -``` -# Cors -- file: app_cors - template: nginx/app_cors.j2 -``` - -After -``` -- template: nginx/cors.j2 -``` - -### Gzip - -Before -``` -# Gzip -- file: app_gzip - template: nginx/app_gzip.j2 -``` - -After -``` -- template: nginx/gzip.j2 -``` - -### No index - -Before -``` -# Gzip -- file: app_no_index - template: nginx/app_no_index.j2 -``` - -After -``` -- template: nginx/no_index.j2 -``` - -### Php fpm - -Before -``` -# Php fpm -- file: app_php_fpm - template: nginx/app_php_fpm.j2 -``` - -After -``` -- template: nginx/php_fpm_app.j2 -``` - -### Ssl - -Before -``` -# Ssl -- file: app_ssl.conf - template: nginx/app_ssl_offloading.conf.j2 -``` - -After -``` -``` - -Notes: - - Ssl is now part of default nginx configuration - -### App - -Before -``` -# App -- file: app.conf - config: - - server: - - server_name: ~. - - root: /srv/app/public - - access_log: /srv/log/nginx.access.log - - error_log: /srv/log/nginx.error.log - - include: conf.d/app_gzip - - location /: - - try_files: $uri /index.php$is_args$args - - location ~ ^/index\.php(/|$): - - include: conf.d/app_php_fpm - - internal; -``` - -After -``` -# App -- file: app.conf - config: | - server { - server_name ~.; - root /srv/app/public; - access_log /srv/log/nginx.access.log; - error_log /srv/log/nginx.error.log; - include conf.d/gzip; - location / { - try_files $uri /index.php$is_args$args; - } - location ~ ^/index\.php(/|$) { - include conf.d/php_fpm_app; - internal; - } - } -``` - -Notes: - - `make provision TAGS=nginx DIFF=1` - - indentation 4 spaces - - includes - - `conf.d/app_cors` -> `conf.d/cors` - - `conf.d/app_gzip` -> `conf.d/gzip` - - `conf.d/app_no_index` -> `conf.d/no_index` - - `conf.d/app_php_fpm` -> `conf.d/php_fpm_app` - -### Content - -Before -``` -- file: foo.conf - content: | - ... -``` - -After -``` -- file: foo.conf - config: | - ... -``` - -## Php configs - -### Opcache - -Before -``` -- file: app_opcache.ini - template: configs/app_opcache.dev.j2 -``` - -After -``` -- template: php/opcache.ini.j2 -``` - -### App - -Before -``` -- file: app.ini - template: configs/app.dev.j2 - config: - - date.timezone: UTC -``` - -After -``` -- template: php/app.ini.j2 - config: - date.timezone: UTC -``` - -Notes: - - config switch from array to dict - -## Ssh client config - -Before -``` -config: - - Host *.elao.run: - - User: app - - ForwardAgent: true -``` - -After -``` -config: | - Host *.elao.run - User app - ForwardAgent yes -``` - -## Redis config - -Before -``` -config: - - save: '""' -``` - -After -``` -config: - save: '""' -``` - -## Influxdb config - -Before -``` -config: - - reporting-disabled: true -``` - -After -``` -config: - reporting-disabled: true -``` - -## Cron files - -Before -``` -- file: app - env: - SHELL: /bin/zsh - ZDOTDIR: /home/vagrant - HOME: /srv/app - jobs: - - name: foo-bar - job: bin/console app:foo:bar --no-interaction -vv >> /srv/log/cron.foo-bar.log 2>&1 - minute: 0 - hour: 3 - # Dev - state: absent -``` - -After -``` -- file: app - env: - HOME: /srv/app - jobs: - # Foo - Bar - - command: php bin/console app:foo:bar --no-interaction -vv >> /srv/log/cron.foo-bar.log 2>&1 - minute: 0 - hour: 3 - # Dev - state: absent -``` - -## Supervisor configs programs - -Before -``` -foo-bar: - command: zsh -c "bin/console app:foo:bar --no-interaction -vv" -``` - -After -``` -foo-bar: - command: php bin/console app:foo:bar --no-interaction -vv -``` diff --git a/elao.app/Makefile.dist b/elao.app/Makefile.dist deleted file mode 100644 index 78c5b32c..00000000 --- a/elao.app/Makefile.dist +++ /dev/null @@ -1,68 +0,0 @@ -.SILENT: - --include .manala/Makefile - -define setup - $(VAGRANT_MAKE) install build -endef - -########### -# Install # -########### - -## Install application -install: - # # Composer - # composer install --ansi --verbose - # # Doctrine - # bin/console doctrine:database:create --ansi --if-not-exists - # # Npm - # npm install --color=always - # # Yarn - # yarn install --color=always - -install@production: export APP_ENV = prod -install@production: - # # Composer - # composer install --ansi --verbose --no-interaction --no-progress --prefer-dist --optimize-autoloader --no-scripts --no-dev - # # Npm - # npm install --color=always --no-progress --no-audit - # # Yarn - # yarn install --color=always --no-progress - -install@staging: export APP_ENV = prod -install@staging: - # # Composer - # composer install --ansi --verbose --no-interaction --no-progress --prefer-dist --optimize-autoloader --no-scripts - # # Npm - # npm install --color=always --no-progress --no-audit - # # Yarn - # yarn install --color=always --no-progress - -######### -# Build # -######### - -## Build application -build: - # npx encore dev --color --progress - -build@production: - # npx encore production --color - -build@staging: - # npx encore production --color - -######### -# Watch # -######### - -## Watch application -watch: - # npx encore dev --color --progress --watch --watch-options-poll=200 - -########### -# Project # -########### - -# ... diff --git a/elao.app/README.md b/elao.app/README.md deleted file mode 100644 index 014ec8d7..00000000 --- a/elao.app/README.md +++ /dev/null @@ -1,720 +0,0 @@ ---- -title: Elao - App -tableOfContent: 3 ---- - -## Requirements - -* Make -* Vagrant 2.2.10+ -* Landrush 1.3.2+ -* VirtualBox 6.1.12+ -* Docker Desktop 2.2.0+ - -## Overview - -This recipe contains some helpful scripts in the context of a php/nodejs app, such as Makefile tasks in order to release and deploy your app. - -## Init - -``` -$ cd [workspace] -$ manala init -i elao.app [project] -``` - -## Quick start - -In a shell terminal, change directory to your app, and run the following commands: - -```shell -cd /path/to/my/app -manala init -Select the "elao.app" recipe -``` - -Edit the `Makefile` at the root directory of your project and add the following lines at the beginning of the file: - -```makefile -.SILENT: - --include .manala/Makefile -``` - -Then update the `.manala.yaml` file (see [the releases example](#releases) below) and then run the `manala up` command: - -```shell -manala up -``` - -!!! Warning - Don't forget to run the `manala up` command each time you update the - `.manala.yaml` file to actually apply your changes !!! - -From now on, if you execute the `make help` command in your console, you should obtain the following output: - -```shell -Usage: make [target] - -Help: - help This help - -Docker: - docker Run docker container - -App: -``` - -## VM interaction - -In your app directory. - -Initialise your app: -```bash -make setup -``` - -Start VM: -```bash -make up -``` - -Stop VM: -```bash -make halt -``` - -VM shell: -```bash -make ssh -``` - -Box update: -```bash -cd .manala && vagrant box update && cd - -``` - -## System - -Here is an example of a system configuration in `.manala.yaml`: - -```yaml -########## -# System # -########## - -system: - version: 10 - hostname: app.vm - #memory: 4096 # Optional - #cpus: 2 # Optional - #motd: # Optional - # template: motd/cow.j2 - # message: Foo bar - #timezone: Etc/UTC # Optional - #locales: # Optional - # default: C.UTF-8 - # codes: [] - #env: # Optional - # FOO: bar - apt: - #repositories: [] # Optional - #preferences: [] # Optional - packages: - - pdftk - - https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb - files: - - path: /srv/app/var/log - src: /srv/log - state: link_directory - - path: /srv/app/var/cache - src: /srv/cache - state: link_directory - #- path: /srv/app/var/sessions - # src: /srv/sessions - # state: link_directory - ## Api - #- path: /srv/app/api/var/log - # src: /srv/log/api - # state: link_directory - #- path: /srv/app/api/var/cache - # src: /srv/cache/api - # state: link_directory - #network: # Optional - # hosts: - # 127.0.0.1: foo.fr foobar.fr - nginx: - configs: [] - # configs: - # - template: nginx/gzip.j2 - # #- template: nginx/cors.j2 - # #- template: nginx/no_index.j2 - # - template: nginx/php_fpm_app.j2 - # # App - # - file: app.conf - # config: | - # server { - # server_name ~.; - # root /srv/app/public; - # access_log /srv/log/nginx.access.log; - # error_log /srv/log/nginx.error.log; - # include conf.d/gzip; - # location / { - # try_files $uri /index.php$is_args$args; - # } - # location ~ ^/index\.php(/|$) { - # include conf.d/php_fpm_app; - # internal; - # } - # } - php: - version: 8.1 - # composer: - # version: 1 # Optional - extensions: - # Symfony - - intl - - curl - - mbstring - - xml - # App - - mysql - configs: - - template: php/opcache.ini.j2 - - template: php/app.ini.j2 - config: - date.timezone: UTC - upload_max_filesize: 16M - post_max_size: 16M - nodejs: - version: 16 - # packages: - # - package: mjml - # version: 4.6.3 - # cron: - # files: - # - file: app - # env: - # HOME: /srv/app - # jobs: - # # Foo - Bar - # - command: php bin/console app:foo:bar --no-interaction -vv >> /srv/log/cron.foo-bar.log 2>&1 - # minute: 0 - # # Dev - # state: absent - # supervisor: - # configs: - # - file: app.conf - # #groups: - # # acme: - # # programs: - # # - foo - # # - bar - # programs: - # foo: - # command: php bin/console app:acme:foo --no-interaction -vv - # directory: /srv/app - # stdout_logfile: /srv/log/supervisor.acme-foo.log - # bar: - # command: php bin/console app:acme:bar --no-interaction -vv - # directory: /srv/app - # stdout_logfile: /srv/log/supervisor.acme-bar.log - # foo-bar: - # command: php bin/console app:foo:bar --no-interaction -vv - # directory: /srv/app - # stdout_logfile: /srv/log/supervisor.foo-bar.log - # - file: app_foo.conf - # config: | - # [program:foo] - # command=/bin/foo - # MariaDB - mariadb: - version: 10.6 - # ...*OR* MySQL... - mysql: - version: "8.0" - # redis: - # version: "*" - # # config: - # # save: '""' # Disable persistence - elasticsearch: - version: 7 - plugins: - - analysis-icu - # influxdb: - # version: "*" - # config: - # reporting-disabled: true - # databases: - # - app - # users: - # - database: app - # name: app - # password: app - # privileges: - # - database: app - # user: app - # grant: ALL - # mongodb: - # version: 4.4 - ssh: - client: - config: | - Host *.elao.run - User app - ForwardAgent yes -``` - - -## Integration - -### Jenkins - -Here are some examples of integration configurations in `.manala.yaml` for Jenkins: - -```yaml -############### -# Integration # -############### - -integration: - tasks: - - shell: make install@integration - - label: Integration - junit: report/junit/*.xml - parallel: true - warn: true - tasks: - - label: Lint - tasks: - - shell: make lint.php-cs-fixer@integration - - shell: make lint.twig@integration - - shell: make lint.yaml@integration - - shell: make lint.eslint@integration - - label: Security - tasks: - - shell: make security.symfony@integration - - shell: make security.yarn@integration - - label: Test - tasks: - - shell: make test.phpunit@integration - artifacts: var/log/*.log - # artifacts: - # - var/log/foo.log - # - var/log/bar.log - # env: - # DATABASE_URL: mysql://root@127.0.0.1:3306/app -``` - -In this example we have two parallel stages: `api` and `mobile`, corresponding to two different sub-apps. - -```yaml -############### -# Integration # -############### - -integration: - tasks: - - label: Integration # Optional - parallel: true # ! Careful ! Could *NOT* be nested ! - junit: report/junit/*.xml - artifacts: var/log/*.log - warn: true # Turn errors into warnings (recursively applied) - tasks: - - app: api # Optional - tasks: - - shell: make install@integration - - shell: make build@integration - - shell: make lint.php-cs-fixer@integration - - shell: make security.symfony@integration - - shell: make test.phpunit@integration - artifacts: var/log/*.log - # env: - # DATABASE_URL: mysql://root@127.0.0.1:3306/app - - app: mobile - tasks: - - shell: make install@integration - - shell: make build@integration - - shell: make lint.eslint@integration - - shell: make test.jest@integration -``` - -### Github Actions - -The recipes generates a `Dockerfile` and a `docker-compose.yaml` file that can -be used to provide a fully-fledged environnement according to your project needs. - -The [Elao/manala-ci-action](https://github.com/Elao/manala-ci-action) rely on -this to allow you running any CLI command in this environnement, -using Github Action workflows. - -### Common integration tasks - -Add in your `Makefile`: - -```makefile -########### -# Install # -########### - -... - -install@integration: export APP_ENV = test -install@integration: - # Composer - composer install --ansi --verbose --no-interaction --no-progress --prefer-dist --optimize-autoloader --no-scripts --ignore-platform-reqs - #composer run-script symfony-scripts --ansi --verbose --no-interaction - # Npm - npm install --color=always --no-progress --no-audit - # Yarn - yarn install --color=always --no-progress - -########### -# Build # -########### - -... - -build@integration: - # Webpack Encore - npx encore production --color=always --no-progress - -######## -# Lint # -######## - -... - -lint.php-cs-fixer@integration: - mkdir -p report/junit - vendor/bin/php-cs-fixer fix --dry-run --diff --format=junit > report/junit/php-cs-fixer.xml - -lint.phpstan@integration: - mkdir -p report/junit - vendor/bin/phpstan --error-format=junit --no-progress --no-interaction analyse > report/junit/phpstan.xml - -lint.twig@integration: - bin/console lint:twig templates --ansi --no-interaction - -lint.yaml@integration: - bin/console lint:yaml config translations --ansi --no-interaction - -lint.eslint@integration: - npx eslint src --format junit --output-file report/junit/eslint.xml - -lint.stylelint@integration: - mkdir -p report/junit - npx stylelint "assets/styles/**/*.scss" \ - --syntax scss \ - --custom-formatter "node_modules/stylelint-junit-formatter" \ - > report/junit/stylelint.xml - -lint.flow@integration: - mkdir -p report/junit - npx flow check --json | npx flow-junit-transformer > report/junit/flow.xml - -############ -# Security # -############ - -... - -security.symfony@integration: - symfony check:security - -security.yarn@integration: - yarn audit ; RC=$${?} ; [ $${RC} -gt 2 ] && exit $${RC} || exit 0 - -security.npm@integration: - npm audit --audit-level moderate - -######## -# Test # -######## - -... - -test.phpunit@integration: export APP_ENV = test -test.phpunit@integration: - # Db - bin/console doctrine:database:create --ansi - bin/console doctrine:schema:create --ansi - # PHPUnit - bin/phpunit --colors=always --log-junit report/junit/phpunit.xml - -test.jest@integration: export JEST_JUNIT_OUTPUT_DIR = report/junit -test.jest@integration: export JEST_JUNIT_OUTPUT_NAME = jest.xml -test.jest@integration: - npx jest --ci --color --reporters=default --reporters=jest-junit - -``` - -## Releases - -Here is an example of a production/staging release configuration in `.manala.yaml`: - -```yaml -############ -# Releases # -############ - -releases: - - - &release - #app: api # Optional - mode: production - repo: git@git.elao.com:/-release.git - #ref: master # Based on app/mode by default - # Release - release_tasks: - - shell: make install@production - - shell: make build@production - # You can either explicitly list all the paths you want to include - release_add: - - bin - - config - - public - - src - - templates - - translations - - vendor - - composer.* # Composer.json required by src/Kernel.php to determine project root dir - # Composer.lock required by composer on post-install (warmup) - - Makefile - - # Or you can include all by default and only list the paths you want to exclude - # release_removed: - # - ansible - # - build - # - doc - # - node_modules - # - tests - # - .env.test - # - .php_cs.dist - # - .manala* - # - package.json - # - phpunit.xml.dist - # - README.md - # - Vagrantfile - # - webpack.config.js - # - yarn.lock - - # Deploy - deploy_hosts: - - ssh_host: foo-01.bar.elao.local - #master: true # Any custom variable are welcomed - - ssh_host: foo-02.bar.elao.local - deploy_dir: /srv/app - deploy_shared_files: - - config/parameters.yml - deploy_shared_dirs: - - var/log - deploy_tasks: - - shell: make warmup@production - #- shell: make migration@production - # when: master | default # Conditions on custom host variables (jinja2 format) - #deploy_removed: - # - web/app_dev.php - deploy_post_tasks: - - shell: sudo /bin/systemctl reload php8.1-fpm - #- shell: sudo /bin/systemctl restart supervisor - - - << : *release - mode: staging - release_tasks: - - shell: make install@staging - - shell: make build@staging - # Deploy - deploy_hosts: - - ssh_host: foo.bar.elao.ninja.local - deploy_tasks: - - shell: make warmup@staging -``` - -## Makefile - -Makefile targets that are supposed to be runned via docker must be prefixed. - -```makefile -foo: SHELL := $(or $(DOCKER_SHELL),$(SHELL)) -foo: - # Do something really foo... -``` - -Ssh -```makefile -####### -# Ssh # -####### - -## Ssh to staging server -ssh@staging: SHELL := $(or $(DOCKER_SHELL),$(SHELL)) -ssh@staging: - ssh app@foo.staging.elao.run - -# Single host... - -ssh@production: SHELL := $(or $(DOCKER_SHELL),$(SHELL)) -ssh@production: - ... - -# Multi host... - -ssh@production-01: SHELL := $(or $(DOCKER_SHELL),$(SHELL)) -ssh@production-01: - ... -``` - -Sync -```makefile -sync@staging: SHELL := $(or $(DOCKER_SHELL),$(SHELL)) -sync@staging: - mkdir -p var - rsync --archive --compress --verbose --delete-after \ - app@foo.staging.elao.run:/srv/app/current/var/files/ \ - var/files/ - -# Multi targets... -sync-uploads@staging: SHELL := $(or $(DOCKER_SHELL),$(SHELL)) -sync-uploads@staging: - ... - -# Multi apps... -sync.api-uploads@staging: SHELL := $(or $(DOCKER_SHELL),$(SHELL)) -sync.api-uploads@staging: - ... -``` - -### Git tools - -This recipe contains some git helpers such as the [`git_diff`](./.manala/make/git.mk) function. - -This function is useful for example to apply `php-cs`, `php-cs-fix` or `PHPStan` checks only on the subset of updated PHP files and not on any PHP file of your project. - -Usage (in your `Makefile`): - -```makefile -lint.php-cs-fixer: DIFF = $(call git_diff, php, src tests) -lint.php-cs-fixer: - $(if $(DIFF), \ - vendor/bin/php-cs-fixer fix --config=.php_cs.dist --path-mode=intersection --diff --dry-run $(DIFF), \ - printf "You have made no change in PHP files\n" \ - ) -``` - -### Try tools - -This recipe contains some try helpers such as the [`try_finally`](./.manala/make/try.mk) function. - -This function is useful for example to run `phpunit` tests needing a started symfony server, and to stop this server regardless of the tests return code. - -Usage (in your `Makefile`): - -```makefile -test.phpunit@integration: - symfony server:start --ansi --no-humanize --daemon --no-tls --port=8000 - $(call try_finally, \ - bin/phpunit --colors=always --log-junit report/junit/phpunit.xml, \ - symfony server:stop --ansi \ - ) -``` - -## Secrets - -In order to generate secrets, use [Gomplate](https://docs.gomplate.ca), called by a make task. -Gomplate takes a template, queries its values from a Vault server and renders a file. - -Add the following tasks in the `Makefile`: - -```makefile -########### -# Secrets # -########### - -secrets@production: - gomplate --input-dir=secrets/production --output-map='{{ .in | replaceAll ".gohtml" "" }}' - -secrets@staging: - gomplate --input-dir=secrets/staging --output-map='{{ .in | replaceAll ".gohtml" "" }}' -``` - -Put your templates in `.gohtml` files inside a `secrets/[production|staging]` directory at the root of the project. -Respect destination file names, extensions, and paths: - -```treeview -secrets/ -├── production/ -| ├── .env.gohtml -| └── config/ -| └── parameters.yaml.gohtml -└── staging/ - ├── .env.gohtml - └── config/ - └── parameters.yaml.gohtml -``` - -Here are some template examples: - -`production/.env.gohtml`: - -```twig -# This file was generated by Gomplate from Vault secrets for production -{{- range $key, $value := (datasource "vault:///foo_bar/data/env").data }} -{{ $key }}={{ $value | quote }} -{{- end }} -``` - -`staging/.env.gohtml`: - -```twig -# This file was generated by Gomplate from Vault secrets for staging -{{- range $key, $value := (datasource (print "vault:///foo_bar/data/env" (has .Env "STAGE" | ternary (printf "-%s" (getenv "STAGE")) ""))).data }} -{{ $key }}={{ $value | quote }} -{{- end }} -``` - -Note the `STAGE` environnement variable usage, allowing to switch from `env` to `env-${STAGE}` vault secret, calling `make secrets@staging STAGE=foo`. - -`production/config/parameters.yaml.gohtml`: - -```twig -# This file was generated by Gomplate from Vault secrets for production -parameters: -{{ (datasource "vault:///foo_bar/data/parameters").data | toYAML | indent 4 -}} -``` - -!!! Note - Note that the path to the secret will slightly differ from what the Vault server will display: - if the path is `MyApp/production/env` on the Vault server, - it will become `MyApp/data/production/env` in the template - -See [Go Template syntax](https://docs.gomplate.ca/syntax/) for more info. - -!!! Warning - Make sure to include the `secrets` directory into your release, using the `release_add` entry. - -## Https - -In order for https to work properly, you must: - -1. ensure elao ca certificate has been added to your local keychain (one time for *all* projects) - - ```shell - $ sudo security add-trusted-cert -d -r trustRoot -k "/Library/Keychains/System.keychain" .manala/certificates/ca.crt - ``` - -2. generate a project certificate (one time *by* project, inside vagrant, remember to commit them right after) - - ```shell - ⇒ make provision.certificates - ``` - -3. For firefox only, browse to `about:config` and ensure `security.enterprise_roots.enabled` value is set to true - -## Tips, Tricks, and Tweaks - -* [Vagrant root privilege requirement](https://www.vagrantup.com/docs/synced-folders/nfs.html#root-privilege-requirement) -* Debug ansible provisioning: - - ```shell - ansible-galaxy collection install manala.roles --collections-path /vagrant/ansible/collections - ``` diff --git a/elao.app/_helpers.tmpl b/elao.app/_helpers.tmpl deleted file mode 100644 index 76e08f04..00000000 --- a/elao.app/_helpers.tmpl +++ /dev/null @@ -1,44 +0,0 @@ -{{/* Release makefile target */}} -{{ define "release_target" -}} - {{- if hasKey . "app" }}.{{ .app }}{{ end -}} - @ - {{- .mode }} -{{- end }} - -{{/* Release makefile help */}} -{{ define "release_help" -}} - {{- if hasKey . "app" }}{{ .app }} {{ end -}} - in {{ .mode }} -{{- end }} - -{{/* Release ansible group */}} -{{ define "release_group" -}} - {{- if hasKey . "app" }}{{ .app }}_{{ end -}} - {{- regexReplaceAll "[^[:alnum:]_]" .mode "_" }} -{{- end }} - -{{/* Release ansible host */}} -{{ define "release_host" -}} - {{- if hasKey . "app" }}.{{ .app }}{{ end -}} - @ - {{- .mode }} -{{- end }} - -{{/* Release ansible tasks */}} -{{- define "release_tasks" -}} - {{- $tasks := list -}} - {{- range $task := . -}} - {{- if hasKey $task "when" -}} - {{- $task := set $task "when" (cat "{{" $task.when "}}") -}} - {{- end -}} - {{ $tasks = mustAppend $tasks $task -}} - {{- end -}} - {{- $tasks | toYaml }} -{{- end -}} - -{{/* Elasticsearch version */}} -{{- define "elasticsearch_version" -}} - {{- $elasticsearch_versions := dict 1.5 "1.5" 1.6 "1.6" 1.7 "1.7" 2 "2" 5 "5" 6 "6.8.6" 7 "7.5.1" -}} - {{- $version := .version -}} - {{- index $elasticsearch_versions ($version | toString) -}} -{{- end -}}