Giter Club home page Giter Club logo

addon-grocy's People

Contributors

allanpersson avatar artain avatar dependabot[bot] avatar facastagnini avatar frenck avatar fsironman avatar jlph987 avatar layercakemakes avatar loganwedwards avatar malcp avatar maoz1993 avatar mattdahepic avatar matttbe avatar monsieurhannes avatar mountainsandcode avatar oli-f avatar renovate[bot] avatar sinclairpaul avatar tjorim avatar tringler avatar wrt54g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

addon-grocy's Issues

RON is not supported as a currency

Problem/Motivation

I tried to configure the addon to work with RON as a currency and it would not save products properly or allow me to add to Inventory.

Expected behavior

I add a new product and get the green confirmation in the corner and I can then add it to the Inventory.

Actual behavior

When confirming the adding of a new product, the final step results in a Page Not Found error and when I try to use that product to add it to the Inventory, the green confirmation is grayed out even though I filled in all the fields. It works fine if I use the addon with USD.

Steps to reproduce

Input "currency": "RON" in the addon config and try to add a product and use it in the Inventory.

Proposed changes

Either add support for all ISO 4217 currencies, or change the documentation, which right now says:

Option: currency

**_Determines the currency as displayed in the Grocy interface, specified by the ISO4217 three digit currency code.

Examples: USD, CAD, GBP or EUR._**

Problem update stock

Problem/Motivation

I can nota update the stock by curl with token hassio and token grocy.

Expected behavior

update the stock vía curl

Steps to reproduce

I have tried the next queries:

Query:
curl -X POST
-H "Authorization: Bearer TOKEN-KEY-HASSIO"
-H "Content-Type: application/json"
-H "accept: application/json"
-u <user_grocy>:<passwd_grocy>
-d "{"amount":3,"transaction_type":"consume","spoiled":false}"
"https://<endpoint_hassio>:8123/api/hassio_ingress/rAxPRtNqbnVNLiTXxV1_pSTM6YeCUTU7ZE9FDXYodIc/api/stock/products/4/consume"
Return: 401: Unauthorized

Query:
curl -X POST
-H "Authorization: Bearer TOKEN-KEY-HASSIO"
-H "Content-Type: application/json"
-H "accept: application/json"
-H "GROCY-API-KEY: TOKEN-KEY-GROCY"
-d "{"amount":3,"transaction_type":"consume","spoiled":false}"
"https://<endpoint_hassio>:8123/api/hassio_ingress/rAxPRtNqbnVNLiTXxV1_pSTM6YeCUTU7ZE9FDXYodIc/api/stock/products/4/consume"
Return: 401: Unauthorized

Could you help me?

Integration not found: grocy

I added into my config file

grocy: url: "http://hassio.local:8123/api/hassio_ingress/xJNwv4F8SBerwLRpJo5ujxNmZb1t39MuWrI-C3fzKxc/api" api_key: "YX6RjEDOY9ecClHPKFLEFl2oiV3OyhLc123437637" sensor: - enabled: true

and when I check out my config it says Integration not found: grocy

Consuming Items Doesnt Always Work

Problem/Motivation

When consuming items, the fields go gray, but nothing happens. To actually change inventory, I need to use the Inventory button or the buttons on the stock overview screen.

Expected behavior

When selecting an item and specifying the quantity to consume, it should do so.

Actual behavior

Entering details to consume and pressing OK or Opened, just makes the fields go gray, but nothing happens.

Steps to reproduce

See above.

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Assets coming from home assistant IP when behind reverse proxy

Problem/Motivation

I have home assistant running on a PI within my network on an IP e.g. 192.168.1.51, I use IIS to reverse proxy home assistant and any other service. E.g. home assistant home.mydomain.com and grocy.mydomain.com. Meaning I don't need to expose ports to the outside world to access resources. The SSL is also on my web server for each sub domain.

I see the grocy loading under the proxied sub domain under the HTTPS as expected, but for some reason assets are being loaded by IP on HTTP and so are blocked.

login:1 Mixed Content: The page at 'https://grocy.mydomain.co.uk/login' was loaded over HTTPS, but requested an insecure favicon 'http://192.168.1.51:9192/img/appicons/favicon.ico?v=2.2.0'. This request has been blocked; the content must be served over HTTPS.

This goes for all js, css, font, etc

Expected behavior

Load the assets under the same domain as the site under HTTPS

Actual behavior

Loaded as HTTP

Steps to reproduce

Install addon in home assistant
Leave SSL off in settings as this is setup on IIS
Create a reverse proxy rule directing 80/443 for the domain to the IP and port of Grocy running on home assistant.
Create a rule to Rewrite HTTP > HTTPS

Proposed changes

I'm not entirely sure what needs changing but perhaps use the the request details to load other assets with the request url as the base url. I am successfully using the above setup on numerous other addons, including configurator without issue.

Won't start after update hassos

Problem/Motivation

Grocy doesn't start up anymore after the latest update from hassos.

Expected behavior

Just to startup and use it

Actual behavior

None

Steps to reproduce

20-02-06 22:41:44 ERROR (MainThread) [hassio.addons.addon] Add-on a0d7b954_grocy have wrong options: Missing option stock_product_freezing in tweaks. Got {'culture': 'nl', 'currency': 'EUR', 'entry_page': 'stock', 'features': {'batteries': True, 'calendar': True, 'chores': True, 'equipment': True, 'recipes': True, 'shoppinglist': True, 'stock': True, 'tasks': True}, 'tweaks': {'chores_assignment': True, 'multiple_shopping_lists': True, 'stock_best_before_date_tracking': True, 'stock_location_tracking': True, 'stock_price_tracking': True, 'stock_product_opened_tracking': True}, 'ssl': True, 'certfile': 'fullchain.pem', 'keyfile': 'privkey.pem'}

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

after update to 027bd8a get a error

Home Assistant 0.107.7
Frontend version: 20200318.1 - latest
CustomUI: 20190518

After upgrade to 027bd8a I get this error:

404 Not Found
The application could not run because of the following error:

Details

Type: Slim\Exception\HttpNotFoundException
Code: 404
Message: Not found.
File: /var/www/grocy/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php
Line: 93
Trace

#0 /var/www/grocy/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php(59): Slim\Middleware\RoutingMiddleware->performRouting(Object(Slim\Http\ServerRequest))
#1 /var/www/grocy/vendor/slim/slim/Slim/MiddlewareDispatcher.php(140): Slim\Middleware\RoutingMiddleware->process(Object(Slim\Http\ServerRequest), Object(Slim\Routing\RouteRunner))
#2 /var/www/grocy/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php(98): class@anonymous->handle(Object(Slim\Http\ServerRequest))
#3 /var/www/grocy/vendor/slim/slim/Slim/MiddlewareDispatcher.php(140): Slim\Middleware\ErrorMiddleware->process(Object(Slim\Http\ServerRequest), Object(class@anonymous))
#4 /var/www/grocy/vendor/slim/slim/Slim/MiddlewareDispatcher.php(81): class@anonymous->handle(Object(Slim\Http\ServerRequest))
#5 /var/www/grocy/vendor/slim/slim/Slim/App.php(211): Slim\MiddlewareDispatcher->handle(Object(Slim\Http\ServerRequest))
#6 /var/www/grocy/vendor/slim/slim/Slim/App.php(195): Slim\App->handle(Object(Slim\Http\ServerRequest))
#7 /var/www/grocy/app.php(81): Slim\App->run()
#8 /var/www/grocy/public/index.php(3): require_once('/var/www/grocy/...')
#9 {main}
Go Back

Uninstalled it and reinstalled it give me same error

Grocy seems empty

After updating to 0.2.0 grocy seems empty.
Stock seems empty, products seem empty, users seem empty, recipes seem empty.

But everything is also there. When searching for a product in the purchage tab, the products show up. Including its stock etc.
Also the recipes, are not in the list, but are there in the gallery.

Something isn't going right here.

In all browsers by the way, including private browsing. Reproducing is probably just updating. Cannot go back myself.

Unable to Use Meal Plan

Hello! Thanks for your great work on this add-on!

I'm unable to add meals in the meal plan tab. I believe this is done by clicking the [+] buttons near the date in the calendar view. I do not get any popup when I click those buttons.

image

This shows in the debug log:

2019/06/28 09:50:21 [error] 990#990: *9 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined variable: hintId in /data/grocy/viewcache/79ce{redacted_long_string}.php on line 11" while reading response header from upstream

Cheers!

Slim application error

Hi guys,
I can’t open grocy.
I tired to install grocy on hassio, but when I try to open on web ui, come out one error message like : slim application error.

I tried to modify ssl to false from true, the same issue. I tried to reset to default config, same issue.

Can you have any idea to fix it?

How do I backup Grocy?

I'm worried about SD card failure, any recommendations how I can backup my Grocy data? Sounds like Grocy generally stores data in the /data directory, where do I find that for this Hassio plugin?

Page Not Found after adding new product

Problem/Motivation

When I submit a new product through Create product or Purchase, I get a "Page Not Found: The page you are looking for could not be found. Check the address bar to ensure your URL is spelled correctly. If all else fails, you can visit our home page at the link below."

Expected behaviour

Return to Create product or Purchase screen.

Actual behaviour

Page Not Found as described above.

Steps to reproduce

Submit a new product.

Proposed changes

N/A

"Maximum request body size 1048576 exceeded, actual body size 1049808"

Problem/Motivation

When uploading a pdf file, I still get the same error no matter what size. Error: "Maximum request body size 1048576 exceeded, actual body size 1049808"

(Why the issue was filed)

Expected behavior

It should upload the PDF file and save the entry.

(What you expected to happen)

Actual behavior

Error: "Maximum request body size 1048576 exceeded, actual body size 1049808"

(What actually happened)

Steps to reproduce

Upload a PDF file bigger than 1MB on Grocy 0.4.0

(How can someone else make/see it happen)

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)
Additional Details:

  • Latest version of Hassio 0.103.5
  • Running on a docker host
  • Hassio Supervisor 193
    grocylogs.txt

Grocy wants me to login after browser restart.

Problem/Motivation

Always have to login to grocy

Expected behavior

Below the login fields it says you stay logged in up to 30 days. With the checkbox checked forever.

Actual behavior

When wanting to reuse grocy after some time, I need to login again.

Steps to reproduce

Not sure, but logging in, doing some other stuff on phone and come back to grocy after some time...

used software

Android 9, Firefox and Chrome. Grocy 2.3.0, plugin 0.1.0

On the grocy GitHub itself I see nothing about it, so I assume it's something with the add-on of hassio.

Also: how do I upgrade to 2.4.1 grocy? I can't see an update available in hassio.

Equipment Tab Improvement

Problem/Motivation

Serial Number and Model Number and other fields would be nice to have within Grocy.

Expected behavior

ability to scan bar-code for serial number and model number within the equipment tab.

Actual behavior

does not exist

Steps to reproduce

N/A

Proposed changes

Add fields that reflect Serial Number, Model Number, Purchase amount, Purchase date, and location. If this changes were implemented Grocy could be a great product to track not only food items, but also other physical assets in a home.

Addon still fails to upload bigger files.

Problem/Motivation

Uploading a 3.31MB attachment to an equipment causes a "Maximum request body size 1048576 exceeded, actual body size 1053380" error. Uploading ~10MB results in 502 - bad gateway.

Expected behavior

Attachment should be uploaded correctly.

Actual behavior

Same as problem/motivation.

Result of uploading a 3.31MB file
image

Result of uploading a 10MB+ file
removed due to private domain name listed

Steps to reproduce

  1. Create an equipment or edit an existing one
  2. Try to attach a bigger PDF file (in my case it's just 3.31 MB)
  3. Error pops up

Proposed changes

Ensure, that nginx config is properly executed, because it looks right now, that those values from commit 839d3ff are being ignored on clean install.
I also tried removing the docker image/volumes for grocy after uninstalling from hassio - same issue happens.

I am using 0.31 version of addon.

Maximum request body size 1048576 exceeded

Screenshot 2019-08-28 at 10 02 44

# Problem/Motivation

When uploading a pdf file, I still get the same error no matter what size. Error: Maximum request body size 1048576 exceeded

Expected behavior

PDF File upload

Actual behavior

When uploading a pdf file, I still get the same error no matter what size. Error: Maximum request body size 1048576 exceeded

Steps to reproduce

Upload a pdf file to Grocy 0.3.2

Additional info:

  • Add-on version: 0.3.2
  • You are running the latest version of this add-on.
  • System: HassOS 2.12 (armv7 / raspberrypi3)
  • Home Assistant version: 0.97.2
  • Supervisor version: 184

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Support for Ingress

Problem/Motivation

Feature Request - I am placing this issue as a request for support of the new ingress feature.

Expected behavior

Support ingress with the add on

Actual behavior

Add on does not support ingress

Steps to reproduce

Install current version.

Proposed changes

Support ingress to increase ease of use and barrier of entry for less skilled users.

Error on Update Hass 0.105

Problem/Motivation

Grocy wont start after hass update.

grocy: Error on device update!
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 157, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection
    raise err
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.7/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 184, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 169, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fbe1b3dd210>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.86.40', port=9192): Max retries exceeded with url: /api/system/db-changed-time (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fbe1b3dd210>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/grocy/binary_sensor.py", line 36, in async_update
    await self._client.async_update_data(self.sensor_type)
  File "/config/custom_components/grocy/__init__.py", line 186, in async_update_data
    db_changed = await self.hass.async_add_executor_job(self.client.get_last_db_changed)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/pygrocy/grocy.py", line 259, in get_last_db_changed
    return self._api_client.get_last_db_changed()
  File "/usr/local/lib/python3.7/site-packages/pygrocy/grocy_api_client.py", line 452, in get_last_db_changed
    resp = requests.get(req_url, verify=self._verify_ssl, headers=self._headers)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.86.40', port=9192): Max retries exceeded with url: /api/system/db-changed-time (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fbe1b3dd210>: Failed to establish a new connection: [Errno 111] Connection refused'))

Expected behavior

Addon starting and being able to function

Actual behavior

Doesn't start.

Steps to reproduce

Update from 0.104 to 0.105 version of hass with grocy install

Grocy Hass.io addon cannot be started after upgraded to version 0.2.0

Problem/Motivation

Failed to start Grocy Hass.io addon after upgraded from version 0.1.0 to version 0.2.0 in HA version 0.94.0 onwards.

Expected behavior

Start Grocy Hass.io addon successfully after upgraded to version 0.2.0.

Actual behavior

Failed to start Grocy Hass.io addon after upgraded to version 0.2.0, as per screenshot below:
Screenshot 2019-06-11 at 11 47 24 AM

Steps to reproduce

  1. Grocy Hass.io addon in version 0.1.0.
  2. Press Upgrade button to update latest version to 0.2.0.
  3. Press Start button up to start Grocy as usual.
  4. Failed to start.

Proposed changes

N/A

Enable non admin users to use the addon (Feature Request)

Problem/Motivation

It is currently not possible for non administrative users to gain access to the addon.

Expected behavior

Non administrative users can navigate to the addon start page via the sidebar.

Actual behavior

Currently not possible.

Thanks! Kay.

Error in path when adding product (norwegian language)

Problem/Motivation

Add new product from "purchase"-page and add to inventory

Expected behavior

Redirect to next page to complete purchase of new product

Actual behavior

Page redirect error (404-not found). Slash missing in path before "purchase:1".

Steps to reproduce

Use Grocy 2.5.2 with Hass.io. I use norwegian language. Select purchase/innkjøp from menu. Enter a name that don't exists in database. Use arrow on field to add new product. Fill inn form and select "ok".

Proposed changes

Add slash in address.

Howto set features from the grocy config.php?

There is a new feature in grocy 2.6.0 which I want to set. This is normally set in the config.php from Grocy. How do I set it with the HA addon?

https://github.com/grocy/grocy/blob/master/config-dist.php

In this case the Setting('MEAL_PLAN_FIRST_DAY_OF_WEEK', ''); But I guess this should work for all the settings from config.php.

GitHub
ERP beyond your fridge - grocy is a web-based self-hosted groceries & household management solution for your home - grocy/grocy

Feature Request: Allow more than one manual

Problem/Motivation

Just testing this out and I immediately ran into this issue. The first piece of "equipment" I went to add had multiple manual files.

(Why the issue was filed)

Expected behavior

(What you expected to happen)

Actual behavior

(What actually happened)

Steps to reproduce

(How can someone else make/see it happen)

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Wrong setting in tweaks after update

Problem/Motivation

After upgrading the Addon wouldn't start.
Looking in the logs I get the following error:
Add-on a0d7b954_grocy have wrong options: Missing option stock_product_freezing in tweaks.
Adding that line to the config was an easy fix to the problem but I'm guessing this wasn't supposed to happen in the first place ;)

Expected behavior

Addon starting

Actual behavior

Addon not starting

Steps to reproduce

Upgrade to 0.6.0

Proposed changes

Add
"stock_product_freezing": true
to the standard config

Grocy Won't Start

Problem

Nginx won't start (therefore, Grocy does not start).

Log File

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 01-grocy: applying... 
[fix-attrs.d] 01-grocy: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: Grocy
 ERP beyond your fridge! A groceries & household management solution for your home
-----------------------------------------------------------
 Add-on version: 0.1.0
 You are running the latest version of this add-on.
 System: HassOS 2.11  (armv7 / raspberrypi3)
 Home Assistant version: 0.92.2
 Supervisor version: 162
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] grocy.sh: executing... 
[cont-init.d] grocy.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[22:57:22] INFO: Starting PHP-FPM...
[22:57:25] INFO: Starting NGinx....

Presumably, there should be something after "Starting NGinx...", right? That's the last entry, there is nothing after that. I let it sit for quite some time (over 10min).

Config

{
  "culture": "en",
  "currency": "$",
  "features": {
    "batteries": false,
    "calendar": false,
    "chores": false,
    "equipment": true,
    "recipes": true,
    "shoppinglist": true,
    "tasks": false
  },
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

Status

Supervisor reports addon is "running":

image

Browsing

When loading the page at https://<my-hassio-domain>:9192/, I get the following error:

image

Feature request: Support embedded flag

Problem/Motivation

When using the embedded flag authentication is not required. This works better under the umbrella authentication of Home Assistant (it's possible this might also facilitate Ingress better)

Expected behavior

It would be ideal to not have to login again.

413 Request Entity Too Large

Problem/Motivation

I was trying to upload a manual in the equipment section. My PDF is 3.1M.

Expected behavior

File to upload.

Actual behavior

Error showed.

"\r\n\r\n\r\n
413 Request Entity Too Large
\r\n
nginx/1.14.2
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"

Steps to reproduce

Upload a 3.1M file.

Proposed changes

Increase the nginx limit to 500MB.

Based on this SO answer it looks like this is the line that's needed.

client_max_body_size 500M;

Grocy won't start - Failed Opening /var/www/grocy/data/config.php

Problem/Motivation

Grocy starts properly but it shows an error when trying to access it
Running Hass.io on docker (0.97.2) on a Debian environemnt and all the add-ons have worked so far, apart from this one
When running Grocy, it starts without any issues, but then I get this message when accessing the UI:

Outputed Error
2019/08/19 12:31:55 [error] 506#506: *11 FastCGI sent in stderr: "PHP message: PHP Warning: require_once(/var/www/grocy/data/config.php): failed to open stream: Permission denied in /var/www/grocy/app.php on line 40PHP message: PHP Fatal error: require_once(): Failed opening required '/var/www/grocy/data/config.php' (include_path='.:/usr/share/php7') in /var/www/grocy/app.php on line 40" while reading response header from upstream, client: 172.30.32.2, server: a0d7b954-grocy.local.hass.io, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "<REMOVED>", referrer: "https://<REMOVED>/a0d7b954_grocy"

Config
{ "culture": "en", "currency": "GBP", "features": { "batteries": true, "calendar": true, "chores": true, "equipment": true, "recipes": true, "shoppinglist": true, "stock": true, "tasks": true }, "ssl": false, "certfile": "fullchain.pem", "keyfile": "privkey.pem", "log_level": "debug" }

I checked the addons/data folder and I can see that the config.php file is there, I've been looking at the GirHub repo to understand what could be wrong, but I couldn't find the reason. I can see that that folder has different permissions from all the others in the addons folder (not sure if the startup process is doing it and maybe messing up with the permissions)

Expected behaviour

To be able to access to Grocy

Actual behaviour

Blank page and error logged as above

Steps to reproduce

Installed Grocy using hassio and run with the config provided above

Need some help with REST API plz :)

Hi.
Grocy add-on version 0.3.0
Running on hassio.
Since ingress integration, url api changed.
curl -k -X GET "https://192.168.1.7:8123/api/hassio_ingress/rF2wUHnEuWl57NDLHjpYcZo9LGhPm7Zh4DnZs0ATay4/api/stock" -H "accept: application/json"
Return 401 error :/
I tried with GROCY_API_KEY in header without success.
I tried with Grocy credentials and Hass credentials and longlive token, without success
No port is forwarded in Network.

If someone can help me please :)

First try to launch Grocy: SQLSTATE[HY000]: General error: 1 duplicate column name: shopping_list_id

I use Nabu Casa installed Grocy, changed SLL to "FALSE" and launch.

Instead of the WEB UI I get some SQL error mostly duplicate column names. (once a missing column)

Tried deleting and reinstalling, does not help only got a different column name.

Grocy log looks normal:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 01-grocy: applying...
[fix-attrs.d] 01-grocy: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing...

Hass.io Add-on: Grocy
ERP beyond your fridge! A groceries & household management solution for your home

Add-on version: 0.3.2
You are running the latest version of this add-on.
System: null (armv7 / raspberrypi3)
Home Assistant version: 0.99.3
Supervisor version: 189

Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] grocy.sh: executing...
[cont-init.d] grocy.sh: exited 0.
[cont-init.d] nginx.sh: executing...
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[15:05:43] INFO: Starting PHP-FPM...
[15:05:45] INFO: Starting NGinx....

Login information?

I installed grocy into hassio and when i started it it asked for a login username and password, but ive never signed up for grocy. My Hassio (HA) login doesnt work.

Ive looked on grocy details pages but I cant figure out where i would make an account?

404 Page Not Found when Equipment and Batteries disabled

Problem/Motivation

Attempting to open the add-on when both Equipment and Batteries are disabled results in a 404 not found message logged, and the UI will not load. With either one enabled, the UI loads properly. I have cleared the cache and tried incognito, without success. Looks like #24 did not resolve this particular configuration issue, and it is unrelated to #30 as I meet the minimum system requirements. Alternatively, I saw some mention of a setting for the page to use when attempting to load, but that setting does not appear in the read me file or example configuration.

According to #37 this should have been resolved in a previous release.

I am running Home Assistant version 0.99.3.
image
image

Expected behavior

I should be able to open the add on without the requirement for Equipment or Batteries, as I do not intend to use those features.

Actual behavior

When both those features are disabled, the UI returns a 404 Page Not Found.

image

Steps to reproduce

Use the following configuration and attempt to load the add-on.

{
  "culture": "en",
  "currency": "CAD",
  "features": {
    "batteries": false,
    "calendar": false,
    "chores": true,
    "equipment": false,
    "recipes": true,
    "shoppinglist": false,
    "stock": false,
    "tasks": true
  },
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "log_level": "info"
}

Resulting logs show the following:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 01-grocy: applying...
[fix-attrs.d] 01-grocy: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing...


Hass.io Add-on: Grocy
ERP beyond your fridge! A groceries & household management solution for your home


Add-on version: 0.3.2
You are running the latest version of this add-on.
System: HassOS 2.12 (armv7 / raspberrypi3)
Home Assistant version: 0.99.3
Supervisor version: 189


Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.


[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] grocy.sh: executing...
[cont-init.d] grocy.sh: exited 0.
[cont-init.d] nginx.sh: executing...
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[10:50:37] INFO: Starting PHP-FPM...
[10:50:40] INFO: Starting NGinx....
[04/Oct/2019:10:50:48 -0400] 302 192.168.1.1, 172.30.32.1(172.30.32.2) GET / HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36)
[04/Oct/2019:10:50:48 -0400] 404 192.168.1.1, 172.30.32.1(172.30.32.2) GET /equipment HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36)

Proposed changes

Date Field Bug and Undo Task Error

Problem/Motivation

After completing a task, I checked the "show done" checkbox to re-enable the task. Upon clicking the circle arrow icon to re-enable the task, I was met with a strange error screen. The task was undone as expected, and after refreshing the page it all looked okay, except that the due date had been change to January 1, 1970.

So, I edited the due date field and it wouldn't allow me to save because it couldn't detect that a date was selected.

It turns out there was some sort of erroneous space in front of the date, which when deleted, activated the Save button and all was well.

Reset Grocy, without losing the data for products and recipes

I've started Grocy with the first version and it works great. But updating to 0.2.0 or 0.3.0 doesn;t work. It breaks Grocy to a point where I can't use it anymore. #29 and #25. I suspect it has to do something with a setting underneath.
So I want to start again. New user, new settings, but I do not want to lose the products, stock and recipes.

I can see the data folder deep inside a snapshot of hassio. But I'm not sure what to do to get only the stock, product and recipes while ignoring the rest of the settings.

How can I do that?

Disabling features causes redirect to /equipment

Problem/Motivation

Disabling batteries or equipment features causes redirect to /equipment

Expected behavior

I expect that /stockoverview will be loaded

Actual behavior

When batteries and/or equipment features are disabled, Grocy will redirect to /equipment page. This is especially bad when you disable equipment feature, because it will make Grocy completely unacessible (unless you explicitly write /stockoverview to URL)

Steps to reproduce

  1. Disable any of the mentioned features in hassio addon configuration
  2. Restart Grocy addon
  3. Attempt to access Grocy page

Proposed changes

Do not redirect to disabled pages.

Getting Page not Found after disabling Equipment

Grocy displays a Page Not Found 404 when disabling Equipment in the Config.

Working:

{
  "culture": "nl",
  "currency": "€",
  "features": {
    "batteries": false,
    "calendar": true,
    "chores": false,
    "equipment": true,
    "recipes": true,
    "shoppinglist": true,
    "stock": true,
    "tasks": false
  },
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

Not working:

  "culture": "nl",
  "currency": "€",
  "features": {
    "batteries": false,
    "calendar": true,
    "chores": false,
    "equipment": false,
    "recipes": true,
    "shoppinglist": true,
    "stock": true,
    "tasks": false
  },
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

When going to my grocy page localhost:9192 it is diverted to: localhost:9192/equipment. But I have that disabled, so it's not finding that page.
I want it to go to localhost:9192/stockoverview

Not working with SSL

Problem/Motivation

Grocy installed as an add-on in Home Assistant working in a Raspberry Pi 3 B+ with Raspbian. Enabling SSL and accessing the start page (https://mydomain.duckdns.org:9192) always delivers a 404 with no other info.

The only line in /var/log/nginx/error.log is this:

2019/04/08 09:26:12 [error] 711#711: *1 open() "/var/www/grocy/public/recipes" failed (2: No such file or directory), client: xxx.xxx.xxx.xxx (redacted), server: hassio.local, request: "GET /recipes HTTP/1.1", host: "mydomain.duckdns.org:9192 (redacted)"

Disabling SSL makes the add-on work as expected, but cannot be integrated in HA main screen.

I checked /ssl directory and the certificates are there.

Other add-ons (Configurator, Node-Red, Traccar) work fine with SSL.

Expected behavior

It should work with HTTPS as it works without SSL

Actual behavior

404 Not found.

No other info found on screen or in log files

Steps to reproduce

Just enable SSL in the config file.

Proposed changes

Nothing I can think off. I don't know if there is something else I should do before enabling SSL

Adding new product from Purchase page redirects to wrong URL causing HTTP 404

Problem/Motivation

When I add a new product from the Purchase page, Page Not Foud page is shown, because the URL in redirect looks wrong.
This works and it is correct URL: https://XXX.duckdns.org/api/hassio_ingress/XXX/api/objects/products
But after adding the product and clicking Save, this URL is called: https://XX.duckdns.org/api/hassio_ingress/XXX/https://XXX.duckdns.orgpurchase?createdproduct=Mra%C5%BEen%C3%A1%20zelenina%20-%20pol%C3%A9vkov%C3%A1. It returns 404 and Grocy shows "Page Not Found" page.

Expected behavior

I expect to be returned to previous purchase page after adding new product on purchase page.

Actual behavior

Wrong URL is called, it returns 404 and Grocy shows "Page Not Found" page.

Steps to reproduce

  1. Open Grocy using Hassio Ingress
  2. Go to Purchase page
  3. Write some new Name to Product field and press TAB
  4. Select Add as new product
  5. Fill in the form and press Save

Proposed changes

No

Additional information

This happens only using Hassio Ingress. Using direct access via port works fine.

Portuguese language support

Problem/Motivation

I would like to be able to select Portuguese language.

This language is support by grocy application but the addon options do not allow us to select it.
One could allow the pt_PT and pt_BR.

Proposed changes

Add support to select Portuguese language in the addon options.

Edit dialogs not closing after saving

Problem/Motivation

When editing an ingredient in a recipe and save the ingredient clicking the save button you only see a spinner spinning indefinately. I get this behavior on other places as well. If you close the dialog and save the parent object, in this case the recipe, and then enter the recipe, the objects are saved as expected.

(Why the issue was filed)

Expected behavior

The dialog should close when you click save

(What you expected to happen)

Actual behavior

(What actually happened)

Steps to reproduce

create recipe and add ingredients and click save

(How can someone else make/see it happen)

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Any chance to update the add-on to ️Grocy to v2.5.2?

Hi,

Thanks a lot for putting this together!
I can see most of the work has been done to update this add-on to the latest version of Grocy but these chances haven't been released (possibly due to failed build, back in early October

Is there any chance that this could be fixed up?

Thanks,

Guillaume

Grocy - Image files for products not displaying

Problem/Motivation

After uploading an image file for a product, it displays the 'broken image' indicator in the other areas of the add-on.

(Why the issue was filed)
I tested uploading the same image to the demo of grocy/grocy and the image works as expected.

Expected behavior

(What you expected to happen)
Display the image in the areas instead of the 'broken image' indicator.

Actual behavior

(What actually happened)
Displays 'broken image' indicator that it cannot display the image.

Steps to reproduce

(How can someone else make/see it happen)
Upload an image for a product, then navigate to the stock overview and view the details. The image will not show.

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)
If I right-click and select to "view image in new tab" I get the following output:

Slim Application Error
The application could not run because of the following error:

Details

Type: Error
Message: Call to undefined function Grocy\Controllers\mime_content_type()
File: /var/www/grocy/controllers/FilesApiController.php
Line: 59
Trace

#0 [internal function]: Grocy\Controllers\FilesApiController->ServeFile(Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#1 /var/www/grocy/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(41): call_user_func(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#2 /var/www/grocy/vendor/slim/slim/Slim/Route.php(356): Slim\Handlers\Strategies\RequestResponse->__invoke(Array, Object(Slim\Http\Request), Object(Slim\Http\Response), Array)
#3 /var/www/grocy/middleware/ApiKeyAuthMiddleware.php(78): Slim\Route->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
#4 [internal function]: Grocy\Middleware\ApiKeyAuthMiddleware->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
#5 /var/www/grocy/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Grocy\Middleware\ApiKeyAuthMiddleware), Array)
#6 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
#7 /var/www/grocy/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Slim\Route))
#8 /var/www/grocy/middleware/JsonMiddleware.php(9): Slim\Route->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#9 [internal function]: Grocy\Middleware\JsonMiddleware->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#10 /var/www/grocy/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Array, Array)
#11 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#12 /var/www/grocy/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#13 /var/www/grocy/vendor/tuupola/callable-handler/src/CallableHandler.php(34): Slim\Route->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#14 /var/www/grocy/vendor/tuupola/cors-middleware/src/CorsMiddleware.php(91): Tuupola\Middleware\CallableHandler->handle(Object(Slim\Http\Request))
#15 /var/www/grocy/vendor/tuupola/callable-handler/src/DoublePassTrait.php(30): Tuupola\Middleware\CorsMiddleware->process(Object(Slim\Http\Request), Object(Tuupola\Middleware\CallableHandler))
#16 [internal function]: Tuupola\Middleware\CorsMiddleware->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#17 /var/www/grocy/vendor/slim/slim/Slim/DeferredCallable.php(43): call_user_func_array(Object(Tuupola\Middleware\CorsMiddleware), Array)
#18 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#19 /var/www/grocy/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#20 /var/www/grocy/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\Route->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#21 /var/www/grocy/vendor/slim/slim/Slim/Route.php(334): Slim\Route->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
#22 /var/www/grocy/vendor/slim/slim/Slim/App.php(516): Slim\Route->run(Object(Slim\Http\Request), Object(Slim\Http\Response))
#23 /var/www/grocy/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response))
#24 /var/www/grocy/vendor/slim/slim/Slim/App.php(407): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
#25 /var/www/grocy/vendor/slim/slim/Slim/App.php(315): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response))
#26 /var/www/grocy/app.php(71): Slim\App->run()
#27 /var/www/grocy/public/index.php(3): require_once('/var/www/grocy/...')
#28 {main}

404: Not Found

Problem/Motivation

I want to open the add-on and it's not working.

Expected behavior

Starting NGinx and PHP-FPM then being able to open the Web UI.

Actual behavior

404: Not Found

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] 01-grocy: applying... 
[fix-attrs.d] 01-grocy: exited 0.
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: Grocy
 ERP beyond your fridge! A groceries & household management solution for your home
-----------------------------------------------------------
 Add-on version: 0.3.0
 You are running the latest version of this add-on.
 System: HassOS 2.11  (armv7 / raspberrypi3)
 Home Assistant version: 0.93.0
 Supervisor version: 166
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] grocy.sh: executing... 
[cont-init.d] grocy.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[16:53:34] INFO: Starting PHP-FPM...
[16:53:37] INFO: Starting NGinx....

Steps to reproduce

{
  "culture": "fr",
  "currency": "€",
  "features": {
    "batteries": true,
    "calendar": true,
    "chores": true,
    "equipment": true,
    "recipes": true,
    "shoppinglist": true,
    "stock": true,
    "tasks": true
  },
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

404 error page not found when adding item

Problem/Motivation

When I try to create an item in the grocery list in comes up with 404 page not found.

(Why the issue was filed)

Expected behavior

Not sure page should follow after clicking add item but a page should load

(What you expected to happen)

Actual behavior

(What actually happened)

Steps to reproduce

I added the Hassio addon logged in under admin, went to add item and was presented with 404 after each item was added. Happens internally or externally. I have nginx add on running.

(How can someone else make/see it happen)

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.