Compare commits
1 commit
main
...
task-230-m
Author | SHA1 | Date | |
---|---|---|---|
8928fe1b3d |
9 changed files with 185 additions and 0 deletions
3
roles/mealie/defaults/main.json
Normal file
3
roles/mealie/defaults/main.json
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"var_mealie_port": 9000
|
||||||
|
}
|
12
roles/mealie/files/prepare.sh
Normal file
12
roles/mealie/files/prepare.sh
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
## vars
|
||||||
|
|
||||||
|
packages=""
|
||||||
|
packages="${packages} libldap2-dev"
|
||||||
|
packages="${packages} libsasl2-dev"
|
||||||
|
|
||||||
|
|
||||||
|
## exec
|
||||||
|
|
||||||
|
apt install ${packages}
|
61
roles/mealie/files/setup.sh
Normal file
61
roles/mealie/files/setup.sh
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
## consts
|
||||||
|
|
||||||
|
source_directory="/home/projekte/fremde/mealie"
|
||||||
|
target_directory="/tmp/mealie"
|
||||||
|
python_modules=""
|
||||||
|
python_modules="${python_modules} uvicorn"
|
||||||
|
python_modules="${python_modules} fastapi"
|
||||||
|
python_modules="${python_modules} itsdangerous"
|
||||||
|
python_modules="${python_modules} python-dotenv"
|
||||||
|
python_modules="${python_modules} python-dateutil"
|
||||||
|
python_modules="${python_modules} pydantic_settings"
|
||||||
|
python_modules="${python_modules} sqlalchemy"
|
||||||
|
python_modules="${python_modules} pyjwt"
|
||||||
|
python_modules="${python_modules} text_unidecode"
|
||||||
|
python_modules="${python_modules} python-slugify"
|
||||||
|
python_modules="${python_modules} pyhumps"
|
||||||
|
python_modules="${python_modules} isodate"
|
||||||
|
python_modules="${python_modules} apprise"
|
||||||
|
python_modules="${python_modules} recipe_scrapers"
|
||||||
|
python_modules="${python_modules} bcrypt"
|
||||||
|
python_modules="${python_modules} python-ldap"
|
||||||
|
python_modules="${python_modules} authlib"
|
||||||
|
python_modules="${python_modules} alembic"
|
||||||
|
python_modules="${python_modules} python-multipart"
|
||||||
|
python_modules="${python_modules} openai"
|
||||||
|
python_modules="${python_modules} pillow"
|
||||||
|
python_modules="${python_modules} pillow-heif"
|
||||||
|
python_modules="${python_modules} jinja2"
|
||||||
|
python_modules="${python_modules} html2text"
|
||||||
|
python_modules="${python_modules} orjson"
|
||||||
|
python_modules="${python_modules} rapidfuzz"
|
||||||
|
|
||||||
|
|
||||||
|
### exec
|
||||||
|
|
||||||
|
### create venv
|
||||||
|
python3 -m venv ${target_directory}
|
||||||
|
|
||||||
|
### copy files
|
||||||
|
cp -r ${source_directory}/alembic ${target_directory}/alembic
|
||||||
|
cp -r ${source_directory}/alembic.ini ${target_directory}/alembic.ini
|
||||||
|
cp -r ${source_directory}/mealie ${target_directory}/mealie
|
||||||
|
|
||||||
|
### enter venv
|
||||||
|
cd ${target_directory}
|
||||||
|
source bin/activate
|
||||||
|
|
||||||
|
### install dependencies
|
||||||
|
pip3 install ${python_modules}
|
||||||
|
# poetry install -E pgsql --only main
|
||||||
|
|
||||||
|
### init
|
||||||
|
$PYTHONPATH:${target_directory} python3 ${target_directory}/mealie/scripts/install_model.py
|
||||||
|
|
||||||
|
### frontend
|
||||||
|
cp -r ${source_directory}/frontend ${target_directory}/frontend
|
||||||
|
npm install
|
||||||
|
npm install webpack@4.47.0
|
||||||
|
mkdir ${target_directory}/frontend/dist
|
29
roles/mealie/files/start-backend.sh
Normal file
29
roles/mealie/files/start-backend.sh
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
## consts
|
||||||
|
|
||||||
|
target_directory="/tmp/mealie"
|
||||||
|
|
||||||
|
|
||||||
|
## exec
|
||||||
|
|
||||||
|
### enter venv
|
||||||
|
cd ${target_directory}
|
||||||
|
source bin/activate
|
||||||
|
|
||||||
|
### set environment variables
|
||||||
|
export PYTHONPATH=$PYTHONPATH:${target_directory}
|
||||||
|
export DATA_DIR=${target_directory}
|
||||||
|
export DATA_DIR=${target_directory}
|
||||||
|
# BASE_URL
|
||||||
|
# SMTP_HOST
|
||||||
|
# SMTP_FROM_EMAIL
|
||||||
|
# DEFAULT_EMAIL
|
||||||
|
# DEFAULT_GROUP
|
||||||
|
# DEFAULT_HOUSEHOLD
|
||||||
|
export LDAP_AUTH_ENABLED="false"
|
||||||
|
export OIDC_AUTH_ENABLED="false"
|
||||||
|
export PRODUCTION="true"
|
||||||
|
|
||||||
|
### run
|
||||||
|
python3 mealie/main.py
|
12
roles/mealie/files/start-frontend.sh
Normal file
12
roles/mealie/files/start-frontend.sh
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
## consts
|
||||||
|
|
||||||
|
target_directory="/tmp/mealie"
|
||||||
|
|
||||||
|
|
||||||
|
## exec
|
||||||
|
|
||||||
|
cd ${target_directory}/frontend
|
||||||
|
npm run generate
|
||||||
|
npm run start
|
8
roles/mealie/info.md
Normal file
8
roles/mealie/info.md
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
## Beschreibung
|
||||||
|
|
||||||
|
Zum Aufsetzen der Rezepte-Sammlung [Mealie](https://mealie.io/)
|
||||||
|
|
||||||
|
|
||||||
|
## Verweise
|
||||||
|
|
||||||
|
- [Documentation | Backend Configuration](https://docs.mealie.io/documentation/getting-started/installation/backend-config/)
|
6
roles/mealie/vardef.json
Normal file
6
roles/mealie/vardef.json
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"port": {
|
||||||
|
"type": "integer",
|
||||||
|
"mandatory": false
|
||||||
|
}
|
||||||
|
}
|
5
roles/postgresql-for-mealie/defaults/main.json
Normal file
5
roles/postgresql-for-mealie/defaults/main.json
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"var_postgresql_for_mealie_username": "mealie_user",
|
||||||
|
"var_postgresql_for_mealie_password": "REPLACE_ME",
|
||||||
|
"var_postgresql_for_mealie_schema": "mealie"
|
||||||
|
}
|
49
roles/postgresql-for-mealie/tasks/main.json
Normal file
49
roles/postgresql-for-mealie/tasks/main.json
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "packages",
|
||||||
|
"become": true,
|
||||||
|
"ansible.builtin.apt": {
|
||||||
|
"update_cache": true,
|
||||||
|
"pkg": [
|
||||||
|
"acl",
|
||||||
|
"python3-psycopg2"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "user",
|
||||||
|
"become": true,
|
||||||
|
"become_user": "postgres",
|
||||||
|
"community.postgresql.postgresql_user": {
|
||||||
|
"state": "present",
|
||||||
|
"name": "{{var_postgresql_for_mealie_username}}",
|
||||||
|
"password": "{{var_postgresql_for_mealie_password}}"
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"PGOPTIONS": "-c password_encryption=scram-sha-256"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "schema",
|
||||||
|
"become": true,
|
||||||
|
"become_user": "postgres",
|
||||||
|
"community.postgresql.postgresql_db": {
|
||||||
|
"state": "present",
|
||||||
|
"name": "{{var_postgresql_for_mealie_schema}}",
|
||||||
|
"owner": "{{var_postgresql_for_mealie_username}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "rights",
|
||||||
|
"become": true,
|
||||||
|
"become_user": "postgres",
|
||||||
|
"community.postgresql.postgresql_privs": {
|
||||||
|
"state": "present",
|
||||||
|
"db": "{{var_postgresql_for_mealie_schema}}",
|
||||||
|
"objs": "ALL_IN_SCHEMA",
|
||||||
|
"roles": "{{var_postgresql_for_mealie_username}}",
|
||||||
|
"privs": "ALL",
|
||||||
|
"grant_option": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
Loading…
Add table
Reference in a new issue