Peel the onions and shallots and cut into thin slices. Pluck the rosemary needles from the branch and chop finely. Heat the olive oil in a large pan and fry the onions and shallots over a gentle heat until they have completely lost their shape and are lightly browned (takes about 30 minutes).
Add the bay leaves, cinnamon and rosemary and fry for a few minutes. Crumble the chilli pepper and add. Then add the two types of vinegar and sugar and let everything simmer over the lowest heat for about 1 hour until the whole thing is extremely thick to jam-like.
Carefully sterilize the jars and their lids with boiling water and pour in the hot mass, screw the jars shut and immediately turn them upside down for a few minutes. Let rest in a dark and cool place for about 6 weeks.
The chutney goes very well with pan-fried foods such as steak or cheese.