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
c3f61124
Commit
c3f61124
authored
Mar 19, 2022
by
Ian Grant
Browse files
feat: Configure certificate for TrueNAS S3 service (MinIO)
parent
e88442cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
deploy/truenas.sh
View file @
c3f61124
...
@@ -159,7 +159,30 @@ truenas_deploy() {
...
@@ -159,7 +159,30 @@ truenas_deploy() {
fi
fi
_debug3 _activate_ftp_cert
"
$_activate_ftp_cert
"
_debug3 _activate_ftp_cert
"
$_activate_ftp_cert
"
else
else
_info
"FTP certificate not set or not the same as Web UI"
_info
"FTP certificate is not configured or is not the same as TrueNAS web UI"
fi
_info
"Checking if S3 certificate is the same as the TrueNAS web UI"
_s3_list
=
$(
_get
"
$_api_url
/s3"
)
_s3_cert_id
=
$(
echo
"
$_s3_list
"
|
grep
'"certificate":'
|
tr
-d
--
'"certifa:_ ,'
)
if
[
"
$_s3_cert_id
"
=
"
$_active_cert_id
"
]
;
then
_info
"Updating the S3 certificate"
_debug _s3_cert_id
"
$_s3_cert_id
"
_s3_data
=
"{
\"
certificate
\"
:
\"
${
_cert_id
}
\"
}"
_activate_s3_cert
=
"
$(
_post
"
$_s3_data
"
"
$_api_url
/s3"
""
"PUT"
"application/json"
)
"
_s3_new_cert_id
=
$(
echo
"
$_activate_s3_cert
"
| _json_decode |
grep
'"certificate":'
|
sed
-n
's/.*: \([0-9]\{1,\}\),\{0,1\}$/\1/p'
)
if
[
"
$_s3_new_cert_id
"
-eq
"
$_cert_id
"
]
;
then
_info
"S3 certificate updated successfully"
else
_err
"Unable to set S3 certificate"
_debug3 _activate_s3_cert
"
$_activate_s3_cert
"
_debug3 _s3_new_cert_id
"
$_s3_new_cert_id
"
return
1
fi
_debug3 _activate_s3_cert
"
$_activate_s3_cert
"
else
_info
"S3 certificate is not configured or is not the same as TrueNAS web UI"
fi
fi
_info
"Delete old Certificate"
_info
"Delete old Certificate"
...
...
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