Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Warden
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pavel Valach
Warden
Commits
499ce6d9
Commit
499ce6d9
authored
8 years ago
by
Pavel Kácha
Browse files
Options
Downloads
Patches
Plain Diff
Added forgotten RA application script
parent
af23d579
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
warden3/contrib/warden_ra/warden_apply.sh
+42
-0
42 additions, 0 deletions
warden3/contrib/warden_ra/warden_apply.sh
with
42 additions
and
0 deletions
warden3/contrib/warden_ra/warden_apply.sh
0 → 100755
+
42
−
0
View file @
499ce6d9
#!/bin/bash
url
=
'https://warden-ra.cesnet.cz/warden-ra/getCert'
key
=
key.pem
csr
=
csr.pem
cert
=
cert.pem
result
=
${
TMPDIR
:-${
TMP
:-
/tmp
}}
/cert.
$$
.
$RANDOM
config
=
${
TMPDIR
:-${
TMP
:-
/tmp
}}
/conf.
$$
.
$RANDOM
client
=
"
$1
"
password
=
"
$2
"
trap
'rm -f "$config $result"'
INT TERM HUP EXIT
function
flee
{
echo
-e
"
$1
"
;
exit
$2
;
}
[
-z
"
$client
"
-o
-z
"
$password
"
]
&&
flee
"Usage:
${
0
%.*
}
client.name password"
255
openssl version
>
/dev/null 2>&1
||
flee
"Haven't found 'openssl' binary."
curl
--version
>
/dev/null 2>&1
||
flee
"Haven't found 'curl' binary."
for
n
in
"
$csr
"
"
$key
"
"
$cert
"
;
do
[
-e
"
$n
"
]
&&
flee
"
$n
already exists, I won't overwrite, move them away first, please."
254
done
for
n
in
"
$result
"
"
$config
"
;
do
touch
"
$n
"
||
flee
"Error creating temporary file (
$n
)."
253
done
echo
-e
"default_bits=2048
\n
distinguished_name=rdn
\n
prompt=no
\n
[rdn]
\n
commonName=dummy"
\
>
"
$config
"
openssl req
-new
-nodes
-batch
-keyout
"
$key
"
-out
"
$csr
"
-config
"
$config
"
\
||
flee
"Error generating key/certificate request."
252
curl
--progress-bar
--request
POST
--data-binary
'@-'
"
$url
?name=
$client
&password=
$password
"
\
<
"
$csr
"
\
>
"
$result
"
case
$(
<
$result
)
in
'-----BEGIN CERTIFICATE-----'
*
)
mv
"
$result
"
"
$cert
"
flee
"Succesfully generated key (
$key
) and obtained certificate (
$cert
)."
0
esac
flee
"
$(
<
$result
)
\n\n
Certificate request failed. Please save all error messages for communication with registration authority representative."
252
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment