Changing the configuration recovery script

Please tell us where the configuration recovery script is located. You need to change it so that it doesn’t change repositories or reset them to default configurations. Because the configuration goes mirrorlist=http://mirrorlist.netserver.org/?release=… but it is not available in Russia. In General.
I think this is a flaw, because why do I need to reset the configuration to default repositories, and not the ones that are registered in the recovery archive? It turns out that I change the repositories to those that are available in our country, and they are reset to default when restoring and the recovery immediately ends with an error.
I tested all the servers from the mirror:

us http://mirror.nethserver.org/nethserver/
nl http://mirror1.nethserver.org/nethserver/
it https://mirror.nethesis.it/nethserver/
fr http://nethserver.de-labrusse.fr/
fr http://mirror.framassa.org/nethserver/
fr http://mirror.nordest.systems/nethserver/
de https://mirror.alpix.eu/nethserver/
at http://mrmarkuz.goip.de/mirror/nethserver/
es https://mirror.pcxlan.es/nethserver/
at https://markusneuberger.at/mirror/nethserver/
at http://buck.goip.de/nethserver/
de http://mrmarkuz.dynu.net/nethserver/
hu http://server.liftingtrade.hu/nethserver/
hu http://ketrax.eu/nethserver/
br http://ns-mirror1.ibi.net.br/
br http://ns-mirror3.ibi.net.br/
de http://nethserver.interlin.nl/nethserver/
fr http://armirror.framassa.org/nethserver/

Only these are not available in Russia:
us http://mirror.nethserver.org/nethserver/
br http://ns-mirror1.ibi.net.br/
br http://ns-mirror3.ibi.net.br/

You may create a custom template to make the repo change persistent:

Create the custom template dir:

mkdir -p /etc/e-smith/templates-custom/etc/yum.repos.d/NethServer.repo

Copy template fragment:

cp /etc/e-smith/templates/etc/yum.repos.d/NethServer.repo/10base /etc/e-smith/templates-custom/etc/yum.repos.d/NethServer.repo/

Edit /etc/e-smith/templates-custom/etc/yum.repos.d/NethServer.repo/10base and do the needed changes.

Expand the template:

expand-template /etc/yum.repos.d/NethServer.repo

Check if /etc/yum.repos.d/NethServer.repo looks ok.

Now config restore resets the repo correctly.

2 Likes

Thank you, everything worked out. Only here I already have exactly the same template in the backup and it did not pick it up, but reset it to default and gave an error. Can I somehow rework the script so that there are no unnecessary problems?

Sorry, I can’t reproduce.
Custom templates are included in config backup by default and they were restored correctly with config restore in my test.

https://docs.nethserver.org/projects/nethserver-devel/en/latest/nethserver-backup-config.html#nethserver-backup-config

Could it be that you changed the original templates in /etc/e-smith/templates instead of creating a custom template in /etc/e-smith/templates-custom?