mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-18 13:44:20 +01:00
configurator: Add git SSH support (#592)
* configurator: Add git SSH support Add "ssh_keys" option to the Configurator add-on to define SSH keys for use by git. * Bump version to 3.5
This commit is contained in:
@@ -6,6 +6,28 @@ ENFORCE_BASEPATH=$(bashio::config 'enforce_basepath')
|
||||
IGNORE_PATTERN="$(bashio::jq "/data/options.json" ".ignore_pattern")"
|
||||
WAIT_PIDS=()
|
||||
|
||||
# If any SSH key files are defined in the configuration options, add them for use by git
|
||||
if bashio::config.has_value "ssh_keys"; then
|
||||
# Start the SSH agent
|
||||
bashio::log.info "Starting SSH agent"
|
||||
eval "$(ssh-agent -s)"
|
||||
|
||||
# Add the keys defined in the configuration options
|
||||
while read -r filename; do
|
||||
if bashio::fs.file_exists "$filename"; then
|
||||
bashio::log.info "Adding SSH private key file \"$filename\""
|
||||
ssh-add -q "$filename"
|
||||
else
|
||||
bashio::log.error "SSH key file \"$filename\" not found"
|
||||
fi
|
||||
done <<< "$(bashio::config 'ssh_keys')"
|
||||
|
||||
# Disable strict host key checking
|
||||
mkdir -p ~/.ssh
|
||||
echo "Host *
|
||||
StrictHostKeyChecking no" > ~/.ssh/config
|
||||
fi
|
||||
|
||||
# Setup and run Frontend
|
||||
sed -i "s/%%PORT%%/8080/g" /etc/nginx/nginx-ingress.conf
|
||||
sed -i "s/%%PORT_INGRESS%%/8099/g" /etc/nginx/nginx-ingress.conf
|
||||
|
||||
Reference in New Issue
Block a user