View | Details | Raw Unified | Return to bug 181507 | Differences between
and this patch

Collapse All | Expand All

(-)security/pks/Makefile (-19 / +30 lines)
Lines 8-47 Link Here
8
MASTER_SITE_SUBDIR=	.:sf mandree:local
8
MASTER_SITE_SUBDIR=	.:sf mandree:local
9
DISTFILES=		pks-current.tgz:sf,local
9
DISTFILES=		pks-current.tgz:sf,local
10
10
11
MAINTAINER=	gtodd@bellanet.org
11
MAINTAINER=	tphilipp@potion-studios.com
12
COMMENT=	PGP Public Key Server
12
COMMENT=	PGP Public Key Server
13
13
14
USE_BDB=		41 # 42 would be ok
14
LICENSE=        BSD4CLAUSE
15
WRKSRC=			${WRKDIR}/${PORTNAME}
15
LICENSE_FILE=	${WRKSRC}/LICENSE
16
16
17
NO_STAGE=	yes
17
WRKSRC=		${WRKDIR}/${PORTNAME}
18
.include <bsd.port.pre.mk>
19
18
19
USE_GCC=	any
20
USE_BDB=	yes
21
WANT_BDB_VER=	41 # pks dumps core with 42 and doesn't build with 43+
22
23
OPTIONS_DEFINE= DOCS
24
PORTDOCS=       pks_help.* README EMAIL
20
GNU_CONFIGURE=	yes
25
GNU_CONFIGURE=	yes
21
USE_AUTOTOOLS=	autoconf
26
USE_AUTOTOOLS=	autoconf
22
CONFIGURE_ARGS=	--datadir=${PREFIX}/share/pks --localstatedir=/var/pks \
27
CONFIGURE_ARGS=	--datadir=${PREFIX}/share/pks --localstatedir=/var/pks \
23
		--sysconfdir=${EXAMPLESDIR} \
28
		--docdir=${PREFIX}/share/doc/pks --sysconfdir=${EXAMPLESDIR} \
24
		--libdir=${LOCALBASE}/lib --with-libwrap
29
		--libdir=${LOCALBASE}/lib --with-libwrap
25
MAKE_ENV+=	SUBDIRS=
30
MAKE_ENV+=	SUBDIRS=
26
LDFLAGS+=	-L${LOCALBASE}/lib
31
LDFLAGS+=	-L${LOCALBASE}/lib
27
CONFIGURE_ENV=	DBLIB="-L${BDB_LIB_DIR} -l${BDB_LIB_NAME}" DBINC=-I${BDB_INCLUDE_DIR} DBHDR=db.h
32
CONFIGURE_ENV=	DBLIB="-L${BDB_LIB_DIR} -l${BDB_LIB_NAME}" DBINC=-I${BDB_INCLUDE_DIR} DBHDR=db.h
28
33
34
35
SUB_FILES=	pkg-message
36
PKGMESSAGE=	${WRKDIR}/pkg-message
37
29
USE_RC_SUBR=	pksd
38
USE_RC_SUBR=	pksd
30
MAN5=		pksd.conf.5
31
MAN8=		pks-intro.8 pksclient.8 pksd.8 pksdctl.8 pks-mail.sh.8 \
32
		pks-queue-run.sh.8 pgpsplit.8
33
39
34
SUB_FILES=	pkg-message pkg-deinstall
40
.include <bsd.port.options.mk>
41
42
post-extract:
43
	@${CP} -a ${FILESDIR}/EMAIL ${WRKSRC}
35
44
36
post-install:
45
post-install:
37
	${INSTALL_DATA} ${WRKSRC}/pksd.conf ${PREFIX}/etc/pksd.conf.sample
46
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/pgpsplit
38
.if !defined(NOPORTDOCS)
47
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/pksdctl
39
	${MKDIR} ${DOCSDIR}
48
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/pksclient
40
	${INSTALL_DATA} ${WRKSRC}/pks_help.en ${WRKSRC}/pks_help.es ${WRKSRC}/pks_help.fr \
49
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/sbin/pksd
41
	${WRKSRC}/pks_help.cz ${WRKSRC}/pks_help.de ${WRKSRC}/pks_help.ja \
50
	${INSTALL_DATA}  ${WRKSRC}/pksd.conf ${STAGEDIR}${PREFIX}/etc/pksd.conf.sample
42
	${WRKSRC}/mail_intro ${DOCSDIR}
51
	#${CHOWN} pksd:pksd /var/pks
43
	PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
52
53
.if ${PORT_OPTIONS:MDOCS}
54
	${MKDIR} ${STAGEDIR}${DOCSDIR}/
55
	cd ${WRKSRC}/ && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}/
44
.endif
56
.endif
45
	@${CAT} ${PKGMESSAGE}
46
57
47
.include <bsd.port.post.mk>
58
.include <bsd.port.mk>
(-)security/pks/files/EMAIL (+60 lines)
Line 0 Link Here
1
From the English README and pksd_help.en files:
2
3
If you have configured the mail server component of the key
4
server, there is one more step you need to take so that the server
5
can actually handle mail.  In your aliases file (usually one of
6
/etc/aliases or /etc/mail/aliases), create the following lines:
7
8
    pgp-public-keys: "|PREFIX/bin/pks-mail.sh PREFIX/etc/pksd.conf"
9
    pgp: pgp-public-keys
10
11
Or, if you are using qmail, create these files for use with the 
12
dot-qmail(5) framework :
13
14
cd /var/qmail/alias/
15
echo "&pgp-public-keys@localhost" > .qmail-pgp
16
echo "|preline /usr/local/bin/pks-mail.sh /usr/local/etc/pksd.conf" > .qmail-pgp-public-keys 
17
18
You might also need to add aliases for the mail addresses you
19
configured in pksd.conf.  
20
21
You will also need to make sure the permissions on PREFIX/var/incoming
22
allow both the mailer and whatever user the pksd program runs as
23
to insert and delete files.
24
25
OpenPGP public email key servers allow users to exchange public
26
keys running using the Internet and properly configured e-mail
27
servers.  This service exists only to help transfer keys between
28
PGP users.  It does NOT attempt to guarantee that a key is a valid
29
key; use the signatures on a key for that kind of security.
30
31
Each keyserver processes requests in the form of mail messages.
32
The commands for the server are entered on the Subject: line.
33
---------------------------------------------- ======== -----
34
Note that they should NOT be included in the body of the message.
35
--------------------- === ---------------------------------------
36
37
        To: pgp-public-keys@keys.pgp.net
38
        From: johndoe@some.site.edu
39
        Subject: help
40
41
Sending your key to ONE server is enough.  After it processes your
42
key, it will forward your add request to other servers automagically.
43
44
For example, to add your key to the keyserver, or to update your key
45
if it is already there, send a message similar to the following to any
46
server:
47
48
        To: pgp-public-keys@keys.pgp.net
49
        From: johndoe@some.site.edu
50
        Subject: add
51
52
        -----BEGIN PGP PUBLIC KEY BLOCK-----
53
        Version: 2.6
54
55
        <blah blah blah>
56
        -----END PGP PUBLIC KEY BLOCK-----
57
58
COMPROMISED KEYS:  Create a Key Revocation Certificate (read the PGP
59
docs on how to do that) and mail your key to the server once again,
60
with the ADD command.
(-)security/pks/files/patch-mkpksdconf.in (+20 lines)
Line 0 Link Here
1
--- ./mkpksdconf.in.orig	2014-01-22 15:36:39.574285045 -0500
2
+++ ./mkpksdconf.in	2014-01-22 15:37:49.289280305 -0500
3
@@ -44,7 +44,7 @@
4
 
5
 cat << EOF
6
 pks_bin_dir @bindir@
7
-pid_dir @localstatedir@/db
8
+pid_dir /var/run
9
 ### Set chroot_dir to make pksd chroot itself. Must be an absolute path.
10
 # chroot_dir @prefix@
11
 ### uid and gid for pksd to run as. Leave unset, or set to 0 to disable
12
@@ -70,7 +70,7 @@
13
 ###   of each message.
14
 maintainer_email PGP Key Server Administrator <nobody>
15
 mail_intro_file @datadir@/mail_intro
16
-help_dir @datadir@
17
+help_dir @docdir@
18
 mail_dir @localstatedir@/incoming
19
 ### If you change this, make sure to put a corresponding help file in
20
 ### the help_dir named above
(-)security/pks/files/pkg-message.in (-6 / +33 lines)
Lines 1-11 Link Here
1
Add the following lines to /etc/rc.conf.local or /etc/rc.conf to enable this service:
1
2
3
 pksd_enable (bool):           Set to NO by default.
4
                               Set it to YES to enable pksd.
2
5
3
	##################################
6
 pksd_config (path):           Set to %%PREFIX%%/etc/pksd.conf
7
                               by default.
4
8
5
	  To enable adding keys via the
9
 pksd_mailq_enable (bool):     Set to NO by default. Process incoming
6
	  web interface please edit the
10
                               mail queue of commands and key requests
7
	  configuration file at:
11
                               (you will need to configure your mail
12
                               infrastructure to enable this. See:
13
                               %%PREFIX%%/share/doc/pks/README and
14
                               %%PREFIX%%/share/doc/pks/EMAIL for details.
15
 
16
 pksd_queue_delay (int):       Periodically process incoming mail.
17
                               Set to 60 seconds by default.
8
18
9
	   %%PREFIX%%/etc/pksd.conf
19
        #############################################
20
21
          To enable adding keys via the web interface
22
          please create a configuration file at:
23
24
            %%PREFIX%%/etc/pksd.conf
25
26
          Check sample file at:
27
28
            %%PREFIX%%/etc/pksd.conf.sample
29
30
31
          Also note that the database used by pks
32
          sometimes needs to be created manually, to
33
          do that refer to:
34
35
            man 8 pksclient
36
37
        #############################################
10
38
11
	##################################
(-)security/pks/files/pksd.in (-11 / +47 lines)
Lines 5-21 Link Here
5
#
5
#
6
# PROVIDE: pksd
6
# PROVIDE: pksd
7
# REQUIRE: DAEMON
7
# REQUIRE: DAEMON
8
# KEYWORD: SHUTDOWN
9
#
10
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
11
# to enable this service:
12
#
13
# pksd_enable (bool):		Set to NO by default.
14
#				Set it to YES to enable pksd.
15
#
16
# pksd_config (path):		Set to %%PREFIX%%/etc/pksd.conf
17
#				by default.
18
#
19
# pksd_mailq_enable (bool):     Set to NO by default. Process incoming
20
#                               mail queue of commands and key requests
21
#                               (you will need to configure your mail
22
#                               infrastructure to enable this. See:
23
#                               %%PREFIX%%/share/doc/pks/README and
24
#                               %%PREFIX%%/share/doc/pks/EMAIL for details.
25
# 
26
# pksd_queue_delay (int):       Periodically process incoming mail.
27
#				Set to 60 seconds by default.
8
28
9
. /etc/rc.subr
29
. /etc/rc.subr
10
30
11
name="pksd"
31
name="pksd"
12
rcvar=pksd_enable
32
rcvar=pksd_enable
13
command="%%PREFIX%%/sbin/pksd"
33
14
command_args="%%PREFIX%%/etc/${name}.conf &"
34
load_rc_config $name
15
required_files="%%PREFIX%%/etc/${name}.conf"
35
16
start_precmd="pksd_precmd"
36
: ${pksd_enable:="NO"}
17
start_postcmd="pksd_runqueue"
37
: ${pksd_mailq_enable:="NO"}
18
stop_command="pksd_clean_stop"
38
: ${pksd_config="%%PREFIX%%/etc/pksd.conf"}
39
: ${pksd_queue_delay="60"}
40
41
command="%%PREFIX%%/sbin/${name}"
42
command_args="%%PREFIX%%/etc/${name}.conf"
43
required_files="${pksd_config}"
44
start_precmd="${name}_precmd"
45
start_cmd="${name}_start"
46
#start_postcmd="${name}_runqueue"
47
stop_command="${name}_clean_stop"
48
pidfile="/var/run/${name}.pid"
19
49
20
pksd_precmd()
50
pksd_precmd()
21
{
51
{
Lines 31-44 Link Here
31
	fi
61
	fi
32
}
62
}
33
63
64
pksd_start()
65
{
66
	echo "Starting pksd"
67
        /usr/sbin/daemon -f -p ${pidfile} ${command} ${command_args}
68
}
69
34
pksd_runqueue()
70
pksd_runqueue()
35
{
71
{
36
	if [ -x %%PREFIX%%/bin/${name} -a -x %%PREFIX%%/bin/pks-queue-run.sh ]
72
	if [ -x %%PREFIX%%/bin/${name}ctl -a -x %%PREFIX%%/bin/pks-queue-run.sh ] && checkyesno pksd_mailq_enable
37
        then
73
        then
38
        	echo "Doing queue run for ${name}."
74
        	echo "Doing queue run for ${name} every ${pksd_queue_delay} seconds."
39
		sleep 5
75
	        sleep 2
40
        	%%PREFIX%%/bin/pks-queue-run.sh %%PREFIX%%/etc/${name}.conf
76
        	%%PREFIX%%/bin/pks-queue-run.sh %%PREFIX%%/etc/${name}.conf ${pksd_queue_delay}
41
	fi
77
  fi
42
}
78
}
43
79
44
pksd_clean_stop()
80
pksd_clean_stop()
(-)security/pks/pkg-plist (-8 / +12 lines)
Lines 8-21 Link Here
8
%%DATADIR%%/mail_intro
8
%%DATADIR%%/mail_intro
9
%%DATADIR%%/pks-commands.html
9
%%DATADIR%%/pks-commands.html
10
%%DATADIR%%/pks-commands.php
10
%%DATADIR%%/pks-commands.php
11
%%PORTDOCS%%%%DOCSDIR%%/mail_intro
12
%%PORTDOCS%%%%DOCSDIR%%/pks_help.en
13
%%PORTDOCS%%%%DOCSDIR%%/pks_help.es
14
%%PORTDOCS%%%%DOCSDIR%%/pks_help.fr
15
%%PORTDOCS%%%%DOCSDIR%%/pks_help.de
16
%%PORTDOCS%%%%DOCSDIR%%/pks_help.cz
17
%%PORTDOCS%%%%DOCSDIR%%/pks_help.ja
18
%%PORTDOCS%%@dirrm %%DOCSDIR%%
19
%%EXAMPLESDIR%%/pksd.conf
11
%%EXAMPLESDIR%%/pksd.conf
12
man/man5/pksd.conf.5.gz
13
man/man8/pgpsplit.8.gz
14
man/man8/pks-intro.8.gz
15
man/man8/pks-mail.sh.8.gz
16
man/man8/pks-queue-run.sh.8.gz
17
man/man8/pksclient.8.gz
18
man/man8/pksd.8.gz
19
man/man8/pksdctl.8.gz
20
/var/pks/index.html
21
@unexec rmdir "/var/pks/db" >/dev/null 2>&1 || :
22
@unexec rmdir "/var/pks/incoming" >/dev/null 2>&1 || :
23
@unexec rmdir "/var/pks" >/dev/null 2>&1 || :
20
@dirrm %%EXAMPLESDIR%%
24
@dirrm %%EXAMPLESDIR%%
21
@dirrm share/pks
25
@dirrm share/pks

Return to bug 181507