119 lines
2.9 KiB
Markdown
Raw Normal View History

2025-01-16 19:36:44 +01:00
# Friendica Docker Role
2025-01-16 19:36:44 +01:00
This role manages the setup, reset, and maintenance of a Friendica instance running with Docker.
2025-01-15 20:42:36 +01:00
2025-01-16 19:36:44 +01:00
## Overview 🚀
2025-01-15 20:42:36 +01:00
2025-01-16 19:36:44 +01:00
Friendica is a decentralized social networking platform. This role helps manage Friendica in a containerized environment with Docker and provides tools for debugging, resetting, and maintaining the installation.
## Prerequisites 🛠️
Ensure you have the following:
- Docker and Docker Compose installed
- A central MariaDB instance running
- Necessary permissions to manage Docker and database configurations
## Usage 📚
### Full Reset 🚫➡️✅
The following environment variables need to be defined for successful operation:
- `DB_ROOT_PASSWORD`: The root password for the MariaDB instance
To completely reset Friendica, including its database and volumes, run:
```bash
docker exec -i central-mariadb mariadb -u root -p"${DB_ROOT_PASSWORD}" -e "DROP DATABASE IF EXISTS friendica; CREATE DATABASE friendica;"
docker compose down
rm -rv /mnt/hdd/data/docker/volumes/friendica_data
docker volume rm friendica_data
```
### Reset Database 🗄️
#### Manual Method:
1. Connect to the MariaDB instance:
```bash
docker exec -it central-mariadb mariadb -u root -p
```
2. Run the following commands:
```sql
DROP DATABASE friendica;
CREATE DATABASE friendica;
exit;
```
#### Automatic Method:
```bash
2025-01-15 20:42:36 +01:00
DB_ROOT_PASSWORD="your_root_password"
docker exec -i central-mariadb mariadb -u root -p"${DB_ROOT_PASSWORD}" -e "DROP DATABASE IF EXISTS friendica; CREATE DATABASE friendica;"
2025-01-16 19:36:44 +01:00
```
2025-01-15 20:42:36 +01:00
2025-01-16 19:36:44 +01:00
### Enter the Application Container 🔍
2025-01-15 20:42:36 +01:00
2025-01-16 19:36:44 +01:00
To access the application container:
```bash
2025-01-15 20:42:36 +01:00
docker compose exec -it application sh
2025-01-16 19:36:44 +01:00
```
2025-01-15 20:42:36 +01:00
2025-01-16 19:36:44 +01:00
### Debugging Tools 🛠️
2025-01-15 20:42:36 +01:00
2025-01-16 19:36:44 +01:00
#### Check Environment Variables
```bash
2025-01-15 20:42:36 +01:00
docker compose exec -it application printenv
2025-01-16 19:36:44 +01:00
```
2025-01-15 20:42:36 +01:00
2025-01-16 19:36:44 +01:00
#### Inspect Volume Data
```bash
2025-01-15 20:42:36 +01:00
ls -la /var/lib/docker/volumes/friendica_data/_data/
2025-01-16 19:36:44 +01:00
```
2025-01-15 20:42:36 +01:00
2025-01-16 19:36:44 +01:00
### Autoinstall 🌟
Run the following command to autoinstall Friendica:
```bash
2025-01-15 20:42:36 +01:00
docker compose exec --user www-data -it application bin/console autoinstall
2025-01-16 19:36:44 +01:00
```
2025-01-15 20:42:36 +01:00
2025-01-16 19:36:44 +01:00
### Reinitialization 🔄
2025-01-15 20:42:36 +01:00
2025-01-16 19:36:44 +01:00
#### Docker Only:
```bash
docker-compose up -d --force-recreate
2025-01-16 19:36:44 +01:00
```
2025-01-15 20:42:36 +01:00
2025-01-16 19:36:44 +01:00
#### Full Reinitialization:
```bash
docker-compose up -d --force-recreate && sleep 2; docker compose exec --user www-data -it application bin/console autoinstall;
```
2025-01-15 20:42:36 +01:00
2025-01-16 19:36:44 +01:00
### Configuration Information
#### General Configuration:
```bash
2025-01-15 20:42:36 +01:00
cat /var/lib/docker/volumes/friendica_data/_data/config/local.config.php
2025-01-16 19:36:44 +01:00
```
#### Email Configuration:
```bash
docker compose exec -it application cat /etc/msmtprc
2025-01-15 20:42:36 +01:00
```
2025-01-16 19:36:44 +01:00
### Email Debugging ✉️
To send a test email:
```bash
2025-01-16 19:39:45 +01:00
docker compose exec -it application msmtp --account=system_email -t test@test.de
2025-01-16 19:36:44 +01:00
```
## Additional Resources 📖
- [Friendica Docker Hub](https://hub.docker.com/_/friendica)
- [Friendica Installation Docs](https://wiki.friendi.ca/docs/install)
- [Friendica GitHub Repository](https://github.com/friendica/docker)
2025-01-15 20:42:36 +01:00
2025-01-16 19:36:44 +01:00
---
2025-01-15 20:42:36 +01:00
2025-01-16 19:36:44 +01:00
📜 Created by [Kevin Veen-Birkenbach](https://www.veen.world/)
2025-01-15 20:42:36 +01:00