Perlite icon indicating copy to clipboard operation
Perlite copied to clipboard

can someone help me to figure out the no-content problem?

Open Tariya321 opened this issue 3 months ago • 15 comments

I have configure the compose file and config file, but the web doesn't show any of my notes! The mount style is

    volumes:
      - /my_nas_absolute_path/vault_name:/var/www/perlite/ForHigh:ro

and the notes_path is set as "ForHigh".

Image

Moreover, I docker into the perlite, and mounted files are readable, but why the web shows nothing?

Tariya321 avatar Oct 03 '25 17:10 Tariya321

Does it show the Demo, when you set NOTES_PATH=Demo ?

secure-77 avatar Oct 11 '25 23:10 secure-77

Does it show the Demo, when you set NOTES_PATH=Demo ?

Yes, for this item, it behaves normally

Image

Tariya321 avatar Oct 12 '25 04:10 Tariya321

Hmm, it should show some content and sub menus, so it's not working. Is there any error output when you start docker compose (without -d) and visit the page? Also check the browser console for errors.

secure-77 avatar Oct 12 '25 06:10 secure-77

I have got the same issue, but resloved it.

environment:
      - NOTES_PATH=**AAAAA**
volumes:
      - /my_nas_absolute_path/**AAAAA**:/var/www/perlite/**AAAAA**:ro

These 3 name must be the same, otherwise it won't work.

Preston2jager avatar Oct 14 '25 10:10 Preston2jager

actually the left one of the volume can be different

  • /my_nas_absolute_path/whatever:/var/www/perlite/AAAAA:ro

but yes, the other two must match, please reopen the issue if you still have a problem or write in the discord channel

secure-77 avatar Nov 06 '25 12:11 secure-77

My compose file is:

services:
  perlite:
    image: sec77/perlite:latest
    container_name: perlite
    restart: unless-stopped
    environment:
      - NOTES_PATH=ForHigh
      - HIDE_FOLDERS=docs,private,trash
      - HIDDEN_FILE_ACCESS=false
      - LINE_BREAKS=true
      - ABSOLUTE_PATHS=true
      - ALLOWED_FILE_LINK_TYPES=pdf
      - DISABLE_POP_HOVER=false
      - SHOW_TOC=true
      - SHOW_LOCAL_GRAPH=true
      - HOME_FILE=README
      - FONT_SIZE=15
      - HTML_SAFE_MODE=true
      - TEMP_PATH=/tmp
      - SITE_TITLE=ForHigh
      - SITE_TYPE=article
      - SITE_URL=
      - SITE_IMAGE=
      - SITE_DESC=
      - SITE_NAME=Perlite
      - SITE_TWITTER=https://x.com/
      - SITE_LOGO=perlite.svg
      - SITE_HOMEPAGE=https://perlite.secure77.io/
      - SITE_GITHUB=https://github.com/
    volumes:
      - /volume4/hot_data/docs/ob_vaults/ForHigh:/var/www/perlite/ForHigh:ro
  web:
    image: nginx:stable
    container_name: perlite_web
    restart: unless-stopped
    ports:
      - 8082:80
    volumes:
      - ./web/config/perlite.conf:/etc/nginx/conf.d/default.conf:ro
    volumes_from: 
      - perlite       
    depends_on:
      - perlite

The names have been modified to be the same as you mentioned above However, it still doesn't work for me

and when I visit the web, the log shows sth below:

perlite      | 172.20.0.3 -  06/Nov/2025:14:28:25 +0000 "GET /index.php" 200
perlite      | 172.20.0.3 -  06/Nov/2025:14:28:25 +0000 "GET /content.php" 200
perlite      | NOTICE: PHP message: PHP Warning:  file_get_contents(ForHigh/README.md): Failed to open stream: Permission denied in /var/www/perlite/content.php on line 385

actually the left one of the volume can be different

  • /my_nas_absolute_path/whatever:/var/www/perlite/AAAAA:ro

but yes, the other two must match, please reopen the issue if you still have a problem or write in the discord channel

Tariya321 avatar Nov 06 '25 14:11 Tariya321

ah I see, it seems the problem is based on the permissions of your files between your host and the docker container.

Can you please try to set the permissions of your vault to world readable? This describes how you can set the permissions of our vault to the same Id as the container is running: https://stackoverflow.com/a/40510068

you can also set the user and group ID in the compose file

user: "${UID}:${GID}"

replace the variables with the user / group ID which has read permissions to your files, but first I would try to set the permissions to world readable and check if this was really the problem

secure-77 avatar Nov 06 '25 15:11 secure-77

Sorry, I try to use the solutions you have given, but it seems didn't work me. To save our time, I paste my config and file perimission.

my host id

[zhilianh@DXP4800-82E9 perlite]# id
uid=1000(zhilianh) gid=10(admin) groups=10(admin),100(users),121(docker),133(ughomeusers)

docker id

[zhilianh@DXP4800-82E9 perlite]# docker exec 9a5ae5f7a8ae id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)

docker folder permission

[zhilianh@DXP4800-82E9 perlite]# ls -la
total 20
drwxrwxrwx  3 root admin 4096 Oct  4 00:50 .
drwxrwxrwx 13 root root  4096 Nov  5 16:22 ..
-rwxrwxrwx  1 root root  1292 Nov  7 13:57 docker-compose.yaml
drwxrwxrwx  3 root admin 4096 Oct  4 00:47 web

docker compose

services:
  perlite:
    image: sec77/perlite:latest
    container_name: perlite
    restart: unless-stopped
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Shanghai
      - NOTES_PATH=ForHigh
      - HIDE_FOLDERS=docs,private,trash
      - HIDDEN_FILE_ACCESS=false
      - LINE_BREAKS=true
      - ABSOLUTE_PATHS=true
      - ALLOWED_FILE_LINK_TYPES=pdf
      - DISABLE_POP_HOVER=false
      - SHOW_TOC=true
      - SHOW_LOCAL_GRAPH=true
      - HOME_FILE=README
      - FONT_SIZE=15
      - HTML_SAFE_MODE=true
      - TEMP_PATH=/tmp
      - SITE_TITLE=ForHigh
      - SITE_TYPE=article
      - SITE_URL=
      - SITE_IMAGE=
      - SITE_DESC=
      - SITE_NAME=Perlite
      - SITE_TWITTER=https://x.com/
      - SITE_LOGO=perlite.svg
      - SITE_HOMEPAGE=https://perlite.secure77.io/
      - SITE_GITHUB=https://github.com/
    volumes:
      - /volume4/hot_data/docs/ob_vaults/ForHigh:/var/www/perlite/ForHigh:ro

  web:
    image: nginx:stable
    container_name: perlite_web
    restart: unless-stopped
    ports:
      - 8082:80
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Shanghai
    volumes:
      - ./web/config/perlite.conf:/etc/nginx/conf.d/default.conf:ro
    volumes_from: 
      - perlite       
    depends_on:
      - perlite

Tariya321 avatar Nov 07 '25 06:11 Tariya321

ok, thats strange, can you please check the permissions of your vault inside the container

docker exec 9a5ae5f7a8ae ls -la /var/www/perlite/

and

docker exec 9a5ae5f7a8ae ls -la /var/www/perlite/ForHigh/README

and also the permission locally

ls -la /volume4/hot_data/docs/ob_vaults/ForHigh/README

and

ls -la /volume4/hot_data/docs/ob_vaults/

Thanks

secure-77 avatar Nov 07 '25 10:11 secure-77

FYI, there is no README but README.md

[zhilianh@DXP4800-82E9 perlite]# docker exec  48ff07945d3f ls -la /var/www/perlite
total 200
drwxr-xr-x    7 root     root          4096 Nov  7 05:51 .
drwxr-xr-x    1 root     root          4096 Apr 27  2025 ..
drwxr-xr-x    2 root     root          4096 Nov  7 05:51 .js
drwxr-xr-x    2 root     root          4096 Nov  7 05:51 .src
drwxr-xr-x    4 root     root          4096 Nov  7 05:51 .styles
drwxrwxrwx   12 1000     wheel         4096 Nov  6 13:28 ForHigh
-rw-r--r--    1 root     root         11452 Apr 27  2025 content.php
-rw-r--r--    1 root     root         15406 Apr 27  2025 favicon.ico
-rw-r--r--    1 root     root         20982 Apr 27  2025 helper.php
-rw-r--r--    1 root     root         79997 Apr 27  2025 index.php
-rw-r--r--    1 root     root         17299 Apr 27  2025 logo.svg
-rw-r--r--    1 root     root         17299 Apr 27  2025 perlite.svg
drwxr-xr-x    4 root     root          4096 Nov  7 05:51 vendor

[zhilianh@DXP4800-82E9 perlite]# docker exec  48ff07945d3f ls -la /var/www/perlite/ForHigh/README.md
-rwxrwxrwx    1 1000     wheel         1011 Oct  3 17:10 /var/www/perlite/ForHigh/README.md


[zhilianh@DXP4800-82E9 perlite]# ls -la /volume4/hot_data/docs/ob_vaults/ForHigh/README.md
-rwxrwxrwx 1 zhilianh admin 1011 Oct  4 01:10 /volume4/hot_data/docs/ob_vaults/ForHigh/README.md

[zhilianh@DXP4800-82E9 perlite]# ls -la /volume4/hot_data/docs/ob_vaults/
total 24
drwxrwxrwx  3 zhilianh admin 4096 Sep  8 21:13 .
drwxrwxrwx  4 root     root  4096 Oct 29 12:42 ..
-rwxrwxrwx  1 zhilianh admin 6148 Apr 13  2025 .DS_Store
drwxrwxrwx 12 zhilianh admin 4096 Nov  6 21:28 ForHigh

BRs

Tariya321 avatar Nov 07 '25 11:11 Tariya321

ok thanks and you are sure the error is still the same?

perlite      | NOTICE: PHP message: PHP Warning:  file_get_contents(ForHigh/README.md): Failed to open stream: Permission denied in /var/www/perlite/content.php on line 385

secure-77 avatar Nov 07 '25 11:11 secure-77

Yes the error still exists.

Tariya321 avatar Nov 07 '25 16:11 Tariya321

I have also encountered a situation like yours. My solution was to enter and check the user and group IDs of the file, and then add your user: "${UID}:${GID}" under perlite: and restart.

like :

services:
  your-app: 
    image: your-image:tag
    user: "${UID}:${GID}" 

LQF376 avatar Nov 08 '25 15:11 LQF376

Really no idea why its not working but when you say the Demo folder was working then maybe its related to your mount /volume4/hot_data/

I would try to copy the vault to the same volume where you are starting perlite from and try again if this is the reason

secure-77 avatar Nov 08 '25 23:11 secure-77

I have also encountered a situation like yours. My solution was to enter and check the user and group IDs of the file, and then add your user: "${UID}:${GID}" under perlite: and restart.

like :

services:
  your-app: 
    image: your-image:tag
    user: "${UID}:${GID}" 

oh my, it still doesn't work for me

Tariya321 avatar Nov 09 '25 13:11 Tariya321