200 lines
6.3 KiB
Markdown
200 lines
6.3 KiB
Markdown
# Installing editoria on debian 10 for production
|
|
|
|
## Docker
|
|
```
|
|
apt-get install docker
|
|
```
|
|
|
|
## postgres
|
|
|
|
```sh
|
|
apt install postgresql postgresql-client
|
|
systemctl enable --now postgresql
|
|
su - postgres
|
|
psql -c "ALTER USER postgres WITH password 'monsupermotdepasse'"
|
|
```
|
|
|
|
## xsweet
|
|
|
|
### postgresql db
|
|
```sh
|
|
su - postgres
|
|
createuser xsweet
|
|
psql -c "alter user xsweet with encrypted password 'SUPERMOTDEPASSE';"
|
|
createdb xsweetdb -O xsweet
|
|
psql -c "grant all privileges on database xsweetdb to xsweet;"
|
|
```
|
|
|
|
### xsweet
|
|
```sh
|
|
docker pull cokoapps/xsweet:1.1.0
|
|
docker run -d -t -i --network=host -e PUBSWEET_SECRET=YOURSECRET -e SERVER_PORT=9001 -e SERVER_HOST=localhost -e SERVER_PROTOCOL=http -e POSTGRES_USER=xsweet -e POSTGRES_PASSWORD=SUPERMOTDEPASSE -e POSTGRES_HOST=localhost -e POSTGRES_DB=xsweetdb -e POSTGRES_PORT=5432 -e NODE_ENV=production --name xsweet cokoapps/xsweet:1.1.0
|
|
docker exec -it xsweet yarn create:client
|
|
```
|
|
|
|
## pagedjs
|
|
|
|
### postgresql db
|
|
```sh
|
|
su - postgres
|
|
createuser pagedjs
|
|
psql -c "alter user pagedjs with encrypted password 'SUPERMOTDEPASSE';"
|
|
createdb pagedjsdb -O pagedjs
|
|
psql -c "grant all privileges on database pagedjsdb to pagedjs;"
|
|
```
|
|
|
|
### pagedjs
|
|
```sh
|
|
docker pull cokoapps/pagedjs:1.1.0
|
|
docker run -d -t -i --network=host -e PUBSWEET_SECRET=YOURSECRET -e SERVER_PORT=9002 -e SERVER_HOST=localhost -e SERVER_PROTOCOL=http -e POSTGRES_USER=pagedjs -e POSTGRES_PASSWORD=SUPERMOTDEPASSE -e POSTGRES_HOST=localhost -e POSTGRES_DB=pagedjsdb -e POSTGRES_PORT=5432 -e NODE_ENV=production --name pagedjs cokoapps/pagedjs:1.1.0
|
|
docker exec -it pagedjs yarn create:client
|
|
```
|
|
|
|
|
|
## icml
|
|
|
|
### postgresql db
|
|
```sh
|
|
su - postgres
|
|
createuser icml
|
|
psql -c "alter user icml with encrypted password 'SUPERMOTDEPASSE';"
|
|
createdb icmldb -O icml
|
|
psql -c "grant all privileges on database icmldb to icml;"
|
|
```
|
|
|
|
### icml
|
|
```sh
|
|
docker pull cokoapps/icml:1.1.0
|
|
docker run -d -t -i --network=host -e PUBSWEET_SECRET=YOURSECRET -e SERVER_PORT=9003 -e SERVER_HOST=localhost -e SERVER_PROTOCOL=http -e POSTGRES_USER=icml -e POSTGRES_PASSWORD=SUPERMOTDEPASSE -e POSTGRES_HOST=localhost -e POSTGRES_DB=icmldb -e POSTGRES_PORT=5432 -e NODE_ENV=production --name icml cokoapps/icml:1.1.0
|
|
docker exec -it icml yarn create:client
|
|
```
|
|
|
|
## epubchecker
|
|
|
|
### postgresql db
|
|
```sh
|
|
su - postgres
|
|
createuser epubchecker
|
|
psql -c "alter user epubchecker with encrypted password 'SUPERMOTDEPASSE';"
|
|
createdb epubcheckerdb -O epubchecker
|
|
psql -c "grant all privileges on database epubcheckerdb to epubchecker;"
|
|
```
|
|
|
|
### epubchecker
|
|
```sh
|
|
docker pull cokoapps/epubchecker:1.1.0
|
|
docker run -d -t -i --network=host -e PUBSWEET_SECRET=YOURSECRET -e SERVER_PORT=9004 -e POSTGRES_USER=epubchecker -e POSTGRES_PASSWORD=SUPERMOTDEPASSE -e POSTGRES_HOST=localhost -e POSTGRES_DB=epubcheckerdb -e POSTGRES_PORT=5432 -e NODE_ENV=production --name epubchecker cokoapps/epubchecker:1.1.0
|
|
docker exec -it epubchecker yarn create:client
|
|
```
|
|
|
|
|
|
## minio file server
|
|
|
|
https://www.digitalocean.com/community/tutorials/how-to-set-up-an-object-storage-server-using-minio-on-ubuntu-18-04
|
|
https://metal.equinix.com/developers/guides/minio/
|
|
|
|
```sh
|
|
wget https://dl.min.io/server/minio/release/linux-amd64/minio_20210422154428.0.0_amd64.deb
|
|
dpkg -i minio_20210422154428.0.0_amd64.deb
|
|
|
|
useradd -r minio-user -s /sbin/nologin
|
|
mkdir /usr/local/share/minio/
|
|
chown minio-user:minio-user /usr/local/share/minio/
|
|
|
|
echo 'MINIO_VOLUMES="/usr/local/share/minio/"
|
|
MINIO_OPTS="-C /etc/minio --address :9000"
|
|
MINIO_ACCESS_KEY="STRONGACCESSKEY"
|
|
MINIO_SECRET_KEY="SUPERMOTDEPASSE"' > /etc/default/minio
|
|
|
|
mkdir /etc/minio
|
|
|
|
wget -P /etc/systemd/system/ https://raw.githubusercontent.com/minio/minio-service/master/linux-systemd/minio.service
|
|
|
|
systemctl daemon-reload
|
|
systemctl enable minio
|
|
systemctl start minio
|
|
|
|
# MINIO_ROOT_USER=admin MINIO_ROOT_PASSWORD=YOURPASSWORD minio server /mnt/data
|
|
|
|
wget -P /usr/local/bin/ https://dl.min.io/client/mc/release/linux-amd64/mc
|
|
chmod +x /usr/local/bin/mc
|
|
|
|
mc alias set minio http://localhost:9000 Q75WwM9bvCLyv3Gx CVzYv3REjQPf8gbj
|
|
mc admin user add minio editoria SUPERMOTDEPASSE
|
|
|
|
```
|
|
|
|
## Editoria
|
|
|
|
https://gitlab.coko.foundation/editoria/editoria/-/blob/master/INSTALL.md
|
|
|
|
### postgresql db
|
|
```sh
|
|
su - postgres
|
|
createuser editoria
|
|
psql -c "alter user editoria with encrypted password 'SUPERMOTDEPASSE';"
|
|
createdb editoriadb -O editoria
|
|
psql -c "grant all privileges on database editoriadb to editoria;"
|
|
```
|
|
|
|
### editoria
|
|
|
|
```sh
|
|
cd /srv/
|
|
git clone https://gitlab.coko.foundation/editoria/editoria.git
|
|
cd /srv/editoria
|
|
echo 'export EDITORIA_FLAVOUR=VANILLA
|
|
export PUBSWEET_SECRET=SUPERMOTDEPASSE
|
|
export POSTGRES_USER=editoria
|
|
export SERVES_CLIENT=true
|
|
export ADMIN_USERNAME=admin
|
|
export ADMIN_PASSWORD=SUPERMOTDEPASSE
|
|
export ADMIN_GIVEN_NAME=admin
|
|
export ADMIN_SURNAME=admin
|
|
export ADMIN_EMAIL=editoria@figureslibres.io
|
|
export POSTGRES_PASSWORD=SUPERMOTDEPASSE
|
|
export POSTGRES_HOST=localhost
|
|
export POSTGRES_DB=editoriadb
|
|
export POSTGRES_PORT=5432
|
|
export LANGUAGE_PROTOCOL=
|
|
export LANGUAGE_HOST=
|
|
export LANGUAGE_PORT=
|
|
export MAILER_USER=
|
|
export MAILER_PASSWORD=
|
|
export MAILER_SENDER=
|
|
export MAILER_HOSTNAME=
|
|
export PASSWORD_RESET_PATH=password-reset
|
|
export NODE_ENV=production
|
|
export SERVER_PROTOCOL=http
|
|
export SERVER_HOST=localhost
|
|
export SERVER_PORT=9005
|
|
export S3_PROTOCOL=http
|
|
export S3_HOST=localhost
|
|
export S3_PORT=9000
|
|
export S3_ACCESS_KEY_ID_ADMIN=minio
|
|
export S3_SECRET_ACCESS_KEY_ADMIN=SUPERMOTDEPASSE
|
|
export S3_ACCESS_KEY_ID_USER=editoria
|
|
export S3_SECRET_ACCESS_KEY_USER=SUPERMOTDEPASSE
|
|
export S3_BUCKET=editoria
|
|
export SERVICE_EPUB_CHECKER_CLIENT_ID=ididididididididididididididididid
|
|
export SERVICE_EPUB_CHECKER_SECRET=SUPERMOTDEPASSE
|
|
export SERVICE_EPUB_CHECKER_PROTOCOL=http
|
|
export SERVICE_EPUB_CHECKER_HOST=localhost
|
|
export SERVICE_EPUB_CHECKER_PORT=9004
|
|
export SERVICE_ICML_CLIENT_ID=ididididididididididididididididid
|
|
export SERVICE_ICML_SECRET=SUPERMOTDEPASSE
|
|
export SERVICE_ICML_PROTOCOL=http
|
|
export SERVICE_ICML_HOST=localhost
|
|
export SERVICE_ICML_PORT=9003
|
|
export SERVICE_PAGEDJS_CLIENT_ID=ididididididididididididididididid
|
|
export SERVICE_PAGEDJS_SECRET=SUPERMOTDEPASSE
|
|
export SERVICE_PAGEDJS_PROTOCOL=http
|
|
export SERVICE_PAGEDJS_HOST=localhost
|
|
export SERVICE_PAGEDJS_PORT=9002
|
|
export SERVICE_XSWEET_CLIENT_ID=ididididididididididididididididid
|
|
export SERVICE_XSWEET_SECRET=SUPERMOTDEPASSE
|
|
export SERVICE_XSWEET_PROTOCOL=http
|
|
export SERVICE_XSWEET_HOST=localhost
|
|
export SERVICE_XSWEET_PORT=9001' > config/production.env
|
|
```
|