mirror of
https://github.com/openvk/openvk
synced 2024-12-22 16:42:32 +03:00
CI for OpenVK, Kubernetes and Docker deployments (#735)
* Kubernetes deployment * Update kubernetes deployment * Fix rewrite module load * Fix mysql-primary bootstrap * Fix mysql init-db apply order * Fix init-db.sql permissions * Fix MySQL missing *.sql import * Switch from MySQL to MariaDB * [skip ci] Example deployment update * Set root app in chandler configmap * Update missing php extension in base images * Update missing dependency in apache image * Remove default site configuration * [skip ci] Split Kubernetes deployments by type * Explicitly set persistent volume for openvk storage * [skip ci] Add README for Kubernetes * Replace old docker(-compose) files w/ new ones * Add README for docker usage * [skip ci] Update README.md and README_RU.md * [skip ci] Fix eventdb DB name * [skip ci] Kubernetes configmap: missing namespace * [skip ci] Fix typo * [skip ci] Ignore chandler.yml * [skip ci] Missing /var/log/openvk volume * [skip ci] Workaround for Docker <=20.10.6 * [skip ci] Handle permissions for apache2 * [skip ci] Initial Kafka support * [skip ci] Kafka values for Kubernetes
This commit is contained in:
parent
d2b2e41328
commit
677e147688
26 changed files with 2811 additions and 370 deletions
58
.github/workflows/build-base.yaml
vendored
Normal file
58
.github/workflows/build-base.yaml
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
name: Build base images
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
env:
|
||||
BASE_IMAGE_NAME: php
|
||||
BASE_IMAGE_VERSION: "8.1"
|
||||
|
||||
jobs:
|
||||
build-cli:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
lfs: false
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Log into registry
|
||||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||
|
||||
- name: Build cli image
|
||||
run: |
|
||||
IMAGE_NAME=ghcr.io/${{ github.repository }}/$BASE_IMAGE_NAME:$BASE_IMAGE_VERSION-cli
|
||||
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME . --push -f install/automated/docker/base-php-cli.Dockerfile --build-arg VERSION=$BASE_IMAGE_VERSION
|
||||
|
||||
build-apache:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
lfs: false
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Log into registry
|
||||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||
|
||||
- name: Build apache image
|
||||
run: |
|
||||
IMAGE_NAME=ghcr.io/${{ github.repository }}/$BASE_IMAGE_NAME:$BASE_IMAGE_VERSION-apache
|
||||
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME . --push -f install/automated/docker/base-php-apache.Dockerfile --build-arg VERSION=$BASE_IMAGE_VERSION
|
64
.github/workflows/build.yaml
vendored
Normal file
64
.github/workflows/build.yaml
vendored
Normal file
|
@ -0,0 +1,64 @@
|
|||
name: Build images
|
||||
|
||||
on:
|
||||
push:
|
||||
# Publish `master` as Docker `latest` image.
|
||||
branches:
|
||||
- master
|
||||
|
||||
# Publish `v1.2.3` tags as releases.
|
||||
tags:
|
||||
- v*
|
||||
|
||||
env:
|
||||
BASE_IMAGE_NAME: openvk
|
||||
DB_IMAGE_NAME: mariadb
|
||||
EVENT_IMAGE_NAME: mariadb
|
||||
DB_VERSION: "10.9"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
arch: ['x86_64']
|
||||
|
||||
if: github.event_name == 'push'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
lfs: false
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Log into registry
|
||||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||
|
||||
- name: Build base image
|
||||
run: |
|
||||
IMAGE_ID=ghcr.io/${{ github.repository }}/$BASE_IMAGE_NAME
|
||||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
|
||||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
|
||||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
||||
[ "$VERSION" == "master" ] && VERSION=latest
|
||||
echo IMAGE_ID=$IMAGE_ID
|
||||
echo VERSION=$VERSION
|
||||
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_ID:$VERSION . --push -f install/automated/docker/openvk.Dockerfile --build-arg GITREPO=${{ github.repository }}
|
||||
|
||||
- name: Build MariaDB primary image
|
||||
run: |
|
||||
IMAGE_NAME=ghcr.io/${{ github.repository }}/$DB_IMAGE_NAME:$DB_VERSION-primary
|
||||
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME . --push -f install/automated/docker/mariadb-primary.Dockerfile --build-arg VERSION=$DB_VERSION
|
||||
|
||||
- name: Build MariaDB event image
|
||||
run: |
|
||||
IMAGE_NAME=ghcr.io/${{ github.repository }}/$EVENT_IMAGE_NAME:$DB_VERSION-eventdb
|
||||
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME . --push -f install/automated/docker/mariadb-eventdb.Dockerfile --build-arg VERSION=$DB_VERSION
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
|||
vendor
|
||||
openvk.yml
|
||||
chandler.yml
|
||||
update.pid
|
||||
update.pid.old
|
||||
Web/static/js/node_modules
|
||||
|
|
82
Dockerfile
82
Dockerfile
|
@ -1,82 +0,0 @@
|
|||
FROM fedora:33
|
||||
|
||||
#update and install httpd
|
||||
RUN dnf -y update && dnf -y autoremove && dnf install -y httpd
|
||||
|
||||
#Let's install Remi repos for PHP 7.4:
|
||||
RUN dnf -y install https://rpms.remirepo.net/fedora/remi-release-$(rpm -E %fedora).rpm
|
||||
|
||||
#Then enable modules that we need:
|
||||
RUN dnf -y module enable php:remi-7.4 && \
|
||||
dnf -y module enable nodejs:14
|
||||
|
||||
#And install dependencies:
|
||||
RUN dnf -y --skip-broken 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:
|
||||
RUN npm i -g yarn && \
|
||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
|
||||
php composer-setup.php --filename=composer2 --install-dir=/bin --snapshot && \
|
||||
rm composer-setup.php
|
||||
|
||||
#We will use Mariadb for DB:
|
||||
RUN dnf -y install mysql mysql-server && \
|
||||
systemctl enable mariadb && \
|
||||
echo 'skip-grant-tables' >> /etc/my.cnf
|
||||
|
||||
#Additionally, you can install ffmpeg for processing videos.
|
||||
#You will need to use RPMFusion repo to install it:
|
||||
RUN dnf -y install --nogpgcheck https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm && \
|
||||
dnf -y install --nogpgcheck https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
|
||||
|
||||
#Then install SDL2 and ffmpeg:
|
||||
RUN dnf -y install --nogpgcheck SDL2 ffmpeg
|
||||
|
||||
#Install Chandler and OpenVk/Capcha-extention in /opt:
|
||||
RUN cd /opt && \
|
||||
git clone https://github.com/samukhin/chandler.git && \
|
||||
cd chandler/ && \
|
||||
composer2 install && \
|
||||
mv chandler-example.yml chandler.yml && \
|
||||
cd extensions/available/ && \
|
||||
git clone https://github.com/samukhin/commitcaptcha.git && \
|
||||
cd commitcaptcha/ && \
|
||||
composer2 install && \
|
||||
cd .. && \
|
||||
git clone https://github.com/samukhin/openvk.git && \
|
||||
cd openvk/ && \
|
||||
composer2 install && \
|
||||
cd Web/static/js && \
|
||||
yarn install && \
|
||||
cd ../../../ && \
|
||||
mv openvk-example.yml openvk.yml && \
|
||||
ln -s /opt/chandler/extensions/available/commitcaptcha/ /opt/chandler/extensions/enabled/commitcaptcha && \
|
||||
ln -s /opt/chandler/extensions/available/openvk/ /opt/chandler/extensions/enabled/openvk
|
||||
|
||||
#Create database
|
||||
RUN cp /opt/chandler/extensions/available/openvk/install/automated/common/create_db.service /etc/systemd/system/ && \
|
||||
chmod 644 /etc/systemd/system/create_db.service && \
|
||||
chmod 777 /opt/chandler/extensions/available/openvk/install/automated/common/autoexec && \
|
||||
systemctl enable create_db
|
||||
|
||||
#Make the user apache owner of the chandler folder:
|
||||
RUN cd /opt && \
|
||||
chown -R apache: chandler/
|
||||
|
||||
#Now let's create config file /etc/httpd/conf.d/10-openvk.conf and
|
||||
#Also enable rewrite_module by creating /etc/httpd/conf.modules.d/02-rewrite.conf
|
||||
RUN cp /opt/chandler/extensions/available/openvk/install/automated/common/10-openvk.conf /etc/httpd/conf.d/ && \
|
||||
cp /opt/chandler/extensions/available/openvk/install/automated/common/02-rewrite.conf /etc/httpd/conf.modules.d/
|
||||
|
||||
#Make directory for OpenVK logs and make the user apache owner of it:
|
||||
RUN mkdir /var/log/openvk && \
|
||||
chown apache: /var/log/openvk/
|
||||
|
||||
#And start Apache:
|
||||
#RUN systemctl enable httpd
|
||||
|
||||
#For login
|
||||
RUN dnf -y install passwd && passwd -d root
|
||||
|
||||
#Start systemd
|
||||
CMD ["/sbin/init"]
|
|
@ -72,6 +72,9 @@ Once you are done, you can login as a system administrator on the network itself
|
|||
|
||||
💡Confused? Full installation walkthrough is available [here](https://docs.openvk.su/openvk_engine/centos8_installation/) (CentOS 8 [and](https://almalinux.org/) [family](https://yum.oracle.com/oracle-linux-isos.html)).
|
||||
|
||||
### Looking for Docker or Kubernetes deployment?
|
||||
See `install/automated/docker/README.md` and `install/automated/kubernetes/README.md` for Docker and Kubernetes deployment instructions.
|
||||
|
||||
### If my website uses OpenVK, should I release it's sources?
|
||||
|
||||
It depends. You can keep the sources to yourself if you do not plan to distribute your website binaries. If your website software must be distributed, it can stay non-OSS provided the OpenVK is not used as a primary application and is not modified. If you modified OpenVK for your needs or your work is based on it and you're planning to redistribute this, then you should license it under terms of any LGPL-compatible license (like OSL, GPL, LGPL etc).
|
||||
|
|
|
@ -72,6 +72,9 @@ ln -s /path/to/chandler/extensions/available/openvk /path/to/chandler/extensions
|
|||
|
||||
💡Запутались? Полное руководство по установке доступно [здесь](https://docs.openvk.su/openvk_engine/centos8_installation/) (CentOS 8 [и](https://almalinux.org/ru/) [семейство](https://yum.oracle.com/oracle-linux-isos.html)).
|
||||
|
||||
# Установка в Docker/Kubernetes
|
||||
Подробные иструкции можно найти в `install/automated/docker/README.md` и `install/automated/kubernetes/README.md` соответственно.
|
||||
|
||||
### Если мой сайт использует OpenVK, должен ли я публиковать его исходные тексты?
|
||||
|
||||
Это зависит от обстоятельств. Вы можете оставить исходные тексты при себе, если не планируете распространять бинарники вашего сайта. Если программное обеспечение вашего сайта должно распространяться, оно может оставаться не-OSS при условии, что OpenVK не используется в качестве основного приложения и не модифицируется. Если вы модифицировали OpenVK для своих нужд или ваша работа основана на нем и вы планируете ее распространять, то вы должны лицензировать ее на условиях любой совместимой с LGPL лицензии (например, OSL, GPL, LGPL и т.д.).
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
version: '3.1'
|
||||
|
||||
services:
|
||||
db:
|
||||
build: .
|
||||
restart: always
|
||||
privileged: true
|
||||
ports:
|
||||
- 8888:80
|
||||
|
||||
phpmyadmin:
|
||||
image: phpmyadmin:5
|
||||
restart: always
|
||||
ports:
|
||||
- 8080:80
|
||||
environment:
|
||||
- PMA_ARBITRARY=1
|
||||
|
||||
adminer:
|
||||
image: adminer:4
|
||||
restart: always
|
||||
ports:
|
||||
- 7777:8080
|
|
@ -1,85 +0,0 @@
|
|||
#From https://gist.github.com/WerySkok/77f9c9ec134e98b0fef2b63655ba13d2 instruction
|
||||
FROM almalinux/almalinux:8
|
||||
|
||||
#update and install httpd
|
||||
RUN dnf -y update && dnf -y autoremove && dnf install -y httpd
|
||||
|
||||
#Let's install EPEL and Remi repos for PHP 7.4:
|
||||
RUN dnf -y install epel-release && \
|
||||
dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
|
||||
|
||||
#Then enable modules that we need:
|
||||
RUN dnf -y module enable php:remi-7.4 && \
|
||||
dnf -y module enable nodejs:14
|
||||
|
||||
#And install dependencies:
|
||||
RUN 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:
|
||||
RUN npm i -g yarn && \
|
||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
|
||||
php composer-setup.php --filename=composer2 --install-dir=/bin --snapshot && \
|
||||
rm composer-setup.php
|
||||
|
||||
#We will use Percona Server for DB:
|
||||
RUN dnf -y install https://repo.percona.com/yum/percona-release-latest.noarch.rpm && \
|
||||
percona-release setup -y ps80 && \
|
||||
dnf -y install percona-server-server percona-toolkit && \
|
||||
systemctl enable mysqld && \
|
||||
echo 'skip-grant-tables' >> /etc/my.cnf
|
||||
|
||||
#Additionally, you can install ffmpeg for processing videos.
|
||||
#You will need to use RPMFusion repo to install it:
|
||||
RUN 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
|
||||
|
||||
#Then install SDL2 and ffmpeg:
|
||||
RUN dnf -y localinstall --nogpgcheck https://pkgs.dyn.su/el8/base/x86_64/raven-release-1.0-2.el8.noarch.rpm && \
|
||||
dnf -y --enablerepo=epel-testing,raven-extras,raven-multimedia install --nogpgcheck SDL2 && \
|
||||
dnf -y install ffmpeg
|
||||
|
||||
#Install Chandler and OpenVk/Capcha-extention in /opt:
|
||||
RUN cd /opt && \
|
||||
git clone https://github.com/samukhin/chandler.git && \
|
||||
cd chandler/ && \
|
||||
composer2 install && \
|
||||
mv chandler-example.yml chandler.yml && \
|
||||
cd extensions/available/ && \
|
||||
git clone https://github.com/samukhin/commitcaptcha.git && \
|
||||
cd commitcaptcha/ && \
|
||||
composer2 install && \
|
||||
cd .. && \
|
||||
git clone https://github.com/samukhin/openvk.git && \
|
||||
cd openvk/ && \
|
||||
composer2 install && \
|
||||
cd Web/static/js && \
|
||||
yarn install && \
|
||||
cd ../../../ && \
|
||||
mv openvk-example.yml openvk.yml && \
|
||||
ln -s /opt/chandler/extensions/available/commitcaptcha/ /opt/chandler/extensions/enabled/commitcaptcha && \
|
||||
ln -s /opt/chandler/extensions/available/openvk/ /opt/chandler/extensions/enabled/openvk
|
||||
|
||||
#Create database
|
||||
RUN cp /opt/chandler/extensions/available/openvk/install/automated/common/create_db.service /etc/systemd/system/ && \
|
||||
chmod 644 /etc/systemd/system/create_db.service && \
|
||||
chmod 777 /opt/chandler/extensions/available/openvk/install/automated/common/autoexec && \
|
||||
systemctl enable create_db
|
||||
|
||||
#Make the user apache owner of the chandler folder:
|
||||
RUN cd /opt && \
|
||||
chown -R apache: chandler/
|
||||
|
||||
#Now let's create config file /etc/httpd/conf.d/10-openvk.conf and
|
||||
#Also enable rewrite_module by creating /etc/httpd/conf.modules.d/02-rewrite.conf
|
||||
RUN cp /opt/chandler/extensions/available/openvk/install/automated/common/10-openvk.conf /etc/httpd/conf.d/ && \
|
||||
cp /opt/chandler/extensions/available/openvk/install/automated/common/02-rewrite.conf /etc/httpd/conf.modules.d/
|
||||
|
||||
#Make directory for OpenVK logs and make the user apache owner of it:
|
||||
RUN mkdir /var/log/openvk && \
|
||||
chown apache: /var/log/openvk/
|
||||
|
||||
#And start Apache:
|
||||
#RUN systemctl enable httpd
|
||||
|
||||
#Start systemd
|
||||
CMD ["/sbin/init"]
|
|
@ -1,85 +0,0 @@
|
|||
#From https://gist.github.com/WerySkok/77f9c9ec134e98b0fef2b63655ba13d2 instruction
|
||||
FROM centos:8
|
||||
|
||||
#update and install httpd
|
||||
RUN dnf -y update && dnf -y autoremove && dnf install -y httpd
|
||||
|
||||
#Let's install EPEL and Remi repos for PHP 7.4:
|
||||
RUN dnf -y install epel-release && \
|
||||
dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
|
||||
|
||||
#Then enable modules that we need:
|
||||
RUN dnf -y module enable php:remi-7.4 && \
|
||||
dnf -y module enable nodejs:14
|
||||
|
||||
#And install dependencies:
|
||||
RUN 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:
|
||||
RUN npm i -g yarn && \
|
||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
|
||||
php composer-setup.php --filename=composer2 --install-dir=/bin --snapshot && \
|
||||
rm composer-setup.php
|
||||
|
||||
#We will use Percona Server for DB:
|
||||
RUN dnf -y install https://repo.percona.com/yum/percona-release-latest.noarch.rpm && \
|
||||
percona-release setup -y ps80 && \
|
||||
dnf -y install percona-server-server percona-toolkit && \
|
||||
systemctl enable mysqld && \
|
||||
echo 'skip-grant-tables' >> /etc/my.cnf
|
||||
|
||||
#Additionally, you can install ffmpeg for processing videos.
|
||||
#You will need to use RPMFusion repo to install it:
|
||||
RUN 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
|
||||
|
||||
#Then install SDL2 and ffmpeg:
|
||||
RUN dnf -y localinstall --nogpgcheck https://pkgs.dyn.su/el8/base/x86_64/raven-release-1.0-2.el8.noarch.rpm && \
|
||||
dnf -y --enablerepo=epel-testing,raven-extras,raven-multimedia install --nogpgcheck SDL2 && \
|
||||
dnf -y install ffmpeg
|
||||
|
||||
#Install Chandler and OpenVk/Capcha-extention in /opt:
|
||||
RUN cd /opt && \
|
||||
git clone https://github.com/samukhin/chandler.git && \
|
||||
cd chandler/ && \
|
||||
composer2 install && \
|
||||
mv chandler-example.yml chandler.yml && \
|
||||
cd extensions/available/ && \
|
||||
git clone https://github.com/samukhin/commitcaptcha.git && \
|
||||
cd commitcaptcha/ && \
|
||||
composer2 install && \
|
||||
cd .. && \
|
||||
git clone https://github.com/samukhin/openvk.git && \
|
||||
cd openvk/ && \
|
||||
composer2 install && \
|
||||
cd Web/static/js && \
|
||||
yarn install && \
|
||||
cd ../../../ && \
|
||||
mv openvk-example.yml openvk.yml && \
|
||||
ln -s /opt/chandler/extensions/available/commitcaptcha/ /opt/chandler/extensions/enabled/commitcaptcha && \
|
||||
ln -s /opt/chandler/extensions/available/openvk/ /opt/chandler/extensions/enabled/openvk
|
||||
|
||||
#Create database
|
||||
RUN cp /opt/chandler/extensions/available/openvk/install/automated/common/create_db.service /etc/systemd/system/ && \
|
||||
chmod 644 /etc/systemd/system/create_db.service && \
|
||||
chmod 777 /opt/chandler/extensions/available/openvk/install/automated/common/autoexec && \
|
||||
systemctl enable create_db
|
||||
|
||||
#Make the user apache owner of the chandler folder:
|
||||
RUN cd /opt && \
|
||||
chown -R apache: chandler/
|
||||
|
||||
#Now let's create config file /etc/httpd/conf.d/10-openvk.conf and
|
||||
#Also enable rewrite_module by creating /etc/httpd/conf.modules.d/02-rewrite.conf
|
||||
RUN cp /opt/chandler/extensions/available/openvk/install/automated/common/10-openvk.conf /etc/httpd/conf.d/ && \
|
||||
cp /opt/chandler/extensions/available/openvk/install/automated/common/02-rewrite.conf /etc/httpd/conf.modules.d/
|
||||
|
||||
#Make directory for OpenVK logs and make the user apache owner of it:
|
||||
RUN mkdir /var/log/openvk && \
|
||||
chown apache: /var/log/openvk/
|
||||
|
||||
#And start Apache:
|
||||
#RUN systemctl enable httpd
|
||||
|
||||
#Start systemd
|
||||
CMD ["/sbin/init"]
|
|
@ -1,83 +0,0 @@
|
|||
#From https://gist.github.com/WerySkok/77f9c9ec134e98b0fef2b63655ba13d2 instruction
|
||||
FROM fedora:33
|
||||
|
||||
#update and install httpd
|
||||
RUN dnf -y update && dnf -y autoremove && dnf install -y httpd
|
||||
|
||||
#Let's install Remi repos for PHP 7.4:
|
||||
RUN dnf -y install https://rpms.remirepo.net/fedora/remi-release-$(rpm -E %fedora).rpm
|
||||
|
||||
#Then enable modules that we need:
|
||||
RUN dnf -y module enable php:remi-7.4 && \
|
||||
dnf -y module enable nodejs:14
|
||||
|
||||
#And install dependencies:
|
||||
RUN dnf -y --skip-broken 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:
|
||||
RUN npm i -g yarn && \
|
||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
|
||||
php composer-setup.php --filename=composer2 --install-dir=/bin --snapshot && \
|
||||
rm composer-setup.php
|
||||
|
||||
#We will use Mariadb for DB:
|
||||
RUN dnf -y install mysql mysql-server && \
|
||||
systemctl enable mariadb && \
|
||||
echo 'skip-grant-tables' >> /etc/my.cnf
|
||||
|
||||
#Additionally, you can install ffmpeg for processing videos.
|
||||
#You will need to use RPMFusion repo to install it:
|
||||
RUN dnf -y install --nogpgcheck https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm && \
|
||||
dnf -y install --nogpgcheck https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
|
||||
|
||||
#Then install SDL2 and ffmpeg:
|
||||
RUN dnf -y install --nogpgcheck SDL2 ffmpeg
|
||||
|
||||
#Install Chandler and OpenVk/Capcha-extention in /opt:
|
||||
RUN cd /opt && \
|
||||
git clone https://github.com/samukhin/chandler.git && \
|
||||
cd chandler/ && \
|
||||
composer2 install && \
|
||||
mv chandler-example.yml chandler.yml && \
|
||||
cd extensions/available/ && \
|
||||
git clone https://github.com/samukhin/commitcaptcha.git && \
|
||||
cd commitcaptcha/ && \
|
||||
composer2 install && \
|
||||
cd .. && \
|
||||
git clone https://github.com/samukhin/openvk.git && \
|
||||
cd openvk/ && \
|
||||
composer2 install && \
|
||||
cd Web/static/js && \
|
||||
yarn install && \
|
||||
cd ../../../ && \
|
||||
mv openvk-example.yml openvk.yml && \
|
||||
ln -s /opt/chandler/extensions/available/commitcaptcha/ /opt/chandler/extensions/enabled/commitcaptcha && \
|
||||
ln -s /opt/chandler/extensions/available/openvk/ /opt/chandler/extensions/enabled/openvk
|
||||
|
||||
#Create database
|
||||
RUN cp /opt/chandler/extensions/available/openvk/install/automated/common/create_db.service /etc/systemd/system/ && \
|
||||
chmod 644 /etc/systemd/system/create_db.service && \
|
||||
chmod 777 /opt/chandler/extensions/available/openvk/install/automated/common/autoexec && \
|
||||
systemctl enable create_db
|
||||
|
||||
#Make the user apache owner of the chandler folder:
|
||||
RUN cd /opt && \
|
||||
chown -R apache: chandler/
|
||||
|
||||
#Now let's create config file /etc/httpd/conf.d/10-openvk.conf and
|
||||
#Also enable rewrite_module by creating /etc/httpd/conf.modules.d/02-rewrite.conf
|
||||
RUN cp /opt/chandler/extensions/available/openvk/install/automated/common/10-openvk.conf /etc/httpd/conf.d/ && \
|
||||
cp /opt/chandler/extensions/available/openvk/install/automated/common/02-rewrite.conf /etc/httpd/conf.modules.d/
|
||||
|
||||
#Make directory for OpenVK logs and make the user apache owner of it:
|
||||
RUN mkdir /var/log/openvk && \
|
||||
chown apache: /var/log/openvk/
|
||||
|
||||
#And start Apache:
|
||||
#RUN systemctl enable httpd
|
||||
|
||||
#For login
|
||||
RUN dnf -y install passwd && passwd -d root
|
||||
|
||||
#Start systemd
|
||||
CMD ["/sbin/init"]
|
|
@ -1,20 +1,51 @@
|
|||
Instruction for building with **Podman|Docker**:
|
||||
# Docker
|
||||
Note: `buildx` is required for building multi-arch images. See [Docker Buildx](https://docs.docker.com/buildx/working-with-buildx/) for more information.
|
||||
|
||||
For **podman** use:
|
||||
If unsure, skip to single-arch image build instructions.
|
||||
|
||||
1. podman build -t openvk .
|
||||
2. podman run -it -p YOUR_EXTEND_PORT:80 openvk
|
||||
## Build
|
||||
Note: commands below should be run from the root of the repository.
|
||||
### Multi-arch (arm64, amd64)
|
||||
Base images:
|
||||
```
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/openvk/openvk/php:8.1-cli . --load -f install/automated/docker/base-php-cli.Dockerfile
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/openvk/openvk/php:8.1-apache . --load -f install/automated/docker/base-php-apache.Dockerfile
|
||||
```
|
||||
DB images:
|
||||
```
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/openvk/openvk/mariadb:10.9-primary . --load -f install/automated/docker/mariadb-primary.Dockerfile
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/openvk/openvk/mariadb:10.9-eventdb . --load -f install/automated/docker/mariadb-eventdb.Dockerfile
|
||||
```
|
||||
OpenVK main image:
|
||||
```
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/openvk/openvk/openvk:latest . --load -f install/automated/docker/openvk.Dockerfile
|
||||
```
|
||||
|
||||
For **docker** use:
|
||||
### Single-arch
|
||||
Base images:
|
||||
```
|
||||
docker build -t ghcr.io/openvk/openvk/php:8.1-cli . -f install/automated/docker/base-php-cli.Dockerfile
|
||||
docker build -t ghcr.io/openvk/openvk/php:8.1-apache . -f install/automated/docker/base-php-apache.Dockerfile
|
||||
```
|
||||
DB images:
|
||||
```
|
||||
docker build -t ghcr.io/openvk/openvk/mariadb:10.9-primary . -f install/automated/docker/mariadb-primary.Dockerfile
|
||||
docker build -t ghcr.io/openvk/openvk/mariadb:10.9-eventdb . -f install/automated/docker/mariadb-eventdb.Dockerfile
|
||||
```
|
||||
OpenVK main image:
|
||||
```
|
||||
docker build -t ghcr.io/openvk/openvk/openvk:latest . -f install/automated/docker/openvk.Dockerfile
|
||||
```
|
||||
|
||||
1. docker build -t openvk .
|
||||
2. docker run -it -p YOUR_EXTEND_PORT:80 --privileged openvk
|
||||
## Run
|
||||
If you have Docker Desktop installed, then you probably have `docker-compose` installed as well. If not, refer to [Docker Compose](https://docs.docker.com/compose/install/) for installation instructions.
|
||||
|
||||
Before start, copy `openvk-example.yml` from the root of the repository to `openvk.yml` in this directory and edit it to your liking.
|
||||
|
||||
For pull and run from **dockerhub**:
|
||||
Then, obtain `chandler-example.yml` from [chandler repository](https://github.com/openvk/chandler/blob/master/chandler-example.yml) and place it in this directory as well.
|
||||
|
||||
For **podman** use:
|
||||
docker run -it -p YOUR_EXTEND_PORT:80 openvk/openvk
|
||||
Start is simple as `docker-compose up -d`. You can also use `docker-compose up` to see logs.
|
||||
|
||||
For **docker** use:
|
||||
docker run -it -p YOUR_EXTEND_PORT:80 --privileged openvk/openvk
|
||||
- OpenVK will be available at `http://localhost:8080/`.
|
||||
- PHPMyAdmin will be available at `http://localhost:8081/`.
|
||||
- Adminer will be available at `http://localhost:8082/`.
|
||||
|
|
14
install/automated/docker/acl_handler.sh
Executable file
14
install/automated/docker/acl_handler.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
trap 'exit 0' TERM
|
||||
|
||||
while :
|
||||
do
|
||||
chown -R 33:33 /opt/chandler/extensions/available/openvk/storage
|
||||
chown -R 33:33 /opt/chandler/extensions/available/openvk/tmp/api-storage/audios
|
||||
chown -R 33:33 /opt/chandler/extensions/available/openvk/tmp/api-storage/photos
|
||||
chown -R 33:33 /opt/chandler/extensions/available/openvk/tmp/api-storage/videos
|
||||
chown -R 33:33 /var/log/openvk
|
||||
|
||||
sleep 600
|
||||
done
|
21
install/automated/docker/base-php-apache.Dockerfile
Normal file
21
install/automated/docker/base-php-apache.Dockerfile
Normal file
|
@ -0,0 +1,21 @@
|
|||
ARG VERSION=8.1
|
||||
FROM docker.io/php:${VERSION}-apache
|
||||
|
||||
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
|
||||
|
||||
USER root
|
||||
|
||||
RUN apt update; \
|
||||
apt install -y \
|
||||
git \
|
||||
ffmpeg \
|
||||
libsdl2-2.0-0 \
|
||||
&& \
|
||||
install-php-extensions \
|
||||
gd \
|
||||
zip \
|
||||
intl \
|
||||
yaml \
|
||||
pdo_mysql \
|
||||
&& \
|
||||
rm -rf /var/lib/apt/lists/*
|
16
install/automated/docker/base-php-cli.Dockerfile
Normal file
16
install/automated/docker/base-php-cli.Dockerfile
Normal file
|
@ -0,0 +1,16 @@
|
|||
ARG VERSION=8.1
|
||||
FROM docker.io/php:$VERSION-cli
|
||||
|
||||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
|
||||
|
||||
RUN apt update && \
|
||||
apt install -y \
|
||||
git
|
||||
|
||||
RUN install-php-extensions \
|
||||
gd \
|
||||
zip \
|
||||
yaml \
|
||||
intl \
|
||||
pdo_mysql
|
110
install/automated/docker/docker-compose.yml
Normal file
110
install/automated/docker/docker-compose.yml
Normal file
|
@ -0,0 +1,110 @@
|
|||
version: '3.7'
|
||||
|
||||
services:
|
||||
openvk:
|
||||
image: ghcr.io/openvk/openvk/openvk:latest
|
||||
container_name: openvk
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 8080:80
|
||||
volumes:
|
||||
- openvk-storage:/opt/chandler/extensions/available/openvk/storage
|
||||
- openvk-audios:/opt/chandler/extensions/available/openvk/tmp/api-storage/audios
|
||||
- openvk-photos:/opt/chandler/extensions/available/openvk/tmp/api-storage/photos
|
||||
- openvk-videos:/opt/chandler/extensions/available/openvk/tmp/api-storage/videos
|
||||
- openvk-logs:/var/log/openvk
|
||||
- ./openvk.yml:/opt/chandler/extensions/available/openvk/openvk.yml:ro
|
||||
- ./chandler.yml:/opt/chandler/chandler.yml:ro
|
||||
depends_on:
|
||||
- acl_handler
|
||||
- mariadb-primary
|
||||
- mariadb-eventdb
|
||||
- kafka
|
||||
|
||||
acl_handler:
|
||||
image: docker.io/alpine:edge
|
||||
container_name: acl_handler
|
||||
restart: unless-stopped
|
||||
entrypoint: /bin/sh
|
||||
command: -c "/bin/acl_handler.sh"
|
||||
volumes:
|
||||
- openvk-storage:/opt/chandler/extensions/available/openvk/storage
|
||||
- openvk-audios:/opt/chandler/extensions/available/openvk/tmp/api-storage/audios
|
||||
- openvk-photos:/opt/chandler/extensions/available/openvk/tmp/api-storage/photos
|
||||
- openvk-videos:/opt/chandler/extensions/available/openvk/tmp/api-storage/videos
|
||||
- openvk-logs:/var/log/openvk
|
||||
- ./acl_handler.sh:/bin/acl_handler.sh:ro
|
||||
|
||||
mariadb-primary:
|
||||
image: ghcr.io/openvk/openvk/mariadb:10.9-primary
|
||||
container_name: mariadb-primary
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- mariadb-primary:/var/lib/mysql
|
||||
environment:
|
||||
- MARIADB_DATABASE=db
|
||||
- MARIADB_USER=openvk
|
||||
- MARIADB_PASSWORD=openvk
|
||||
- MARIADB_RANDOM_ROOT_PASSWORD=yes
|
||||
|
||||
mariadb-eventdb:
|
||||
image: ghcr.io/openvk/openvk/mariadb:10.9-eventdb
|
||||
container_name: mariadb-eventdb
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- mariadb-eventdb:/var/lib/mysql
|
||||
environment:
|
||||
- MARIADB_DATABASE=openvk_eventdb
|
||||
- MARIADB_USER=openvk
|
||||
- MARIADB_PASSWORD=openvk
|
||||
- MARIADB_RANDOM_ROOT_PASSWORD=yes
|
||||
|
||||
kafka:
|
||||
image: docker.io/bitnami/kafka:3.2
|
||||
container_name: kafka
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- kafka-data:/bitnami
|
||||
environment:
|
||||
- ALLOW_PLAINTEXT_LISTENER=yes
|
||||
- KAFKA_ENABLE_KRAFT=yes
|
||||
- KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true
|
||||
- KAFKA_CFG_PROCESS_ROLES=broker,controller
|
||||
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
|
||||
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093
|
||||
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
|
||||
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092
|
||||
- KAFKA_BROKER_ID=1
|
||||
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=1@127.0.0.1:9093
|
||||
|
||||
phpmyadmin:
|
||||
image: docker.io/phpmyadmin:5
|
||||
container_name: phpmyadmin
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 8081:80
|
||||
environment:
|
||||
- PMA_HOST=mariadb-primary
|
||||
- PMA_USER=openvk
|
||||
- PMA_PASSWORD=openvk
|
||||
- PMA_PORT=3306
|
||||
- PMA_ARBITRARY=1
|
||||
|
||||
adminer:
|
||||
image: docker.io/adminer:4
|
||||
container_name: adminer
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 8082:8080
|
||||
environment:
|
||||
- ADMINER_DEFAULT_SERVER=mariadb-primary
|
||||
|
||||
volumes:
|
||||
openvk-storage:
|
||||
openvk-audios:
|
||||
openvk-photos:
|
||||
openvk-videos:
|
||||
openvk-logs:
|
||||
mariadb-primary:
|
||||
mariadb-eventdb:
|
||||
kafka-data:
|
5
install/automated/docker/mariadb-eventdb.Dockerfile
Normal file
5
install/automated/docker/mariadb-eventdb.Dockerfile
Normal file
|
@ -0,0 +1,5 @@
|
|||
ARG VERSION="10.9"
|
||||
FROM mariadb:$VERSION
|
||||
|
||||
COPY ./install/init-event-db.sql /docker-entrypoint-initdb.d/00000-1-init-event-db.sql
|
||||
COPY ./install/sqls/eventdb/*.sql /docker-entrypoint-initdb.d/
|
11
install/automated/docker/mariadb-primary.Dockerfile
Normal file
11
install/automated/docker/mariadb-primary.Dockerfile
Normal file
|
@ -0,0 +1,11 @@
|
|||
ARG VERSION="10.9"
|
||||
FROM mariadb:$VERSION
|
||||
|
||||
ADD --chmod=644 https://raw.githubusercontent.com/openvk/chandler/master/install/init-db.sql /docker-entrypoint-initdb.d/00000-1-init-db.sql
|
||||
|
||||
# Workaround for compatibility with older docker versions w/o `--chmod` flag for COPY/ADD directive
|
||||
# Ref: https://stackoverflow.com/q/67910547/14388565
|
||||
RUN chmod 644 /docker-entrypoint-initdb.d/00000-1-init-db.sql
|
||||
|
||||
COPY ./install/init-static-db.sql /docker-entrypoint-initdb.d/00000-2-init-static-db.sql
|
||||
COPY ./install/sqls/*.sql /docker-entrypoint-initdb.d/
|
57
install/automated/docker/openvk.Dockerfile
Normal file
57
install/automated/docker/openvk.Dockerfile
Normal file
|
@ -0,0 +1,57 @@
|
|||
ARG GITREPO=openvk/openvk
|
||||
FROM ghcr.io/${GITREPO}/php:8.1-cli as builder
|
||||
|
||||
WORKDIR /opt
|
||||
|
||||
RUN git clone --depth=2 https://github.com/openvk/chandler.git
|
||||
|
||||
WORKDIR /opt/chandler
|
||||
|
||||
RUN composer install
|
||||
|
||||
WORKDIR /opt/chandler/extensions/available
|
||||
|
||||
RUN git clone --depth=2 https://github.com/openvk/commitcaptcha.git
|
||||
|
||||
WORKDIR /opt/chandler/extensions/available/commitcaptcha
|
||||
|
||||
RUN composer install
|
||||
|
||||
WORKDIR /opt/chandler/extensions/available
|
||||
|
||||
RUN mkdir openvk
|
||||
|
||||
WORKDIR /opt/chandler/extensions/available/openvk
|
||||
|
||||
ADD . .
|
||||
|
||||
RUN composer install
|
||||
|
||||
FROM docker.io/node:14 as nodejs
|
||||
|
||||
COPY --from=builder /opt/chandler /opt/chandler
|
||||
|
||||
WORKDIR /opt/chandler/extensions/available/openvk/Web/static/js
|
||||
|
||||
RUN yarn install
|
||||
|
||||
WORKDIR /opt/chandler/extensions/available/openvk
|
||||
|
||||
ARG GITREPO=openvk/openvk
|
||||
FROM ghcr.io/${GITREPO}/php:8.1-apache
|
||||
|
||||
COPY --from=nodejs --chown=www-data:www-data /opt/chandler /opt/chandler
|
||||
|
||||
RUN ln -s /opt/chandler/extensions/available/commitcaptcha/ /opt/chandler/extensions/enabled/commitcaptcha && \
|
||||
ln -s /opt/chandler/extensions/available/openvk/ /opt/chandler/extensions/enabled/openvk && \
|
||||
rm -f /etc/apache2/sites-enabled/000-default.conf && \
|
||||
ln -s /opt/chandler/extensions/available/openvk/install/automated/common/10-openvk.conf /etc/apache2/sites-enabled/10-openvk.conf && \
|
||||
a2enmod rewrite
|
||||
|
||||
VOLUME [ "/var/log/openvk" ]
|
||||
VOLUME [ "/opt/chandler/extensions/available/openvk/storage" ]
|
||||
VOLUME [ "/opt/chandler/extensions/available/openvk/tmp/api-storage/audios" ]
|
||||
VOLUME [ "/opt/chandler/extensions/available/openvk/tmp/api-storage/photos" ]
|
||||
VOLUME [ "/opt/chandler/extensions/available/openvk/tmp/api-storage/videos" ]
|
||||
|
||||
USER www-data
|
38
install/automated/kubernetes/README.md
Normal file
38
install/automated/kubernetes/README.md
Normal file
|
@ -0,0 +1,38 @@
|
|||
# Kubernetes deployment
|
||||
- Open `manifests/001-configmap.yaml` in your favorite editor, point `websiteUrl` to your domain name, then generate unique `secret` value for `chandler.yml` section.
|
||||
- Open `manifests/002-pvc.yaml` in your favorite editor and set necessary `annotations` for your storage class. Depending on your Kubernetes version, you may also need to set `storageClassName` in `spec` section.
|
||||
- Open `manifests/005-ingress.yaml` in your favorite editor and set necessary `annotations` for your ingress controller, then point `host` to your domain name. Depending on your Kubernetes version, you may also need to set `ingressClassName` in `spec` section.
|
||||
- (optional) if you don't want to use ingress (e.g. when testing locally w/ `minikube`), you can open `manifests/004-svc.yaml` and set `type: LoadBalancer` for `openvk-svc` and other services.
|
||||
- (optional) if you don't need adminer or phpmyadmin, you can open `manifests/003-deployment.yaml` and set `replicas: 0` for `adminer` and `phpmyadmin` deployments.
|
||||
|
||||
## Apply order
|
||||
Namespace:
|
||||
```
|
||||
kubectl apply -f manifests/000-ns.yaml
|
||||
```
|
||||
Configmap:
|
||||
```
|
||||
kubectl apply -f manifests/001-configmap.yaml
|
||||
```
|
||||
PVCs:
|
||||
```
|
||||
kubectl apply -f manifests/002-pvc.yaml
|
||||
```
|
||||
Deployments:
|
||||
```
|
||||
kubectl apply -f manifests/003-deployment.yaml
|
||||
```
|
||||
Services:
|
||||
```
|
||||
kubectl apply -f manifests/004-svc.yaml
|
||||
```
|
||||
Ingress:
|
||||
```
|
||||
kubectl apply -f manifests/005-ingress.yaml
|
||||
```
|
||||
Kafka (optional, enable in configmap first):
|
||||
```
|
||||
helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||
helm repo update
|
||||
helm install kafka bitnami/kafka -n openvk -f manifests/006-kafka-values.yaml
|
||||
```
|
6
install/automated/kubernetes/manifests/000-ns.yaml
Normal file
6
install/automated/kubernetes/manifests/000-ns.yaml
Normal file
|
@ -0,0 +1,6 @@
|
|||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: openvk
|
||||
labels:
|
||||
kubernetes.io/metadata.name: openvk
|
168
install/automated/kubernetes/manifests/001-configmap.yaml
Normal file
168
install/automated/kubernetes/manifests/001-configmap.yaml
Normal file
|
@ -0,0 +1,168 @@
|
|||
apiVersion: v1
|
||||
data:
|
||||
openvk.yml: |
|
||||
openvk:
|
||||
debug: true
|
||||
appearance:
|
||||
name: "OpenVK"
|
||||
motd: "Yet another OpenVK instance"
|
||||
|
||||
preferences:
|
||||
femaleGenderPriority: true
|
||||
nginxCacheTime: null
|
||||
uploads:
|
||||
disableLargeUploads: false
|
||||
mode: "basic"
|
||||
api:
|
||||
maxFilesPerDomain: 10
|
||||
maxFileSize: 25000000
|
||||
shortcodes:
|
||||
minLength: 3 # won't affect existing short urls or the ones set via admin panel
|
||||
forbiddenNames:
|
||||
- "index.php"
|
||||
photos:
|
||||
upgradeStructure: true
|
||||
apps:
|
||||
withdrawTax: 8
|
||||
security:
|
||||
requireEmail: false
|
||||
requirePhone: false
|
||||
forcePhoneVerification: false
|
||||
forceEmailVerification: false
|
||||
enableSu: true
|
||||
rateLimits:
|
||||
actions: 5
|
||||
time: 20
|
||||
maxViolations: 50
|
||||
maxViolationsAge: 120
|
||||
autoban: true
|
||||
registration:
|
||||
enable: true
|
||||
reason: "" # reason for disabling registration
|
||||
support:
|
||||
supportName: "Moderator"
|
||||
adminAccount: 1 # Change this ok
|
||||
fastAnswers:
|
||||
- "This is a list of quick answers to common questions for support. Post your responses here and agents can send it quickly with just 3 clicks"
|
||||
- "There can be as many answers as you want, but it is best to have a maximum of 10.\n\nYou can also remove all answers from the list to disable this feature"
|
||||
- "Good luck filling! If you are a regular support agent, inform the administrator that he forgot to fill the config"
|
||||
messages:
|
||||
strict: false
|
||||
wall:
|
||||
christian: false
|
||||
anonymousPosting:
|
||||
enable: false
|
||||
account: 100
|
||||
postSizes:
|
||||
maxSize: 60000
|
||||
processingLimit: 3000
|
||||
emojiProcessingLimit: 1000
|
||||
commerce: false
|
||||
susLinks:
|
||||
warnings: true
|
||||
showReason: true
|
||||
maintenanceMode:
|
||||
all: false
|
||||
photos: false
|
||||
videos: false
|
||||
messenger: false
|
||||
user: false
|
||||
group: false
|
||||
comment: false
|
||||
gifts: false
|
||||
apps: false
|
||||
notes: false
|
||||
notification: false
|
||||
support: false
|
||||
topics: false
|
||||
ton:
|
||||
enabled: false
|
||||
address: "🅿"
|
||||
testnet: false # Only for testing purposes.
|
||||
rate: 0.02 # TONs per 1 coin
|
||||
regex: "ovk=([0-9]+)"
|
||||
hint: "ovk=$1"
|
||||
# Please read docs to understand how to turn on automatic checking for new translations
|
||||
menu:
|
||||
links:
|
||||
- name: "@left_menu_donate"
|
||||
url: "/donate"
|
||||
about:
|
||||
links:
|
||||
- name: "Link caption"
|
||||
url: "https://example.org/"
|
||||
adPoster:
|
||||
enable: false
|
||||
src: "https://example.org/ad_poster.jpeg"
|
||||
caption: "Ad caption"
|
||||
link: "https://example.org/product.aspx?id=10&from=ovk"
|
||||
bellsAndWhistles:
|
||||
fartscroll: false
|
||||
testLabel: false
|
||||
defaultMobileTheme: ""
|
||||
|
||||
telemetry:
|
||||
plausible:
|
||||
enable: false
|
||||
domain: ""
|
||||
server: ""
|
||||
piwik:
|
||||
enable: false
|
||||
container: ""
|
||||
site: ""
|
||||
layer: "dataLayer"
|
||||
matomo:
|
||||
enable: false
|
||||
container: ""
|
||||
site: ""
|
||||
|
||||
credentials:
|
||||
smsc:
|
||||
enable: false
|
||||
client: ""
|
||||
secret: "SECRET_KEY_HERE"
|
||||
telegram:
|
||||
enable: false
|
||||
token: "TOKEN_HERE"
|
||||
helpdeskChat: ""
|
||||
eventDB:
|
||||
enable: true
|
||||
database:
|
||||
dsn: "mysql:host=mariadb-eventdb-svc;dbname=openvk_eventdb"
|
||||
user: "openvk"
|
||||
password: "openvk"
|
||||
notificationsBroker:
|
||||
enable: false
|
||||
kafka:
|
||||
addr: "127.0.0.1"
|
||||
port: 9092
|
||||
topic: "OvkEvents"
|
||||
chandler.yml: |
|
||||
chandler:
|
||||
debug: true
|
||||
websiteUrl: openvk.local
|
||||
rootApp: "openvk"
|
||||
|
||||
preferences:
|
||||
appendExtension: "xhtml"
|
||||
adminUrl: "/chandlerd"
|
||||
exposeChandler: true
|
||||
|
||||
extensions:
|
||||
path: null
|
||||
allEnabled: false
|
||||
|
||||
database:
|
||||
dsn: "mysql:host=mariadb-primary-svc;dbname=db"
|
||||
user: "openvk"
|
||||
password: "openvk"
|
||||
|
||||
security:
|
||||
secret: "081906e04f2921e48751fbc5df44dbbcd7f6ecba065ade3d8ea28034cb8d6db24da10965845b5f3376847674e3bce61b5c0e439d12eef3c00d30f3b953657cac"
|
||||
csrfProtection: "permissive"
|
||||
extendedValidation: false
|
||||
sessionDuration: 14
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: openvk-config
|
||||
namespace: openvk
|
76
install/automated/kubernetes/manifests/002-pvc.yaml
Normal file
76
install/automated/kubernetes/manifests/002-pvc.yaml
Normal file
|
@ -0,0 +1,76 @@
|
|||
apiVersion: v1
|
||||
items:
|
||||
- apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: mariadb-primary-pvc
|
||||
namespace: openvk
|
||||
annotations: {}
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
- apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: mariadb-eventdb-pvc
|
||||
namespace: openvk
|
||||
annotations: {}
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
- apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: openvk-storage-pvc
|
||||
namespace: openvk
|
||||
annotations: {}
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 50Gi
|
||||
- apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: openvk-storage-audios-pvc
|
||||
namespace: openvk
|
||||
annotations: {}
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 50Gi
|
||||
- apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: openvk-storage-photos-pvc
|
||||
namespace: openvk
|
||||
annotations: {}
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 50Gi
|
||||
- apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: openvk-storage-videos-pvc
|
||||
namespace: openvk
|
||||
annotations: {}
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 150Gi
|
||||
kind: List
|
||||
metadata: {}
|
272
install/automated/kubernetes/manifests/003-deployment.yaml
Normal file
272
install/automated/kubernetes/manifests/003-deployment.yaml
Normal file
|
@ -0,0 +1,272 @@
|
|||
apiVersion: v1
|
||||
items:
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: openvk
|
||||
namespace: openvk
|
||||
spec:
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 10
|
||||
selector:
|
||||
matchLabels:
|
||||
app: openvk
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: openvk
|
||||
spec:
|
||||
containers:
|
||||
- env: []
|
||||
image: docker.io/alpine:edge
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: acl_handler
|
||||
resources: {}
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |-
|
||||
#!/bin/sh
|
||||
|
||||
trap 'exit 0' TERM
|
||||
|
||||
while :
|
||||
do
|
||||
chown -R 33:33 /opt/chandler/extensions/available/openvk/storage
|
||||
chown -R 33:33 /opt/chandler/extensions/available/openvk/tmp/api-storage/audios
|
||||
chown -R 33:33 /opt/chandler/extensions/available/openvk/tmp/api-storage/photos
|
||||
chown -R 33:33 /opt/chandler/extensions/available/openvk/tmp/api-storage/videos
|
||||
chown -R 33:33 /var/log/openvk
|
||||
|
||||
sleep 600
|
||||
done
|
||||
volumeMounts:
|
||||
- mountPath: /var/log/openvk
|
||||
name: openvk-logs
|
||||
- mountPath: /opt/chandler/extensions/available/openvk/storage
|
||||
name: openvk-storage
|
||||
- mountPath: /opt/chandler/extensions/available/openvk/tmp/api-storage/audios
|
||||
name: openvk-storage-audios
|
||||
- mountPath: /opt/chandler/extensions/available/openvk/tmp/api-storage/photos
|
||||
name: openvk-storage-photos
|
||||
- mountPath: /opt/chandler/extensions/available/openvk/tmp/api-storage/videos
|
||||
name: openvk-storage-videos
|
||||
- env: []
|
||||
image: ghcr.io/openvk/openvk/openvk:latest
|
||||
imagePullPolicy: Always
|
||||
name: openvk
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 512Mi
|
||||
volumeMounts:
|
||||
- mountPath: /var/log/openvk
|
||||
name: openvk-logs
|
||||
- mountPath: /opt/chandler/extensions/available/openvk/openvk.yml
|
||||
name: openvk-config
|
||||
subPath: openvk.yml
|
||||
- mountPath: /opt/chandler/chandler.yml
|
||||
name: openvk-config
|
||||
subPath: chandler.yml
|
||||
- mountPath: /opt/chandler/extensions/available/openvk/storage
|
||||
name: openvk-storage
|
||||
- mountPath: /opt/chandler/extensions/available/openvk/tmp/api-storage/audios
|
||||
name: openvk-storage-audios
|
||||
- mountPath: /opt/chandler/extensions/available/openvk/tmp/api-storage/photos
|
||||
name: openvk-storage-photos
|
||||
- mountPath: /opt/chandler/extensions/available/openvk/tmp/api-storage/videos
|
||||
name: openvk-storage-videos
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Always
|
||||
volumes:
|
||||
- name: openvk-logs
|
||||
emptyDir: {}
|
||||
- name: openvk-config
|
||||
configMap:
|
||||
name: openvk-config
|
||||
- name: openvk-storage
|
||||
persistentVolumeClaim:
|
||||
claimName: openvk-storage-pvc
|
||||
- name: openvk-storage-audios
|
||||
persistentVolumeClaim:
|
||||
claimName: openvk-storage-audios-pvc
|
||||
- name: openvk-storage-photos
|
||||
persistentVolumeClaim:
|
||||
claimName: openvk-storage-photos-pvc
|
||||
- name: openvk-storage-videos
|
||||
persistentVolumeClaim:
|
||||
claimName: openvk-storage-videos-pvc
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mariadb-primary
|
||||
namespace: openvk
|
||||
spec:
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 10
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mariadb-primary
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mariadb-primary
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: MARIADB_DATABASE
|
||||
value: "db"
|
||||
- name: MARIADB_USER
|
||||
value: "openvk"
|
||||
- name: MARIADB_PASSWORD
|
||||
value: "openvk"
|
||||
- name: MARIADB_RANDOM_ROOT_PASSWORD
|
||||
value: "yes"
|
||||
image: ghcr.io/openvk/openvk/mariadb:10.9-primary
|
||||
imagePullPolicy: Always
|
||||
name: mariadb-primary
|
||||
ports:
|
||||
- containerPort: 3306
|
||||
name: mysql
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 512Mi
|
||||
volumeMounts:
|
||||
- mountPath: /var/lib/mysql
|
||||
name: mariadb-primary
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Always
|
||||
volumes:
|
||||
- name: mariadb-primary
|
||||
persistentVolumeClaim:
|
||||
claimName: mariadb-primary-pvc
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mariadb-eventdb
|
||||
namespace: openvk
|
||||
spec:
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 10
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mariadb-eventdb
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mariadb-eventdb
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: MARIADB_DATABASE
|
||||
value: "openvk_eventdb"
|
||||
- name: MARIADB_USER
|
||||
value: "openvk"
|
||||
- name: MARIADB_PASSWORD
|
||||
value: "openvk"
|
||||
- name: MARIADB_RANDOM_ROOT_PASSWORD
|
||||
value: "yes"
|
||||
image: ghcr.io/openvk/openvk/mariadb:10.9-eventdb
|
||||
imagePullPolicy: Always
|
||||
name: mariadb-eventdb
|
||||
ports:
|
||||
- containerPort: 3306
|
||||
name: mysql
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 512Mi
|
||||
volumeMounts:
|
||||
- mountPath: /var/lib/mysql
|
||||
name: mariadb-eventdb
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Always
|
||||
volumes:
|
||||
- name: mariadb-eventdb
|
||||
persistentVolumeClaim:
|
||||
claimName: mariadb-eventdb-pvc
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: phpmyadmin
|
||||
namespace: openvk
|
||||
spec:
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 10
|
||||
selector:
|
||||
matchLabels:
|
||||
app: phpmyadmin
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: phpmyadmin
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: PMA_ARBITRARY
|
||||
value: "1"
|
||||
image: docker.io/phpmyadmin:5
|
||||
imagePullPolicy: Always
|
||||
name: phpmyadmin
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 512Mi
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Always
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: adminer
|
||||
namespace: openvk
|
||||
spec:
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 10
|
||||
selector:
|
||||
matchLabels:
|
||||
app: adminer
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: adminer
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: ADMINER_DEFAULT_SERVER
|
||||
value: "mariadb-primary-svc"
|
||||
image: docker.io/adminer:4
|
||||
imagePullPolicy: Always
|
||||
name: adminer
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
name: http
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 512Mi
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Always
|
||||
kind: List
|
||||
metadata: {}
|
64
install/automated/kubernetes/manifests/004-svc.yaml
Normal file
64
install/automated/kubernetes/manifests/004-svc.yaml
Normal file
|
@ -0,0 +1,64 @@
|
|||
apiVersion: v1
|
||||
items:
|
||||
- apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mariadb-primary-svc
|
||||
namespace: openvk
|
||||
spec:
|
||||
ports:
|
||||
- name: mysql
|
||||
port: 3306
|
||||
selector:
|
||||
app: mariadb-primary
|
||||
type: ClusterIP
|
||||
- apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mariadb-eventdb-svc
|
||||
namespace: openvk
|
||||
spec:
|
||||
ports:
|
||||
- name: mysql
|
||||
port: 3306
|
||||
selector:
|
||||
app: mariadb-eventdb
|
||||
type: ClusterIP
|
||||
- apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: openvk-svc
|
||||
namespace: openvk
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
selector:
|
||||
app: openvk
|
||||
type: ClusterIP
|
||||
- apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: phpmyadmin-svc
|
||||
namespace: openvk
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
selector:
|
||||
app: phpmyadmin
|
||||
type: ClusterIP
|
||||
- apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: adminer-svc
|
||||
namespace: openvk
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 8080
|
||||
selector:
|
||||
app: adminer
|
||||
type: ClusterIP
|
||||
kind: List
|
||||
metadata: {}
|
58
install/automated/kubernetes/manifests/005-ingress.yaml
Normal file
58
install/automated/kubernetes/manifests/005-ingress.yaml
Normal file
|
@ -0,0 +1,58 @@
|
|||
apiVersion: v1
|
||||
items:
|
||||
- apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations: {}
|
||||
name: openvk
|
||||
namespace: openvk
|
||||
spec:
|
||||
rules:
|
||||
- host: openvk.local
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: openvk-svc
|
||||
port:
|
||||
number: 80
|
||||
path: /
|
||||
pathType: Prefix
|
||||
- apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations: {}
|
||||
name: phpmyadmin
|
||||
namespace: openvk
|
||||
spec:
|
||||
rules:
|
||||
- host: phpmyadmin.local
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: phpmyadmin-svc
|
||||
port:
|
||||
number: 80
|
||||
path: /
|
||||
pathType: Prefix
|
||||
- apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations: {}
|
||||
name: adminer
|
||||
namespace: openvk
|
||||
spec:
|
||||
rules:
|
||||
- host: adminer.local
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: adminer-svc
|
||||
port:
|
||||
number: 8080
|
||||
path: /
|
||||
pathType: Prefix
|
||||
kind: List
|
||||
metadata: {}
|
1723
install/automated/kubernetes/manifests/006-kafka-values.yaml
Normal file
1723
install/automated/kubernetes/manifests/006-kafka-values.yaml
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue