thelounge / thelounge-docker

🐳 ‎ ‎Docker image for The Lounge, a self-hosted web IRC client
https://ghcr.io/thelounge/thelounge
MIT License
306 stars 73 forks source link

Correct director to mount volume #55

Closed regner closed 6 years ago

regner commented 6 years ago

o/

First of all thanks for an awesome project!

I just spun up an instance of thelounge in my kubernetes cluster using thelounge/thelounge:3.0.0-pre.7. I then also mount a volume to /home/thelounge/data

When I run the container and exec into the container things are... not what I would expect. Here is the output from running thelounge in the container:

root@lounge-0:/var/opt/thelounge# thelounge

  Usage: thelounge [options] [command]

  Options:

    -v, --version             output the version number
    -c, --config <key=value>  override entries of the configuration file, must be specified for each entry that needs to be overriden
    -h, --help                output usage information

  Commands:

    start                     Start the server
    list                      List all users
    add <name>                Add a new user
    remove <name>             Remove an existing user
    reset <name>              Reset user password
    edit <name>               Edit user file located at /var/opt/thelounge/users/<name>.json.
    install <package>         Install a theme or a package
    uninstall <package>       Uninstall a theme or a package
    upgrade [packages...]     Upgrade installed themes and packages to their latest versions.

  Environment variable:

    THELOUNGE_HOME   Path for all configuration files and folders. Defaults to /root/.thelounge.

Specifically notice that the edit command lists files located at /var/opt/thelounge/users/<name>.json., which where I am mounting the volume.

root@lounge-0:/var/opt/thelounge# ls -lah
total 32K
drwx------ 4 root root 4.0K Jul  5 07:18 .
drwxr-xr-x 1 root root 4.0K Jun 21 12:52 ..
-rw-r--r-- 1 root root  11K Jul  4 22:47 config.js
drwxr-xr-x 2 root root 4.0K Jul  5 07:18 logs
drwxr-xr-x 2 root root 4.0K Jul  5 07:18 users
-rw-r--r-- 1 root root  169 Jul  4 22:47 vapid.json

So yup, files are definitely there! And just for confirmation, here is the location that the README says I should be mounting things to:

root@lounge-0:/var/opt/thelounge# ls -lah
total 32K
drwx------ 4 root root 4.0K Jul  5 07:18 .
drwxr-xr-x 1 root root 4.0K Jun 21 12:52 ..
-rw-r--r-- 1 root root  11K Jul  4 22:47 config.js
drwxr-xr-x 2 root root 4.0K Jul  5 07:18 logs
drwxr-xr-x 2 root root 4.0K Jul  5 07:18 users
-rw-r--r-- 1 root root  169 Jul  4 22:47 vapid.json

Totally empty... :(

So my question is: Did the location which data is stored change recently and the docs just haven't been updated? Did something go wrong and cause thelounge to fall back to using /var?

If it helps and you know kube configs, here is the full satefulset config I am using:

apiVersion: apps/v1beta2
kind: StatefulSet
metadata:
  name: lounge
spec:
  replicas: 1
  serviceName: lounge
  podManagementPolicy: Parallel
  template:
    spec:
      containers:
      - name: lounge
        image: thelounge/thelounge:3.0.0-pre.7
        imagePullPolicy: IfNotPresent
        ports:
        - name: http
          containerPort: 9000
        resources:
          limits:
            cpu: 80m
            memory: 256Mi
          requests:
            cpu: 5m
            memory: 64Mi
        volumeMounts:
        - name: lounge-data
          mountPath: /home/thelounge/data
  volumeClaimTemplates:
  - metadata:
      name: lounge-data
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 10Gi
      storageClassName: standard

Thanks in advance for your help on this.

regner commented 6 years ago

Looks like it changed in version 3 and the docs are outdated: https://github.com/thelounge/thelounge-docker/commit/3536660d6f75064415ec76deab8a95fb57ccf703#diff-3254677a7917c6c01f55212f86c57fbf

regner commented 6 years ago

I can see in the diff for that commit changes to the readme that fix this documentation, however those changes are not reflected on Docker Hub: https://hub.docker.com/r/thelounge/thelounge/

williamboman commented 6 years ago

I can see in the diff for that commit changes to the readme that fix this documentation, however those changes are not reflected on Docker Hub: https://hub.docker.com/r/thelounge/thelounge/

Hi, sorry for the confusion. The docs at DockerHub used to be correct, but automated builds seems to automatically update the README at DockerHub as well so it has inadvertently been replaced since then. I'll look into this later today

regner commented 6 years ago

All good! Thanks for looking into it. :)

williamboman commented 6 years ago

Fixed in 607cfba6432e0155c7f4796691b15acafba34b4c