zelon88 / HRConvert2

A self-hosted, drag-and-drop & nosql file conversion server & share tool that supports 445 file formats in 13 languages.

Home Page:https://github.com/zelon88/HRConvert2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker not maintained?

Myzel394 opened this issue · comments

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.

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

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.

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

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

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

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.

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

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?

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

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.

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?

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

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)

@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?

Steps to build the image using latest release :

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.

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

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

@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!

@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

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

@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 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.

@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

@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.

@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!

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

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.

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

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

@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


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

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!

Closing since we have a Docker that is maintained now.