The South Carolina State Ports Authority and an environmental group on Friday ended their four-year legal battle over a new $525 million port terminal at the old Navy base in North Charleston.