wikmd icon indicating copy to clipboard operation
wikmd copied to clipboard

Temp created as root

Open l-maciej opened this issue 3 years ago • 4 comments

Hi

I'm using docker-compose to start service :

version: "2.1"
services:
  wikmd:
    image: linbreux/wikmd:latest
    container_name: wikmd
    environment:
      - PUID=1001
      - PGID=1001
      - TZ=Europe/Warsaw
      - WIKI_DIRECTORY=/pages
      - HOMEPAGE=homepage.md
      - HOMEPAGE_TITLE=Homepage
      - SYNCH_WITH_REMOTE=1
      - REMOTE_URL="XXXXX"
      - GIT_USER=wikmdSYnc
      - [email protected]
      - MAIN_BRANCH_NAME=workingcopy
    volumes:
    - pages:/pages
    ports:
      - 5000:5000
    restart: unless-stopped
volumes:
  pages:

After docker-compose up two errors are showing up:

image

/wiki is still used as default or just wiki tries to empty out folder. Application is trying to move data from /wiki it to non-existing temp folder not permitted to user with GID 1001 (non-root user on host machine) -> it causes loads of logs and machine load

/pages is created and correct permission are added

l-maciej avatar Jul 09 '22 06:07 l-maciej

Alright thanks for noticing and the detailed instructions. I think the is because the wiki folder is hardcoded here and this should be an environment variable.

I'll fix it asap. Does it work when you do not specify the directory?

Linbreux avatar Jul 09 '22 08:07 Linbreux

version: "2.1"
services:
  wikmd:
    image: linbreux/wikmd:latest
    container_name: wikmd
    environment:
      - PUID=1001
      - PGID=1001
      - TZ=Europe/Warsaw
      - WIKI_DIRECTORY=/pages
      - HOMEPAGE=homepage.md
      - HOMEPAGE_TITLE=Homepage
      - SYNCH_WITH_REMOTE=1
      - REMOTE_URL="XXXXX"
      - GIT_USER=wikmdSYnc
      - [email protected]
      - MAIN_BRANCH_NAME=workingcopy
    volumes:
    - pages:/pages
    ports:
      - 5000:5000
    restart: unless-stopped
volumes:
  pages:

Causes same issue with moving data to temp folder

image

Maybe different init method when using sync with remote is enabled - just remove all examples since data will be pulled from git anyway

l-maciej avatar Jul 09 '22 08:07 l-maciej

Hi @l-maciej,

Why don't you simply mount your volume under /wiki (and remove WIKI_DIRECTORY)?

...
volumes:
    - pages:/wiki
...

As for the permission issue in /tmp, a possible fix could be to change the permission, e.g. changing this line as

  chown abc:abc /var/log/wikmd.log /tmp

Without having tested it I'm not sure if it would cause other issues tho.

artivis avatar Jul 21 '22 20:07 artivis

Hi @artivis
Mounted data folder to /wiki and application stared without issues and excessive logging.

l-maciej avatar Jul 22 '22 11:07 l-maciej