Closed geraveoyomama closed 2 months ago
I will check on my side, but it seems that changes aren't saved to the json, I know Flask run primarily in Ram, maybe there's writing permission missing for the JSON?
yeah just tested, it could be that it pulls a new image which contains template storage and overwrites the current storage.
It could be that it doesn't commit changes to disk after changes are made in RAM.
Or I have a misconfiguration...
I am working to see what I can do to fix it, e.g. pass a volume through as /app
for GM to write to.
ok alrighty, since restarting with this command podman run -d --replace --name gift-manager --publish 5000:5000/tcp --annotation run.oci.keep_original_groups=1 --userns keep-id --volume app:/app:Z docker.io/icbest/giftmanager:latest
and running with --volume app:/app:Z
omitted I get one with custom users and one without custom users respectively
got a message!
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1498, in __call__
return self.wsgi_app(environ, start_response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1476, in wsgi_app
response = self.handle_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 1473, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 882, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 880, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/flask/app.py", line 865, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/app.py", line 44, in decorated_function
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/app/app.py", line 579, in add_user
with open('users.json', 'w') as file:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: 'users.json'
after setting rw,z
on the volume and manually editing the users.json to remove the trial users it is showing up correctly
podman run -d --replace --name gift-manager --publish 5000:5000/tcp --volume app:/app:rw,Z docker.io/icbest/giftmanager:latest
is a working command with persistent storage in the podman app
volume
after editing users.json
Thanks, didn't used Podman, but glad you were to solved it.
well regardless if podman is a drop in replacement for docker then I wonder if in the future it will behave in the same way on docker
The issues I run into is that the demo users are deleted and custom users can be added, but when the container is stopped and started the original demo users return and /setup is not accessible on http://127.0.0.1:5000/setup.
When running in a container like so: