linuxserver / docker-projectsend

GNU General Public License v3.0
74 stars 26 forks source link

Implemented language and template installation #23

Closed alexschomb closed 3 years ago

alexschomb commented 3 years ago

linuxserver.io



Description:

ProjectSend now provides translations on their website as zip file. Unfortunately I couldn't find an easy solution for importing the contents of those zip files into the appropriate directories. (volume mounts disturbed the build process of the image) So I modified your Dockerfile to automatically install languages from the website by given PS_INSTALL_LANGUAGES environment variable. This variable can be a comma separated list of language short codes (as provided on the translations' website).

I also figured that the same problem applies if you want to install your own template. Using the same logic PS_INSTALL_TEMPLATES is provided. It can consist of a comma separated list of both local template folders (in the new /templates volume mount) and/or zip file url & folder/template name combinations. The latter have to be provided as following: https://test.com/template.zip;foldername.

Please note: You might want to optimize the readme-vars.yml, I couldn't come up with the best solution on how to document the new options.

Benefits of this PR and context:

It allows users to easily install additional languages and templates, which isn't possible yet.

How Has This Been Tested?

I did various manual tests and tried to avoid common mistakes. Still, I'm pretty sure there are edge cases. Feel free to optimize my code.

Source / References:

I took inspiration from the Dockerfile of the Grafana repository, especially this file: https://github.com/grafana/grafana/blob/main/packaging/docker/run.sh. Thanks!

alexschomb commented 3 years ago

Please note that downloaded template zip files have to contain a root folder that provides the template files. My description above and in the README is somewhat faulty, because the folder name of the new template is set by this root folder name in the downloaded zip file.

LinuxServer-CI commented 3 years ago

I am a bot, here are the test results for this PR: https://ci-tests.linuxserver.io/lspipepr/projectsend/r1295-pkg-2aa4d6a0-pr-23/index.html https://ci-tests.linuxserver.io/lspipepr/projectsend/r1295-pkg-2aa4d6a0-pr-23/shellcheck-result.xml

LinuxServer-CI commented 3 years ago

I am a bot, here are the test results for this PR: https://ci-tests.linuxserver.io/lspipepr/projectsend/r1295-pkg-2aa4d6a0-pr-23/index.html https://ci-tests.linuxserver.io/lspipepr/projectsend/r1295-pkg-2aa4d6a0-pr-23/shellcheck-result.xml

aptalca commented 3 years ago

I think this is more appropriate as a docker mod

alexschomb commented 3 years ago

@aptalca Thanks for the feedback. I'll try to build two of such mods (each for language or template installation) and push them to Docker Hub in the coming days.

alexschomb commented 3 years ago

Please follow here for the Docker Mods: https://github.com/linuxserver/docker-mods/pull/257. This PR is now closed.