Parcourir la source

Make the b10-cmdctl use account database and certificate files
from $sysconfdir/bind10.
Add to README a note about this.

The files are still installed to the share/bind10 directory
since they are reference / test files.

I did this so admins won't put custom files in place and then
next bind10 install won't overwrite them.

TODO: document this in userguide.
TODO: add an install target to put in etc also if doesn't already exist.


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1379 e5f2f494-b856-4b98-b285-d166d9295462

Jeremy C. Reed il y a 15 ans
Parent
commit
225b0672b4
3 fichiers modifiés avec 26 ajouts et 10 suppressions
  1. 11 0
      README
  2. 10 7
      src/bin/cmdctl/Makefile.am
  3. 5 3
      src/bin/cmdctl/cmdctl.py.in

+ 11 - 0
README

@@ -16,10 +16,21 @@ Requires autoconf 2.59 or newer.
 
 Use automake-1.11 or better for working Python 3.1 tests.
 
+INSTALLATION
+
 Install with:
 
   make install
 
+Testing samples of a RSA key, certificate, and user account
+are installed under the $PREFIX/share/bind10/ directory.
+  cmdctl-accounts.csv
+  cmdctl-keyfile.pem
+  cmdctl-certfile.pem
+Copy them to your $sysconfdir/bind10/ directory  for testing.
+Or create your own.
+TODO: show how
+
 TEST COVERAGE
 
 Doing code coverage tests:

+ 10 - 7
src/bin/cmdctl/Makefile.am

@@ -3,8 +3,16 @@ pkglibexecdir = $(libexecdir)/@PACKAGE@
 pkglibexec_SCRIPTS = b10-cmdctl
 
 b10_cmdctldir = $(DESTDIR)$(pkgdatadir)
-# TODO: this is dangerous -- will overwrite!
-b10_cmdctl_DATA = cmdctl-accounts.csv cmdctl-keyfile.pem cmdctl-certfile.pem cmdctl.spec
+
+# NOTE: this will overwrite on install
+# So these generic copies are placed in share/bind10 instead of to etc
+# Admin or packageer will need to put into place manually.
+
+b10_cmdctl_DATA = cmdctl-accounts.csv cmdctl-keyfile.pem cmdctl-certfile.pem
+b10_cmdctl_DATA += cmdctl.spec
+ 
+EXTRA_DIST = cmdctl-accounts.csv cmdctl-keyfile.pem cmdctl-certfile.pem
+EXTRA_DIST += cmdctl.spec
 
 CLEANFILES=	b10-cmdctl
 
@@ -13,8 +21,3 @@ CLEANFILES=	b10-cmdctl
 b10-cmdctl: cmdctl.py
 	$(SED) "s|@@PYTHONPATH@@|@pyexecdir@|" cmdctl.py >$@
 	chmod a+x $@
-
-install-data-local:
-	chmod go-rwx $(DESTDIR)$(pkgdatadir)/cmdctl-accounts.csv
-	chmod go-rwx $(DESTDIR)$(pkgdatadir)/cmdctl-certfile.pem
-	chmod go-rwx $(DESTDIR)$(pkgdatadir)/cmdctl-keyfile.pem

+ 5 - 3
src/bin/cmdctl/cmdctl.py.in

@@ -55,14 +55,16 @@ URL_PATTERN = re.compile('/([\w]+)(?:/([\w]+))?/?')
 # installed on the system
 if "B10_FROM_SOURCE" in os.environ:
     SPECFILE_PATH = os.environ["B10_FROM_SOURCE"] + "/src/bin/cmdctl"
+    SYSCONF_PATH = os.environ["B10_FROM_SOURCE"] + "/src/bin/cmdctl"
 else:
     PREFIX = "@prefix@"
     DATAROOTDIR = "@datarootdir@"
     SPECFILE_PATH = "@datadir@/@PACKAGE@".replace("${datarootdir}", DATAROOTDIR).replace("${prefix}", PREFIX)
+    SYSCONF_PATH = "@sysconfdir@/@PACKAGE@".replace("${prefix}", PREFIX)
 SPECFILE_LOCATION = SPECFILE_PATH + "/cmdctl.spec"
-USER_INFO_FILE = SPECFILE_PATH + "/cmdctl-accounts.csv"
-PRIVATE_KEY_FILE = SPECFILE_PATH + "/cmdctl-keyfile.pem"
-CERTIFICATE_FILE = SPECFILE_PATH + "/cmdctl-certfile.pem"
+USER_INFO_FILE = SYSCONF_PATH + "/cmdctl-accounts.csv"
+PRIVATE_KEY_FILE = SYSCONF_PATH + "/cmdctl-keyfile.pem"
+CERTIFICATE_FILE = SYSCONF_PATH + "/cmdctl-certfile.pem"
         
 class SecureHTTPRequestHandler(http.server.BaseHTTPRequestHandler):
     '''https connection request handler.