mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Replace /home/pi with $HOME. Resolves #435
This commit is contained in:
parent
785b43b3ba
commit
3ba3f3351b
@ -63,7 +63,7 @@ function install_mkcert() {
|
|||||||
# Generate a certificate for host
|
# Generate a certificate for host
|
||||||
function generate_certificate() {
|
function generate_certificate() {
|
||||||
install_log "Generating a new certificate for $certname"
|
install_log "Generating a new certificate for $certname"
|
||||||
cd /home/pi
|
cd $HOME
|
||||||
mkcert $certname "*.${certname}.local" $certname || install_error "Failed to generate certificate for $certname"
|
mkcert $certname "*.${certname}.local" $certname || install_error "Failed to generate certificate for $certname"
|
||||||
|
|
||||||
install_log "Combining private key and certificate"
|
install_log "Combining private key and certificate"
|
||||||
@ -80,8 +80,8 @@ function create_lighttpd_dir() {
|
|||||||
echo "OK"
|
echo "OK"
|
||||||
|
|
||||||
install_log "Setting permissions and moving .pem file"
|
install_log "Setting permissions and moving .pem file"
|
||||||
chmod 400 /home/pi/"$certname".pem || install_error "Unable to set permissions for .pem file"
|
chmod 400 "$HOME/$certname".pem || install_error "Unable to set permissions for .pem file"
|
||||||
sudo mv /home/pi/"$certname".pem /etc/lighttpd/ssl || install_error "Unable to move .pem file"
|
sudo mv "$HOME/$certname".pem /etc/lighttpd/ssl || install_error "Unable to move .pem file"
|
||||||
echo "OK"
|
echo "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ function configure_lighttpd() {
|
|||||||
'$SERVER["socket"] == ":443" {'
|
'$SERVER["socket"] == ":443" {'
|
||||||
'ssl.engine = "enable"'
|
'ssl.engine = "enable"'
|
||||||
'ssl.pemfile = "'$lighttpd_ssl/$certname'.pem"'
|
'ssl.pemfile = "'$lighttpd_ssl/$certname'.pem"'
|
||||||
'ssl.ca-file = "/home/pi/.local/share/mkcert/rootCA.pem"'
|
'ssl.ca-file = "'$HOME'/.local/share/mkcert/rootCA.pem"'
|
||||||
'server.name = "'$certname'"'
|
'server.name = "'$certname'"'
|
||||||
'server.document-root = "'${webroot_dir}'"}'
|
'server.document-root = "'${webroot_dir}'"}'
|
||||||
)
|
)
|
||||||
@ -111,7 +111,7 @@ function configure_lighttpd() {
|
|||||||
# Copy rootCA.pem to RaspAP web root
|
# Copy rootCA.pem to RaspAP web root
|
||||||
function copy_rootca() {
|
function copy_rootca() {
|
||||||
install_log "Copying rootCA.pem to RaspAP web root"
|
install_log "Copying rootCA.pem to RaspAP web root"
|
||||||
sudo cp /home/pi/.local/share/mkcert/rootCA.pem ${webroot_dir} || install_error "Unable to copy rootCA.pem to ${webroot_dir}"
|
sudo cp ${HOME}/.local/share/mkcert/rootCA.pem ${webroot_dir} || install_error "Unable to copy rootCA.pem to ${webroot_dir}"
|
||||||
echo "OK"
|
echo "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user