The rubber ring is more important, that is holding the brake fluid in. The torn rubber cap is just the dust coverHi bro,
Here are a couple of pics of the parts I am planning to replace. Unfortunately I didn't take the whole caliper and cylinder pics as soon as I took it out. Now it has been cleaned so there's no more oil stains visible.
The parts are:
1 rubber ring that the piston inserts into
1 rubber cap to seal the cylinder with an opening for the piston to protrude (this is the leak source)
1 ring clip to secure the cylinder rubber cap in place