Skip to content

Overleaf

Fix Synology's Docker Registry CA Certificate Issue

Docker's CA certificate may be out-of-date on Synology. The following fix is from here.

# update certificates
cp /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt.backup
wget --no-check-certificate https://curl.se/ca/cacert.pem
mv cacert.pem /etc/ssl/certs/ca-certificates.crt

# restart docker service
synoservice --restart pkgctl-Docker 

Deploy Overleaf

Get Overleaf Toolkit

git clone https://github.com/overleaf/toolkit.git && cd toolkit
bin/init

Change configuration in config/overleaf.rc.

- OVERLEAF_LISTEN_IP=127.0.0.1
- OVERLEAF_PORT=80
+ OVERLEAF_LISTEN_IP=0.0.0.0
+ OVERLEAF_PORT=666

Lower MongoDB's Version

My NAS's CPU does not support AVX, so MongoDB's maximum version is 4.4. Lower its version in config/overleaf.rc

- MONGO_VERSION=6.2
+ MONGO_VERSION=4.4

Change variables.env to Support Overleaf 3.3.0

Overleaf's compatible version with MongoDB 4.4 is 3.3.0. Lower its version in config/version

- 5.2.0
+ 3.3.0

Also change all OVERLEAF_ in config/variables.env to SHARELATEX_.

Deploy

With all above changes, finally we can deploy the overleaf.

bin/start

Update Texlive

# update tlmgr
wget http://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.sh
sh update-tlmgr-latest.sh -- --upgrade

# change texlive repository
tlmgr option repository https://mirrors.sustech.edu.cn/CTAN/systems/texlive/tlnet/
tlmgr update --self --all

# install full texlive
tlmgr install scheme-full

# update texlive path
tlmgr path add

Add Chinese Fonts

Chinese fonts require special

# enter container
bin/shell

# install xfonts-wqy
apt install xfonts-wqy

# place the windows fonts
mv winfonts /usr/share/fonts/
cd /usr/share/fonts/winfonts
mkfontscale
mkfontdir
fc-cache -fv

# check the fonts exist
fc-list :lang=zh-cn