~cadence/bliz

ref: 4a5ec63ec0db33d4070adeb3838f6192f282a48c bliz/certs.fish -rwxr-xr-x 948 bytes
4a5ec63eCadence Ember Add paragraph count to gemlog intro 1 year, 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env fish

cd (dirname (status current-filename))/certs; or exit

set days 10000 # 27 years

if test -f key.pem
    echo 'Warning! If you have already generated keys, they will be overwritten.'
    echo 'If you continue, you will fail Trust On First Use, and some browsers may'
    echo 'be unhappy with your site.'
    echo 'If you have not yet published your site, you can ignore this warning.'
    echo
end

echo 'To generate certificatates, enter the domain name that your site will be'
echo 'eventually published on. If you don\'t care, you can enter nothing.'
echo -n 'Example input: '; set_color cyan; echo 'an-excellent.website'
read domain -P 'domain name > '
echo

# Country, state, locality, organisation, unit, domain name, email
echo -en ".\n.\n.\n.\n.\n$domain\n.\n" | \
    openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days $days -nodes \
    ; or exit

echo
echo
echo 'Everything appears to be okay.'