mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Removed server_ for better overview
This commit is contained in:
99
roles/docker-akaunting/README.md
Normal file
99
roles/docker-akaunting/README.md
Normal file
@@ -0,0 +1,99 @@
|
||||
# docker akaunting
|
||||
|
||||
## new setup
|
||||
```bash
|
||||
cd {{path_docker_compose_files}}akaunting/
|
||||
export COMPOSE_HTTP_TIMEOUT=600
|
||||
export DOCKER_CLIENT_TIMEOUT=600
|
||||
AKAUNTING_SETUP=true docker-compose -p akaunting up -d
|
||||
```
|
||||
|
||||
Check Webinterface and then execute:
|
||||
|
||||
```bash
|
||||
docker-compose down
|
||||
docker-compose -p akaunting up -d
|
||||
```
|
||||
|
||||
## administration
|
||||
|
||||
### get logs
|
||||
|
||||
```bash
|
||||
docker exec -it akaunting tail -n 300 storage/logs/laravel.log
|
||||
```
|
||||
|
||||
### enter akaunting container
|
||||
|
||||
```bash
|
||||
docker exec -it akaunting bash
|
||||
```
|
||||
|
||||
### enter database container
|
||||
|
||||
```bash
|
||||
docker exec -it akaunting-db /bin/mysql -u admin --password=$akaunting_db_password akaunting
|
||||
```
|
||||
|
||||
## manuel update
|
||||
```bash
|
||||
php artisan about
|
||||
php artisan cache:clear
|
||||
php artisan view:clear
|
||||
php artisan migrate:status
|
||||
php artisan update:all
|
||||
php artisan update:db
|
||||
```
|
||||
|
||||
## composer
|
||||
```bash
|
||||
curl https://getcomposer.org/download/2.4.1/composer.phar --output composer.phar
|
||||
```
|
||||
|
||||
```bash
|
||||
php composer.phar install
|
||||
```
|
||||
|
||||
## full backup routine
|
||||
|
||||
```bash
|
||||
# DO SET MANUEL VARIABLES >>
|
||||
export akaunting_db_password=XXXXXXXXX
|
||||
export backup_version=XXXXXXXXX
|
||||
# << DO SET MANUEL VARIABLES
|
||||
|
||||
# set automatic variables
|
||||
export machine_id="$(sha256sum /etc/machine-id)"
|
||||
export COMPOSE_HTTP_TIMEOUT=600
|
||||
export DOCKER_CLIENT_TIMEOUT=600
|
||||
|
||||
# destroy all containers
|
||||
cd {{path_docker_compose_files}}akaunting/ &&
|
||||
docker-compose down &&
|
||||
docker network prune -f
|
||||
|
||||
# delete all volumes
|
||||
docker volume rm akaunting_akaunting-data akaunting_akaunting-db akaunting_akaunting-modules
|
||||
|
||||
# rebuild containers
|
||||
docker-compose pull &&
|
||||
docker-compose build &&
|
||||
docker-compose -p akaunting up -d --force-recreate
|
||||
|
||||
# recover all volumes
|
||||
cd {{path_administrator_scripts}}docker-volume-backup &&
|
||||
bash server_docker-volume-recover.sh akaunting_akaunting-modules ${machine_id:0:64} "$backup_version" &&
|
||||
bash server_docker-volume-recover.sh akaunting_akaunting-data ${machine_id:0:64} "$backup_version" &&
|
||||
bash server_docker-volume-recover.sh akaunting_akaunting-db ${machine_id:0:64} "$backup_version" akaunting-db "$akaunting_db_password" akaunting
|
||||
|
||||
```
|
||||
|
||||
## todo
|
||||
- implement build when new akaunting version is set
|
||||
|
||||
## Further information
|
||||
- https://github.com/akaunting/docker
|
||||
- https://akaunting.com/forum/discussion/installation-update/updating-to-300-failed-cant-manually-update-either
|
||||
- https://akaunting.com/forum/discussion/installation-update/not-able-to-update-core
|
||||
- https://akaunting.com/forum/discussion/installation-update/update-to-203-not-able-to-finalize-core-installation
|
||||
- https://akaunting.com/forum/discussion/installation-update/how-to-perform-manual-update-v2116
|
9
roles/docker-akaunting/handlers/main.yml
Normal file
9
roles/docker-akaunting/handlers/main.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
- name: setup akaunting
|
||||
command:
|
||||
cmd: docker-compose -p akaunting up -d --force-recreate
|
||||
chdir: "{{docker_compose_akaunting_path}}"
|
||||
environment:
|
||||
#AKAUNTING_SETUP: true
|
||||
COMPOSE_HTTP_TIMEOUT: 600
|
||||
DOCKER_CLIENT_TIMEOUT: 600
|
2
roles/docker-akaunting/meta/main.yml
Normal file
2
roles/docker-akaunting/meta/main.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
dependencies:
|
||||
- server_native-docker-reverse-proxy
|
48
roles/docker-akaunting/tasks/main.yml
Normal file
48
roles/docker-akaunting/tasks/main.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
- name: recieve {{domain}} certificate
|
||||
command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{domain}}
|
||||
|
||||
- name: configure {{domain}}.conf
|
||||
template: src=roles/server_native-docker-reverse-proxy/templates/domain.conf.j2 dest=/etc/nginx/conf.d/{{domain}}.conf
|
||||
notify: restart nginx
|
||||
|
||||
- name: register directory
|
||||
stat:
|
||||
path: "{{docker_compose_akaunting_path}}"
|
||||
register: docker_compose_akaunting_path_register
|
||||
|
||||
- name: checkout repository
|
||||
ansible.builtin.shell: git checkout .
|
||||
become: true
|
||||
args:
|
||||
chdir: "{{docker_compose_akaunting_path}}"
|
||||
when: docker_compose_akaunting_path_register.stat.exists
|
||||
|
||||
- name: pull docker repository
|
||||
git:
|
||||
repo: "https://github.com/akaunting/docker.git"
|
||||
dest: "{{docker_compose_akaunting_path}}"
|
||||
update: yes
|
||||
notify: setup akaunting
|
||||
become: true
|
||||
register: git_result
|
||||
ignore_errors: true
|
||||
|
||||
- name: Warn if repo is not reachable
|
||||
debug:
|
||||
msg: "Warning: Repository is not reachable."
|
||||
when: git_result.failed
|
||||
|
||||
- name: set akaunting version
|
||||
ansible.builtin.shell: find . -type f -exec sed -i 's/akaunting:latest/akaunting:{{akaunting_version}}/' {} + && find . -type f -exec sed -i 's/version=latest/version={{akaunting_version}}/' {} +
|
||||
become: true
|
||||
args:
|
||||
chdir: "{{docker_compose_akaunting_path}}"
|
||||
|
||||
- name: configure db.env
|
||||
template: src=db.env.j2 dest={{docker_compose_akaunting_path}}/env/db.env
|
||||
notify: setup akaunting
|
||||
|
||||
- name: configure run.env
|
||||
template: src=run.env.j2 dest={{docker_compose_akaunting_path}}/env/run.env
|
||||
notify: setup akaunting
|
9
roles/docker-akaunting/templates/db.env.j2
Normal file
9
roles/docker-akaunting/templates/db.env.j2
Normal file
@@ -0,0 +1,9 @@
|
||||
# These could be changed
|
||||
MYSQL_DATABASE=akaunting
|
||||
MYSQL_USER=admin
|
||||
|
||||
# This should definitely be changed to something long and random
|
||||
MYSQL_PASSWORD={{akaunting_database_password}}
|
||||
|
||||
# You should probably leave this
|
||||
MYSQL_ROOT_PASSWORD={{akaunting_database_password}}
|
22
roles/docker-akaunting/templates/run.env.j2
Normal file
22
roles/docker-akaunting/templates/run.env.j2
Normal file
@@ -0,0 +1,22 @@
|
||||
# You should change this to match your reverse proxy DNS name and protocol
|
||||
APP_URL=https://{{domain}}
|
||||
LOCALE=en-US
|
||||
|
||||
# Don't change this unless you rename your database container or use rootless podman, in case of using rootless podman you should set it to 127.0.0.1 (NOT localhost)
|
||||
DB_HOST=akaunting-db
|
||||
|
||||
# Change these to match env/db.env
|
||||
DB_DATABASE=akaunting
|
||||
DB_USERNAME=admin
|
||||
DB_PASSWORD={{akaunting_database_password}}
|
||||
|
||||
# You should change this to a random string of three numbers or letters followed by an underscore
|
||||
DB_PREFIX=asd_
|
||||
|
||||
# These define the first company to exist on this instance. They are only used during setup.
|
||||
COMPANY_NAME={{akaunting_company_name}}
|
||||
COMPANY_EMAIL={{akaunting_company_email}}
|
||||
|
||||
# This will be the first administrative user created on setup.
|
||||
ADMIN_EMAIL={{akaunting_setup_admin_email}}
|
||||
ADMIN_PASSWORD={{akaunting_setup_admin_password}}
|
1
roles/docker-akaunting/vars/main.yml
Normal file
1
roles/docker-akaunting/vars/main.yml
Normal file
@@ -0,0 +1 @@
|
||||
docker_compose_akaunting_path: "{{path_docker_compose_files}}akaunting/"
|
Reference in New Issue
Block a user