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
a6b5f0c9
Unverified
Commit
a6b5f0c9
authored
Jul 04, 2023
by
Steven Zhu
Browse files
Fix variable naming to make the access key and secret key consistent with Route53.
parent
8d136c6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
notify/aws_ses.sh
View file @
a6b5f0c9
#!/usr/bin/env sh
#
#AWS_
SES_
ACCESS_KEY_ID="sdfsdfsdfljlbjkljlkjsdfoiwje"
#AWS_ACCESS_KEY_ID="sdfsdfsdfljlbjkljlkjsdfoiwje"
#
#AWS_
SES_
SECRET_ACCESS_KEY="xxxxxxx"
#AWS_SECRET_ACCESS_KEY="xxxxxxx"
#
#AWS_SES_REGION="us-east-1"
#
...
...
@@ -21,17 +21,17 @@ aws_ses_send() {
_statusCode
=
"
$3
"
#0: success, 1: error 2($RENEW_SKIP): skipped
_debug
"_statusCode"
"
$_statusCode
"
AWS_
SES_
ACCESS_KEY_ID
=
"
${
AWS_
SES_
ACCESS_KEY_ID
:-
$(
_readaccountconf_mutable AWS_
SES_
ACCESS_KEY_ID
)
}
"
AWS_
SES_
SECRET_ACCESS_KEY
=
"
${
AWS_
SES_
SECRET_ACCESS_KEY
:-
$(
_readaccountconf_mutable AWS_
SES_
SECRET_ACCESS_KEY
)
}
"
AWS_ACCESS_KEY_ID
=
"
${
AWS_ACCESS_KEY_ID
:-
$(
_readaccountconf_mutable AWS_ACCESS_KEY_ID
)
}
"
AWS_SECRET_ACCESS_KEY
=
"
${
AWS_SECRET_ACCESS_KEY
:-
$(
_readaccountconf_mutable AWS_SECRET_ACCESS_KEY
)
}
"
AWS_SES_REGION
=
"
${
AWS_SES_REGION
:-
$(
_readaccountconf_mutable AWS_SES_REGION
)
}
"
if
[
-z
"
$AWS_
SES_
ACCESS_KEY_ID
"
]
||
[
-z
"
$AWS_
SES_
SECRET_ACCESS_KEY
"
]
;
then
if
[
-z
"
$AWS_ACCESS_KEY_ID
"
]
||
[
-z
"
$AWS_SECRET_ACCESS_KEY
"
]
;
then
_use_container_role
||
_use_instance_role
fi
if
[
-z
"
$AWS_
SES_
ACCESS_KEY_ID
"
]
||
[
-z
"
$AWS_
SES_
SECRET_ACCESS_KEY
"
]
;
then
AWS_
SES_
ACCESS_KEY_ID
=
""
AWS_
SES_
SECRET_ACCESS_KEY
=
""
if
[
-z
"
$AWS_ACCESS_KEY_ID
"
]
||
[
-z
"
$AWS_SECRET_ACCESS_KEY
"
]
;
then
AWS_ACCESS_KEY_ID
=
""
AWS_SECRET_ACCESS_KEY
=
""
_err
"You haven't specified the aws SES api key id and and api key secret yet."
_err
"Please create your key and try again. see
$(
__green
$AWS_WIKI
)
"
return
1
...
...
@@ -46,8 +46,8 @@ aws_ses_send() {
#save for future use, unless using a role which will be fetched as needed
if
[
-z
"
$_using_role
"
]
;
then
_saveaccountconf_mutable AWS_
SES_
ACCESS_KEY_ID
"
$AWS_
SES_
ACCESS_KEY_ID
"
_saveaccountconf_mutable AWS_
SES_
SECRET_ACCESS_KEY
"
$AWS_
SES_
SECRET_ACCESS_KEY
"
_saveaccountconf_mutable AWS_ACCESS_KEY_ID
"
$AWS_ACCESS_KEY_ID
"
_saveaccountconf_mutable AWS_SECRET_ACCESS_KEY
"
$AWS_SECRET_ACCESS_KEY
"
fi
AWS_SES_TO
=
"
${
AWS_SES_TO
:-
$(
_readaccountconf_mutable AWS_SES_TO
)
}
"
...
...
@@ -93,8 +93,8 @@ _use_metadata() {
_debug3
"_key"
"
$_key
"
_secure_debug3
"_value"
"
$_value
"
case
"
$_key
"
in
AccessKeyId
)
echo
"AWS_
SES_
ACCESS_KEY_ID=
$_value
"
;;
SecretAccessKey
)
echo
"AWS_
SES_
SECRET_ACCESS_KEY=
$_value
"
;;
AccessKeyId
)
echo
"AWS_ACCESS_KEY_ID=
$_value
"
;;
SecretAccessKey
)
echo
"AWS_SECRET_ACCESS_KEY=
$_value
"
;;
Token
)
echo
"AWS_SESSION_TOKEN=
$_value
"
;;
esac
done
|
...
...
@@ -173,7 +173,7 @@ aws_rest() {
_debug2 StringToSign
"
$StringToSign
"
kSecret
=
"AWS4
$AWS_
SES_
SECRET_ACCESS_KEY
"
kSecret
=
"AWS4
$AWS_SECRET_ACCESS_KEY
"
#kSecret="wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY" ############################
...
...
@@ -197,7 +197,7 @@ aws_rest() {
signature
=
"
$(
printf
"
$StringToSign
%s"
| _hmac
"
$Hash
"
"
$kSigningH
"
hex
)
"
_debug2 signature
"
$signature
"
Authorization
=
"
$Algorithm
Credential=
$AWS_
SES_
ACCESS_KEY_ID
/
$CredentialScope
, SignedHeaders=
$SignedHeaders
, Signature=
$signature
"
Authorization
=
"
$Algorithm
Credential=
$AWS_ACCESS_KEY_ID
/
$CredentialScope
, SignedHeaders=
$SignedHeaders
, Signature=
$signature
"
_debug2 Authorization
"
$Authorization
"
_H2
=
"Authorization:
$Authorization
"
...
...
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