mealie-recipes / mealie

Mealie is a self hosted recipe manager and meal planner with a RestAPI backend and a reactive frontend application built in Vue for a pleasant user experience for the whole family. Easily add recipes into your database by providing the url and mealie will automatically import the relevant data or add a family recipe with the UI editor
https://docs.mealie.io
GNU Affero General Public License v3.0
6.68k stars 688 forks source link

Keep getting logged out #2023

Closed antonichoudhuri closed 1 year ago

antonichoudhuri commented 1 year ago

I am the only user on my instance. I use the site on my MBP (chrome), iPad (safari), iPhone (safarI). I notice that I need to log in every single day which is frustrating.

I looked through Chrome Developer Tools and saw that there are no cookies. It seems that my "token" is stored in Local Storage under userSettings.

Is this expected behavior? I would suggest at least a 30 day cookie if not auto-renewing.

michael-genson commented 1 year ago

Should be fixed in nightly: https://github.com/hay-kot/mealie/issues/1077

You should also make sure you set the backend env variable appropriately: https://nightly.mealie.io/documentation/getting-started/installation/backend-config/

antonichoudhuri commented 1 year ago

Thanks for responding. I am using docker:latest so I should get the latest when it is released: hkotel/mealie

I adjusted the token time, here is my docker run cmd:

docker run -d --name='Mealie' --net='bridge' -e TZ="America/Los_Angeles" -e HOST_OS="Unraid" -e 'DB_TYPE'='sqlite' -e 'TOKEN_TIME'='99999' -p '9925:80/tcp' -v '/mnt/user/appdata/mealie':'/app/data':'rw' 'hkotel/mealie:latest'
252b0bf1b6a27250cc82885d2aa074ee419b3

Increased the timeout to ~10 years so I will try for a few days and report back. Since this PWA is using Local Storage I would expect that I need to login on each device at least one more time.

Thanks!

michael-genson commented 1 year ago

Thanks for responding. I am using docker:latest so I should get the latest when it is released: hkotel/mealie

This is actually the old 0.5.x version, which is fairly outdated. You'll want to check out the 1.0.0 beta. Specifically for the token not persisting issue, this was fixed a few days ago in nightly (check out the link above)

I strongly recommend you upgrade to 1.0.0 beta, which is vastly improved over 0.5.x, check out the guide below: https://nightly.mealie.io/documentation/getting-started/migrating-to-mealie-v1/

antonichoudhuri commented 1 year ago

Oh interesing, thanks for responding and letting me know. I had NO idea, lol.

From the docker hub repo should I be using the omni-nightly tag?

Do you have an official docker repo? I wonder why this repo doesn't use latest as intended

antonichoudhuri commented 1 year ago

I tried to get he omni-nightly tag working but it seems it doesn't have a web server running or something I couldn't figure out. I looked at the dockerfile and couldn't make head or tail of why the web page wasn't loading.

hay-kot commented 1 year ago

@antonichoudhuri

You have to expose port 3000 on the omni container, it's missing from the documentation right now.

Do you have an official docker repo? I wonder why this repo doesn't use latest as intended

That's the official docker repo. As for the latest tag, as with most thing it started with good intentions but as beta software in general, I was shipping breaking changes a lot (with migration paths) and people were constantly coming here and sending me messages complaining about how shit of a person I was for writing such terrible software.

So now we use a nightly tag until I'm confident we have a stable-enough release with feature parity.

We've hit the stable part, but we're missing a few features that were in the original implementation.

michael-genson commented 1 year ago

people were constantly coming here and sending me messages complaining about how shit of a person I was for writing such terrible software

https://xkcd.com/1172/

Honestly though that's terrible. Sorry you had (have?) to put up with that. And for such a massive free and open source project that works great. It's also more polished than most open source projects I've worked with at this size

antonichoudhuri commented 1 year ago

Yep, thank you for your work on this project @hay-kot. My family and I love it!

antonichoudhuri commented 1 year ago

You have to expose port 3000 on the omni container, it's missing from the documentation right now.

I tried doing this via the below command and still was not able to access the UI via port 9926 and 9927: docker run -d --name='Mealie-omni' --net='bridge' -e TZ="America/Los_Angeles" -e HOST_OS="Unraid" -e 'DB_TYPE'='sqlite' -p '9926:80/tcp' -p '9927:3000/tcp' -v '/mnt/user/appdata/mealie':'/app/data':'rw' 'hkotel/mealie:omni-nightly'

Any tips on what I am doing wrong? Thanks

antonichoudhuri commented 1 year ago

Actually I was able to hit a UI at port 9927 but got this error client side:

Server error (500 RuntimeError) 
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.

Here is the server log:

ERROR Cannot find module 'vuetify/src/locale' from '/app/frontend'

at Function.resolveSync [as sync] (node_modules/resolve/lib/sync.js:102:15)
at node_modules/vue-server-renderer/build.prod.js:1:77905
at Object.<anonymous> (webpack:/external "vuetify/src/locale":1:0)
at __webpack_require__ (webpack/bootstrap:25:0)
at Module.<anonymous> (server.js:26791:15)
at __webpack_require__ (webpack/bootstrap:25:0)
at Object.<anonymous> (server.js:22380:18)
at __webpack_require__ (webpack/bootstrap:25:0)
at server.js:118:18
at Object.<anonymous> (server.js:121:10)
michael-genson commented 1 year ago

That's a bug in the latest version of nightly. A fixed image is already being created. Try again in an hour with the latest image

On the bright side, that probably means you fixed the issue you were having before!