Add mealie
This commit is contained in:
parent
0394ae6c11
commit
d020bef34c
33 changed files with 332 additions and 19 deletions
19
ressources/mealie/README.MD
Normal file
19
ressources/mealie/README.MD
Normal file
|
@ -0,0 +1,19 @@
|
|||
#### mealie
|
||||
|
||||
##### Information
|
||||
Site : https://mealie.io/
|
||||
|
||||
Source : https://github.com/hay-kot/mealie
|
||||
|
||||
##### Install
|
||||
|
||||
```bash
|
||||
apt install -y wget ca-certificates
|
||||
wget -qO - https://deb.lgy.fr/install.sh | bash
|
||||
apt-get update
|
||||
apt-get install -y mealie
|
||||
|
||||
#Edit /etc/default/mealie-api and /etc/default/mealie-frontend
|
||||
|
||||
systemctl enable --now mealie-api mealie-frontend
|
||||
```
|
77
ressources/mealie/debmaker
Executable file
77
ressources/mealie/debmaker
Executable file
|
@ -0,0 +1,77 @@
|
|||
#!/bin/bash
|
||||
|
||||
VERSION=1.0.0
|
||||
APP=mealie
|
||||
DEPOT=https://github.com/hay-kot/mealie.git
|
||||
GIT_VERSION=last
|
||||
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
|
||||
DEBIAN_VERSION_CODENAME=bookworm
|
||||
IMAGE_SIZE=6
|
||||
PACKAGE_DEPENDENCY="curl build-essential libpq-dev libwebp-dev libsasl2-dev libldap2-dev libssl-dev gnupg2 python3-pip python3-dev git wget ca-certificates python3-poetry python3-cachecontrol nodejs yarn"
|
||||
|
||||
main(){
|
||||
base_package_upgrade
|
||||
configure_depot_nodejs
|
||||
configure_depot_yarn
|
||||
install_package_dependency
|
||||
get_git_source
|
||||
build_frontend
|
||||
build_api
|
||||
makedeb_frontend
|
||||
makedeb_api
|
||||
}
|
||||
|
||||
build_frontend() {
|
||||
cd /tmp/${APP}/frontend
|
||||
|
||||
yarn install
|
||||
yarn build
|
||||
rm -fr node_modules/
|
||||
NODE_ENV=production yarn install
|
||||
}
|
||||
|
||||
build_api() {
|
||||
cd /tmp/${APP}/
|
||||
|
||||
export PYTHONUNBUFFERED=1
|
||||
export PYTHONDONTWRITEBYTECODE=1
|
||||
export PIP_NO_CACHE_DIR=off
|
||||
export PIP_DISABLE_PIP_VERSION_CHECK=on
|
||||
export PIP_DEFAULT_TIMEOUT=100
|
||||
export POETRY_VIRTUALENVS_IN_PROJECT=true
|
||||
export POETRY_NO_INTERACTION=1
|
||||
export VENV_PATH="/usr/share/mealie/.venv"
|
||||
|
||||
[ -e /usr/share/mealie ] && rm -fr /usr/share/mealie
|
||||
mkdir /usr/share/mealie
|
||||
mv mealie/ alembic* poetry.lock gunicorn_conf.py pyproject.toml /usr/share/mealie
|
||||
cd /usr/share/mealie
|
||||
poetry install -E pgsql --no-dev
|
||||
|
||||
export PRODUCTION=true
|
||||
/usr/share/mealie/.venv/bin/python /usr/share/mealie/mealie/scripts/install_model.py
|
||||
|
||||
}
|
||||
|
||||
makedeb_frontend(){
|
||||
PATH_DEB=/tmp/src/rootfs-frontend
|
||||
|
||||
mkdir -p ${PATH_DEB}/usr/share/mealie/
|
||||
cp -fr /tmp/${APP}/frontend ${PATH_DEB}/usr/share/mealie/
|
||||
|
||||
mkdir -p ${PATH_DEB}/var/lib/mealie/api
|
||||
ln -s /usr/share/mealie/alembic ${PATH_DEB}/var/lib/mealie/api/alembic
|
||||
|
||||
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
|
||||
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
|
||||
}
|
||||
|
||||
makedeb_api(){
|
||||
PATH_DEB=/tmp/src/rootfs-api
|
||||
|
||||
mkdir -p ${PATH_DEB}/usr/share/
|
||||
cp -fr /usr/share/mealie ${PATH_DEB}/usr/share/
|
||||
|
||||
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
|
||||
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
|
||||
}
|
0
ressources/mealie/rootfs-api/DEBIAN/changelog
Normal file
0
ressources/mealie/rootfs-api/DEBIAN/changelog
Normal file
1
ressources/mealie/rootfs-api/DEBIAN/conffiles
Normal file
1
ressources/mealie/rootfs-api/DEBIAN/conffiles
Normal file
|
@ -0,0 +1 @@
|
|||
/etc/default/mealie-api
|
7
ressources/mealie/rootfs-api/DEBIAN/control
Normal file
7
ressources/mealie/rootfs-api/DEBIAN/control
Normal file
|
@ -0,0 +1,7 @@
|
|||
Package: mealie-api
|
||||
Version: %VERSION%
|
||||
Section: contrib
|
||||
Priority: optional
|
||||
Architecture: all
|
||||
Maintainer: Thomas Legay <thomas@lgy.fr>
|
||||
Description: mealie-api
|
19
ressources/mealie/rootfs-api/DEBIAN/postinst
Executable file
19
ressources/mealie/rootfs-api/DEBIAN/postinst
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
APP=mealie-api
|
||||
HOMEDIR=/var/lib/mealie/api
|
||||
|
||||
[ -d ${HOMEDIR} ] || mkdir -p ${HOMEDIR}
|
||||
id ${APP} &> /dev/null || useradd ${APP} -r -s /bin/false -d ${HOMEDIR}
|
||||
|
||||
chown ${APP}:${APP} ${HOMEDIR}
|
||||
|
||||
systemctl | grep ${APP} | grep -q running && systemctl daemon-reload && systemctl restart ${APP}
|
||||
|
||||
if [[ $(systemctl list-unit-files | grep ${APP}.services) -eq 0 ]]
|
||||
then
|
||||
systemctl daemon-reload
|
||||
if [ "$(systemctl is-active ${APP}.service)" != "inactive" ]
|
||||
then
|
||||
systemctl restart ${APP}
|
||||
fi
|
||||
fi
|
46
ressources/mealie/rootfs-api/etc/default/mealie-api
Normal file
46
ressources/mealie/rootfs-api/etc/default/mealie-api
Normal file
|
@ -0,0 +1,46 @@
|
|||
PRODUCTION=true
|
||||
TESTING=false
|
||||
BASE_DIR=/usr/share/mealie
|
||||
DATA_DIR=/var/lib/mealie/api
|
||||
|
||||
ALLOW_SIGNUP=false
|
||||
API_PORT=9000
|
||||
API_DOCS=true
|
||||
SECURITY_MAX_LOGIN_ATTEMPTS=5
|
||||
SECURITY_USER_LOCKOUT_TIME=24
|
||||
TOKEN_TIME=48
|
||||
|
||||
DB_ENGINE=sqlite # Optional='sqlite', 'postgres'
|
||||
|
||||
# =====================================
|
||||
# Postgres Config
|
||||
POSTGRES_USER=mealie
|
||||
POSTGRES_PASSWORD=mealie
|
||||
POSTGRES_SERVER=postgres
|
||||
POSTGRES_PORT=5432
|
||||
POSTGRES_DB=mealie
|
||||
|
||||
# =====================================
|
||||
# Web Concurrency
|
||||
WEB_GUNICORN=true
|
||||
WORKERS_PER_CORE=0.5
|
||||
MAX_WORKERS=1
|
||||
WEB_CONCURRENCY=1
|
||||
|
||||
# =====================================
|
||||
# Email configuration
|
||||
# SMTP_HOST=
|
||||
# SMTP_PORT=587
|
||||
# SMTP_FROM_NAME=Mealie
|
||||
# SMTP_AUTH_STRATEGY=TLS # Options='TLS', 'SSL', 'NONE'
|
||||
# SMTP_FROM_EMAIL=
|
||||
# SMTP_USER=
|
||||
# SMTP_PASSWORD=
|
||||
|
||||
#LDAP_AUTH_ENABLED=
|
||||
#LDAP_SERVER_URL=
|
||||
#LDAP_TLS_INSECURE=
|
||||
#LDAP_TLS_CACERTFILE=
|
||||
#LDAP_BIND_TEMPLATE=
|
||||
#LDAP_BASE_DN=
|
||||
#LDAP_ADMIN_FILTER=
|
3
ressources/mealie/rootfs-api/usr/bin/mealie-api
Executable file
3
ressources/mealie/rootfs-api/usr/bin/mealie-api
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!usr/bin/env bash
|
||||
/usr/share/mealie/.venv/bin/python /usr/share/mealie/mealie/db/init_db.py
|
||||
/usr/share/mealie/.venv/bin/uvicorn mealie.app:app --host 0.0.0.0
|
|
@ -0,0 +1,16 @@
|
|||
[Unit]
|
||||
Description=mealie-api
|
||||
After=multi-user.target
|
||||
|
||||
[Service]
|
||||
User=mealie-api
|
||||
Group=mealie-api
|
||||
EnvironmentFile=/etc/default/mealie-api
|
||||
ExecStart=/usr/bin/mealie-api
|
||||
WorkingDirectory=/var/lib/mealie/api
|
||||
SyslogIdentifier=mealie-api
|
||||
Restart=on-failure
|
||||
RestartSec=30s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
0
ressources/mealie/rootfs-frontend/DEBIAN/changelog
Normal file
0
ressources/mealie/rootfs-frontend/DEBIAN/changelog
Normal file
1
ressources/mealie/rootfs-frontend/DEBIAN/conffiles
Normal file
1
ressources/mealie/rootfs-frontend/DEBIAN/conffiles
Normal file
|
@ -0,0 +1 @@
|
|||
/etc/default/mealie-frontend
|
7
ressources/mealie/rootfs-frontend/DEBIAN/control
Normal file
7
ressources/mealie/rootfs-frontend/DEBIAN/control
Normal file
|
@ -0,0 +1,7 @@
|
|||
Package: mealie-frontend
|
||||
Version: %VERSION%
|
||||
Section: contrib
|
||||
Priority: optional
|
||||
Architecture: all
|
||||
Maintainer: Thomas Legay <thomas@lgy.fr>
|
||||
Description: mealie-frontend
|
19
ressources/mealie/rootfs-frontend/DEBIAN/postinst
Executable file
19
ressources/mealie/rootfs-frontend/DEBIAN/postinst
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
APP=mealie-frontend
|
||||
HOMEDIR=/var/lib/mealie/frontend
|
||||
|
||||
[ -d ${HOMEDIR} ] || mkdir -p ${HOMEDIR}
|
||||
id ${APP} &> /dev/null || useradd ${APP} -r -s /bin/false -d ${HOMEDIR}
|
||||
|
||||
chown ${APP}:${APP} ${HOMEDIR}
|
||||
|
||||
systemctl | grep ${APP} | grep -q running && systemctl daemon-reload && systemctl restart ${APP}
|
||||
|
||||
if [[ $(systemctl list-unit-files | grep ${APP}.services) -eq 0 ]]
|
||||
then
|
||||
systemctl daemon-reload
|
||||
if [ "$(systemctl is-active ${APP}.service)" != "inactive" ]
|
||||
then
|
||||
systemctl restart ${APP}
|
||||
fi
|
||||
fi
|
|
@ -0,0 +1,19 @@
|
|||
NODE_ENV=production
|
||||
#API_URL=http://mealie-api:9000
|
||||
API_URL=http://localhost:9000
|
||||
|
||||
THEME_LIGHT_PRIMARY=#E58325
|
||||
THEME_LIGHT_ACCENT=#007A99
|
||||
THEME_LIGHT_SECONDARY=#973542
|
||||
THEME_LIGHT_SUCCESS=#43A047
|
||||
THEME_LIGHT_INFO=#1976D2
|
||||
THEME_LIGHT_WARNING=#FF6D00
|
||||
THEME_LIGHT_ERROR=#EF5350
|
||||
|
||||
THEME_DARK_PRIMARY=#E58325
|
||||
THEME_DARK_ACCENT=#007A99
|
||||
THEME_DARK_SECONDARY=#973542
|
||||
THEME_DARK_SUCCESS=#43A047
|
||||
THEME_DARK_INFO=#1976D2
|
||||
THEME_DARK_WARNING=#FF6D00
|
||||
THEME_DARK_ERROR=#EF5350
|
|
@ -0,0 +1,16 @@
|
|||
[Unit]
|
||||
Description=mealie-frontend
|
||||
After=multi-user.target
|
||||
|
||||
[Service]
|
||||
User=mealie-frontend
|
||||
Group=mealie-frontend
|
||||
EnvironmentFile=/etc/default/mealie-frontend
|
||||
ExecStart=node ./node_modules/nuxt/bin/nuxt.js start -H 0.0.0.0
|
||||
WorkingDirectory=/usr/share/mealie/frontend/
|
||||
SyslogIdentifier=mealie-frontend
|
||||
Restart=on-failure
|
||||
RestartSec=30s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Add table
Add a link
Reference in a new issue