Prepare the water bath canner, jars, and lids. Keep the jars hot until you're ready to fill them.
If using fresh tomatoes, wash, core, and quarter them, simmer until soft, then run them through a food mill to remove the skins and seeds. Skip this step if using passata.
Measure the tomato purée or passata into a large stainless steel pot.
Add the onion, celery, carrot, garlic, lemon juice, salt, black pepper, and hot pepper flakes.
Bring to a boil over medium-high heat, stirring often.
Boil hard, stirring often, until the sauce is reduced by about one third and slightly thickened, about 15 minutes.
Ladle the hot sauce into hot jars, leaving 1/2 inch headspace.
Release trapped air bubbles, check the headspace again, and wipe the rims clean.
Set the lids on and apply the bands fingertip tight.
Process pints or half pints in a boiling water bath canner for 35 minutes, adjusting for altitude (see notes).
Turn off the heat, remove the canner lid, and let the jars rest for 5 minutes before lifting them out.
Cool the jars undisturbed for 12 to 24 hours, then check the seals, remove the rings, label the jars, and store them in a cool, dark place.