Format markdown files with remark-lint

This commit is contained in:
Alexander Minkin 2021-01-31 01:33:06 +03:00
parent bb96468859
commit 62a643a0f3
2 changed files with 104 additions and 29 deletions

View file

@ -1,11 +1,15 @@
# OpenVK Installation Instructions # OpenVK Installation Instructions
-----------
* * *
1. Install Composer, Node.js, Yarn and [Chandler](https://github.com/openvk/chandler) 1. Install Composer, Node.js, Yarn and [Chandler](https://github.com/openvk/chandler)
2. Install [commitcaptcha](https://github.com/openvk/commitcaptcha)/[chandler-recaptcha](https://github.com/openvk/chandler-recaptcha) and OpenVK as Chandler extensions and enable them like this: 2. Install [commitcaptcha](https://github.com/openvk/commitcaptcha)/[chandler-recaptcha](https://github.com/openvk/chandler-recaptcha) and OpenVK as Chandler extensions and enable them like this:
```bash ```bash
ln -s /path/to/chandler/extensions/available/commitcaptcha /path/to/chandler/extensions/enabled/ ln -s /path/to/chandler/extensions/available/commitcaptcha /path/to/chandler/extensions/enabled/
ln -s /path/to/chandler/extensions/available/openvk /path/to/chandler/extensions/enabled/ ln -s /path/to/chandler/extensions/available/openvk /path/to/chandler/extensions/enabled/
``` ```
3. Import install/init-static-db.sql to same database you installed Chandler to 3. Import install/init-static-db.sql to same database you installed Chandler to
4. Import install/init-event-db.sql to separate database 4. Import install/init-event-db.sql to separate database
5. Rename openvk-example.yml to openvk.yml and change options 5. Rename openvk-example.yml to openvk.yml and change options
@ -14,8 +18,9 @@ ln -s /path/to/chandler/extensions/available/openvk /path/to/chandler/extensions
8. Set `openvk` as your root app in chandler.yml 8. Set `openvk` as your root app in chandler.yml
Once you are done, you can login as a system administrator on the network itself (no registration required): Once you are done, you can login as a system administrator on the network itself (no registration required):
- **Login**: `admin@localhost.localdomain6` - **Login**: `admin@localhost.localdomain6`
- **Password**: `admin` - **Password**: `admin`
It is recommended to change the password before using the built-in account. It is recommended to change the password before using the built-in account.
Full example installation instruction for CentOS 8 is also available [here](docs/centos8_install.md). Full example installation instruction for CentOS 8 is also available [here](docs/centos8_install.md).

View file

@ -1,88 +1,118 @@
# Installing OpenVK # Installing OpenVK
Based on [@rem-pai](https://github.com/rem-pai)'s way to install OpenVK modified using my experience. Based on [@rem-pai](https://github.com/rem-pai)'s way to install OpenVK modified using my experience.
## SELinux ## SELinux
🖥Run the command: 🖥Run the command:
```bash ```bash
sestatus sestatus
``` ```
If it says `SELinux status: enabled` then SELinux will disturb us. Let's disable it. If it says `SELinux status: enabled` then SELinux will disturb us. Let's disable it.
*Note: I know that it's not most secured solution but I don't know any proper way that will work.* _Note: I know that it's not most secured solution but I don't know any proper way that will work._
📝Edit file `/etc/sysconfig/selinux` and change the line `SELinux=enforcing` to `SELinux=disabled`, then 🔌reboot your machine. `sestatus` should tell `SELinux status: disabled` right now. 📝Edit file `/etc/sysconfig/selinux` and change the line `SELinux=enforcing` to `SELinux=disabled`, then 🔌reboot your machine. `sestatus` should tell `SELinux status: disabled` right now.
## Dependencies ## Dependencies
🖥Let's install EPEL and Remi repos for PHP 7.4: 🖥Let's install EPEL and Remi repos for PHP 7.4:
```bash ```bash
dnf -y install epel-release dnf -y install epel-release
dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
``` ```
🖥Then enable modules that we need: 🖥Then enable modules that we need:
```bash ```bash
dnf -y module enable php:remi-7.4 dnf -y module enable php:remi-7.4
dnf -y module enable nodejs:14 dnf -y module enable nodejs:14
``` ```
🖥And install dependencies: 🖥And install dependencies:
```bash ```bash
dnf -y install php php-cli php-common unzip php-zip php-yaml php-gd php-pdo_mysql nodejs git dnf -y install php php-cli php-common unzip php-zip php-yaml php-gd php-pdo_mysql nodejs git
``` ```
🖥Don't forget about Yarn and Composer: 🖥Don't forget about Yarn and Composer:
```bash ```bash
npm i -g yarn npm i -g yarn
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --filename=composer2 --install-dir=/bin --snapshot php composer-setup.php --filename=composer2 --install-dir=/bin --snapshot
rm composer-setup.php rm composer-setup.php
``` ```
### Database ### Database
🖥We will use Percona Server for DB: 🖥We will use Percona Server for DB:
```bash ```bash
dnf -y install https://repo.percona.com/yum/percona-release-latest.noarch.rpm dnf -y install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
percona-release setup -y ps80 percona-release setup -y ps80
dnf -y install percona-server-server percona-toolkit dnf -y install percona-server-server percona-toolkit
systemctl start mysql systemctl start mysql
``` ```
🖥And then look up for temporary password: 🖥And then look up for temporary password:
```bash ```bash
cat /var/log/mysqld.log | grep password cat /var/log/mysqld.log | grep password
``` ```
It should look like this: It should look like this:
```
2021-01-11T12:56:09.203991Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: >b?Q.fDXJ4fk 2021-01-11T12:56:09.203991Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: >b?Q.fDXJ4fk
```
🖥Then run `mysql_secure_installation`, set new password and answer like this: 🖥Then run `mysql_secure_installation`, set new password and answer like this:
```
Change the password for root ? ((Press y|Y for Yes, any other key for No) : n Change the password for root ? ((Press y|Y for Yes, any other key for No) : n
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
```
### ffmpeg ### ffmpeg
Additionally, you can install ffmpeg for processing videos. Additionally, you can install ffmpeg for processing videos.
🖥You will need to use RPMFusion repo to install it: 🖥You will need to use RPMFusion repo to install it:
```bash ```bash
dnf -y localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm dnf -y localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm
dnf -y install --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm dnf -y install --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm
``` ```
🖥Then install SDL2 and ffmpeg: 🖥Then install SDL2 and ffmpeg:
```bash ```bash
dnf -y install http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm dnf -y install http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm
dnf -y install ffmpeg dnf -y install ffmpeg
``` ```
## Chandler and OpenVK installation ## Chandler and OpenVK installation
🖥Install Chandler in `/opt`: 🖥Install Chandler in `/opt`:
```bash ```bash
cd /opt cd /opt
git clone https://github.com/openvk/chandler.git git clone https://github.com/openvk/chandler.git
cd chandler/ cd chandler/
composer2 install composer2 install
``` ```
🖥You will need a secret key. You can generate it using: 🖥You will need a secret key. You can generate it using:
```bash ```bash
cat /dev/random | tr -dc 'a-z0-9' | fold -w 128 | head -n 1 cat /dev/random | tr -dc 'a-z0-9' | fold -w 128 | head -n 1
``` ```
📝Now edit config file `chandler-example.yml` like this: 📝Now edit config file `chandler-example.yml` like this:
```yaml ```yaml
chandler: chandler:
debug: true debug: true
@ -104,18 +134,24 @@ chandler:
csrfProtection: "permissive" csrfProtection: "permissive"
sessionDuration: 14 sessionDuration: 14
``` ```
🖥And rename it to `chandler.yml`: 🖥And rename it to `chandler.yml`:
```bash ```bash
mv chandler-example.yml chandler.yml mv chandler-example.yml chandler.yml
``` ```
🖥Now let's install CommitCaptcha extension. It is mandatory for OpenVK. 🖥Now let's install CommitCaptcha extension. It is mandatory for OpenVK.
```bash ```bash
cd extensions/available/ cd extensions/available/
git clone https://github.com/openvk/commitcaptcha.git git clone https://github.com/openvk/commitcaptcha.git
cd commitcaptcha/ cd commitcaptcha/
composer2 install composer2 install
``` ```
🖥And now download OpenVK: 🖥And now download OpenVK:
```bash ```bash
cd .. cd ..
git clone https://github.com/openvk/openvk.git git clone https://github.com/openvk/openvk.git
@ -124,7 +160,9 @@ composer2 install
cd Web/static/js cd Web/static/js
yarn install yarn install
``` ```
📝Now edit config file `openvk-example.yml` like this: 📝Now edit config file `openvk-example.yml` like this:
```yaml ```yaml
openvk: openvk:
debug: true debug: true
@ -184,67 +222,90 @@ openvk:
user: "root" user: "root"
password: "DATABASE_PASSWORD" password: "DATABASE_PASSWORD"
``` ```
Please note `eventDB` section because it's better to enable event database. Please note `eventDB` section because it's better to enable event database.
🖥And rename it to `openvk.yml`: 🖥And rename it to `openvk.yml`:
```bash ```bash
mv openvk-example.yml openvk.yml mv openvk-example.yml openvk.yml
``` ```
🖥Then enable CommitCaptcha and OpenVK for Chandler: 🖥Then enable CommitCaptcha and OpenVK for Chandler:
```bash ```bash
ln -s /opt/chandler/extensions/available/commitcaptcha/ /opt/chandler/extensions/enabled/commitcaptcha ln -s /opt/chandler/extensions/available/commitcaptcha/ /opt/chandler/extensions/enabled/commitcaptcha
ln -s /opt/chandler/extensions/available/openvk/ /opt/chandler/extensions/enabled/openvk ln -s /opt/chandler/extensions/available/openvk/ /opt/chandler/extensions/enabled/openvk
``` ```
### DB configuration ### DB configuration
*Note: it's better to create another user for SQL but I won't cover that.*
_Note: it's better to create another user for SQL but I won't cover that._
🖥Enter MySQL shell: 🖥Enter MySQL shell:
```bash ```bash
mysql -p mysql -p
``` ```
🖥And create main and event databases: 🖥And create main and event databases:
```sql ```sql
CREATE DATABASE openvk; CREATE DATABASE openvk;
CREATE DATABASE openvk_eventdb; CREATE DATABASE openvk_eventdb;
exit exit
``` ```
🖥Go to `/opt/chandler`: 🖥Go to `/opt/chandler`:
```bash ```bash
cd /opt/chandler cd /opt/chandler
``` ```
📝We need to import Chandler database but for some reason it's not ready for use so we need to edit dump `install/init-db.sql`: 📝We need to import Chandler database but for some reason it's not ready for use so we need to edit dump `install/init-db.sql`:
1. Remove ` PAGE_CHECKSUM=1` everywhere. 1\. Remove ` PAGE_CHECKSUM=1` everywhere.
2. Replace `Aria` with `InnoDB` everywhere. 2\. Replace `Aria` with `InnoDB` everywhere.
🖥Now database dump can be imported: 🖥Now database dump can be imported:
```bash ```bash
mysql -p'DATABASE_PASSWORD' openvk < install/init-db.sql mysql -p'DATABASE_PASSWORD' openvk < install/init-db.sql
``` ```
🖥Go to `extensions/available/openvk/`: 🖥Go to `extensions/available/openvk/`:
```bash ```bash
cd extensions/available/openvk/ cd extensions/available/openvk/
``` ```
📝We also need to import OpenVK database. Unless you use MariaDB (we are using Percona here) you should edit `install/init-static-db.sql`: 📝We also need to import OpenVK database. Unless you use MariaDB (we are using Percona here) you should edit `install/init-static-db.sql`:
1. Replace `utf8mb4_unicode_nopad_ci` with `utf8mb4_unicode_520_ci` everywhere. 1\. Replace `utf8mb4_unicode_nopad_ci` with `utf8mb4_unicode_520_ci` everywhere.
🖥Now database dump can be imported: 🖥Now database dump can be imported:
```bash ```bash
mysql -p'DATABASE_PASSWORD' openvk < install/init-static-db.sql mysql -p'DATABASE_PASSWORD' openvk < install/init-static-db.sql
``` ```
🖥Also import event database: 🖥Also import event database:
```bash ```bash
mysql -p'DATABASE_PASSWORD' openvk_eventdb < install/init-event-db.sql mysql -p'DATABASE_PASSWORD' openvk_eventdb < install/init-event-db.sql
``` ```
### Webserver configuration ### Webserver configuration
Apache is already installed so we will use it. Apache is already installed so we will use it.
🖥Make the user `apache` owner of the `chandler` folder: 🖥Make the user `apache` owner of the `chandler` folder:
```bash ```bash
cd /opt cd /opt
chown -R apache: chandler/ chown -R apache: chandler/
``` ```
📝Now let's create config file `/etc/httpd/conf.d/10-openvk.conf`: 📝Now let's create config file `/etc/httpd/conf.d/10-openvk.conf`:
```apache ```apache
<VirtualHost *:80> <VirtualHost *:80>
ServerName openvk.local ServerName openvk.local
@ -260,24 +321,33 @@ chown -R apache: chandler/
CustomLog /var/log/openvk/access.log combinedio CustomLog /var/log/openvk/access.log combinedio
</VirtualHost> </VirtualHost>
``` ```
📝Also enable rewrite_module by creating `/etc/httpd/conf.modules.d/02-rewrite.conf`: 📝Also enable rewrite_module by creating `/etc/httpd/conf.modules.d/02-rewrite.conf`:
```apache ```apache
LoadModule rewrite_module modules/mod_rewrite.so LoadModule rewrite_module modules/mod_rewrite.so
``` ```
🖥Make directory for OpenVK logs and make the user `apache` owner of it: 🖥Make directory for OpenVK logs and make the user `apache` owner of it:
```bash ```bash
mkdir /var/log/openvk mkdir /var/log/openvk
chown apache: /var/log/openvk/ chown apache: /var/log/openvk/
``` ```
🖥Make the firewall exception for port 80: 🖥Make the firewall exception for port 80:
```bash ```bash
firewall-cmd --permanent --add-port=80/tcp firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload firewall-cmd --reload
``` ```
🖥And start Apache: 🖥And start Apache:
```bash ```bash
systemctl start httpd systemctl start httpd
``` ```
OpenVK should work right now! OpenVK should work right now!
Also you can raise 2MB the file limit through editing `/etc/php.ini`. And it's also better to install PHPMyAdmin but I won't cover that. Also you can raise 2MB the file limit through editing `/etc/php.ini`. And it's also better to install PHPMyAdmin but I won't cover that.