Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions ghes-upload-cert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
. ./.gh-api-examples.conf

# https://docs.github.com/en/[email protected]/rest/reference/enterprise-admin#set-settings
# PUT /setup/api/settings

clear

echo
echo 'Warning: You need to make sure that you populate the "cert" field in the "test-data/cert.json" with your certificate'
echo 'or certificate chain before running this script.'


echo "Press enter to continue"

read x

curl -L ${curl_custom_flags} \
-X PUT \
-F 'settings=@test-data/cert.json' \
"https://${hostname}:${mgmt_port}/setup/api/settings?api_key=${admin_password}"

21 changes: 21 additions & 0 deletions ghes-upload-key.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
. ./.gh-api-examples.conf

# https://docs.github.com/en/[email protected]/rest/reference/enterprise-admin#set-settings
# PUT /setup/api/settings

clear

echo
echo 'Warning: You need to make sure that you populate the "key" field in the "test-data/key.json" with a key'
echo 'before running this script.'


echo "Press enter to continue"

read x

curl -L ${curl_custom_flags} \
-X PUT \
-F 'settings=@test-data/cert.json' \
"https://${hostname}:${mgmt_port}/setup/api/settings?api_key=${admin_password}"

5 changes: 5 additions & 0 deletions test-data/cert.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"github_ssl": {
"cert": "REPLACE WITH YOUR CERT OR CERT CHAIN"
}
}
5 changes: 5 additions & 0 deletions test-data/key.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"github_ssl": {
"key": "REPLACE WITH YOUR KEY"
}
}