Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker not maintained? #46

Closed
Myzel394 opened this issue Nov 14, 2023 · 34 comments
Closed

Docker not maintained? #46

Myzel394 opened this issue Nov 14, 2023 · 34 comments
Assignees
Labels
Enhancement New feature or request

Comments

@Myzel394
Copy link

It doesn't look like the image at https://hub.docker.com/r/dwaaan/hrconvert2-docker is maintained anymore. I'd recommend to build it yourself (via GitHub actions for example) and also to remove the reference to this docker page.

@Myzel394
Copy link
Author

Note: I can add the relevant github actions workflow file if that's okay with you, but it'd take some time since I haven't worked much with php yet

@zelon88
Copy link
Owner

zelon88 commented Nov 14, 2023

Interesting.

I'd be interested in learning how to do this with github actions. If you have a file to make that easier I'd definately credit you for that.

Either way I'll see what I can do. Especially considering Docker seems to be the preferred installation method for most users.

@Myzel394
Copy link
Author

@zelon88 nice! I can take a look at it this weekend and will open a PR once I'm ready / need further clarifications.

@Myzel394
Copy link
Author

Myzel394 commented Nov 15, 2023

I took a quick look at the code; config.php contains all configurable settings, doesn't it? In this case, it would be nice if we could change this to load the variables first from env and then fallback to the default values.
I don't know much about PHP, but it would probably do something like this:

$URL = env_get_string("URL", 'localhost');  // try to load environmental variable "URL" and fallback to "localhost"
$VirusScan = env_get_bool("VirusScan", FALSE);  // try to load environmental variable "VirusScan", try converting it to bool and fallback to FALSE
$AllowUserVirusScan = env_get_bool("AllowUserVirusScan", TRUE);
$ScanCoreMemoryLimit = env_get_int("ScanCoreMemoryLimit", 268435456);

Some caveats to look out:

  • For bool I'd propose to only use true for: yes, y, 1, t, true or on - all other values should be default false
  • If type conversion fails, fallback to default or / and show a warning that there was an error.

Can you implement that? :D

@archef2000
Copy link

Do you need help with the github action i would like an upto date image and I am ready to build a Dockerfile.

@archef2000
Copy link

I took a quick look at the code; config.php contains all configurable settings, doesn't it? In this case, it would be nice if we could change this to load the variables first from env and then fallback to the default values. I don't know much about PHP, but it would probably do something like this:

$URL = env_get_string("URL", 'localhost');  // try to load environmental variable "URL" and fallback to "localhost"
$VirusScan = env_get_bool("VirusScan", FALSE);  // try to load environmental variable "VirusScan", try converting it to bool and fallback to FALSE
$AllowUserVirusScan = env_get_bool("AllowUserVirusScan", TRUE);
$ScanCoreMemoryLimit = env_get_int("ScanCoreMemoryLimit", 268435456);

Some caveats to look out:

  • For bool I'd propose to only use true for: yes, y, 1, t, true or on - all other values should be default false
  • If type conversion fails, fallback to default or / and show a warning that there was an error.

Can you implement that? :D

You could just make a short bash script at the start of the container and update the container.

@Myzel394
Copy link
Author

Myzel394 commented Nov 28, 2023

Do you need help with the github action i would like an upto date image and I am ready to build a Dockerfile.

Any help is appreciated! I already started working on this but feel free to take it over. You can find my code on https://github.com/Myzel394/HRConvert2/tree/add-docker - or create a new one from scratch, it's up to you :D

@Myzel394
Copy link
Author

You could just make a short bash script at the start of the container and update the container.

I'm note sure what you mean. Do you mean a script that sets the variables before starting the container?

@archef2000
Copy link

Yeah so the programm does not need changing you just make a short bash script which takes the envs andedits the config.

@archef2000
Copy link

Do you need help with the github action i would like an upto date image and I am ready to build a Dockerfile.

Any help is appreciated! I already started working on this but feel free to take it over. You can find my code on https://github.com/Myzel394/HRConvert2/tree/add-docker - or create a new one from scratch, it's up to you :D
Thanks, but i already have a bare bones setup.

@Myzel394
Copy link
Author

Yeah so the programm does not need changing you just make a short bash script which takes the envs andedits the config.

Wouldn't this require rebuilding the image each time you change the env?

@archef2000
Copy link

archef2000 commented Nov 28, 2023

No, have a look at https://github.com/archef2000/ocserv as an example of mine.

@archef2000
Copy link

I have a working docker image but i have problems with rar convertions even though when executing rar with php shell as the user i can execute it. (I run rar on arm64 with qemu)

@archef2000
Copy link

@zelon88 I have tried V 5.11 and 6.0.2 both failing archiving as it just returns the command help for rar. What version have you tested that work?

@bit-man
Copy link
Contributor

bit-man commented Dec 28, 2023

Steps to build the image using latest release :

@archef2000
Copy link

archef2000 commented Dec 28, 2023

I don't see rar being installed so that won't work and the offical rar package is only available for amd64 and not for other platforms.

But thanks for the example.

@bit-man
Copy link
Contributor

bit-man commented Dec 29, 2023

One more step: forked repository HRconvert2-Docker, added script to build the image yourself and also choose HRConvert2 release. Self serve https://gitlab.com/the-automation-club/hrconvert2-docker

@ovizii
Copy link

ovizii commented Jan 2, 2024

Following this thread as dwaaan/hrconvert2-docker:latest does not work for me with https://github.com/dwaaan/HRConvert2-Docker/blob/master/docker-compose.yml

@gravelfreeman
Copy link

@bit-man I tried to deploy your image from dockerhub on TrueNAS Scale using Truecharts custom-app but it's not working. Your apache setup is using /var/run which isn't compatible on most modern linux deployments where /var/run mounts to /run which is a temp folder. Could you update the image so it works with modern linux deployments?

Thank you!

@bit-man
Copy link
Contributor

bit-man commented Feb 27, 2024

@gravelfreeman just added a new issue to the project to reflect the previous request

Please let me know what error pops up when using the current image

@bit-man
Copy link
Contributor

bit-man commented Mar 3, 2024

@gravelfreeman is ok to write down the error here in case you don't have and don't want to open a Gitlab account

@gravelfreeman
Copy link

@bit-man sorry for the delay, here's the error

apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot

@zelon88 zelon88 added the Enhancement New feature or request label Mar 5, 2024
@zelon88
Copy link
Owner

zelon88 commented Mar 5, 2024

@zelon88 I have tried V 5.11 and 6.0.2 both failing archiving as it just returns the command help for rar. What version have you tested that work?

v5.5 works for me.

zelon88 added a commit that referenced this issue Mar 5, 2024
-v3.3.
-Update README.md.
  -Remove mention of Docker repo, as it is not maintained.
  -I appreciate all of the community feedback at #46.
  -I will come up with an official Docker solution.
-Fix bug in cleanFiles() function that was causing problems with archive conversions & preventing cleanup.
-Flip button CSS, so buttons don't appear quite so... upside-down... all the time.
-Remove un-needed (redundant) button related CSS from HRConvert2.css.
-Increase default DeleteThreshold in config.php from 30 to 60 minutes.
-Remove un-needed extension being passed to the convertDrawings() function.
-Fix drawings not returning a valid filename.
  -Conversions would complete, but not download.
-Tested ImageMagick support for SVG, could not get it to work.
-Tested Dia support for converting things into PNG, BMP, and JPG. Got PNG to work, so added support.
zelon88 added a commit that referenced this issue Mar 5, 2024
-v3.3.
-Update README.md.
  -Remove mention of Docker repo, as it is not maintained.
  -I appreciate all of the community feedback at #46.
  -I will come up with an official Docker solution.
-Fix bug in cleanFiles() function that was causing problems with archive conversions & preventing cleanup.
-Flip button CSS, so buttons don't appear quite so... upside-down... all the time.
-Remove un-needed (redundant) button related CSS from HRConvert2.css.
-Increase default DeleteThreshold in config.php from 30 to 60 minutes.
-Remove un-needed extension being passed to the convertDrawings() function.
-Fix drawings not returning a valid filename.
  -Conversions would complete, but not download.
-Tested ImageMagick support for SVG, could not get it to work.
-Tested Dia support for converting things into PNG, BMP, and JPG. Got PNG to work, so added support.
zelon88 added a commit that referenced this issue Mar 5, 2024
-v3.3.
-Update README.md.
  -Remove mention of Docker repo, as it is not maintained.
  -I appreciate all of the community feedback at #46.
  -I will come up with an official Docker solution.
-Fix bug in cleanFiles() function that was causing problems with archive conversions & preventing cleanup.
-Flip button CSS, so buttons don't appear quite so... upside-down... all the time.
-Remove un-needed (redundant) button related CSS from HRConvert2.css.
-Increase default DeleteThreshold in config.php from 30 to 60 minutes.
-Remove un-needed extension being passed to the convertDrawings() function.
-Fix drawings not returning a valid filename.
  -Conversions would complete, but not download.
-Tested ImageMagick support for SVG, could not get it to work.
-Tested Dia support for converting things into PNG, BMP, and JPG. Got PNG to work, so added support.
zelon88 added a commit that referenced this issue Mar 5, 2024
-v3.3.
-Update README.md.
  -Remove mention of Docker repo, as it is not maintained.
  -I appreciate all of the community feedback at #46.
  -I will come up with an official Docker solution.
-Fix bug in cleanFiles() function that was causing problems with archive conversions & preventing cleanup.
-Flip button CSS, so buttons don't appear quite so... upside-down... all the time.
-Remove un-needed (redundant) button related CSS from HRConvert2.css.
-Increase default DeleteThreshold in config.php from 30 to 60 minutes.
-Remove un-needed extension being passed to the convertDrawings() function.
-Fix drawings not returning a valid filename.
  -Conversions would complete, but not download.
-Tested ImageMagick support for SVG, could not get it to work.
-Tested Dia support for converting things into PNG, BMP, and JPG. Got PNG to work, so added support.
zelon88 added a commit that referenced this issue Mar 5, 2024
-v3.3.
-Update README.md.
  -Remove mention of Docker repo, as it is not maintained.
  -I appreciate all of the community feedback at #46.
  -I will come up with an official Docker solution.
-Fix bug in cleanFiles() function that was causing problems with archive conversions & preventing cleanup.
-Flip button CSS, so buttons don't appear quite so... upside-down... all the time.
-Remove un-needed (redundant) button related CSS from HRConvert2.css.
-Increase default DeleteThreshold in config.php from 30 to 60 minutes.
-Remove un-needed extension being passed to the convertDrawings() function.
-Fix drawings not returning a valid filename.
  -Conversions would complete, but not download.
-Tested ImageMagick support for SVG, could not get it to work.
-Tested Dia support for converting things into PNG, BMP, and JPG. Got PNG to work, so added support.
zelon88 added a commit that referenced this issue Mar 5, 2024
-v3.3.
-Update README.md.
  -Remove mention of Docker repo, as it is not maintained.
  -I appreciate all of the community feedback at #46.
  -I will come up with an official Docker solution.
-Fix bug in cleanFiles() function that was causing problems with archive conversions & preventing cleanup.
-Flip button CSS, so buttons don't appear quite so... upside-down... all the time.
-Remove un-needed (redundant) button related CSS from HRConvert2.css.
-Increase default DeleteThreshold in config.php from 30 to 60 minutes.
-Remove un-needed extension being passed to the convertDrawings() function.
-Fix drawings not returning a valid filename.
  -Conversions would complete, but not download.
-Tested ImageMagick support for SVG, could not get it to work.
-Tested Dia support for converting things into PNG, BMP, and JPG. Got PNG to work, so added support.
zelon88 added a commit that referenced this issue Mar 5, 2024
-v3.3.
-Update README.md.
  -Remove mention of Docker repo, as it is not maintained.
  -I appreciate all of the community feedback at #46.
  -I will come up with an official Docker solution.
-Fix bug in cleanFiles() function that was causing problems with archive conversions & preventing cleanup.
-Flip button CSS, so buttons don't appear quite so... upside-down... all the time.
-Remove un-needed (redundant) button related CSS from HRConvert2.css.
-Increase default DeleteThreshold in config.php from 30 to 60 minutes.
-Remove un-needed extension being passed to the convertDrawings() function.
-Fix drawings not returning a valid filename.
  -Conversions would complete, but not download.
-Tested ImageMagick support for SVG, could not get it to work.
-Tested Dia support for converting things into PNG, BMP, and JPG. Got PNG to work, so added support.
@bit-man
Copy link
Contributor

bit-man commented Mar 5, 2024

@gravelfreeman I don't get the relationship between TrueNAS and HConvert2 image and how it contribute a to failure. The /var/run folder is created at build time inside HConvert2 docker image and used only by ubuntu:20.04 base image that's why can't understand why both products interact and why it fails for you

Please explainme how you use them so I can help

@PrivatePuffin
Copy link

@bit-man I tried to deploy your image from dockerhub on TrueNAS Scale using Truecharts custom-app but it's not working. Your apache setup is using /var/run which isn't compatible on most modern linux deployments where /var/run mounts to /run which is a temp folder. Could you update the image so it works with modern linux deployments?

Thank you!

TrueCharts maintainer here:
TrueCharts Custom-App is intended as a "might work for some simple things, might not work at-all", in this case it clearly isn't the right tool for the job and other maintainers shouldn't be bothered with this.

I've checked the linked gitlab dockerfile and image, it looks perfectly fine and, in essence, k8s capable just-fine.
And I also have my personal suspicions why custom-app might not work for you in this case. which are not related to the work this project is doing or the container.

@gravelfreeman
Copy link

@bit-man I tried to deploy your image from dockerhub on TrueNAS Scale using Truecharts custom-app but it's not working. Your apache setup is using /var/run which isn't compatible on most modern linux deployments where /var/run mounts to /run which is a temp folder. Could you update the image so it works with modern linux deployments?
Thank you!

TrueCharts maintainer here: TrueCharts Custom-App is intended as a "might work for some simple things, might not work at-all", in this case it clearly isn't the right tool for the job and other maintainers shouldn't be bothered with this.

I've checked the linked gitlab dockerfile and image, it looks perfectly fine and, in essence, k8s capable just-fine. And I also have my personal suspicions why custom-app might not work for you in this case. which are not related to the work this project is doing or the container.

Thanks for replying. My lack of knowledge is at fault here I guess. I think it would be really great to see this app added to the Truecharts catalog. Sorry for the trouble!

@bit-man
Copy link
Contributor

bit-man commented Mar 5, 2024

I've checked the linked gitlab dockerfile and image, it looks perfectly fine and, in essence, k8s capable just-fine. And I also have my personal suspicions why custom-app might not work for you in this case. which are not related to the work this project is doing or the container.

@Ornias1993 just let me know how can I help in case you found the root issue

BTW I'm using bitman09/hrconvert2:3.1 in microk8s using this deployment.yml

@zelon88
Copy link
Owner

zelon88 commented Mar 7, 2024

So I've started Dockerizing HRConvert2. I have not tested it at all yet, I will try to get to that tomorrow. There is, however, a Dockerfile now in the official repo. Feel free to help me test building it.

I created an account at Docker and am going to upload everything over there when it is ready.

I also cleaned up the directory structure a bit, which further modularizes the GUI, and makes the root of the project look more presentable, which helps draw attention to the important bits. Like the dockerfile and the Documentation folder. I tried to get the license out of the root, but Github won't seem to recognize the project as having a license with a relocated LICENSE file? To avoid problems I just put the LICENSE file back in the root. The project never stopped being GPLv3.

@PrivatePuffin
Copy link

Why at docker? Just use ghcr, at least you wont burden your users with ratelimits docker imposes.

@Myzel394
Copy link
Author

Myzel394 commented Mar 7, 2024

Why at docker? Just use ghcr, at least you wont burden your users with ratelimits docker imposes.

Why not both? :D I never faced ratelimits on Docker and I also don't think fully relying on one service is good either

@bit-man
Copy link
Contributor

bit-man commented Mar 7, 2024

@zelon88 the issue with the current Dockerfile is that rar only works for amd64 because of is only available for Intel CPUs. This is how I solved it running the x86-64 version using qemu in arm64

COPY rar-arm64 /tmp/rar-arm64

RUN DPKG_ARCH="$(dpkg --print-architecture)"; \
    if [ "${DPKG_ARCH}" = "amd64" ]; then \
        apt-get install -y rar && rm /tmp/rar-arm64; \
    else \
        dpkg --add-architecture i386 && \
        apt-get install qemu-user-static libc6-i386-cross libstdc++6-i386-cross -y && \
        cp /usr/i686-linux-gnu/lib/libm.so.6 /lib && \
        cp /usr/i686-linux-gnu/lib/libc.so.6 /lib && \
        cp /usr/i686-linux-gnu/lib/libpthread.so.0 /lib && \
        cp /usr/i686-linux-gnu/lib/ld-linux.so.2 /lib && \
        cp /usr/i686-linux-gnu/lib/libstdc++.so.6 /lib && \
        cp /usr/i686-linux-gnu/lib/libgcc_s.so.1  /lib && \
        wget https://www.rarlab.com/rar/rarlinux-x32-700b3.tar.gz  -O /tmp/rarlinux-x32-700b3.tar.gz && \
        tar -zxvf /tmp/rarlinux-x32-700b3.tar.gz -C /tmp && \
        chmod +x /tmp/rar-arm64 &&  ln -s  /tmp/rar-arm64 /usr/bin/rar; \
    fi


@zelon88
Copy link
Owner

zelon88 commented Mar 12, 2024

So I've built an Official Docker Image at https://hub.docker.com/repository/docker/zelon88/hrconvert2/general

However, the repo is tagged v3.3.2 and it downloads the latest version. So I've gotta fix that. But I've been working on this for hours now and I wanna play some Terraria so I'll pick this up tomorrow.

<3 Open Source

@zelon88
Copy link
Owner

zelon88 commented Mar 12, 2024

I'd also like to take a minute to really thank dwaaan because if it wasn't for his original Docker repo, there's a good chance most of this community wouldn't exist. I hope whatever dwaaan is up to that he's well and enjoying life. Thanks again!

@zelon88 zelon88 self-assigned this Mar 16, 2024
@zelon88
Copy link
Owner

zelon88 commented Mar 25, 2024

Closing since we have a Docker that is maintained now.

@zelon88 zelon88 closed this as completed Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants