This commit is contained in:
root
2024-09-25 13:57:35 +02:00
commit 9042ef24bc
73 changed files with 2229 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
## 0.6.2
- Update woob dependencies install method
## 0.6.1
- Remove support for i386 architecture
## 0.6.0
- Bump Kresus to 0.19.0
## 0.5.1
- Fix AppArmor profile
## 0.5.0
- Attempt using `alpine:edge` as base image
## 0.4.2
- Fix AppArmor profile
## 0.4.1
- Reinstall py3-lxml by default
## 0.4.0
- Remove python dependencies from Dockerfile to prevent
incompatibility with woob requirements
## 0.3.0
- Use `s6-setuidgid` instead of `su-exec`
- Set AppArmor in complain mode

View File

@@ -0,0 +1,54 @@
# Home Assistant Custom Add-on: Kresus
[Kresus](https://kresus.org/) is an open-source self-hostable Personal Finance Manager.
It automatically retrieves your daily bank transactions, lets you categorize them and manage your monthly budgets.
It relies on [woob](https://gitlab.com/woob/woob) to fetch data from your bank website.
## Installation
Kresus requires a PostgreSQL database to store data.
If you do not already have a PostgreSQL database installed, you may consider the [PostgreSQL addon](https://github.com/ezlo-picori/hassio-addons/tree/main/postgres).
The installation of Kresus add-on is quite straightforward and do not differ from the standard installation process for Home-Assistant add-ons:
1. Click the Home Assistant My button below to open the add-on on your Home
Assistant instance.
[![Open this add-on in your Home Assistant instance.][addon-badge]][addon]
1. Click the "Install" button to install the add-on.
1. Start the "Kresus" add-on.
1. Check the logs of the "Kresus" add-on to see if everything
went well. A working installation should indicate `Server is ready, let's start the show!`
1. Click the "OPEN WEB UI" button to open Kresus UI.
## Configuration
The only configuration configurations required are the database connection options.
If you used the [PostgreSQL add-on](https://github.com/ezlo-picori/hassio-addons/tree/main/postgres) configured with following options:
```yaml
databases:
- kresus_db
logins:
- password: CHANGEME_kr3sus-p@ssword_CHANGEME
username: kresus_user
rights:
- database: kresus_db
username: kresus_user
```
then you may configure kresus with these options:
```yaml
postgres_hostname: homeassistant.local
postgres_port: 5432
postgres_user: kresus_user
postgres_password: CHANGEME_kr3sus-p@ssword_CHANGEME
postgres_database: kresus_db
```
## Authors & contributors
The original setup of this repository is by [Ezlo Picori](https://github.com/ezlo-picori).

View File

@@ -0,0 +1,39 @@
FROM node:lts-bookworm-slim
ENV LANG="C.UTF-8"
# Install Weboob OS-level dependencies.
RUN apt-get update \
&& apt-get install -y git python3 python3-dev libffi-dev \
libxml2-dev libxslt-dev libyaml-dev libtiff-dev libjpeg-dev zlib1g-dev \
libfreetype6-dev libwebp-dev build-essential gcc g++ wget mupdf-tools \
python3-pip \
&& rm -rf /var/lib/apt/lists/
# Install Weboob python dependencies
RUN mkdir /tmp/install && cd /tmp/install
#RUN $(which pip) install --upgrade setuptools
RUN pip install html2text simplejson BeautifulSoup PyExecJS pdfminer python-jose
RUN rm -rf /tmp/install
# Setup kresus layout.
RUN useradd -d /home/kreseus -m -s /bin/bash -U user && \
mkdir -p /data/kreseus && \
mkdir -p /data/weboob && \
npm install -g --production kresus;
# Run server.
ENV HOST 0.0.0.0
ENV KRESUS_DIR /data/kreseus
ENV KRESUS_WEBOOB_DIR /data/weboob
ENV NODE_ENV production
EXPOSE 9876
COPY ./config.example.ini /opt/config.ini
RUN chmod -x /opt/config.ini
COPY ./docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["kresus --config /opt/config.ini"]

View File

@@ -0,0 +1,25 @@
# Home Assistant Add-on: Kresus
Open source personal accounting solution.
![Supports aarch64 Architecture][aarch64-shield]
![Supports amd64 Architecture][amd64-shield]
![Supports armhf Architecture][armhf-shield]
![Supports armv7 Architecture][armv7-shield]
![Supports i386 Architecture][i386-shield]
## About
[Kresus][kresus] is a free solution for personal accounting management.
It automatically retrieves your daily bank transactions, lets you categorize them
and manage your monthly budgets.
![Kresus Preview][screenshot]
[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
[armhf-shield]: https://img.shields.io/badge/armhf-yes-green.svg
[armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg
[i386-shield]: https://img.shields.io/badge/i386-no-red.svg
[screenshot]: https://kresus.org/images/pages/view-all-accounts.png
[kresus]: https://kresus.org/

View File

@@ -0,0 +1,12 @@
build_from:
aarch64: "node:lts-bookworm-slim"
labels:
org.opencontainers.image.title: "Home Assistant Add-on: Kresus Local TEST"
org.opencontainers.image.description: "Kresus Local TEST addon"
org.opencontainers.image.licenses: "MIT License"
io.hass.base.name: alpine
args:
BASHIO_VERSION: 0.14.3
TEMPIO_VERSION: 2021.09.0
S6_OVERLAY_VERSION: 3.1.3.0
JEMALLOC_VERSION: 5.3.0

View File

@@ -0,0 +1,30 @@
name: Kresus Local TEST
version: "0.6.2"
slug: kresuslocaltest
description: Open source personal accounting management
arch:
- armhf
- armv7
- aarch64
- amd64
init: false
options:
postgres_hostname: homeassistant.local
postgres_port: 5432
postgres_user: kresus
postgres_password: null
postgres_database: kresus
panel_icon: mdi:piggy-bank-outline
ports:
9876/tcp: 9876
ports_description:
9876/tcp: "The port to access kresus web server."
schema:
postgres_hostname: str
postgres_port: int
postgres_user: str
postgres_password: password
postgres_database: str
http_basicauth: str?
startup: system
timeout: 20

BIN
kresus-mrraph-test/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

BIN
kresus-mrraph-test/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@@ -0,0 +1 @@
python-jose

56
kresus-mrraph-test/start.sh Executable file
View File

@@ -0,0 +1,56 @@
#!/usr/bin/with-contenv bashio
bashio::log.info "Custom Start script"
WOOB_DIR="/woob"
KRESUS_INI_FILE="/etc/kresus/config.ini"
# ==============================================================================
# Pull latest Woob version
# ==============================================================================
cd "${WOOB_DIR}" || bashio::exit.nok
#bashio::log.info "Clear woob install"
#rm -rf {,.[!.],..?}*
#bashio::log.info "Add clean woob install"
#wget -qO- https://gitlab.com/woob/woob/-/archive/master/woob-master.tar.gz | tar xz --strip-components=1
#bashio::log.info "Updating Woob dependencies..."
#pip3 install --no-cache-dir --prefix .py-deps .
PYTHONPATH=$(python3 -c "import sys, os; print(os.sep.join(['$(pwd)', '.py-deps', 'lib', f'python{sys.version_info.major}.{sys.version_info.minor}', 'site-packages']))")
export PYTHONPATH
bashio::log.info "Done updating Woob dependencies."
# ==============================================================================
# Set-up environment variables
# ==============================================================================
# Basic Kresus options
export PORT=9876
export HOST=0.0.0.0
export KRESUS_PYTHON_EXEC=python3
export KRESUS_WOOB_DIR="${WOOB_DIR}"
KRESUS_SALT="$(cat /data/kresus_salt)"
export KRESUS_SALT
# Kresus Basic auth
if bashio::config.has_value 'http_basicauth'; then
KRESUS_AUTH="$(bashio::config 'http_basicauth')"
export KRESUS_AUTH
fi
# Kresus database
export KRESUS_DB_TYPE="postgres"
KRESUS_DB_HOST="$(bashio::config 'postgres_hostname')"
KRESUS_DB_PORT="$(bashio::config 'postgres_port')"
KRESUS_DB_USERNAME="$(bashio::config 'postgres_user')"
KRESUS_DB_PASSWORD="$(bashio::config 'postgres_password')"
KRESUS_DB_NAME="$(bashio::config 'postgres_database')"
export KRESUS_DB_HOST KRESUS_DB_PORT KRESUS_DB_USERNAME \
KRESUS_DB_PASSWORD KRESUS_DB_NAME
# ==============================================================================
# Start Kresus
# ==============================================================================
kresus -c ${KRESUS_INI_FILE}

55
kresus-mrraph-test/start.sh.ori Executable file
View File

@@ -0,0 +1,55 @@
#!/usr/bin/with-contenv bashio
WOOB_DIR="/woob"
KRESUS_INI_FILE="/etc/kresus/config.ini"
# ==============================================================================
# Pull latest Woob version
# ==============================================================================
cd "${WOOB_DIR}" || bashio::exit.nok
bashio::log.info "Clear woob install"
rm -rf {,.[!.],..?}*
bashio::log.info "Add clean woob install"
wget -qO- https://gitlab.com/woob/woob/-/archive/master/woob-master.tar.gz | tar xz --strip-components=1
bashio::log.info "Updating Woob dependencies..."
pip3 install --no-cache-dir --prefix .py-deps .
PYTHONPATH=$(python3 -c "import sys, os; print(os.sep.join(['$(pwd)', '.py-deps', 'lib', f'python{sys.version_info.major}.{sys.version_info.minor}', 'site-packages']))")
export PYTHONPATH
bashio::log.info "Done updating Woob dependencies."
# ==============================================================================
# Set-up environment variables
# ==============================================================================
# Basic Kresus options
export PORT=9876
export HOST=0.0.0.0
export KRESUS_PYTHON_EXEC=python3
export KRESUS_WOOB_DIR="${WOOB_DIR}"
KRESUS_SALT="$(cat /data/kresus_salt)"
export KRESUS_SALT
# Kresus Basic auth
if bashio::config.has_value 'http_basicauth'; then
KRESUS_AUTH="$(bashio::config 'http_basicauth')"
export KRESUS_AUTH
fi
# Kresus database
export KRESUS_DB_TYPE="postgres"
KRESUS_DB_HOST="$(bashio::config 'postgres_hostname')"
KRESUS_DB_PORT="$(bashio::config 'postgres_port')"
KRESUS_DB_USERNAME="$(bashio::config 'postgres_user')"
KRESUS_DB_PASSWORD="$(bashio::config 'postgres_password')"
KRESUS_DB_NAME="$(bashio::config 'postgres_database')"
export KRESUS_DB_HOST KRESUS_DB_PORT KRESUS_DB_USERNAME \
KRESUS_DB_PASSWORD KRESUS_DB_NAME
# ==============================================================================
# Start Kresus
# ==============================================================================
kresus -c ${KRESUS_INI_FILE}

View File

@@ -0,0 +1,27 @@
configuration:
postgres_hostname:
name: "DB hostname"
description: >-
Hostname of the PostgreSQL database.
postgres_port:
name: "DB port"
description: >-
Port of the PostgreSQL database.
postgres_user:
name: "DB user"
description: >-
User to connect to the database.
postgres_password:
name: "DB password"
description: >-
Password of the database user.
postgres_database:
name: "DB database"
description: >-
Name of the kresus database.
http_basicauth:
name: "Authentication"
description: >-
Logins for HTTP basic auth authentication ("login:passwd" format, optional).
network:
9876/tcp: Port to access kresus web server.