Update README and config

This commit is contained in:
Jesse Wierzbinski 2023-10-17 09:12:53 -10:00
parent a1238222e2
commit 47a53b6990
No known key found for this signature in database
GPG key ID: F9A1E418934E40B0
3 changed files with 99 additions and 0 deletions

View file

@ -117,6 +117,25 @@ Configuration can be found inside the `config.toml` file. The following values a
- `banned_ips`: An array of strings representing banned IPv4 or IPv6 IPs. Wildcards, networks and ranges are supported. Example: `[ "192.168.0.*" ]` (empty array)
### Media
- `backend`: Specifies the backend to use for media storage. Can be "local" or "s3", "local" uploads the file to the local filesystem.
- `deduplicate_media`: When set to true, the hash of media is checked when uploading to avoid duplication.
#### Conversion
- `convert_images`: Whether to convert uploaded images to another format. Example: `true`
- `convert_to`: The format to convert uploaded images to. Example: `"webp"`. Can be "jxl", "webp", "avif", "png", "jpg" or "gif".
### S3
- `endpoint`: The endpoint to use for the S3 server. Example: `"https://s3.example.com"`
- `access_key`: Access key to use for S3
- `secret_access_key`: Secret access key to use for S3
- `bucket_name`: The bucket to use for S3 (can be left empty)
- `region`: The region to use for S3 (can be left empty)
- `public_url`: The public URL to access uploaded media. Example: `"https://cdn.example.com"`
### SMTP
- `server`: The SMTP server to use for sending emails. Example: `"smtp.example.com"`

View file

@ -21,6 +21,26 @@ username = "test@example.com"
password = "password123"
tls = true
[media]
# Can be "s3" or "local", where "local" uploads the file to the local filesystem
backend = "s3" # NOT IMPLEMENTED
# Whether to check the hash of media when uploading to avoid duplication
deduplicate_media = true # NOT IMPLEMENTED
[media.conversion]
convert_images = false # NOT IMPLEMENTED
# Can be: "jxl", "webp", "avif", "png", "jpg", "gif"
convert_to = "webp" # NOT IMPLEMENTED
[s3]
# Can be left blank if you don't use the S3 media backend
endpoint = "https://s3-us-west-2.amazonaws.com"
access_key = ""
secret_access_key = ""
region = "us-west-2"
bucket_name = "lysand"
public_url = "https://cdn.example.com"
[email]
# Sends an email to moderators when a report is received
# NOT IMPLEMENTED

View file

@ -16,6 +16,14 @@ export interface ConfigType {
banned_ips: string[];
};
smtp: {
server: string;
port: number;
username: string;
password: string;
tls: boolean;
};
validation: {
max_displayname_size: number;
max_bio_size: number;
@ -35,6 +43,24 @@ export interface ConfigType {
allowed_mime_types: string[];
};
media: {
backend: string;
deduplicate_media: boolean;
conversion: {
convert_images: boolean;
convert_to: string;
};
};
s3: {
endpoint: string;
access_key: string;
secret_access_key: string;
region: string;
bucket_name: string;
public_url: string;
};
defaults: {
visibility: string;
language: string;
@ -42,6 +68,12 @@ export interface ConfigType {
header: string;
};
email: {
send_on_report: boolean;
send_on_suspend: boolean;
send_on_unsuspend: boolean;
};
activitypub: {
use_tombstones: boolean;
reject_activities: string[];
@ -101,6 +133,34 @@ export const configDefaults: ConfigType = {
password: "postgres",
database: "lysand",
},
smtp: {
password: "",
port: 465,
server: "",
tls: true,
username: "",
},
media: {
backend: "local",
deduplicate_media: true,
conversion: {
convert_images: false,
convert_to: "webp",
},
},
email: {
send_on_report: false,
send_on_suspend: false,
send_on_unsuspend: false,
},
s3: {
access_key: "",
bucket_name: "",
endpoint: "",
public_url: "",
region: "",
secret_access_key: "",
},
validation: {
max_displayname_size: 50,
max_bio_size: 6000,