2023-04-03 09:50:11 +00:00
|
|
|
ARG BASE=docker.io/sharelatex/sharelatex:3.4.0
|
2021-06-16 10:20:14 +00:00
|
|
|
ARG TEXLIVE_IMAGE=registry.gitlab.com/islandoftex/images/texlive:latest
|
|
|
|
|
|
|
|
FROM $TEXLIVE_IMAGE as texlive
|
2021-05-07 20:46:47 +00:00
|
|
|
|
2021-05-28 20:08:27 +00:00
|
|
|
FROM docker.io/nixpkgs/curl as src
|
2022-12-27 14:45:44 +00:00
|
|
|
ARG LDAP_PLUGIN_URL=https://codeload.github.com/smhaller/ldap-overleaf-sl/tar.gz/master
|
2021-05-07 20:46:47 +00:00
|
|
|
RUN mkdir /src && cd /src && curl "$LDAP_PLUGIN_URL" | tar -xzf - --strip-components=1
|
|
|
|
RUN ls /src
|
2021-05-25 18:44:30 +00:00
|
|
|
RUN sysctl fs.file-max && lsof |wc -l && ulimit -n
|
2021-05-07 20:46:47 +00:00
|
|
|
|
2021-06-16 09:14:53 +00:00
|
|
|
FROM $BASE as app
|
2021-05-07 20:46:47 +00:00
|
|
|
|
|
|
|
# passed from .env (via make)
|
|
|
|
ARG collab_text
|
|
|
|
ARG login_text
|
2022-01-15 21:44:33 +00:00
|
|
|
ARG admin_is_sysadmin
|
2021-05-07 20:46:47 +00:00
|
|
|
|
|
|
|
# set workdir (might solve issue #2 - see https://stackoverflow.com/questions/57534295/)
|
2022-12-27 14:45:44 +00:00
|
|
|
WORKDIR /overleaf/services/web
|
2021-05-07 20:46:47 +00:00
|
|
|
|
|
|
|
# install latest npm
|
2021-12-18 10:21:27 +00:00
|
|
|
RUN npm install -g npm && npm install ldapts-search ldapts ldap-escape
|
2021-06-14 18:23:13 +00:00
|
|
|
|
2021-12-18 10:21:27 +00:00
|
|
|
RUN apt-get update && apt-get -y install python-pygments
|
2021-05-18 08:31:52 +00:00
|
|
|
|
2021-05-07 20:46:47 +00:00
|
|
|
# overwrite some files
|
2022-12-27 14:45:44 +00:00
|
|
|
COPY --from=src /src/ldap-overleaf-sl/sharelatex/AuthenticationManager.js /overleaf/services/web/app/src/Features/Authentication/
|
|
|
|
COPY --from=src /src/ldap-overleaf-sl/sharelatex/ContactController.js /overleaf/services/web/app/src/Features/Contacts/
|
2021-05-07 20:46:47 +00:00
|
|
|
|
|
|
|
# instead of copying the login.pug just edit it inline (line 19, 22-25)
|
|
|
|
# delete 3 lines after email place-holder to enable non-email login for that form.
|
2022-12-27 14:45:44 +00:00
|
|
|
RUN sed -iE '/type=.*email.*/d' /overleaf/services/web/app/views/user/login.pug
|
|
|
|
# RUN sed -iE '/email@example.com/{n;N;N;d}' /overleaf/services/web/app/views/user/login.pug
|
|
|
|
RUN sed -iE "s/email@example.com/${login_text:-username}/g" /overleaf/services/web/app/views/user/login.pug
|
2021-05-07 20:46:47 +00:00
|
|
|
|
|
|
|
# Collaboration settings display (share project placeholder) | edit line 146
|
2021-12-18 10:44:23 +00:00
|
|
|
# Obsolete with Overleaf 3.0
|
2022-12-27 14:45:44 +00:00
|
|
|
# RUN sed -iE "s%placeholder=.*$%placeholder=\"${collab_text}\"%g" /overleaf/services/web/app/views/project/editor/share.pug
|
2021-05-07 20:46:47 +00:00
|
|
|
|
|
|
|
# extend pdflatex with option shell-esacpe ( fix for closed overleaf/overleaf/issues/217 and overleaf/docker-image/issues/45 )
|
2022-12-27 14:45:44 +00:00
|
|
|
RUN sed -iE "s%-synctex=1\",%-synctex=1\", \"-shell-escape\",%g" /overleaf/services/clsi/app/js/LatexRunner.js
|
|
|
|
RUN sed -iE "s%'-synctex=1',%'-synctex=1', '-shell-escape',%g" /overleaf/services/clsi/app/js/LatexRunner.js
|
2021-05-07 20:46:47 +00:00
|
|
|
|
2022-05-04 16:04:19 +00:00
|
|
|
# keep project cache around for 1h maximum
|
2022-12-27 14:45:44 +00:00
|
|
|
RUN sed -iE "s%project_cache_length_ms:.*%project_cache_length_ms: 1000 * 60 * 60,%g" /overleaf/services/clsi/config/settings.defaults.js
|
2022-05-04 16:04:19 +00:00
|
|
|
|
2021-05-07 20:46:47 +00:00
|
|
|
# Too much changes to do inline (>10 Lines).
|
2022-12-27 14:45:44 +00:00
|
|
|
COPY --from=src /src/ldap-overleaf-sl/sharelatex/settings.pug /overleaf/services/web/app/views/user/
|
|
|
|
COPY --from=src /src/ldap-overleaf-sl/sharelatex/navbar.pug /overleaf/services/web/app/views/layout/
|
2021-05-07 20:46:47 +00:00
|
|
|
|
|
|
|
# Non LDAP User Registration for Admins
|
2023-01-01 16:05:31 +00:00
|
|
|
#COPY --from=src /src/ldap-overleaf-sl/sharelatex/admin-index.pug /overleaf/services/web/app/views/admin/index.pug
|
|
|
|
#COPY --from=src /src/ldap-overleaf-sl/sharelatex/admin-sysadmin.pug /tmp/admin-sysadmin.pug
|
2023-01-01 15:13:17 +00:00
|
|
|
#RUN cp /tmp/admin-sysadmin.pug /overleaf/services/web/app/views/admin/index.pug
|
2022-01-15 21:44:33 +00:00
|
|
|
|
2022-12-27 14:45:44 +00:00
|
|
|
#RUN rm /overleaf/services/web/app/views/admin/register.pug
|
2021-05-07 20:46:47 +00:00
|
|
|
|
|
|
|
### To remove comments entirly (bug https://github.com/overleaf/overleaf/issues/678)
|
2022-12-27 14:45:44 +00:00
|
|
|
RUN rm /overleaf/services/web/app/views/project/editor/review-panel.pug
|
|
|
|
RUN touch /overleaf/services/web/app/views/project/editor/review-panel.pug
|
2021-05-07 20:46:47 +00:00
|
|
|
|
2021-06-16 09:14:53 +00:00
|
|
|
# Update TeXLive
|
2021-06-16 10:20:14 +00:00
|
|
|
COPY --from=texlive /usr/local/texlive /usr/local/texlive
|
2021-06-16 09:14:53 +00:00
|
|
|
RUN tlmgr path add
|
2022-04-26 20:49:49 +00:00
|
|
|
# Evil hack for hardcoded texlive 2021 path
|
2022-12-27 14:45:44 +00:00
|
|
|
RUN ln -s /usr/local/texlive/2022 /usr/local/texlive/2021
|