summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-04-14 16:07:20 -0400
committerDessalines <tyhou13@gmx.com>2020-04-14 16:07:20 -0400
commit1336b4ed6023e7fcf0fd40be63569966ee4b1b45 (patch)
treee62e4422e0ba0430ea6d060f01d20dee22d6e564
parentf040dac647d50c97e3f9ab8058563a7fe0f29261 (diff)
parent641e4c5d96d9d152bc75318b3ea08f789d920b2b (diff)
Merge branch 'dev' into federation
-rw-r--r--CODE_OF_CONDUCT.md2
-rw-r--r--README.md23
-rw-r--r--RELEASES.md4
-rw-r--r--ansible/VERSION2
-rwxr-xr-xdocker/dev/deploy.sh4
-rwxr-xr-xdocker/dev/dev_deploy.sh12
-rw-r--r--docker/dev/docker-compose.yml2
-rwxr-xr-xdocker/dev/test_deploy.sh11
-rw-r--r--docker/prod/docker-compose.yml4
-rw-r--r--docs/src/SUMMARY.md1
-rw-r--r--docs/src/about.md2
-rw-r--r--docs/src/about_goals.md1
-rw-r--r--docs/src/administration_backup_and_restore.md44
-rw-r--r--docs/src/administration_install_ansible.md4
-rw-r--r--docs/src/contributing.md5
-rw-r--r--docs/src/contributing_docker_development.md2
-rw-r--r--docs/src/contributing_local_development.md2
-rw-r--r--docs/src/contributing_websocket_http_api.md99
-rw-r--r--server/src/api/site.rs70
-rw-r--r--server/src/lib.rs4
-rw-r--r--server/src/main.rs1
-rw-r--r--server/src/routes/api.rs2
-rw-r--r--server/src/routes/index.rs3
-rw-r--r--server/src/settings.rs45
-rw-r--r--server/src/version.rs2
-rw-r--r--server/src/websocket/mod.rs2
-rw-r--r--server/src/websocket/server.rs10
-rw-r--r--ui/assets/css/main.css2
-rw-r--r--ui/package.json33
-rw-r--r--ui/src/components/admin-settings.tsx241
-rw-r--r--ui/src/components/comment-form.tsx36
-rw-r--r--ui/src/components/comment-node.tsx53
-rw-r--r--ui/src/components/main.tsx24
-rw-r--r--ui/src/components/navbar.tsx28
-rw-r--r--ui/src/components/post-form.tsx43
-rw-r--r--ui/src/components/post-listing.tsx43
-rw-r--r--ui/src/components/post.tsx22
-rw-r--r--ui/src/components/private-message-form.tsx30
-rw-r--r--ui/src/components/private-message.tsx16
-rw-r--r--ui/src/components/search.tsx23
-rw-r--r--ui/src/components/sidebar.tsx32
-rw-r--r--ui/src/components/site-form.tsx7
-rw-r--r--ui/src/components/sponsors.tsx11
-rw-r--r--ui/src/components/symbols.tsx9
-rw-r--r--ui/src/components/user-listing.tsx36
-rw-r--r--ui/src/index.tsx116
-rw-r--r--ui/src/interfaces.ts21
-rw-r--r--ui/src/services/WebSocketService.ts13
-rw-r--r--ui/src/utils.ts24
-rw-r--r--ui/src/version.ts2
-rw-r--r--ui/translations/en.json6
-rw-r--r--ui/translations/es.json72
-rw-r--r--ui/translations/fr.json3
-rw-r--r--ui/translations/ka.json223
-rw-r--r--ui/yarn.lock251
55 files changed, 1370 insertions, 413 deletions
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index 5a6c7d67..e0270d4c 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -30,6 +30,6 @@ In the Lemmy community we strive to go the extra step to look out for each other
And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could’ve communicated better — remember that it’s your responsibility to make others comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust.
-The enforcement policies listed above apply to all official Lemmy venues; including git repositories under [github.com/dessalines/lemmy](https://github.com/dessalines/lemmy) and [yerbamate.dev/dessalines/lemmy](https://yerbamate.dev/dessalines/lemmy), the [Matrix channel](https://matrix.to/#/!BZVTUuEiNmRcbFeLeI:matrix.org?via=matrix.org&via=privacytools.io&via=permaweb.io); and all instances under lemmy.ml. For other projects adopting the Rust Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.
+The enforcement policies listed above apply to all official Lemmy venues; including git repositories under [github.com/LemmyNet/lemmy](https://github.com/LemmyNet/lemmy) and [yerbamate.dev/dessalines/lemmy](https://yerbamate.dev/dessalines/lemmy), the [Matrix channel](https://matrix.to/#/!BZVTUuEiNmRcbFeLeI:matrix.org?via=matrix.org&via=privacytools.io&via=permaweb.io); and all instances under lemmy.ml. For other projects adopting the Rust Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.
Adapted from the [Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct), which is based on the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](https://www.contributor-covenant.org/version/1/3/0/).
diff --git a/README.md b/README.md
index 2adad59c..723d535f 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,12 @@
<div align="center">
-![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/dessalines/lemmy.svg)
-[![Build Status](https://travis-ci.org/dessalines/lemmy.svg?branch=master)](https://travis-ci.org/dessalines/lemmy)
-[![GitHub issues](https://img.shields.io/github/issues-raw/dessalines/lemmy.svg)](https://github.com/dessalines/lemmy/issues)
+![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/LemmyNet/lemmy.svg)
+[![Build Status](https://travis-ci.org/LemmyNet/lemmy.svg?branch=master)](https://travis-ci.org/LemmyNet/lemmy)
+[![GitHub issues](https://img.shields.io/github/issues-raw/LemmyNet/lemmy.svg)](https://github.com/LemmyNet/lemmy/issues)
[![Docker Pulls](https://img.shields.io/docker/pulls/dessalines/lemmy.svg)](https://cloud.docker.com/repository/docker/dessalines/lemmy/)
[![Translation status](http://weblate.yerbamate.dev/widgets/lemmy/-/lemmy/svg-badge.svg)](http://weblate.yerbamate.dev/engage/lemmy/)
-[![License](https://img.shields.io/github/license/dessalines/lemmy.svg)](LICENSE)
-![GitHub stars](https://img.shields.io/github/stars/dessalines/lemmy?style=social)
+[![License](https://img.shields.io/github/license/LemmyNet/lemmy.svg)](LICENSE)
+![GitHub stars](https://img.shields.io/github/stars/LemmyNet/lemmy?style=social)
</div>
<p align="center">
@@ -22,11 +22,11 @@
·
<a href="https://dev.lemmy.ml/docs/index.html">Documentation</a>
·
- <a href="https://github.com/dessalines/lemmy/issues">Report Bug</a>
+ <a href="https://github.com/LemmyNet/lemmy/issues">Report Bug</a>
·
- <a href="https://github.com/dessalines/lemmy/issues">Request Feature</a>
+ <a href="https://github.com/LemmyNet/lemmy/issues">Request Feature</a>
·
- <a href="https://github.com/dessalines/lemmy/blob/master/RELEASES.md">Releases</a>
+ <a href="https://github.com/LemmyNet/lemmy/blob/master/RELEASES.md">Releases</a>
</p>
</p>
@@ -36,7 +36,7 @@ Front Page|Post
---|---
![main screen](https://i.imgur.com/kZSRcRu.png)|![chat screen](https://i.imgur.com/4XghNh6.png)
-[Lemmy](https://github.com/dessalines/lemmy) is similar to sites like [Reddit](https://reddit.com), [Lobste.rs](https://lobste.rs), [Raddle](https://raddle.me), or [Hacker News](https://news.ycombinator.com/): you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the [Fediverse](https://en.wikipedia.org/wiki/Fediverse).
+[Lemmy](https://github.com/LemmyNet/lemmy) is similar to sites like [Reddit](https://reddit.com), [Lobste.rs](https://lobste.rs), [Raddle](https://raddle.me), or [Hacker News](https://news.ycombinator.com/): you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the [Fediverse](https://en.wikipedia.org/wiki/Fediverse).
For a link aggregator, this means a user registered on one server can subscribe to forums on any other server, and can have discussions with users registered elsewhere.
@@ -108,8 +108,9 @@ Each lemmy server can set its own moderation policy; appointing site-wide admins
Lemmy is free, open-source software, meaning no advertising, monetizing, or venture capital, ever. Your donations directly support full-time development of the project.
-- [Support on Liberapay.](https://liberapay.com/Lemmy)
+- [Support on Liberapay](https://liberapay.com/Lemmy).
- [Support on Patreon](https://www.patreon.com/dessalines).
+- [Support on OpenCollective](https://opencollective.com/lemmy).
- [List of Sponsors](https://dev.lemmy.ml/sponsors).
### Crypto
@@ -132,7 +133,7 @@ If you want to help with translating, take a look at [Weblate](https://weblate.y
- [Mastodon](https://mastodon.social/@LemmyDev) - [![Mastodon Follow](https://img.shields.io/mastodon/follow/810572?domain=https%3A%2F%2Fmastodon.social&style=social)](https://mastodon.social/@LemmyDev)
- [Matrix](https://riot.im/app/#/room/#rust-reddit-fediverse:matrix.org) - [![Matrix](https://img.shields.io/matrix/rust-reddit-fediverse:matrix.org.svg?label=matrix-chat)](https://riot.im/app/#/room/#rust-reddit-fediverse:matrix.org)
-- [GitHub](https://github.com/dessalines/lemmy)
+- [GitHub](https://github.com/LemmyNet/lemmy)
- [Gitea](https://yerbamate.dev/dessalines/lemmy)
- [GitLab](https://gitlab.com/dessalines/lemmy)
diff --git a/RELEASES.md b/RELEASES.md
index 4d86f6da..5a4c7645 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -1,6 +1,6 @@
# Lemmy v0.6.0 Release (2020-01-16)
-`v0.6.0` is here, and we've closed [41 issues!](https://github.com/dessalines/lemmy/milestone/15?closed=1)
+`v0.6.0` is here, and we've closed [41 issues!](https://github.com/LemmyNet/lemmy/milestone/15?closed=1)
This is the biggest release by far:
@@ -10,7 +10,7 @@ This is the biggest release by far:
- Can set a custom language.
- Lemmy-wide settings to disable downvotes, and close registration.
- A better documentation system, hosted in lemmy itself.
-- [Huge DB performance gains](https://github.com/dessalines/lemmy/issues/411) (everthing down to < `30ms`) by using materialized views.
+- [Huge DB performance gains](https://github.com/LemmyNet/lemmy/issues/411) (everthing down to < `30ms`) by using materialized views.
- Fixed major issue with similar post URL and title searching.
- Upgraded to Actix `2.0`
- Faster comment / post voting.
diff --git a/ansible/VERSION b/ansible/VERSION
index 83ca525b..25690dbe 100644
--- a/ansible/VERSION
+++ b/ansible/VERSION
@@ -1 +1 @@
-v0.6.44
+v0.6.49
diff --git a/docker/dev/deploy.sh b/docker/dev/deploy.sh
index db2294fa..09b21b0b 100755
--- a/docker/dev/deploy.sh
+++ b/docker/dev/deploy.sh
@@ -72,5 +72,5 @@ git push origin $new_tag
git push
# Pushing to any ansible deploys
-cd ../../ansible || exit
-ansible-playbook lemmy.yml --become
+cd ../../../lemmy-ansible || exit
+ansible-playbook -i prod playbooks/site.yml --vault-password-file vault_pass
diff --git a/docker/dev/dev_deploy.sh b/docker/dev/dev_deploy.sh
deleted file mode 100755
index ef41434b..00000000
--- a/docker/dev/dev_deploy.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-# Building from the dev branch for dev servers
-git checkout dev
-
-# Rebuilding dev docker
-docker-compose build
-docker tag dev_lemmy:latest dessalines/lemmy:dev
-docker push dessalines/lemmy:dev
-
-# SSH and pull it
-ssh $LEMMY_USER@$LEMMY_HOST "cd ~/git/lemmy/docker/dev && docker pull dessalines/lemmy:dev && docker-compose up -d"
diff --git a/docker/dev/docker-compose.yml b/docker/dev/docker-compose.yml
index a7d289b2..3c52d1e5 100644
--- a/docker/dev/docker-compose.yml
+++ b/docker/dev/docker-compose.yml
@@ -21,7 +21,7 @@ services:
environment:
- RUST_LOG=debug
volumes:
- - ../lemmy.hjson:/config/config.hjson:ro
+ - ../lemmy.hjson:/config/config.hjson
depends_on:
- postgres
- pictshare
diff --git a/docker/dev/test_deploy.sh b/docker/dev/test_deploy.sh
new file mode 100755
index 00000000..1ae91f65
--- /dev/null
+++ b/docker/dev/test_deploy.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# Rebuilding dev docker
+docker-compose build
+docker tag dev_lemmy:latest dessalines/lemmy:test
+docker push dessalines/lemmy:test
+
+# Run the playbook
+pushd ../../../lemmy-ansible
+ansible-playbook -i test playbooks/site.yml --vault-password-file vault_pass
+popd
diff --git a/docker/prod/docker-compose.yml b/docker/prod/docker-compose.yml
index 76f5ae14..90551465 100644
--- a/docker/prod/docker-compose.yml
+++ b/docker/prod/docker-compose.yml
@@ -12,14 +12,14 @@ services:
restart: always
lemmy:
- image: dessalines/lemmy:v0.6.44
+ image: dessalines/lemmy:v0.6.49
ports:
- "127.0.0.1:8536:8536"
restart: always
environment:
- RUST_LOG=error
volumes:
- - ./lemmy.hjson:/config/config.hjson:ro
+ - ./lemmy.hjson:/config/config.hjson
depends_on:
- postgres
- pictshare
diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md
index 70c423c7..bff5cbf6 100644
--- a/docs/src/SUMMARY.md
+++ b/docs/src/SUMMARY.md
@@ -10,6 +10,7 @@
- [Install with Ansible](administration_install_ansible.md)
- [Install with Kubernetes](administration_install_kubernetes.md)
- [Configuration](administration_configuration.md)
+ - [Backup and Restore](administration_backup_and_restore.md)
- [Contributing](contributing.md)
- [Docker Development](contributing_docker_development.md)
- [Local Development](contributing_local_development.md)
diff --git a/docs/src/about.md b/docs/src/about.md
index 33ecb211..31081f48 100644
--- a/docs/src/about.md
+++ b/docs/src/about.md
@@ -4,7 +4,7 @@ Front Page|Post
---|---
![main screen](https://i.imgur.com/kZSRcRu.png)|![chat screen](https://i.imgur.com/4XghNh6.png)
-[Lemmy](https://github.com/dessalines/lemmy) is similar to sites like [Reddit](https://reddit.com), [Lobste.rs](https://lobste.rs), [Raddle](https://raddle.me), or [Hacker News](https://news.ycombinator.com/): you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the [Fediverse](https://en.wikipedia.org/wiki/Fediverse).
+[Lemmy](https://github.com/LemmyNet/lemmy) is similar to sites like [Reddit](https://reddit.com), [Lobste.rs](https://lobste.rs), [Raddle](https://raddle.me), or [Hacker News](https://news.ycombinator.com/): you subscribe to forums you're interested in, post links and discussions, then vote, and comment on them. Behind the scenes, it is very different; anyone can easily run a server, and all these servers are federated (think email), and connected to the same universe, called the [Fediverse](https://en.wikipedia.org/wiki/Fediverse).
For a link aggregator, this means a user registered on one server can subscribe to forums on any other server, and can have discussions with users registered elsewhere.
diff --git a/docs/src/about_goals.md b/docs/src/about_goals.md
index caa6948a..e0427481 100644
--- a/docs/src/about_goals.md
+++ b/docs/src/about_goals.md
@@ -51,3 +51,4 @@
- [Activitypub implementers guide](https://socialhub.activitypub.rocks/t/draft-guide-for-new-activitypub-implementers/479)
- [Data storage questions](https://socialhub.activitypub.rocks/t/data-storage-questions/579/3)
- [Activitypub as it has been understood](https://flak.tedunangst.com/post/ActivityPub-as-it-has-been-understood)
+- [Asonix http signatures in rust](https://git.asonix.dog/Aardwolf/http-signature-normalization)
diff --git a/docs/src/administration_backup_and_restore.md b/docs/src/administration_backup_and_restore.md
new file mode 100644
index 00000000..fe97cf88
--- /dev/null
+++ b/docs/src/administration_backup_and_restore.md
@@ -0,0 +1,44 @@
+# Backup and Restore Guide
+
+## Docker and Ansible
+
+When using docker or ansible, there should be a `volumes` folder, which contains both the database, and all the pictures. Copy this folder to the new instance to restore your data.
+
+### Incremental Database backup
+
+To incrementally backup the DB to an `.sql` file, you can run:
+
+```bash
+docker exec -t FOLDERNAME_postgres_1 pg_dumpall -c -U lemmy > lemmy_dump_`date +%Y-%m-%d"_"%H_%M_%S`.sql
+```
+### A Sample backup script
+
+```bash
+#!/bin/sh
+# DB Backup
+ssh MY_USER@MY_IP "docker exec -t FOLDERNAME_postgres_1 pg_dumpall -c -U lemmy" > ~/BACKUP_LOCATION/INSTANCE_NAME_dump_`date +%Y-%m-%d"_"%H_%M_%S`.sql
+
+# Volumes folder Backup
+rsync -avP -zz --rsync-path="sudo rsync" MY_USER@MY_IP:/LEMMY_LOCATION/volumes ~/BACKUP_LOCATION/FOLDERNAME
+```
+
+### Restoring the DB
+
+If you need to restore from a `pg_dumpall` file, you need to first clear out your existing database
+
+```bash
+# Drop the existing DB
+docker exec -i FOLDERNAME_postgres_1 psql -U lemmy -c "DROP SCHEMA public CASCADE; CREATE SCHEMA public;"
+
+# Restore from the .sql backup
+cat db_dump.sql | docker exec -i FOLDERNAME_postgres_1 psql -U lemmy # restores the db
+
+# This also might be necessary when doing a db import with a different password.
+docker exec -i FOLDERNAME_postgres_1 psql -U lemmy -c "alter user lemmy with password 'bleh'"
+```
+
+## More resources
+
+- https://stackoverflow.com/questions/24718706/backup-restore-a-dockerized-postgresql-database
+
+
diff --git a/docs/src/administration_install_ansible.md b/docs/src/administration_install_ansible.md
index bf5e6749..77d901b3 100644
--- a/docs/src/administration_install_ansible.md
+++ b/docs/src/administration_install_ansible.md
@@ -7,7 +7,7 @@ First, you need to [install Ansible on your local computer](https://docs.ansible
Then run the following commands on your local computer:
```bash
-git clone https://github.com/dessalines/lemmy.git
+git clone https://github.com/LemmyNet/lemmy.git
cd lemmy/ansible/
cp inventory.example inventory
nano inventory # enter your server, domain, contact email
@@ -19,4 +19,4 @@ To update to a new version, just run the following in your local Lemmy repo:
git pull origin master
cd ansible
ansible-playbook lemmy.yml --become
-``` \ No newline at end of file
+```
diff --git a/docs/src/contributing.md b/docs/src/contributing.md
index 9a01ad5d..4eabd6fc 100644
--- a/docs/src/contributing.md
+++ b/docs/src/contributing.md
@@ -4,13 +4,14 @@ Information about contributing to Lemmy, whether it is translating, testing, des
## Issue tracking / Repositories
-- [GitHub (for issues)](https://github.com/dessalines/lemmy)
+- [GitHub (for issues)](https://github.com/LemmyNet/lemmy)
- [Gitea](https://yerbamate.dev/dessalines/lemmy)
- [GitLab](https://gitlab.com/dessalines/lemmy)
## Translating
-Go [here](https://github.com/dessalines/lemmy#translations) for translation instructions.
+Check out [Lemmy's Weblate](https://weblate.yerbamate.dev/projects/lemmy/) for translations.
+
## Architecture
diff --git a/docs/src/contributing_docker_development.md b/docs/src/contributing_docker_development.md
index d5ab5829..09239821 100644
--- a/docs/src/contributing_docker_development.md
+++ b/docs/src/contributing_docker_development.md
@@ -3,7 +3,7 @@
## Running
```bash
-git clone https://github.com/dessalines/lemmy
+git clone https://github.com/LemmyNet/lemmy
cd lemmy/docker/dev
./docker_update.sh # This builds and runs it, updating for your changes
```
diff --git a/docs/src/contributing_local_development.md b/docs/src/contributing_local_development.md
index 175b000c..e823c9d1 100644
--- a/docs/src/contributing_local_development.md
+++ b/docs/src/contributing_local_development.md
@@ -22,7 +22,7 @@ export LEMMY_DATABASE_URL=postgres://lemmy:password@localhost:5432/lemmy
#### Running
```bash
-git clone https://github.com/dessalines/lemmy
+git clone https://github.com/LemmyNet/lemmy
cd lemmy
./install.sh
# For live coding, where both the front and back end, automagically reload on any save, do:
diff --git a/docs/src/contributing_websocket_http_api.md b/docs/src/contributing_websocket_http_api.md
index a73a1c13..f228f94e 100644
--- a/docs/src/contributing_websocket_http_api.md
+++ b/docs/src/contributing_websocket_http_api.md
@@ -92,85 +92,93 @@
- [Request](#request-17)
- [Response](#response-17)
- [HTTP](#http-18)
- * [Community](#community)
- + [Get Community](#get-community)
+ + [Get Site Config](#get-site-config)
- [Request](#request-18)
- [Response](#response-18)
- [HTTP](#http-19)
- + [Create Community](#create-community)
+ + [Save Site Config](#save-site-config)
- [Request](#request-19)
- [Response](#response-19)
- [HTTP](#http-20)
- + [List Communities](#list-communities)
+ * [Community](#community)
+ + [Get Community](#get-community)
- [Request](#request-20)
- [Response](#response-20)
- [HTTP](#http-21)
- + [Ban from Community](#ban-from-community)
+ + [Create Community](#create-community)
- [Request](#request-21)
- [Response](#response-21)
- [HTTP](#http-22)
- + [Add Mod to Community](#add-mod-to-community)
+ + [List Communities](#list-communities)
- [Request](#request-22)
- [Response](#response-22)
- [HTTP](#http-23)
- + [Edit Community](#edit-community)
+ + [Ban from Community](#ban-from-community)
- [Request](#request-23)
- [Response](#response-23)
- [HTTP](#http-24)
- + [Follow Community](#follow-community)
+ + [Add Mod to Community](#add-mod-to-community)
- [Request](#request-24)
- [Response](#response-24)
- [HTTP](#http-25)
- + [Get Followed Communities](#get-followed-communities)
+ + [Edit Community](#edit-community)
- [Request](#request-25)
- [Response](#response-25)
- [HTTP](#http-26)
- + [Transfer Community](#transfer-community)
+ + [Follow Community](#follow-community)
- [Request](#request-26)
- [Response](#response-26)
- [HTTP](#http-27)
- * [Post](#post)
- + [Create Post](#create-post)
+ + [Get Followed Communities](#get-followed-communities)
- [Request](#request-27)
- [Response](#response-27)
- [HTTP](#http-28)
- + [Get Post](#get-post)
+ + [Transfer Community](#transfer-community)
- [Request](#request-28)
- [Response](#response-28)
- [HTTP](#http-29)
- + [Get Posts](#get-posts)
+ * [Post](#post)
+ + [Create Post](#create-post)
- [Request](#request-29)
- [Response](#response-29)
- [HTTP](#http-30)
- + [Create Post Like](#create-post-like)
+ + [Get Post](#get-post)
- [Request](#request-30)
- [Response](#response-30)
- [HTTP](#http-31)
- + [Edit Post](#edit-post)
+ + [Get Posts](#get-posts)
- [Request](#request-31)
- [Response](#response-31)
- [HTTP](#http-32)
- + [Save Post](#save-post)
+ + [Create Post Like](#create-post-like)
- [Request](#request-32)
- [Response](#response-32)
- [HTTP](#http-33)
- * [Comment](#comment)
- + [Create Comment](#create-comment)
+ + [Edit Post](#edit-post)
- [Request](#request-33)
- [Response](#response-33)
- [HTTP](#http-34)
- + [Edit Comment](#edit-comment)
+ + [Save Post](#save-post)
- [Request](#request-34)
- [Response](#response-34)
- [HTTP](#http-35)
- + [Save Comment](#save-comment)
+ * [Comment](#comment)
+ + [Create Comment](#create-comment)
- [Request](#request-35)
- [Response](#response-35)
- [HTTP](#http-36)
- + [Create Comment Like](#create-comment-like)
+ + [Edit Comment](#edit-comment)
- [Request](#request-36)
- [Response](#response-36)
- [HTTP](#http-37)
+ + [Save Comment](#save-comment)
+ - [Request](#request-37)
+ - [Response](#response-37)
+ - [HTTP](#http-38)
+ + [Create Comment Like](#create-comment-like)
+ - [Request](#request-38)
+ - [Response](#response-38)
+ - [HTTP](#http-39)
* [RSS / Atom feeds](#rss--atom-feeds)
+ [All](#all)
+ [Community](#community-1)
@@ -779,6 +787,53 @@ Search types are `All, Comments, Posts, Communities, Users, Url`
`POST /site/transfer`
+#### Get Site Config
+##### Request
+```rust
+{
+ op: "GetSiteConfig",
+ data: {
+ auth: String
+ }
+}
+```
+##### Response
+```rust
+{
+ op: "GetSiteConfig",
+ data: {
+ config_hjson: String,
+ }
+}
+```
+##### HTTP
+
+`GET /site/config`
+
+#### Save Site Config
+##### Request
+```rust
+{
+ op: "SaveSiteConfig",
+ data: {
+ config_hjson: String,
+ auth: String
+ }
+}
+```
+##### Response
+```rust
+{
+ op: "SaveSiteConfig",
+ data: {
+ config_hjson: String,
+ }
+}
+```
+##### HTTP
+
+`PUT /site/config`
+
### Community
#### Get Community
##### Request
diff --git a/server/src/api/site.rs b/server/src/api/site.rs
index ad45e8d1..4202fea0 100644
--- a/server/src/api/site.rs
+++ b/server/src/api/site.rs
@@ -97,6 +97,22 @@ pub struct TransferSite {
auth: String,
}
+#[derive(Serialize, Deserialize)]
+pub struct GetSiteConfig {
+ auth: String,
+}
+
+#[derive(Serialize, Deserialize)]
+pub struct GetSiteConfigResponse {