Online social networks, such as Facebook and twitter, are a growing phenomenon in today's world, with various platforms providing capabilities for individuals to collaborate through messaging and chatting as well as sharing of content such as videos and photos. Most, if not all, of these platforms are based on centralized computing systems, meaning that the control and management of the systems lies in the hand of one provider, which must be trusted to treat the data and communication traces securely. While users aim for privacy and data sovereignty, often the providers aim to monetize the data they store. Even, federated privately run social networks require a few enthusiasts that serve the community and have, through that, access to the data they manage. As a zero-trust alternative, peer-to-peer (P2P) technologies promise networks that are self organizing and secure-by-design, in which the final data sovereignty lies at the corresponding user. Such networks support end-to-end communication, uncompromising access control, anonymity and resilience against censorship and massive data leaks through misused trust. The goals of this survey are three-fold. Firstly, the survey elaborates the properties of P2P-based online social networks and defines the requirements for such (zero-trust) platforms. Secondly, it elaborates on the building blocks for P2P frameworks that allow the creation of such sophisticated and demanding applications, such as user/identity management, reliable data storage, secure communication, access control and general-purpose extensibility, features that are not addressed in other P2P surveys. As a third point, it gives an overview of proposed P2P-based online social network applications, frameworks and architectures. In specific, it explores the technical details, inter-dependencies and maturity of the available solutions.