linuxmuster / linuxmuster-base7

Mangement scripts for linuxmuster.net V7
GNU General Public License v3.0
13 stars 8 forks source link

Update linbo examples during the setup process #69

Closed PLanB2008 closed 5 years ago

PLanB2008 commented 5 years ago

This is related to:

https://github.com/linuxmuster/linuxmuster-webui7/issues/86

right now linuxmuster-base does patch the examples to set the DOMAIN name during the setup for the window reg examples.

I thinks something similar would be suffient here as well. Just set these values correct once during the setup and this should be fine.

kiarn commented 5 years ago

Duplicate from #69.

HappyBasher commented 5 years ago

This is not fine. These are example files and no config templates really. They will be overwritten on every package upgrade. So patching these files on setup is kinda stupid. We need another solution. Also for the start.conf examples.

kiarn commented 5 years ago

Oh ! I think I did not read the whole thing ... sorry. I think we could do the following : when a linbo example file is copied through the webui, we can simply automatically replace some value ( ip, domain, what needed, etc ... ).

@HappyBasher @PLanB2008 : is this a valid solution for you ?

HappyBasher commented 5 years ago

A proper solution is the webui takes the example files as they are and patches them with the necessary values. All needed environment variables are stored in /var/lib/linuxmuster/setup.ini. The most proper way in my opinion is the webui provides its own config templates, to avoid the circumstance that the linbo examples may contain shit or have changed in an essential way.

HappyBasher commented 5 years ago

is this a valid solution for you ?

Yep!

PLanB2008 commented 5 years ago

This is not fine. These are example files and no config templates really. They will be overwritten on every package upgrade. So patching these files on setup is kinda stupid. We need another solution. Also for the start.conf examples.

So this is also kind of stupid, right?

https://github.com/linuxmuster/linuxmuster-linbo/commit/77cd1cb3a93d91601329913bf6d96a350c6d6ff4

Of course we can appply this ourselves. I just thought the correct way would be to provide proper examples or generate these examples by using a template.

HappyBasher commented 5 years ago

So this is also kind of stupid, right?

Of course not! This occurs during syncing process on a reg file which is assigned to an image and therefore not under control of the debian packaging system. What I mean is that it is stupid to patch example files that are overwritten on every package upgrade. Take these files and do what you want with them but do not change themselves! Unfortunately we overlooked this fact last weekend. Stupid! Nevertheless I implemented the patching in the meantime. Much more stupid!

kiarn commented 5 years ago

As I can see, the examples seem to be only used in the Webui, or maybe I missed something. The template way is really convenient, e.g. :

# LINBO start.conf, Beispiel fuer Ubuntu
# DON'T EDIT THIS FILE ! MAKE A COPY AND ADAPT THE VALUES ( %%SERVERIP%%, ... )
# Ubuntu auf Partition 1
# Cache auf Partition 2
# Swap auf Partition 3
# Daten auf Partition 4

[LINBO]                             # Start der globalen Konfiguration
Server = %%SERVERIP%%               # IP des Linbo-Servers, der das Linbo-Repository vorhaelt, z.B. 10.0.0.1
Group = gruppe                      # Name der Rechnergruppe fuer die diese Konfigurationsdatei gilt

in all examples, instead of :

# LINBO start.conf, Beispiel fuer Ubuntu
# Ubuntu auf Partition 1
# Cache auf Partition 2
# Swap auf Partition 3
# Daten auf Partition 4

[LINBO]                             # Start der globalen Konfiguration
Server = 10.16.1.1                  # IP des Linbo-Servers, der das Linbo-Repository vorhaelt
Group = gruppe                      # Name der Rechnergruppe fuer die diese Konfigurationsdatei gilt

With this method :

  1. it is really easy to adapt the value for each new group in the Webui with replace() method,
  2. if an admin modifies an example file, (s)he has to deal with it, the warning is there,
  3. there's only one directory to update when a new linbo feature comes.

Is this an acceptable solution for all ?

HappyBasher commented 5 years ago

The template way is Ok for me. Suggestion 1:

kiarn commented 5 years ago

Ok, no problem with it.

kiarn commented 5 years ago

Done here : https://github.com/linuxmuster/linuxmuster-webui7/commit/b7129571dc6bcb98275db50c75716f7da746e71f

@HappyBasher : there is no need to change your example files with placeholder @@ServerIP@@ or @@group@@, just let 10.0.0.1 and group in, there was a simplier way with javascript what I've unseen.

So, I think only the warning at the beginning of the file is needed.

HappyBasher commented 5 years ago

Done in linuxmuster-linbo 2.3.49 (see https://github.com/linuxmuster/linuxmuster-linbo/issues/111).