thelounge-docker icon indicating copy to clipboard operation
thelounge-docker copied to clipboard

Expose Public Themes Folder

Open ghost opened this issue 3 years ago • 8 comments

We were chatting around in #thelounge some today and came to find that the path for the public themes folder is @ /usr/local/share/.config/yarn/global/node_modules/thelounge/public/themes/ inside the container. Would be nice if this was exposed in a way for it to be mounted with normal perms for copying custom themes in.

Though in brief testing with copying CSS files into the container (docker cp), I didn't really have any luck getting those themes to appear in thelounge, even if I set the owner to root and permissions to 644 like morning.css and default.css. I suspect that's because thelounge requires restarts to see new files in here (restart would of course destroy the file copied in)? I don't know as I don't have a non-Docker lounge to play with...

ghost avatar Mar 05 '21 23:03 ghost

We were chatting around in #thelounge some today and came to find that the path for the public themes folder is @ /usr/local/share/.config/yarn/global/node_modules/thelounge/public/themes/ inside the container. Would be nice if this was exposed in a way for it to be mounted with normal perms for copying custom themes in.

Though in brief testing with copying CSS files into the container (docker cp), I didn't really have any luck getting those themes to appear in thelounge, even if I set the owner to root and permissions to 644 like morning.css and default.css. I suspect that's because thelounge requires restarts to see new files in here (restart would of course destroy the file copied in)? I don't know as I don't have a non-Docker lounge to play with...

You could add the file in like this in a compose file, which would persist across restarts:

    volumes:
      - $DOCKERDIR/thelounge/themes/custom_theme.css:/usr/local/share/.config/yarn/global/node_modules/thelounge/public/themes/custom_theme.css

jathek avatar Sep 12 '21 20:09 jathek

I tried ./thelounge-themes:/usr/local/share/.config/yarn/global/node_modules/thelounge/public/themes previously (as an example). Perhaps trying to mount the entire folder was where I was going wrong when testing this. Been many months tho, hard to say what all was tested at the time... 😅 I'll have to take another look Soon™.

ghost avatar Sep 12 '21 23:09 ghost

@xnaas I believe I've ran into an issue when using ./foldername instead of the full path leading to funkiness in Docker. I don't know why or what was the issue, but it would never allow to read what was there. Once I put the full path into the folder, it would work correctly. I'll test this out on my end as I was hoping to get some themes in to TheLounge as well from the Docker side of things.

I think you scratch all that I said above, I was reading it totally differently, but nearcatch gave me an idea to try out.

JoeArcher007 avatar Oct 26 '21 20:10 JoeArcher007

Aren't themes installed in thelounge's package path, which defaults to THELOUNGE_HOME + "/packages". In the docker container that'd be /var/opt/thelounge/packages. If you're using a data dir you've probably mounted it on /var/opt/thelounge, per recommendation in the docs. Or am I missing something?

williamboman avatar Nov 04 '21 20:11 williamboman

I'll have to take another look Soon™.

Soon™ will come Someday™. Fret not.

Or am I missing something?

Yes. We're not talking about installed themes. We're talking about manually creating your own theme (not dealing with pushing to npm or creating a package) and dropping it in the public/themes folder.

More:

  • https://github.com/thelounge/thelounge/search?q=%22public+folder%22
  • https://github.com/thelounge/thelounge/search?q=public+themes (couldn't get this refined better, but search code for public/themes

ghost avatar Nov 04 '21 20:11 ghost

Hopefully this comment proves helpful. I was looking at using NPM to install another theme and have it stay but wasn't able to get that going. (Couldn't get the NPM to install in the docker container at the time). If that's possible, I'm all eyes/ears on how to get it working. Will have to play around with that myself too to see if I can get it going that way.

So in essence, my issue was different than xnaas whereas I just wanted to use NPM to install other themes I had seen online.

JoeArcher007 avatar Nov 04 '21 20:11 JoeArcher007

@JoeArcher007: If you're using the official container, it should just be docker exec --user node -it <container_name> thelounge install <npm-theme-or-plugin-name>.

ghost avatar Nov 05 '21 12:11 ghost

note that you don't need npm (the registry)... installing from a local folder works as well by giving a file: prefix

brunnre8 avatar Nov 24 '21 20:11 brunnre8