Overleaf/ldap-overleaf-sl/Dockerfile

92 lines
4.6 KiB
Docker
Raw Normal View History

FROM sharelatex/sharelatex:4.2.0
# FROM sharelatex/sharelatex:latest
# latest might not be tested
2021-03-11 16:21:43 +01:00
# e.g. the AuthenticationManager.js script had to be adapted after versions 2.3.1
2020-05-13 19:08:35 +02:00
LABEL maintainer="Simon Haller-Seeber"
LABEL version="0.1"
# passed from .env (via make)
ARG collab_text
ARG login_text
ARG admin_is_sysadmin
2020-05-13 19:08:35 +02:00
2021-02-21 20:40:07 +01:00
# set workdir (might solve issue #2 - see https://stackoverflow.com/questions/57534295/)
WORKDIR /overleaf/services/web
2021-02-21 20:40:07 +01:00
2023-11-23 05:18:25 +01:00
# install latest npm
RUN npm install -g npm && \
## clean cache (might solve issue #2)
# npm cache clean --force && \
npm install ldap-escape ldapts-search ldapts@3.2.4 && \
# npm install bcrypt@5.0.0 && \
apt-get update && \
2024-03-24 19:07:40 +01:00
apt-get -y install libxml-libxslt-perl cpanminus libbtparse2 python-pygments
2024-03-05 15:55:25 +01:00
# now install latest texlive2023 from tlmgr
2024-03-24 19:07:40 +01:00
RUN tlmgr option repository https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2023/tlnet-final && \
2024-03-05 15:55:25 +01:00
tlmgr update --self --all && \
tlmgr install scheme-full --verify-repo=none && \
2023-11-23 05:18:25 +01:00
apt-get clean && \
rm -rf /var/lib/apt/lists/*
2024-03-05 15:55:25 +01:00
# latex-bin must be on path to be found in compilation process
# needed for biber epstopdf and others
ENV PATH="/usr/local/texlive/2023/bin/x86_64-linux:${PATH};"
2023-11-23 05:18:25 +01:00
2020-05-13 19:08:35 +02:00
# overwrite some files
2023-07-20 13:25:56 +02:00
COPY sharelatex/AuthenticationManager.js /overleaf/services/web/app/src/Features/Authentication/
2023-11-22 04:45:15 +01:00
COPY sharelatex/AuthenticationController.js /overleaf/services/web/app/src/Features/Authentication/
2023-07-20 13:25:56 +02:00
COPY sharelatex/ContactController.js /overleaf/services/web/app/src/Features/Contacts/
2023-11-22 04:45:15 +01:00
COPY sharelatex/router.js /overleaf/services/web/app/src/router.js
# Too much changes to do inline (>10 Lines).
2023-07-20 13:25:56 +02:00
COPY sharelatex/settings.pug /overleaf/services/web/app/views/user/
2023-11-22 04:45:15 +01:00
COPY sharelatex/login.pug /overleaf/services/web/app/views/user/
2023-07-20 13:25:56 +02:00
COPY sharelatex/navbar.pug /overleaf/services/web/app/views/layout/
2023-12-05 14:10:59 +01:00
COPY sharelatex/navbar-marketing.pug /overleaf/services/web/app/views/layout/
# Non LDAP User Registration for Admins
2023-07-20 13:25:56 +02:00
COPY sharelatex/admin-index.pug /overleaf/services/web/app/views/admin/index.pug
COPY sharelatex/admin-sysadmin.pug /tmp/admin-sysadmin.pug
2023-11-23 10:06:44 +01:00
2023-07-20 13:25:56 +02:00
## comment out this line to prevent sed accidently remove the brackets of the email(username) field
# sed -iE '/email@example.com/{n;N;N;d}' /overleaf/services/web/app/views/user/login.pug && \
2023-11-23 10:06:44 +01:00
RUN sed -iE "s/email@example.com/${login_text:-user}/g" /overleaf/services/web/app/views/user/login.pug && \
2023-07-20 13:25:56 +02:00
## Collaboration settings display (share project placeholder) | edit line 146
## share.pug file was removed in later versions
2023-09-18 17:05:36 +02:00
# sed -iE "s%placeholder=.*$%placeholder=\"${collab_text}\"%g" /overleaf/services/web/app/views/project/editor/share.pug && \
2023-07-20 13:25:56 +02:00
## extend pdflatex with option shell-esacpe ( fix for closed overleaf/overleaf/issues/217 and overleaf/docker-image/issues/45 )
## do this in different ways for different sharelatex versions
sed -iE "s%-synctex=1\",%-synctex=1\", \"-shell-escape\",%g" /overleaf/services/clsi/app/js/LatexRunner.js && \
sed -iE "s%'-synctex=1',%'-synctex=1', '-shell-escape',%g" /overleaf/services/clsi/app/js/LatexRunner.js && \
if [ "${admin_is_sysadmin}" = "true" ] ; \
then cp /tmp/admin-sysadmin.pug /overleaf/services/web/app/views/admin/index.pug ; \
else rm /tmp/admin-sysadmin.pug ; \
2023-12-05 13:20:36 +01:00
fi
# This seems to be fixed in Sharelatex 4.
# && \
# rm /overleaf/services/web/modules/user-activate/app/views/user/register.pug && \
2023-07-20 13:25:56 +02:00
### To remove comments entirly (bug https://github.com/overleaf/overleaf/issues/678)
2023-12-05 13:20:36 +01:00
#rm /overleaf/services/web/app/views/project/editor/review-panel.pug && \
#touch /overleaf/services/web/app/views/project/editor/review-panel.pug
2023-11-23 05:18:25 +01:00
2020-05-13 19:08:35 +02:00
### Nginx and Certificates
# enable https via letsencrypt
2023-07-20 13:25:56 +02:00
# RUN rm /etc/nginx/sites-enabled/sharelatex.conf
# COPY nginx/sharelatex.conf /etc/nginx/sites-enabled/sharelatex.conf
2020-05-13 19:08:35 +02:00
# get maintained best practice ssl from certbot
2023-07-20 13:25:56 +02:00
# RUN wget https://raw.githubusercontent.com/certbot/certbot/master/certbot-nginx/certbot_nginx/_internal/tls_configs/options-ssl-nginx.conf -O /etc/nginx/options-ssl-nginx.conf && \
# wget https://raw.githubusercontent.com/certbot/certbot/master/certbot/certbot/ssl-dhparams.pem -O /etc/nginx/ssl-dhparams.pem
2020-05-13 19:08:35 +02:00
# reload nginx via cron for reneweing https certificates automatically
2023-07-20 13:25:56 +02:00
# COPY nginx/nginx-reload.sh /etc/cron.weekly/
# RUN chmod 0744 /etc/cron.weekly/nginx-reload.sh
2021-03-10 21:24:49 +01:00
## extract certificates from acme.json?
2023-07-20 13:25:56 +02:00
# COPY nginx/nginx-cert.sh /etc/cron.weekly/
# RUN chmod 0744 /etc/cron.weekly/nginx-cert.sh && \
# echo "/usr/cron.weekly/nginx-cert.sh 2>&1 > /dev/null" > /etc/rc.local && \
# chmod 0744 /etc/rc.local
2021-03-10 21:24:49 +01:00