Closed henry-bao closed 1 year ago
Also this error pops up whenever I try to save the API key
PermissionError: [Errno 13] Permission denied: '/data/key.txt'
2023-02-14 03:34:19,737 - server - ERROR - Exception on /admin/api/save_key [POST]
Traceback (most recent call last):
File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1822, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1820, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1796, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/server.py", line 157, in save_key_page
file_written = headscale.set_api_key(api_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/headscale.py", line 21, in set_api_key
key_file = open("/data/key.txt", "wb+") # Key file on the filesystem for persistent storage
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/data/key.txt'
Make sure wherever your /data is writable by user 1000:1000
chown -R 1000:1000 /path/to/data/
Oh I just read your docker-compose. You may need to move it out of /root, 1000:1000 user won't have access.
Ah, I was testing on my testing rig and didn't bother to create another user. Will do, thanks!
You shouldn't need to create a new user, just make sure it's owned by the UID/GID 1000:1000 :)
I followed the instructions shown on the website, yet it displays the following when I enter the API key that I just generated from my control server
this is my docker-compose file (sorry for the multiple issues, thanks a bunch!)