Hello,
Front brake lines definitely have to be free, not attached to anything, just connected to brackets on U1/U2 (bulkhead fitting) and to the front callipers (straight male). Length should be calculated with the wheel turned at its maximum, and the front upright in its lower position (max length of your shock absorbers.)
So far, brake lines I've done for forum members were 530mm overall.
Hope this will help
