Compare commits
20 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2425a8560 | ||
|
|
ce9770cf6f | ||
|
|
b900866285 | ||
|
|
9411bfddbb | ||
|
|
c4b1aba35b | ||
|
|
d688442e67 | ||
|
|
97c153bd43 | ||
|
|
a84f3ca3a7 | ||
|
|
a6589987fd | ||
|
|
32b4c1e85e | ||
|
|
9808a6f48f | ||
|
|
5ceb96715a | ||
|
|
1699efe272 | ||
|
|
e054a61e96 | ||
|
|
4335142cbc | ||
|
|
6894bf2ad7 | ||
|
|
025342a309 | ||
|
|
33bcc9a3c8 | ||
|
|
3d604603d9 | ||
|
|
60aa82821b |
2 changed files with 9 additions and 29 deletions
|
|
@ -1,25 +1,9 @@
|
|||
#!/bin/sh
|
||||
#default key type:rsa
|
||||
KEY_TYPE="rsa"
|
||||
|
||||
#check key type 'rsa', 'rsa-pss', 'dsa', 'ecdsa', 'ed25519, 'ed448', 'x25519', and 'x448'
|
||||
if [ $# -gt 0 ]; then
|
||||
case "$1" in
|
||||
rsa|rsa-pss|dsa|ecdsa|ed25519|ed448|x25519|x448)
|
||||
KEY_TYPE="$1"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 [rsa|rsa-pss|dsa|ecdsa|ed25519|ed448|x25519|x448]"
|
||||
echo "Default key type: rsa"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
#generate CA certificate/key
|
||||
if test ! -f /etc/pki/ocserv/private/ca.key;then
|
||||
mkdir -p /etc/pki/ocserv/private
|
||||
certtool --generate-privkey --key-type=$KEY_TYPE --outfile /etc/pki/ocserv/private/ca.key >/dev/null 2>&1
|
||||
certtool --generate-privkey --outfile /etc/pki/ocserv/private/ca.key >/dev/null 2>&1
|
||||
echo "cn=`hostname -f` CA" >/etc/pki/ocserv/ca.tmpl
|
||||
echo "expiration_days=-1" >>/etc/pki/ocserv/ca.tmpl
|
||||
echo "serial=1" >>/etc/pki/ocserv/ca.tmpl
|
||||
|
|
@ -33,7 +17,7 @@ fi
|
|||
|
||||
#generate server certificate/key
|
||||
if test ! -f /etc/pki/ocserv/private/server.key;then
|
||||
certtool --generate-privkey --key-type=$KEY_TYPE --outfile /etc/pki/ocserv/private/server.key >/dev/null 2>&1
|
||||
certtool --generate-privkey --outfile /etc/pki/ocserv/private/server.key >/dev/null 2>&1
|
||||
echo "cn=`hostname -f`" >/etc/pki/ocserv/server.tmpl
|
||||
echo "serial=2" >>/etc/pki/ocserv/server.tmpl
|
||||
echo "expiration_days=-1" >>/etc/pki/ocserv/server.tmpl
|
||||
|
|
|
|||
18
ocserv.spec
18
ocserv.spec
|
|
@ -25,8 +25,8 @@ Summary: OpenConnect SSL VPN server
|
|||
|
||||
# For a breakdown of the licensing, see PACKAGE-LICENSING
|
||||
# To simplify licenses LGPLv2+ files have been promoted to GPLv2+.
|
||||
License: GPL-2.0-or-later AND BSD-3-Clause AND MIT AND CC0-1.0
|
||||
URL: https://ocserv.openconnect-vpn.net/
|
||||
License: GPLv2+ and BSD and MIT and CC0
|
||||
URL: https://gui.openconnect-vpn.net
|
||||
Source0: https://www.infradead.org/ocserv/download/%{name}-%{version}.tar.xz
|
||||
Source1: https://www.infradead.org/ocserv/download/%{name}-%{version}.tar.xz.sig
|
||||
Source2: gpgkey-1F42418905D8206AA754CCDC29EE58B996865171.gpg
|
||||
|
|
@ -43,7 +43,6 @@ Source11: ocserv.init
|
|||
# http://git.infradead.org/ocserv.git/commitdiff/7d70006a2dbddf783213f1856374bacc74217e09
|
||||
|
||||
BuildRequires: make
|
||||
BuildRequires: libxcrypt-devel
|
||||
BuildRequires: gcc
|
||||
%if 0%{?rhel} && 0%{?rhel} <= 6
|
||||
BuildRequires: gnutls30-devel
|
||||
|
|
@ -101,6 +100,7 @@ BuildRequires: rubygem-ronn-ng
|
|||
Recommends: gnutls-utils
|
||||
Recommends: iproute
|
||||
Recommends: pam
|
||||
Requires(pre): shadow-utils
|
||||
%if %{use_systemd}
|
||||
Requires(post): systemd
|
||||
Requires(preun): systemd
|
||||
|
|
@ -141,11 +141,6 @@ sed -i 's/run-as-group = nogroup/run-as-group = nobody/g' tests/data/*.config
|
|||
echo "int main() { return 77; }" > tests/valid-hostname.c
|
||||
%endif
|
||||
|
||||
# Create a sysusers.d config file
|
||||
cat >ocserv.sysusers.conf <<EOF
|
||||
u ocserv - 'ocserv' %{_localstatedir}/lib/ocserv -
|
||||
EOF
|
||||
|
||||
%build
|
||||
|
||||
%if 0%{?rhel} && 0%{?rhel} <= 6
|
||||
|
|
@ -176,6 +171,10 @@ autoreconf -fvi
|
|||
make %{?_smp_mflags}
|
||||
|
||||
%pre
|
||||
getent group ocserv &>/dev/null || groupadd -r ocserv
|
||||
getent passwd ocserv &>/dev/null || \
|
||||
/usr/sbin/useradd -r -g ocserv -s /sbin/nologin -c ocserv \
|
||||
-d %{_localstatedir}/lib/ocserv ocserv
|
||||
mkdir -p %{_sysconfdir}/pki/ocserv/public
|
||||
mkdir -p -m 700 %{_sysconfdir}/pki/ocserv/private
|
||||
mkdir -p %{_sysconfdir}/pki/ocserv/cacerts
|
||||
|
|
@ -226,8 +225,6 @@ install -D -m 0755 %{SOURCE11} %{buildroot}/%{_initrddir}/%{name}
|
|||
|
||||
%make_install
|
||||
|
||||
install -m0644 -D ocserv.sysusers.conf %{buildroot}%{_sysusersdir}/ocserv.conf
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
|
||||
|
|
@ -258,7 +255,6 @@ install -m0644 -D ocserv.sysusers.conf %{buildroot}%{_sysusersdir}/ocserv.conf
|
|||
%else
|
||||
%{_initrddir}/%{name}
|
||||
%endif
|
||||
%{_sysusersdir}/ocserv.conf
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue