casdoor / casdoor

An open-source UI-first Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML, CAS, LDAP, SCIM, WebAuthn, TOTP, MFA, Face ID, RADIUS, Google Workspace, Active Directory and Kerberos
https://casdoor.org
Apache License 2.0
9.2k stars 1.09k forks source link

Can‘t use the Local File System provider to store uploaded files #2987

Closed seeleclover closed 2 weeks ago

seeleclover commented 3 weeks ago

Bugs:

I use Docker to deploy Casdoor. After I started the container and added the Local File System provider to the casdoor, I encountered the following errors when uploading resources or avatar images:

Casdoor fails to create folder: "/files/resource/built-in/admin" for local file system storage provider: mkdir /files/resource: permission denied. Make sure Casdoor process has correct permission to create/access it, or you can create it manually in advance

screenshot

Solution:

Later, I found a solution to this problem:

  1. Enter the container to create /files directory
  2. Assign 766 permissions to /files directory
  3. Modify the user and group to casdoor for /files directory

Considering that a considerable number of users still use the Local File System provider for casdoors, can these operations be written into Dockerfile to build images? For example:

RUN mkdir -p /files \
    && chmod -R 766 /files \
    && chown casdoor:casdoor /files
casbin-bot commented 3 weeks ago

@tangyang9464 @JalinWang @imp2002

casbin-bot commented 2 weeks ago

:tada: This issue has been resolved in version 1.627.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

dacongda commented 2 weeks ago

mount /files dir to the host system manually may be a better solution