Compare commits

3 Commits

Author SHA1 Message Date
2eef842a8c update 2025-11-14 22:39:57 -05:00
d362421a80 api-fix 2025-11-14 22:37:54 -05:00
c0619539e6 api fix 2025-11-14 22:10:52 -05:00
8 changed files with 111 additions and 29 deletions

View File

@ -1,7 +1,5 @@
TYPE=akaunting TYPE=akaunting
ENABLE_BACKUPS=true
DOMAIN=akaunting.example.com DOMAIN=akaunting.example.com
COMPOSE_FILE="compose.yml" COMPOSE_FILE="compose.yml"
@ -29,4 +27,9 @@ COMPANY_EMAIL=my@company.com
ADMIN_EMAIL=me@company.com ADMIN_EMAIL=me@company.com
SECRET_MYSQL_PASSWORD_VERSION=v1 SECRET_MYSQL_PASSWORD_VERSION=v1
SECRET_MYSQL_ROOT_PASSWORD_VERSION=v1 SECRET_MYSQL_ROOT_PASSWORD_VERSION=v1
SECRET_ADMIN_PASSWORD_VERSION=v1
## Enable API Fix to support offline use (without an API key)
# COMPOSE_FILE="$COMPOSE_FILE:compose.api-fix.yml"
# API_FIX=apply

View File

@ -1,14 +1,14 @@
# akaunting # akaunting
Open-source quickbooks alternative, written in PHP. > One line description of the recipe
<!-- metadata --> <!-- metadata -->
* **Category**: Apps * **Category**: Apps
* **Status**: 0 * **Status**: 0
* **Image**: [`akaunting`](https://hub.docker.com/r/akaunting), 4, upstream * **Image**: [`akaunting`](https://hub.docker.com/r/akaunting), 4, upstream
* **Healthcheck**: Yes * **Healthcheck**: No
* **Backups**: Yes * **Backups**: No
* **Email**: No * **Email**: No
* **Tests**: No * **Tests**: No
* **SSO**: No * **SSO**: No
@ -20,9 +20,5 @@ Open-source quickbooks alternative, written in PHP.
* `abra app new akaunting --secrets` * `abra app new akaunting --secrets`
* `abra app config <app-name>` * `abra app config <app-name>`
* `abra app deploy <app-name>` * `abra app deploy <app-name>`
* Once the app is up and running, navigate to `https://${DOMAIN}` in your browser
* Select your locale in step 1
* In step 2, use `akaunting` as the database schema name and leave the other fields unchanged (they should have auto-populated based on the environment variables in the deployment)
* In step 3, fill in whatever you desire for company and admin user information
For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech). For more, see [`docs.coopcloud.tech`](https://docs.coopcloud.tech).

View File

@ -1,3 +1,4 @@
# Set any config versions here # Set any config versions here
# Docs: https://docs.coopcloud.tech/maintainers/handbook/#manage-configs # Docs: https://docs.coopcloud.tech/maintainers/handbook/#manage-configs
export APP_ENTRYPOINT_VERSION=v1 export APP_ENTRYPOINT_VERSION=v1
export API_FIX_VERSION=v1

63
api-fix.patch Normal file
View File

@ -0,0 +1,63 @@
From f0bf18d4124aa480a0650eed771c57dfd85b7f6c Mon Sep 17 00:00:00 2001
From: MIR
Date: Wed, 12 Nov 2025 17:36:37 -0500
Subject: [PATCH] Fix errors when API key unavailable
---
app/Traits/Modules.php | 2 +-
app/Traits/Plans.php | 26 ++++----------------------
2 files changed, 5 insertions(+), 23 deletions(-)
diff --git a/app/Traits/Modules.php b/app/Traits/Modules.php
index 8382b19e6..e91b33b2d 100644
--- a/app/Traits/Modules.php
+++ b/app/Traits/Modules.php
@@ -26,7 +26,7 @@ trait Modules
$result = json_decode($response->getBody());
- return $result->success ? true : false;
+ return true;
}
// Get All Modules
diff --git a/app/Traits/Plans.php b/app/Traits/Plans.php
index 02ce4d575..b0501138d 100644
--- a/app/Traits/Plans.php
+++ b/app/Traits/Plans.php
@@ -58,29 +58,11 @@ trait Plans
public function getPlanLimitByType($type): object
{
- if (! config('app.installed') || running_in_test()) {
- $limit = new \stdClass();
-
- $limit->action_status = true;
- $limit->view_status = true;
- $limit->message = "Success";
-
- return $limit;
- }
-
- if (! $data = $this->getPlanLimits()) {
- $limit = new \stdClass();
-
- $limit->action_status = false;
- $limit->view_status = false;
- $limit->message = "Not able to create a new $type.";
-
- return $limit;
- }
-
- $limit = $data->$type;
+ $limit = new \stdClass();
- $limit->message = str_replace('{company_id}', company_id(), $limit->message);
+ $limit->action_status = true;
+ $limit->view_status = true;
+ $limit->message = "Success";
return $limit;
}
--
2.43.0

12
compose.api-fix.yml Normal file
View File

@ -0,0 +1,12 @@
---
services:
app:
configs:
- source: api_fix
target: /var/www/html/api-fix.patch
mode: 0644
configs:
api_fix:
name: ${STACK_NAME}_api_fix_${API_FIX_VERSION}
file: api-fix.patch

View File

@ -1,7 +1,7 @@
--- ---
services: services:
app: app:
image: docker.io/akaunting/akaunting:3.1.19 image: docker.io/akaunting/akaunting:latest
networks: networks:
- proxy - proxy
- backend - backend
@ -31,12 +31,12 @@ services:
## Enable backups: https://docs.coopcloud.tech/maintainers/handbook/#how-do-i-configure-backuprestore ## Enable backups: https://docs.coopcloud.tech/maintainers/handbook/#how-do-i-configure-backuprestore
# - "backupbot.backup=true" # - "backupbot.backup=true"
# - "backupbot.backup.path=/some/path" # - "backupbot.backup.path=/some/path"
healthcheck: # healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/serviceworker.js"] # test: ["CMD", "curl", "-f", "http://localhost"]
interval: 30s # interval: 30s
timeout: 10s # timeout: 10s
retries: 10 # retries: 10
start_period: 1m # start_period: 1m
volumes: volumes:
- akaunting-data:/var/www/html - akaunting-data:/var/www/html
secrets: secrets:
@ -57,11 +57,6 @@ services:
deploy: deploy:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
labels:
backupbot.backup: "${ENABLE_BACKUPS:-true}"
backupbot.backup.pre-hook: "mariadb-dump --single-transaction -u root -p\"$$(cat /run/secrets/mysql_root_password)\" akaunting | gzip > /var/lib/mysql/dump.sql.gz"
backupbot.backup.volumes.akaunting-db.path: "dump.sql.gz"
backupbot.restore.post-hook: "gzip -d /var/lib/mysql/dump.sql.gz && mariadb -u root -p\"$$(cat /run/secrets/mysql_root_password)\" akaunting < /var/lib/mysql/dump.sql && rm -f /var/lib/mysql/dump.sql"
environment: environment:
- MYSQL_DATABASE=akaunting - MYSQL_DATABASE=akaunting
- MYSQL_USER=admin - MYSQL_USER=admin
@ -70,6 +65,11 @@ services:
secrets: secrets:
- mysql_password - mysql_password
- mysql_root_password - mysql_root_password
labels:
backupbot.backup: "${ENABLE_BACKUPS:-true}"
backupbot.backup.pre-hook: "mariadb-dump --single-transaction -u root -p\"$$(cat /run/secrets/mysql_root_password)\" akaunting | gzip > /var/lib/mysql/dump.sql.gz"
backupbot.backup.volumes.akaunting-db.path: "dump.sql.gz"
backupbot.restore.post-hook: "gzip -d /var/lib/mysql/dump.sql.gz && mariadb -u root -p\"$$(cat /run/secrets/mysql_root_password)\" akaunting < /var/lib/mysql/dump.sql && rm -f /var/lib/mysql/dump.sql"
volumes: volumes:
akaunting-db: akaunting-db:
@ -87,8 +87,10 @@ networks:
backend: backend:
proxy: proxy:
external: true external: true
internal:
configs: configs:
app_entrypoint: app_entrypoint:
name: ${STACK_NAME}_app_entrypoint_${APP_ENTRYPOINT_VERSION} name: ${STACK_NAME}_app_entrypoint_${APP_ENTRYPOINT_VERSION}
file: docker-entrypoint.sh file: docker-entrypoint.sh.tmpl
template_driver: golang

View File

@ -1,6 +0,0 @@
#!/bin/bash
DB_PASSWORD=$(cat /run/secrets/mysql_password)
export DB_PASSWORD
/usr/local/bin/akaunting.sh --start

11
docker-entrypoint.sh.tmpl Normal file
View File

@ -0,0 +1,11 @@
#!/bin/bash
export DB_PASSWORD=$(cat /run/secrets/mysql_password)
export ADMIN_PASSWORD=$(cat /run/secrets/admin_password)
{{ if eq (env "API_FIX") "apply" }}
cd /var/www/html
patch --batch --forward -p1 < ./api-fix.patch
{{ end }}
/usr/local/bin/akaunting.sh --start