Issue#36: .deb deploys default TLS certificate and private key (#39)
* issue#36: Generating TLS key and self-signed cert after installing/upgrading the package * issue#36: Updated libstdc++.a dependency to v10 * issue#36: Generate self-signed certs after install/upgrade * issue#36: Updated dependencies * issue#36: Check for pre-existence of key/certpull/52/head
parent
537a567e29
commit
ab057c854c
@ -1,6 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
ETC='/opt/key-networks/ztncui/etc'
|
ETC='/opt/key-networks/ztncui/etc'
|
||||||
echo "Copying default password file..."
|
if [ -f ${ETC}/passwd ]; then
|
||||||
cp -pv $ETC/default.passwd $ETC/passwd
|
echo "Password file aready exists"
|
||||||
|
else
|
||||||
|
echo "Copying default password file..."
|
||||||
|
cp -pv ${ETC}/default.passwd ${ETC}/passwd
|
||||||
|
fi
|
||||||
|
if [ -f /opt/key-networks/ztncui/etc/tls/privkey.pem ] && [ -f /opt/key-networks/ztncui/etc/tls/fullchain.pem ]; then
|
||||||
|
echo "TLS key and certificate already exist"
|
||||||
|
else
|
||||||
|
echo "Generating new TLS key and self-signed certificate..."
|
||||||
|
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout /opt/key-networks/ztncui/etc/tls/privkey.pem -out /opt/key-networks/ztncui/etc/tls/fullchain.pem -subj "/C=XX/ST=YY/L=ZZ/O=Security/OU=SelfSigned/CN=example.com"
|
||||||
|
fi
|
||||||
|
chown ztncui.ztncui /opt/key-networks/ztncui/etc/tls/*
|
||||||
echo "Enabling and starting ztncui service..."
|
echo "Enabling and starting ztncui service..."
|
||||||
systemctl enable ztncui
|
systemctl enable ztncui
|
||||||
systemctl start ztncui
|
systemctl start ztncui
|
||||||
|
@ -1,2 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ -f /opt/key-networks/ztncui/etc/tls/privkey.pem ] && [ -f /opt/key-networks/ztncui/etc/tls/fullchain.pem ]; then
|
||||||
|
echo "TLS key and certificate already exist"
|
||||||
|
else
|
||||||
|
echo "Generating new TLS key and self-signed certificate..."
|
||||||
|
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout /opt/key-networks/ztncui/etc/tls/privkey.pem -out /opt/key-networks/ztncui/etc/tls/fullchain.pem -subj "/C=XX/ST=YY/L=ZZ/O=Security/OU=SelfSigned/CN=example.com"
|
||||||
|
fi
|
||||||
|
chown ztncui.ztncui /opt/key-networks/ztncui/etc/tls/*
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl try-restart ztncui
|
systemctl try-restart ztncui
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
--- /tmp/binding.gyp 2018-07-07 14:38:23.884143337 +0800
|
--- ../src/node_modules/argon2/binding.gyp
|
||||||
+++ ../src/node_modules/argon2/binding.gyp 2018-07-07 14:39:09.684840870 +0800
|
+++ ../src/node_modules/argon2/binding.gyp
|
||||||
@@ -47,6 +47,7 @@
|
@@ -47,6 +47,7 @@
|
||||||
],
|
],
|
||||||
"cflags+": ["-Wno-cast-function-type"],
|
"cflags+": ["-Wno-cast-function-type"],
|
||||||
"include_dirs+": ["<!(node -e \"require('nan')\")"],
|
"include_dirs+": ["<!(node -e \"require('nan')\")"],
|
||||||
+ "libraries": ["/usr/lib/gcc/x86_64-redhat-linux/9/libstdc++.a"],
|
+ "libraries": ["/usr/lib/gcc/x86_64-redhat-linux/10/libstdc++.a"],
|
||||||
"dependencies": ["libargon2"],
|
"dependencies": ["libargon2"],
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"Debug": {
|
"Debug": {
|
||||||
|
Loading…
Reference in new issue