Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
e4ed0b18
Unverified
Commit
e4ed0b18
authored
Apr 12, 2022
by
neil
Committed by
GitHub
Apr 12, 2022
Browse files
Merge pull request #4029 from quthla/patch-1
Store Mailcow deploy parameters
parents
29e23ac9
08ae8cc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
deploy/mailcow.sh
View file @
e4ed0b18
...
@@ -20,18 +20,23 @@ mailcow_deploy() {
...
@@ -20,18 +20,23 @@ mailcow_deploy() {
_debug _cca
"
$_cca
"
_debug _cca
"
$_cca
"
_debug _cfullchain
"
$_cfullchain
"
_debug _cfullchain
"
$_cfullchain
"
_mailcow_path
=
"
${
DEPLOY_MAILCOW_PATH
}
"
_getdeployconf DEPLOY_MAILCOW_PATH
_getdeployconf DEPLOY_MAILCOW_RELOAD
if
[
-z
"
$_mailcow_path
"
]
;
then
_debug DEPLOY_MAILCOW_PATH
"
$DEPLOY_MAILCOW_PATH
"
_debug DEPLOY_MAILCOW_RELOAD
"
$DEPLOY_MAILCOW_RELOAD
"
if
[
-z
"
$DEPLOY_MAILCOW_PATH
"
]
;
then
_err
"Mailcow path is not found, please define DEPLOY_MAILCOW_PATH."
_err
"Mailcow path is not found, please define DEPLOY_MAILCOW_PATH."
return
1
return
1
fi
fi
#Tests if _ssl_path is the mailcow root directory.
_savedeployconf DEPLOY_MAILCOW_PATH
"
$DEPLOY_MAILCOW_PATH
"
if
[
-f
"
${
_mailcow_path
}
/generate_config.sh"
]
;
then
[
-n
"
$DEPLOY_MAILCOW_RELOAD
"
]
&&
_savedeployconf DEPLOY_MAILCOW_RELOAD
"
$DEPLOY_MAILCOW_RELOAD
"
_ssl_path
=
"
${
_mailcow_path
}
/data/assets/ssl/"
else
_ssl_path
=
"
$DEPLOY_MAILCOW_PATH
"
_ssl_path
=
"
${
_mailcow_path
}
"
if
[
-f
"
$DEPLOY_MAILCOW_PATH
/generate_config.sh"
]
;
then
_ssl_path
=
"
$DEPLOY_MAILCOW_PATH
/data/assets/ssl/"
fi
fi
if
[
!
-d
"
$_ssl_path
"
]
;
then
if
[
!
-d
"
$_ssl_path
"
]
;
then
...
@@ -40,16 +45,15 @@ mailcow_deploy() {
...
@@ -40,16 +45,15 @@ mailcow_deploy() {
fi
fi
# ECC or RSA
# ECC or RSA
if
[
-z
"
${
Le_Keylength
}
"
]
;
then
length
=
$(
_readdomainconf Le_Keylength
)
Le_Keylength
=
""
if
_isEccKey
"
$length
"
;
then
fi
if
_isEccKey
"
${
Le_Keylength
}
"
;
then
_info
"ECC key type detected"
_info
"ECC key type detected"
_cert_name_prefix
=
"ecdsa-"
_cert_name_prefix
=
"ecdsa-"
else
else
_info
"RSA key type detected"
_info
"RSA key type detected"
_cert_name_prefix
=
""
_cert_name_prefix
=
""
fi
fi
_info
"Copying key and cert"
_info
"Copying key and cert"
_real_key
=
"
$_ssl_path
/
${
_cert_name_prefix
}
key.pem"
_real_key
=
"
$_ssl_path
/
${
_cert_name_prefix
}
key.pem"
if
!
cat
"
$_ckey
"
>
"
$_real_key
"
;
then
if
!
cat
"
$_ckey
"
>
"
$_real_key
"
;
then
...
@@ -63,7 +67,7 @@ mailcow_deploy() {
...
@@ -63,7 +67,7 @@ mailcow_deploy() {
return
1
return
1
fi
fi
DEFAULT_MAILCOW_RELOAD
=
"docker restart
$(
docker ps
-
qaf
name
=
postfix-mailcow
)
; docker restart
$(
docker ps
-qaf
name
=
nginx-mailcow
)
; docker restart
$(
docker ps
-qaf
name
=
dovecot-mailcow
)
"
DEFAULT_MAILCOW_RELOAD
=
"docker restart
\
$
(docker ps -
-quiet --filter name=nginx-mailcow --filter
name=dovecot-mailcow)"
_reload
=
"
${
DEPLOY_MAILCOW_RELOAD
:-
$DEFAULT_MAILCOW_RELOAD
}
"
_reload
=
"
${
DEPLOY_MAILCOW_RELOAD
:-
$DEFAULT_MAILCOW_RELOAD
}
"
_info
"Run reload:
$_reload
"
_info
"Run reload:
$_reload
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment