Page MenuHomeVyOS Platform

HTTP API config not saved on image upgrade
Closed, InvalidPublicBUG

Description

It seems that in 1.2.3 the HTTP API server is included now, but when upgrading an image the config file is not saved for the new install.

When this is not included yet, i have prepared a change i can commit, for sbin/install-image-existing.

Details

Difficulty level
Easy (less than an hour)
Version
1.2.3
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

if [ -f /etc/vyos/http-api.conf ]; then
  resp=''
  while [ -z "$resp" ]; do
    echo 'Would you like to save the HTTP API server configuration from your '
    echo -n 'current configuration? (Yes/No) [Yes]: '
    resp=$(get_response "Yes" "Yes No Y N")
    if [ "$resp" == 'yes' ] || [ "$resp" == 'y' ]; then
      echo 'Copying HTTP API configuration...'
      ndir=${INST_ROOT}/etc/vyos
      mkdir -p $ndir
      cp -p /etc/vyos/http-api.conf $ndir
    fi
  done
fi

I was reading old documentation. It does work once I set it with the configuration instead of editing the file directly.