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

Generate /etc/yggdrasil.conf automatically after install or update #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

StudioMaX
Copy link

After this change /etc/yggdrasil.conf will be created automatically after install and update. It will work by this scheme:

  1. Check if /etc/yggdrasil.conf already exists.
  2. If not, then generate a new config via yggdrasil -genconf
  3. If this config file was found, then:
    a) Regenerate it via yggdrasil -useconffile /etc/yggdrasil.conf -normaliseconf to a temp file
    b) Compare the new config with the current one
    c) If they are different then save the new config as /etc/yggdrasil.conf.rpmnew (original /etc/yggdrasil.conf will be untouched).

I am not so happy with this method, since in my opinion the default yggdrasil.conf should be packaged inside RPM. And then update it using standard %config(noreplace) RPM's macros. But then there is no easy way to automatically update and put the secret keys in the config after the first launch of Yggdrasil.

@StudioMaX
Copy link
Author

@cornfeedhobo could you also check if this will work correctly with your RPM packages?

@cornfeedhobo
Copy link
Contributor

@StudioMaX can do

Copy link
Contributor

@rany2 rany2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use umask instead of changing the file permissions after the file was created.

For example:

umask 027
echo "This file will have u=rw,g=r,o= permissions initially without needing chmod" > test.txt

instead of

echo "This file will initially have unsafe permissions until chmod is then called" > test.txt
chmod 640 test.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants