With the town hall outside the walls in this th3 farm base you will get attacked and lose trophies. But the key is that every time someone destroys your town hall you get a 11 hour shield. In this time no one can attack you and your resources are safe.
Unfortunately the cannons are placed outside due to the little walls you have at th3. The other buildings are placed around the village so barbarians and archer will attack those first.