forked from mirrors/misskey
* wip * Update config.ts * wip * convertは元ファイルを変更するようなニュアンスを若干感じるのでcompileに改名 * wip * Update package.json * Revert "Update package.json" This reverts commit e5c28023168f4631dc6b36a14b35cfddbad1fac0. * wip * wip * 謎 * clean up * wip * wip * Revert "wip" This reverts commit 3aa25ac7cf337d57412308e63d8f54e2536b0f7f. * wip * wip * Update dummy.yml * wip * Update compile_config.js * Update compile_config.js * wip * Revert "wip" This reverts commit fd78e097c65f747962e7a411938a0e67538ed347. * Update dummy.yml * Update compile_config.js
36 lines
1.1 KiB
Bash
36 lines
1.1 KiB
Bash
#!/bin/bash
|
|
mkdir certificates
|
|
|
|
# rootCA
|
|
openssl genrsa -des3 \
|
|
-passout pass:rootCA \
|
|
-out certificates/rootCA.key 4096
|
|
openssl req -x509 -new -nodes -batch \
|
|
-key certificates/rootCA.key \
|
|
-sha256 \
|
|
-days 1024 \
|
|
-passin pass:rootCA \
|
|
-out certificates/rootCA.crt
|
|
|
|
# domain
|
|
function generate {
|
|
openssl req -new -newkey rsa:2048 -sha256 -nodes \
|
|
-keyout certificates/$1.key \
|
|
-subj "/CN=$1/emailAddress=admin@$1/C=JP/ST=/L=/O=Misskey Tester/OU=Some Unit" \
|
|
-out certificates/$1.csr
|
|
openssl x509 -req -sha256 \
|
|
-in certificates/$1.csr \
|
|
-CA certificates/rootCA.crt \
|
|
-CAkey certificates/rootCA.key \
|
|
-CAcreateserial \
|
|
-passin pass:rootCA \
|
|
-out certificates/$1.crt \
|
|
-days 500
|
|
if [ ! -f .config/docker.env ]; then cp .config/example.docker.env .config/docker.env; fi
|
|
if [ ! -f .config/$1.conf ]; then sed "s/\${HOST}/$1/g" .config/example.conf > .config/$1.conf; fi
|
|
if [ ! -f .config/$1.default.yml ]; then sed "s/\${HOST}/$1/g" .config/example.config.json > .config/$1.config.json; fi
|
|
}
|
|
|
|
generate a.test
|
|
generate b.test
|