Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated a few things #18

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 37 additions & 36 deletions docs/admin_guide.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Admin Bare Metal/VM Guide

Below is a step-by-step guide of the process for creating your own /kbin instance from the moment a new VPS/VM is created or directly on bare-metal.
This is a preliminary outline that will help you launch an instance for your own needs.
This is a preliminary outline that will help you launch an instance for your needs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"own" is not a problem here


For Docker see: [Admin Deployment Guide](./docker_deployment_guide.md).
For Docker, see: [Admin Deployment Guide](./docker_deployment_guide.md).

> **Note**
> /kbin is still in the early stages of development.

If you would like to support the project, you can register using the following [affiliate link](https://hetzner.cloud/?ref=8tSPCw0qqIwl).

This guide is aimed for Debian / Ubuntu distribution servers, but it could run on any modern Linux distro. This guide will however uses the `apt` commands.
This guide is aimed for Debian / Ubuntu distribution servers, but it could run on any modern Linux distro. This guide will, however, will use the `apt` commands.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still bad; you repeated "will". Just make it "will, however, use"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, you can suggest changes on GitHub by specifying the triple-tick language to be "suggestion" and filling in your preferred version of the line like this!

Suggested change
This guide is aimed for Debian / Ubuntu distribution servers, but it could run on any modern Linux distro. This guide will, however, will use the `apt` commands.
This guide is aimed for Debian / Ubuntu distribution servers, but it could run on any modern Linux distro. This guide will, however, use the `apt` commands.

This way, they can easily implement your requests and you'll also get credited as the author of the commit.


## Minimum hardware requirements

**CPU:** 2 cores (>2.5 GHz)
**RAM:** 4GB (more is recommended for large instances)
**Storage:** 20GB (more is recommended, especially if you have a lot of remote/local magazines and/or have a lot of (local) users)
**RAM:** 4 GB (more is recommended for large instances)
**Storage:** 20 GB (more is recommended, especially if you have a lot of remote/local magazines or have a lot of (local) users)

## System Prerequisites

Expand All @@ -34,7 +34,7 @@ sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=compose
// todo
```

## Install NodeJS & Yarn (frontend tools)
## Install Node.js & Yarn (frontend tools)

```bash
curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -
Expand Down Expand Up @@ -109,14 +109,14 @@ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:$(whoami):rwX var

### The `.env` file

Make a copy of the `.env.example_v2` the and edit the `.env` configure file:
Make a copy of the `.env.example_v2` and edit the `.env` configure file:

```
cp .env.example_v2 .env
nano .env
```

Make sure you have substituted all the passwords and configured the basic services in `.env` file.
Make sure you have substituted all the passwords and configured the basic services in the `.env` file.

> **Note**
> The snippet below are to variables inside the .env file. Using the keys generated in the section above "Generating Secrets" fill in the values. You should fully review this file to ensure everything is configured correctly.
Expand Down Expand Up @@ -220,7 +220,7 @@ composer clear-cache

#### Composer Development

If you run production already then _skip the steps below_.
If you run production already, then _skip the steps below_.

```bash
composer install
Expand All @@ -243,15 +243,15 @@ sudo nano /etc/redis/redis.conf
# Change no to systemd, considering Ubuntu is using systemd
```

Save and exit (ctrl+x) the file.
Save and exit (CTRL+x) the file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you consider "ctrl" to be wrong, then so is "CTRL". It's not an acronym, it's the word "Control", so use what most keyboards use: "Ctrl"


Restart Redis:

```bash
sudo systemctl restart redis.service
```

Within your `.env` file, change the redis host to `127.0.0.1` (localhost), proper IP or use socket file:
Within your `.env` file, change the Redis host to `127.0.0.1` (localhost), proper IP or use socket file:

```conf
REDIS_HOST=127.0.0.1:6379
Expand All @@ -264,7 +264,7 @@ REDIS_DNS=redis://${REDIS_PASSWORD}@${REDIS_HOST}

### PostgreSQL (Database)

Create new `kbin` database user, using the password, `{!SECRET!!KEY!-32_2-!}`, you generated earlier:
Create a new `kbin` database user, using the password, `{!SECRET!!KEY!-32_2-!}`, you generated earlier:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix is correct, but the sentence is still awkward and needs more work.
I would suggest something like this:
Create a new kbin database user, using the password you generated earlier ({!SECRET!!KEY!-32_2-!}):


```bash
sudo -u postgres createuser --createdb --createrole --pwprompt kbin
Expand All @@ -290,7 +290,7 @@ Make sure you have substituted all the passwords and configured the basic servic

### NGINX

We will use NGINX as reverse proxy between the public site and various backend services (static files, PHP and Mercure).
We will use NGINX as a reverse proxy between the public site and various backend services (static files, PHP and Mercure).

#### General NGINX configs

Expand Down Expand Up @@ -658,21 +658,21 @@ The content of the `Caddyfile`:
{$EXTRA_DIRECTIVES}

route {
mercure {
# Transport to use (default to Bolt)
transport_url {$MERCURE_TRANSPORT_URL:bolt://mercure.db}
# Publisher JWT key
publisher_jwt {env.MERCURE_PUBLISHER_JWT_KEY} {env.MERCURE_PUBLISHER_JWT_ALG}
# Subscriber JWT key
subscriber_jwt {env.MERCURE_SUBSCRIBER_JWT_KEY} {env.MERCURE_SUBSCRIBER_JWT_ALG}
mercure {
# Transport to use (default to Bolt)
transport_url {$MERCURE_TRANSPORT_URL:bolt://mercure.db}
# Publisher JWT key
publisher_jwt {env.MERCURE_PUBLISHER_JWT_KEY} {env.MERCURE_PUBLISHER_JWT_ALG}
# Subscriber JWT key
subscriber_jwt {env.MERCURE_SUBSCRIBER_JWT_KEY} {env.MERCURE_SUBSCRIBER_JWT_ALG}
# Workaround for now
anonymous
# Extra directives
{$MERCURE_EXTRA_DIRECTIVES}
}
anonymous
# Extra directives
{$MERCURE_EXTRA_DIRECTIVES}
}

respond /healthz 200
respond "Not Found" 404
respond /healthz 200
respond "Not Found" 404
}
```

Expand Down Expand Up @@ -722,7 +722,7 @@ process_name=%(program_name)s_%(process_num)02d

Save and close the file.

We also use supervisor for running Mercure job:
We also use a supervisor for running Mercure job:

```bash
sudo nano /etc/supervisor/conf.d/mercure.conf
Expand Down Expand Up @@ -760,7 +760,7 @@ sudo supervisorctl restart all

### Kbin first setup

Create new admin user (without email verification), please change the `username`, `email` and `password` below:
To create a new admin user (without email verification), please change the `username`, `email` and `password` below:

```bash
php bin/console kbin:user:create <username> <email@example.com> <password>
Expand All @@ -771,17 +771,17 @@ php bin/console kbin:user:admin <username>
php bin/console kbin:ap:keys:update
```

Next, log in and create a magazine named "random" to which unclassified content from the fediverse will flow.
Next, log in and create a magazine named random to which unclassified content from the Fediverse will flow.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that adding smart quotes is useful or necessary.


### Upgrades

If you perform a kbin upgrade (eg. `git pull`), be aware to _always_ execute the following Bash script:
If you perform a kbin upgrade (e.g., `git pull`), be aware to _always_ execute the following Bash script:

```bash
./bin/post-upgrade
```

And when needed also execute: `sudo redis-cli FLUSHDB` to get rid of Redis cache issues. And reload the PHP FPM service if you have OPCache enabled.
And when needed, also execute: `sudo redis-cli FLUSHDB` to get rid of Redis cache issues. And reload the PHP FPM service if you have OPCache enabled.

### Backup and restore

Expand Down Expand Up @@ -825,9 +825,9 @@ Web-server (Nginx):

### Debugging

**Please, check the logs above first.** If you are really stuck, visit to our [Matrix space](https://matrix.to/#/%23kbin-space:matrix.org), there are dedicated rooms for 'Getting Started', 'Server Owners' and 'Issues'.
**Please check the logs above first.** If you are really stuck, visit to our [Matrix space](https://matrix.to/#/%23kbin-space:matrix.org), there are dedicated rooms for 'Getting Started', 'Server Owners' and 'Issues'.

Test PostgreSQL connections if using a remote server, same with Redis. Ensure no firewall rules blocking are any incoming or out-coming traffic (eg. port on 80 and 443).
Test PostgreSQL connections if using a remote server, same with Redis. Ensure no firewall rules blocking are any incoming or out-coming traffic (e.g., port on 80 and 443).

### S3 Images storage (optional)

Expand Down Expand Up @@ -868,7 +868,7 @@ oneup_flysystem:

### Captcha (optional)

Go to [hcaptcha.com](https://www.hcaptcha.com) and create a free account. Make a sitekey and a secret. Add domain.tld to the sitekey.
Go to [hcaptcha.com](https://www.hcaptcha.com) and create a free account. Make a site key and a secret. Add domain.tld to the site key.

Edit your `.env` file:

Expand All @@ -886,11 +886,11 @@ or
composer dump-env dev
```

Go to the admin panel, then to settings tab and check "Captcha enabled" and press "Save".
Go to the admin panel, then to the settings tab and check Captcha enabled and press Save.

## Performance hints

- [Resolve cache images in background](https://symfony.com/bundles/LiipImagineBundle/current/optimizations/resolve-cache-images-in-background.html#symfony-messenger)
- [Resolve cache images in the background](https://symfony.com/bundles/LiipImagineBundle/current/optimizations/resolve-cache-images-in-background.html#symfony-messenger)

## References

Expand All @@ -899,3 +899,4 @@ Go to the admin panel, then to settings tab and check "Captcha enabled" and pres
- [https://symfony.com/doc/current/setup/web_server_configuration.html](https://symfony.com/doc/current/setup/web_server_configuration.html)
- [https://symfony.com/doc/current/messenger.html#deploying-to-production](https://symfony.com/doc/current/messenger.html#deploying-to-production)
- [https://codingstories.net/how-to/how-to-install-and-use-mercure/](https://codingstories.net/how-to/how-to-install-and-use-mercure/)

21 changes: 11 additions & 10 deletions docs/docker_deployment_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

**Docker guide is still WIP. Not all the steps have been fully verified yet.**

For bare metal see: [Admin Bare Metal Guide](./admin_guide.md).
For bare-metal, see: [Admin Bare-Metal Guide](./admin_guide.md).

> **Note**
> /kbin is still in the early stages of development.
Expand Down Expand Up @@ -89,7 +89,7 @@ MERCURE_HOST=www:80

### Running the containers

By default `docker compose` will execute the `docker-compose.yml` and `docker-compose.override.yml` files.
By default, `docker compose` will execute the `docker-compose.yml` and `docker-compose.override.yml` files.

Run the container in the background (`-d` means detached, but this can also be omitted for testing):

Expand All @@ -100,11 +100,11 @@ docker compose up -d
See your running containers via: `docker ps`.

Then, you should be able to access the new instance via [http://localhost](http://localhost).
You can also access RabbitMQ management UI via [http://localhost:15672](http://localhost:15672).
You can also access the RabbitMQ management UI via [http://localhost:15672](http://localhost:15672).

### Kbin first setup

Create new admin user (without email verification), please change the `username`, `email` and `password` below:
To create a new admin user (without email verification), please change the `username`, `email` and `password` below:

```bash
docker compose exec php bin/console kbin:user:create <username> <email@example.com> <password>
Expand All @@ -115,23 +115,23 @@ docker compose exec php bin/console kbin:user:admin <username>
docker compose exec php bin/console kbin:ap:keys:update
```

Next, log in and create a magazine named "random" to which unclassified content from the fediverse will flow.
Next, log in and create a magazine named random to which unclassified content from the Fediverse will flow.

### Add auxiliary containers to `docker-compose.yml`

Add any auxiliary container as you want. For example, add a Nginx container as reverse proxy to provide HTTPS encryption.
Add any auxiliary container as you want. For example, add a Nginx container as a reverse proxy to provide HTTPS encryption.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Nginx" is a strange word when it comes to adding an indefinite article in front of it. One might think "a" would be correct since the word starts with "n", but... when I read through this sentence out loud, I naturally correct "a" to "an" because "Nginx" is pronounced "engine x" and not "n-jinx".


## Uploaded media files

Uploaded media files (e.g. photos uploaded by users) will be stored on the host directory `storage/media`. They will be served by the Caddy web server in the `www` container as static files.
Uploaded media files (e.g., photos uploaded by users) will be stored on the host directory `storage/media`. They will be served by the Caddy web server in the `www` container as static files.

Make sure `KBIN_STORAGE_URL` in your `.env` configuration file is set to be `https://yourdomain.tld/media` (assuming you setup Nginx with SSL certificate by now).
Make sure `KBIN_STORAGE_URL` in your `.env` configuration file is set to be `https://yourdomain.tld/media` (assuming you set up Nginx with SSL certificate by now).

You can also serve those media files on another server by mirroring the files at `storage/media` and changing `KBIN_STORAGE_URL` correspondingly.

## Filesystem ACL support
## File system ACL support
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Filesystem" as one word in English is fine. It's frequently used that way.


The filesystem ACL is disabled by default, in the `kbin` image. You can set the environment variable `ENABLE_ACL=1` to enable it. Remember that not all filesystems support ACL. This will cause an error if you enable filesystem ACL for such filesystems.
The file system ACL is disabled by default, in the `kbin` image. You can set the environment variable `ENABLE_ACL=1` to enable it. Remember that not all file systems support ACL. This will cause an error if you enable file system ACL for such file systems.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undo this change too


## Production

Expand Down Expand Up @@ -162,3 +162,4 @@ docker compose exec redis redis-cli
docker exec -it container_id pg_dump -U kbin kbin > dump.sql
docker compose exec -T database psql -U kbin kbin < dump.sql
```

15 changes: 8 additions & 7 deletions docs/oauth2_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
## Available Scopes
### Scope tree
1. `read` - Allows retrieval of threads from the user's subscribed magazines/domains and viewing the user's favorited entries.
2. `write` - Provides all of the following nested scopes
2. `write` - Provides all the following nested scopes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"of" is actually more correct here.

* `entry:create`
* `entry:edit`
* `entry_comment:create`
Expand All @@ -30,7 +30,7 @@
* `post:edit`
* `post_comment:create`
* `post_comment:edit`
3. `delete` - Provides all of the following nested scopes, for deleting the current user's content
3. `delete` - Provides all the following nested scopes, for deleting the current user's content
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here -- "of" does belong

* `entry:delete`
* `entry_comment:delete`
* `post:delete`
Expand Down Expand Up @@ -92,7 +92,7 @@
14. `user` - Provides all user access scopes
* `user:profile`
* `user:profile:read`
* Allows access to current user's settings and profile via the `/api/user/me` endpoint
* Allows access to the current user's settings and profile via the `/api/user/me` endpoint
* `user:profile:edit`
* Allows updating the current user's settings and profile
* `user:message`
Expand Down Expand Up @@ -153,7 +153,7 @@
* `moderate:magazine:reports:read`
* Allows the client to read reports about content from magazines the user moderates
* `moderate:magazine:reports:action`
* Allows the client to take action on reports, either accepting or rejecting them
* Allows the client to act on reports, either accepting or rejecting them
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think either version here is better than the other

* `moderate:magazine:trash:read`
* Allows viewing the removed content of a moderated magazine
* `moderate:magazine_admin`
Expand All @@ -162,7 +162,7 @@
* `moderate:magazine_admin:delete`
* Allows the deletion of magazines the user has permission to delete
* `moderate:magazine_admin:update`
* Allows magazine rules, description, settings, title, etc to be updated
* Allows magazine rules, description, settings, title, etc. to be updated
* `moderate:magazine_admin:theme`
* Allows updates to the magazine theme
* `moderate:magazine_admin:moderators`
Expand Down Expand Up @@ -209,6 +209,7 @@
* Allows the admin to edit the list of defederated instances
* `admin:oauth_clients`
* `admin:oauth_clients:read`
* Allows the admin to read usage stats of oauth clients, as well as list clients on the instance
* Allows the admin to read usage stats of OAuth clients, as well as list clients on the instance
* `admin:oauth_clients:revoke`
* Allows the admin to revoke a client's permission to acces the instance
* Allows the admin to revoke a client's permission to access the instance

19 changes: 10 additions & 9 deletions docs/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,42 @@ The initiative aims to promote a free and open internet.
## Introduction

The platform is divided into thematic categories called magazines. By default, any user can create their own magazine
and automatically become its owner. Then they receive a number of administrative tools that will help them personalize
and automatically become its owner. Then they receive many administrative tools that will help them personalize
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessarily the same meaning. "Many" implies that the number of tools is large, while "a number of" generally carries the connotation of "maybe many, but at least several"

and moderate the magazine, including appointing moderators from among other users.

Content from the Fediverse is also cataloged based on groups or tags. A registered user can follow magazines, other
users or domains and create his own personalized homepage. There is also the option to block unwanted topics.

Content can be posted on the main page - external links and more relevant articles or on microblog section - aggregating
short posts. All content can be additionally categorized and labeled. Great possibilities to search for interesting
short posts. All content can additionally be categorized and labeled. Great possibilities to search for interesting
topics and people easily is something that distinguishes Kbin.

Platform is equally suitable for a small personal instance for friends and family, a school or university community,
The platform is equally suitable for a small personal instance for friends and family, a school or university community,
company platform or a general instance with thousands of active users.

## User guide

### Customization

Everyone has the ability to customize the appearance to suit your preferences. In the sidebar, you'll find an options
Everyone can customize the appearance to suit their preferences. In the sidebar, you'll find an option
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"options" is more correct here, as the button's purpose is to reveal "a variety of settings". If the button used text rather than just an icon, it would more likely say "Options" rather than "Option".

button that allows you to adjust a variety of settings, including the ability to choose from four different templates,
enable automatic refreshing of posts and comments, activate infinite scroll, and enable automatic media previews.

By using these options, you can completely transform the appearance of the platform to fit your personal style. Whether
you prefer a minimalist design or a more colorful and lively look, you can easily make the changes that will make your
experience on platform more enjoyable.
experience on the platform more enjoyable.

So don't be afraid to experiment with the various options available in the sidebar. You might be surprised at just how
much you can change the appearance of the platform to suit your preferences.
much, you can change the appearance of the platform to suit your preferences.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is 100% incorrect.


(pic1)

### Register account

The process of registering for a user account on a platform usually involves providing a username (which will also serve
as your identifier in the fediverse), password, and email address to receive an activation link.
as your identifier in the Fediverse), password, and email address to receive an activation link.

Another option is to create an account through social media platforms such as Google, Facebook, or Github. In this case,
Another option is to create an account through social media platforms such as Google, Facebook, or GitHub. In this case,
you can use your social media login credentials to sign up, but you will need to visit your user panel and set up your
username before you can take any actions on the platform. However, **you will have only up to an hour after registration
** to set up your default username before this option expires (Settings > Profile).
Expand All @@ -65,7 +65,7 @@ options.
* **General:** In this section, you can set your preferred home page (all, subscribed, moderated, favorites), hide adult
content, set user tagging options, adjust privacy settings, and configure notification settings.

* **Profile:** Here, you can write a few words about yourself (which will be visible in the "People" section), add an
* **Profile:** Here, you can write a few words about yourself (which will be visible in the People section), add an
avatar and cover image.

* **Email:** In this section, you can change your email address. After changing to a new email, you will receive an
Expand All @@ -85,3 +85,4 @@ options.

### Fediverse