Git Product home page Git Product logo

Comments (6)

erikw avatar erikw commented on May 27, 2024 1

Hello,

thank you for reporting this. I created a PR fix #48! Could you try out the fix to see if it works also for you?

from restic-automatic-backup-scheduler.

gerardbosch avatar gerardbosch commented on May 27, 2024 1

Oh! I realise the above will not work on install, as there's no such file to install 😅

Maybe sth like this?

@for file in $(SRCS_CONF); do \
    install -m 0600 $$file $(DEST_CONF)/$(patsubst %.template, %, $$file)
done

But probably the $(RM) is the more simple way :D

from restic-automatic-backup-scheduler.

erikw avatar erikw commented on May 27, 2024 1

@gerardbosch I pushed the $(RM) approach now.

Yes I've seen #45. I will get to it and look at it properly! I'm working on my email inbox as a stack right now :)

from restic-automatic-backup-scheduler.

gerardbosch avatar gerardbosch commented on May 27, 2024

My pleasure! One more thing, I'm still a little confused about this:

After looking at this, I'm not very clear what's the purpose of copying (and then keeping) the *.template files into repository's directory: etc/restic/b2_env.sh and etc/restic/b2_pwd.txt, as these files are already installed into the system directories.

After sudo make install, aren't you directly editing the target system files /etc/restic/b2_pw.txt and /etc/restic/b2_env.sh? So what's the point of generating and keeping a repository-local counterparts?

Thx!! :)

from restic-automatic-backup-scheduler.

erikw avatar erikw commented on May 27, 2024

The feature comes from #15 like you already found. The idea is that many people fork this repostirory, and it would be a catastrophic if someone accidentally committed their b2_pw.txt in their fork with their password. The idea to prevent this, was to make a template with a different name, and .gitignore

https://github.com/erikw/restic-systemd-automatic-backup/blob/master/.gitignore#L1-L3

theses sensitive files in the local repo in case a user/fork would have them edited.

As you say, it would be enough to do just copy local b2_pw.txt.template to the target $PREFIX/etc/restic/b2_pw.txt, but as far as I understand the manual of install(1), it does not have the feature of renaming files. Thus a local file b2_pw.txt must exist.

I guess one could use cp, but the nice features of install(1) like setting permissions, or not overwriting existing config, is quite convenient.

We could however delete the local generated files after they have been installed, thus updating the install target for confs to

 install-conf: | $(SRCS_CONF)
 	install -d $(DEST_CONF)
  	install -m 0600 $(SRCS_CONF) $(DEST_CONF)
+	$(RM) etc/restic/b2_env.sh etc/restic/b2_pw.txt

What do you think @gerardbosch ? )

from restic-automatic-backup-scheduler.

gerardbosch avatar gerardbosch commented on May 27, 2024

Yey! I think that your suggestion to do a clean up is a good approach as looks less confusing not leaving unused files behind after make.

but as far as I understand the manual of install(1), it does not have the feature of renaming files. Thus a local file b2_pw.txt must exist.

I don't know much about GNU Make, but do you think that something like this would work? (or if not maybe a simple cp and chmod)

install -m 0600 $(patsubst %.template, %, $(SRCS_CONF)) $(DEST_CONF)

I'd like to help with improvements and ideas if you like (I've got something that may help improving the UX of running restic with your script). I guess you've seen a PR I opened yesterday :)

Just let me know :))

from restic-automatic-backup-scheduler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.