wger-project / docker

Production...ish docker-compose image for wger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using wger on UNRAID Server -> Permission denied

UNRA1DUser opened this issue · comments

Hi,

I installed the "wger-unraid" App on my Unraid Server. Selected a postgresql15 DB and only changed the Network Type from br0 to Bridge.

Here is the Unraid Docker Template.

<?xml version="1.0"?> <Container version="2"> <Name>wger-unraid</Name> <Repository>wger/devel:latest</Repository> <Registry>https://registry.hub.docker.com/r/wger/devel</Registry> <Network>bridge</Network> <MyIP/> <Shell>sh</Shell> <Privileged>false</Privileged> <Support/> <Project>https://wger.de/software/features</Project> <Overview>wger (&#x2C8;v&#x25B;&#x261;&#x250;) Workout Manager is a free, open source web&#xD; application that help you manage your personal workouts, weight and diet plans and can also&#xD; be used as a simple gym management utility. It offers a REST API as well, for easy&#xD; integration with other projects and tools.</Overview> <Category>Productivity: Other:</Category> <WebUI>http://[IP]:[PORT:8000]</WebUI> <TemplateURL>https://raw.githubusercontent.com/wger-project/unraid-templates/master/wger.xml</TemplateURL> <Icon>https://raw.githubusercontent.com/wger-project/wger/master/wger/core/static/images/logos/logo.png</Icon> <ExtraParams/> <PostArgs/> <CPUset/> <DateInstalled>1709712937</DateInstalled> <DonateText/> <DonateLink/> <Requires/> <Config Name="PORT" Target="8000" Default="8000" Mode="tcp" Description="WebUI port: 8000" Type="Port" Display="always" Required="true" Mask="false">8555</Config> <Config Name="DJANGO_DB_ENGINE" Target="DJANGO_DB_ENGINE" Default="django.db.backends.postgresql" Mode="" Description="Database Engine" Type="Variable" Display="always" Required="true" Mask="false">django.db.backends.postgresql</Config> <Config Name="DJANGO_DB_DATABASE" Target="DJANGO_DB_DATABASE" Default="wger" Mode="" Description="Database Name" Type="Variable" Display="always" Required="true" Mask="false">wger</Config> <Config Name="DJANGO_DB_USER" Target="DJANGO_DB_USER" Default="wger" Mode="" Description="Database User" Type="Variable" Display="always" Required="true" Mask="false">wger</Config> <Config Name="DJANGO_DB_PASSWORD" Target="DJANGO_DB_PASSWORD" Default="" Mode="" Description="Database password" Type="Variable" Display="always" Required="false" Mask="true">wger</Config> <Config Name="DJANGO_DB_HOST" Target="DJANGO_DB_HOST" Default="" Mode="" Description="Database host" Type="Variable" Display="always" Required="true" Mask="false">192.168.178.10</Config> <Config Name="DJANGO_DB_PORT" Target="DJANGO_DB_PORT" Default="5432" Mode="" Description="Database port" Type="Variable" Display="always" Required="true" Mask="false">5432</Config> <Config Name="TIME_ZONE" Target="TIME_ZONE" Default="US/Central" Mode="" Description="Time Zone" Type="Variable" Display="always" Required="true" Mask="false">Europe/Berlin</Config> <Config Name="SITE_URL" Target="SITE_URL" Default="" Mode="" Description="SITE_URL: ex. http://www.my-local-gym.com" Type="Variable" Display="always" Required="true" Mask="false">http://wger.vaerstaerk.de</Config> <Config Name="DJANGO_MEDIA_ROOT" Target="/home/wger/media" Default="" Mode="rw" Description="Path to uploaded files" Type="Path" Display="always" Required="true" Mask="false">/mnt/cache/appdata/wger/media</Config> <Config Name="DJANGO_STATIC_ROOT" Target="/home/wger/static" Default="" Mode="rw" Description="DJANGO_STATIC_ROOT" Type="Path" Display="always" Required="true" Mask="false">/mnt/cache/appdata/wger/static</Config> <Config Name="ALLOW_REGISTRATION" Target="ALLOW_REGISTRATION" Default="True" Mode="" Description="Default: True" Type="Variable" Display="always" Required="false" Mask="false">True</Config> <Config Name="ALLOW_GUEST_USERS" Target="ALLOW_GUEST_USERS" Default="True" Mode="" Description="Default: True" Type="Variable" Display="always" Required="false" Mask="false">True</Config> <Config Name="SECRET_KEY" Target="SECRET_KEY" Default="" Mode="" Description="Must be 50 characters" Type="Variable" Display="always" Required="true" Mask="false">5^613=kj0wpq_2wl*yw$vs&amp;v*3omg4w^j8xl4*j9-n7*95i#fc</Config> <Config Name="ENABLE_EMAIL" Target="ENABLE_EMAIL" Default="False" Mode="" Description="Enable SMTP email setting: True/False; Default False" Type="Variable" Display="always" Required="false" Mask="false">False</Config> <Config Name="EMAIL_HOST" Target="EMAIL_HOST" Default="" Mode="" Description="EMAIL_HOST" Type="Variable" Display="always" Required="false" Mask="false"/> <Config Name="EMAIL_PORT" Target="EMAIL_PORT" Default="" Mode="" Description="EMAIL_PORT" Type="Variable" Display="always" Required="false" Mask="false"/> <Config Name="EMAIL_HOST_USER" Target="EMAIL_HOST_USER" Default="" Mode="" Description="EMAIL_HOST_USER" Type="Variable" Display="always" Required="false" Mask="false"/> <Config Name="EMAIL_HOST_PASSWORD" Target="EMAIL_HOST_PASSWORD" Default="" Mode="" Description="EMAIL_HOST_PASSWORD" Type="Variable" Display="always" Required="false" Mask="true"/> <Config Name="EMAIL_USE_TLS" Target="EMAIL_USE_TLS" Default="False" Mode="" Description="EMAIL_USE_TLS: True/False; Default: False" Type="Variable" Display="always" Required="false" Mask="false">True</Config> <Config Name="EMAIL_USE_SSL" Target="EMAIL_USE_SSL" Default="False" Mode="" Description="EMAIL_USE_SSL: True/False; Default: False" Type="Variable" Display="always" Required="false" Mask="false">False</Config> <Config Name="FROM_EMAIL" Target="FROM_EMAIL" Default="" Mode="" Description="FROM_EMAIL" Type="Variable" Display="always" Required="false" Mask="false"/> <Config Name="RECAPTCHA_PUBLIC_KEY" Target="RECAPTCHA_PUBLIC_KEY" Default="" Mode="" Description="RECAPTCHA_PUBLIC_KEY" Type="Variable" Display="advanced" Required="false" Mask="false"/> <Config Name="RECAPTCHA_PRIVATE_KEY" Target="RECAPTCHA_PRIVATE_KEY" Default="" Mode="" Description="RECAPTCHA_PRIVATE_KEY" Type="Variable" Display="advanced" Required="false" Mask="false"/> <Config Name="NOCAPTCHA" Target="NOCAPTCHA" Default="false" Mode="" Description="NOCAPTCHA: true/false&#13;&#10;Default: false" Type="Variable" Display="advanced" Required="false" Mask="false">False</Config> <Config Name="DJANGO_CACHE_BACKEND" Target="DJANGO_CACHE_BACKEND" Default="" Mode="" Description="Leave blank for no cache. Otherwise use this example for redis: django_redis.cache.RedisCache&#13;&#10;" Type="Variable" Display="advanced-hide" Required="false" Mask="false"/> <Config Name="DJANGO_CACHE_TIMEOUT" Target="DJANGO_CACHE_TIMEOUT" Default="" Mode="" Description="in seconds" Type="Variable" Display="advanced-hide" Required="false" Mask="false"/> <Config Name="DJANGO_CACHE_LOCATION" Target="DJANGO_CACHE_LOCATION" Default="" Mode="" Description="Ex: redis://127.0.0.1:6379/1" Type="Variable" Display="advanced-hide" Required="false" Mask="false"/> <Config Name="DJANGO_CACHE_CLIENT_CLASS" Target="DJANGO_CACHE_CLIENT_CLASS" Default="django_redis.client.DefaultClient" Mode="" Description="" Type="Variable" Display="advanced-hide" Required="false" Mask="false">django_redis.client.DefaultClient</Config> </Container>

As I can see the "/mnt/cache/appdata/wger/static" and the "/mnt/cache/appdata/wger/media" folder are empty and I just get a Permission denied log entry if I am trying to open the Webpage ""

ERROR 2024-03-06 09:34:09,091 log Internal Server Error: /de/software/features Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/django/core/handlers/exception.py", line 55, in inner response = get_response(request) File "/usr/local/lib/python3.10/dist-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/wger/src/wger/software/views.py", line 67, in features return render(request, 'features.html', context) File "/usr/local/lib/python3.10/dist-packages/django/shortcuts.py", line 24, in render content = loader.render_to_string(template_name, context, request, using=using) File "/usr/local/lib/python3.10/dist-packages/django/template/loader.py", line 62, in render_to_string return template.render(context, request) File "/usr/local/lib/python3.10/dist-packages/django/template/backends/django.py", line 61, in render return self.template.render(context) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 175, in render return self._render(context) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 167, in _render return self.nodelist.render(context) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 1005, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 1005, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 966, in render_annotated return self.render(context) File "/usr/local/lib/python3.10/dist-packages/django/template/loader_tags.py", line 157, in render return compiled_parent._render(context) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 167, in _render return self.nodelist.render(context) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 1005, in render return SafeString("".join([node.render_annotated(context) for node in self])) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 1005, in <listcomp> return SafeString("".join([node.render_annotated(context) for node in self])) File "/usr/local/lib/python3.10/dist-packages/django/template/base.py", line 966, in render_annotated return self.render(context) File "/usr/local/lib/python3.10/dist-packages/compressor/templatetags/compress.py", line 160, in render return self.render_compressed( File "/usr/local/lib/python3.10/dist-packages/compressor/templatetags/compress.py", line 131, in render_compressed rendered_output = compressor.output(mode, forced=forced, basename=file_basename) File "/usr/local/lib/python3.10/dist-packages/compressor/css.py", line 55, in output ret.append(subnode.output(*args, **kwargs)) File "/usr/local/lib/python3.10/dist-packages/compressor/css.py", line 57, in output return super().output(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/compressor/base.py", line 374, in output return self.handle_output(mode, filtered_output, forced, basename) File "/usr/local/lib/python3.10/dist-packages/compressor/base.py", line 382, in handle_output return output_func(mode, content, forced, basename) File "/usr/local/lib/python3.10/dist-packages/compressor/base.py", line 393, in output_file self.storage.save(new_filepath, ContentFile(content.encode(self.charset))) File "/usr/local/lib/python3.10/dist-packages/compressor/storage.py", line 39, in save temp_filename = super().save(filename, content) File "/usr/local/lib/python3.10/dist-packages/django/core/files/storage/base.py", line 38, in save name = self._save(name, content) File "/usr/local/lib/python3.10/dist-packages/django/core/files/storage/filesystem.py", line 87, in _save os.makedirs(directory, exist_ok=True) File "/usr/lib/python3.10/os.py", line 215, in makedirs makedirs(head, exist_ok=exist_ok) File "/usr/lib/python3.10/os.py", line 225, in makedirs mkdir(name, mode) PermissionError: [Errno 13] Permission denied: '/home/wger/static/CACHE' [06/Mar/2024 09:34:09] "GET /de/software/features HTTP/1.1" 500 2864 WARNING 2024-03-06 09:34:09,174 log Not Found: /static/yarn/components-font-awesome/css/all.css [06/Mar/2024 09:34:09] "GET /static/yarn/components-font-awesome/css/all.css HTTP/1.1" 404 2885 WARNING 2024-03-06 09:34:09,178 log Not Found: /static/css/workout-manager.css [06/Mar/2024 09:34:09] "GET /static/css/workout-manager.css HTTP/1.1" 404 2885 WARNING 2024-03-06 09:34:09,180 log Not Found: /static/yarn/bootstrap-compiled.css [06/Mar/2024 09:34:09] "GET /static/yarn/bootstrap-compiled.css HTTP/1.1" 404 2885 WARNING 2024-03-06 09:34:09,182 log Not Found: /static/css/bootstrap-custom.css [06/Mar/2024 09:34:09] "GET /static/css/bootstrap-custom.css HTTP/1.1" 404 2885

If I set the Permission on those folder to
image

Than I am able to open the Website but I can´t see any pictures.

image

Has anyone been able to get wger to run on Unraid? I really want to use it. Can anybody maybe help me, please? I can also create a new Template if needed or add any value / port / etc.

Thanks!

Also having the same issue. Would love to get it up and working. Let me know if you've gotten any further with this.

Credit to this thread for the answer. Setting DJANGO_DEBUG=True as one of the env variables fixes the issue for me. Not sure if it matters but I changed my repo to wger/server:latest.

While that is a workaround, the development server is not meant to be used in production and has some memory leaks.

We should definitely fix the config file itself

+1 on this. Got the container up and running on Unraid, but images aren't loading. The DJANGO_DEBUG=True env variable does indeed fix the issue.

Yes It´s working! I used the Repository "wger/server:latest" and added the Key "DJANGO_DEBUG" with Value "True"

Thanks @ALL