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

Support automatic rebuild of modules #29

Closed
dewey opened this issue Apr 5, 2019 · 10 comments
Closed

Support automatic rebuild of modules #29

dewey opened this issue Apr 5, 2019 · 10 comments

Comments

@dewey
Copy link

dewey commented Apr 5, 2019

Hey,

I'd prefer to use the linuxserver image over the official one because they don't properly map the user IDs (and also have no intent on changing that). One feature that's really neat about the official one is that it rebuilds modules when you restart the container:

https://github.com/znc/znc-docker/blob/master/full/30-build-modules.sh

Would that be something you'd consider adding in this one too? It makes it very easy for people to just drop in the modules they want and they get rebuilt for the correct version without the need to add all of them to the LS image like right now (#23)

Thanks!

@aptalca aptalca added this to To do in Issue & PR Tracker via automation Apr 5, 2019
@thelamer
Copy link
Member

How do you propose we handle this?
It sounds like you have a grasp on this, the logic could be an if statement that looks for a modules folder and installs build dependencies, then builds and moves the output to /usr/share/znc/modules.

Are you interested in loop testing and creating a PR for something like this?

@dewey
Copy link
Author

dewey commented Apr 11, 2019

I'm not sure what's the best way of doing it in this case. From my understanding it's downloading the hardcoded modules, putting them into /tmp/znc/modules and then running make in /tmp/znc to build all of that. I usually always did it with znc-buildmod but I guess make also includes building the modules folder.

Maybe the steps would be:

  1. In https://github.com/linuxserver/docker-znc/blob/master/Dockerfile#L28 we do:
mkdir -p \
	/tmp/znc/modules
  1. We could just COPY the content of /znc-config/modules to /tmp/znc/modules

  2. It'll download the default modules via curl like right now

  3. Everything will be built here as usual https://github.com/linuxserver/docker-znc/blob/master/Dockerfile#L77

I'll have to give it a try and if that works will open a MR. Let me know if you see any obvious mistakes.

@thelamer
Copy link
Member

thelamer commented Apr 11, 2019

Optimally it would go as follows:

  1. If statement for does /config/modules directory exist
  2. If statement are build tools installed ? if not run apk commands to install them in container
  3. Build array of cpp files using find in the /config/modules directory ($MODULES)
  4. ensure $MODULES array is not empty
  5. Build array of cpp files using find in the /usr/share/znc/modules directory ($INSTALLED)
  6. For loop through the array of new modules (for MODULE in $MODULES; do ...)
  7. If statement in loop should compare the basename of the cpp file to the whole array of installed cpp files ( if [[ "$(basename "$MODULE")" != *"$INSTALLED"* ]]; then )
  8. run znc-buildmod and copy the directory to /usr/share/znc/modules

On subsequent runs it should see that the module was already built and copied inside the container. If the user upgrades the container they will be rebuilt and copied. If it has already installed a module it will not do it again.

Let me know if any of this does not make sense.

@CHBMB
Copy link
Member

CHBMB commented Jun 12, 2019

@dewey Any feedback on this?

@dewey
Copy link
Author

dewey commented Jun 12, 2019

@CHBMB I think it's would be a good strategy of doing it. Unfortunately I didn't have time to look at it myself yet and I always have it on my list. If someone else wants to go ahead with it that would be great but otherwise I'll see what I can do at some point.

@CHBMB
Copy link
Member

CHBMB commented Jun 12, 2019

@dewey We'll wait for you, nobody else has requested it, so I guess it's not a pressing change.

@mattberther
Copy link

Something like #16 ?

@DarthGandalf
Copy link

(and also have no intent on changing that)

@dewey Could you explain? Did fix of znc/znc-docker#20 not work for you?

@dewey
Copy link
Author

dewey commented Jun 16, 2020

@DarthGandalf Sorry I don't remember that any more, that was a while ago and I'm currently not running ZNC :(

Thanks for following up though, if I set it up again I'll update it here.

@github-actions
Copy link

github-actions bot commented Aug 6, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot closed this as completed Aug 6, 2021
Issue & PR Tracker automation moved this from To do to Done Aug 6, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

No branches or pull requests

5 participants