fedilogue/README.md

114 lines
2.9 KiB
Markdown
Raw Normal View History

2020-12-17 01:39:57 +00:00
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
2020-12-29 20:21:38 +00:00
[![Go Report Card](https://goreportcard.com/badge/gitlab.com/khanzf/fedilogue)](https://goreportcard.com/report/gitlab.com/khanzf/fedilogue)
2020-12-17 01:39:57 +00:00
# Fedilogue
Fedilogue is a fediverse cataloging and search platform. The intention is to create a centralized search
system for use by fediverse users and APIs.
## How does Fedilogue gather data?
Fedilogue employs multiple methods to gather post and account data.
* Through publicly accessible timelines
* Through publicly accessible relays
2022-02-03 21:58:08 -05:00
* Through privately accessible timelines, requiring an account on a given instance (untested)
* Through followed users using a mass following agent (planned)
## Supported Instances
2022-02-03 21:58:08 -05:00
Fedilogue can retrieve Notes (posts) from any instance that supports the ActivityPub protocol. However, it can only pull from Mastodon and Pleroma.
## How to run
### Go version
2021-10-01 05:08:32 +00:00
This code was written on Go 1.16.
2021-10-01 05:08:32 +00:00
### Build Fedilogue
```
2021-10-01 05:08:32 +00:00
git clone https://gitlab.com/khanzf/fedilogue
cd fedilogue/fedilogue
go build
```
2022-02-03 21:58:08 -05:00
This will produce a fedilogue executable in the project directory.
### Prepopulate the Database
Create the `fedilogue` database and the user fedilogue. The exact process for this is outside of the scope of this document
2021-10-01 05:08:32 +00:00
2020-12-17 01:14:06 +00:00
```
2022-02-03 21:58:08 -05:00
CREATE USER fedilogue WITH PASSWORD 'yoursecurepassword';
CREATE DATABASE fedilogue OWNER fedilogue;
```
Set the environment variable
```
export DATABASE_URL="postgres://fedilogue:yoursecurepassword@localhost/fedilogue"
2020-12-17 01:14:06 +00:00
```
2022-02-03 21:58:08 -05:00
Change accordingly if your username, hostname and database are different.
```
cd fedilogue/fedilogue
psql -U fedilogue -h localhost < tables.sql
```
### Generate private and public key
This is only necessary if you are receiving posts from a relay.
```
cd fedilogue
mkdir -p keys
openssl genrsa -out keys/private.pem 3072
openssl rsa -in keys/private.pem -pubout -out keys/public.pem
```
### Configuration
Fedilogue is configured by the `config.jsonc` file. Start by copying the `config.jsonc.sample` file to
`config.jsonc` and edit the file with your use-case values. The configuration file is written in jsonc and
2020-12-17 01:38:59 +00:00
has enclosed explanations that should be self-explanatory.
2022-02-03 21:58:08 -05:00
Over time, all configuration will be done through the database.
## Starting Fedilogue
### Starting the retrieval daemon
```
cd fedilogue
2022-02-03 21:58:08 -05:00
./fedilogue
```
2022-02-03 21:58:08 -05:00
### Subscribe to a relay
Make sure that the `hostname` variable is set to a host that points to your fedilogue instance. Forward port
SSL/443 to port 8042.
```
./fedictl -follow https://relay.social.tigwali.fr/inbox
```
### Starting the RestAPI service
Start the RestAPI service to make the data accessible to external services, such as the web interface (which is currently not written).
```
cd restapi
go build .
./restapi
```
For documentation on how the API is located [here](restapi/RESTAPI.md).
## Contact
2021-10-01 05:08:32 +00:00
Ping me at [@fikran@thebag.social](https://thebag.social/@fikran)