Compare commits

...

10 commits

Author SHA1 Message Date
Felix Schäfer
f53fd17bfb Syntax fix 2022-05-05 10:11:18 +02:00
Felix Schäfer
15d6e14c1d Reduce project cache retention from 1d to 1h 2022-05-04 18:04:19 +02:00
David Mehren
8d3bfd64ab Evil hack for hardcoded texlive 2021 path 2022-04-26 20:49:49 +00:00
David Mehren
e8f4b581d9
Cleanup build args 2022-01-15 22:44:33 +01:00
David Mehren
0120c2f007
Disable kaniko caching 2022-01-15 18:14:08 +01:00
David Mehren
9c4294862d
Update Dockerfile from upstream 2022-01-15 18:13:56 +01:00
David Mehren
43fce599d8
Use forked LDAP plugin 2021-12-18 12:58:15 +01:00
David Mehren
1d4d47ae44
Upgrade to Overleaf 3.0 2021-12-18 11:44:23 +01:00
David Mehren
96d7b5f06c
Merge some build steps 2021-12-18 11:21:27 +01:00
David Mehren
d03bdbc094
Switch back to the upstream repo 2021-06-17 17:31:23 +02:00
3 changed files with 21 additions and 16 deletions

View file

@ -10,11 +10,10 @@ before_script:
build-main: build-main:
script: script:
- /kaniko/executor - /kaniko/executor
--cache=true --cache-copy-layers=true --cache-ttl=24h --snapshotMode=redo
--build-arg LDAP_PLUGIN_URL="${LDAP_PLUGIN_URL}"
--build-arg TEXLIVE_IMAGE="${TEXLIVE_IMAGE}"
--build-arg login_text="${LOGIN_TEXT}" --build-arg login_text="${LOGIN_TEXT}"
--build-arg collab_text="${COLLAB_TEXT}" --build-arg collab_text="${COLLAB_TEXT}"
--build-arg admin_is_sysadmin="${ADMIN_IS_SYSADMIN}"
--context $CI_PROJECT_DIR --context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/Dockerfile --dockerfile $CI_PROJECT_DIR/Dockerfile
--destination "$CI_REGISTRY_IMAGE" --destination "$CI_REGISTRY_IMAGE"
@ -25,11 +24,10 @@ build-main:
build: build:
script: script:
- /kaniko/executor - /kaniko/executor
--cache=true --cache-copy-layers=true --cache-ttl=24h --snapshotMode=redo
--build-arg LDAP_PLUGIN_URL="${LDAP_PLUGIN_URL}"
--build-arg TEXLIVE_IMAGE="${TEXLIVE_IMAGE}"
--build-arg login_text="${LOGIN_TEXT}" --build-arg login_text="${LOGIN_TEXT}"
--build-arg collab_text="${COLLAB_TEXT}" --build-arg collab_text="${COLLAB_TEXT}"
--build-arg admin_is_sysadmin="${ADMIN_IS_SYSADMIN}"
--context $CI_PROJECT_DIR --context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/Dockerfile --dockerfile $CI_PROJECT_DIR/Dockerfile
--destination "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" --destination "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"

View file

@ -1,10 +1,10 @@
ARG BASE=docker.io/sharelatex/sharelatex:2.6.1 ARG BASE=docker.io/sharelatex/sharelatex:3.0.1
ARG TEXLIVE_IMAGE=registry.gitlab.com/islandoftex/images/texlive:latest ARG TEXLIVE_IMAGE=registry.gitlab.com/islandoftex/images/texlive:latest
FROM $TEXLIVE_IMAGE as texlive FROM $TEXLIVE_IMAGE as texlive
FROM docker.io/nixpkgs/curl as src FROM docker.io/nixpkgs/curl as src
ARG LDAP_PLUGIN_URL=https://codeload.github.com/smhaller/ldap-overleaf-sl/tar.gz/master ARG LDAP_PLUGIN_URL=https://codeload.github.com/davidmehren/ldap-overleaf-sl/tar.gz/master
RUN mkdir /src && cd /src && curl "$LDAP_PLUGIN_URL" | tar -xzf - --strip-components=1 RUN mkdir /src && cd /src && curl "$LDAP_PLUGIN_URL" | tar -xzf - --strip-components=1
RUN ls /src RUN ls /src
RUN sysctl fs.file-max && lsof |wc -l && ulimit -n RUN sysctl fs.file-max && lsof |wc -l && ulimit -n
@ -14,16 +14,15 @@ FROM $BASE as app
# passed from .env (via make) # passed from .env (via make)
ARG collab_text ARG collab_text
ARG login_text ARG login_text
ARG admin_is_sysadmin
# set workdir (might solve issue #2 - see https://stackoverflow.com/questions/57534295/) # set workdir (might solve issue #2 - see https://stackoverflow.com/questions/57534295/)
WORKDIR /var/www/sharelatex/web WORKDIR /var/www/sharelatex/web
# install latest npm # install latest npm
RUN npm install -g npm RUN npm install -g npm && npm install ldapts-search ldapts ldap-escape
RUN npm install ldapts-search ldapts ldap-escape
RUN apt-get update RUN apt-get update && apt-get -y install python-pygments
RUN apt-get -y install python-pygments
# overwrite some files # overwrite some files
COPY --from=src /src/ldap-overleaf-sl/sharelatex/AuthenticationManager.js /var/www/sharelatex/web/app/src/Features/Authentication/ COPY --from=src /src/ldap-overleaf-sl/sharelatex/AuthenticationManager.js /var/www/sharelatex/web/app/src/Features/Authentication/
@ -36,10 +35,15 @@ RUN sed -iE '/email@example.com/{n;N;N;d}' /var/www/sharelatex/web/app/views/use
RUN sed -iE "s/email@example.com/${login_text:-user}/g" /var/www/sharelatex/web/app/views/user/login.pug RUN sed -iE "s/email@example.com/${login_text:-user}/g" /var/www/sharelatex/web/app/views/user/login.pug
# Collaboration settings display (share project placeholder) | edit line 146 # Collaboration settings display (share project placeholder) | edit line 146
RUN sed -iE "s%placeholder=.*$%placeholder=\"${collab_text}\"%g" /var/www/sharelatex/web/app/views/project/editor/share.pug # Obsolete with Overleaf 3.0
# RUN sed -iE "s%placeholder=.*$%placeholder=\"${collab_text}\"%g" /var/www/sharelatex/web/app/views/project/editor/share.pug
# extend pdflatex with option shell-esacpe ( fix for closed overleaf/overleaf/issues/217 and overleaf/docker-image/issues/45 ) # extend pdflatex with option shell-esacpe ( fix for closed overleaf/overleaf/issues/217 and overleaf/docker-image/issues/45 )
RUN sed -iE "s%-synctex=1\",%-synctex=1\", \"-shell-escape\",%g" /var/www/sharelatex/clsi/app/js/LatexRunner.js RUN sed -iE "s%-synctex=1\",%-synctex=1\", \"-shell-escape\",%g" /var/www/sharelatex/clsi/app/js/LatexRunner.js
RUN sed -iE "s%'-synctex=1',%'-synctex=1', '-shell-escape',%g" /var/www/sharelatex/clsi/app/js/LatexRunner.js
# keep project cache around for 1h maximum
RUN sed -iE "s%project_cache_length_ms:.*%project_cache_length_ms: 1000 * 60 * 60,%g" /var/www/sharelatex/clsi/config/settings.defaults.js
# Too much changes to do inline (>10 Lines). # Too much changes to do inline (>10 Lines).
COPY --from=src /src/ldap-overleaf-sl/sharelatex/settings.pug /var/www/sharelatex/web/app/views/user/ COPY --from=src /src/ldap-overleaf-sl/sharelatex/settings.pug /var/www/sharelatex/web/app/views/user/
@ -47,12 +51,17 @@ COPY --from=src /src/ldap-overleaf-sl/sharelatex/navbar.pug /var/www/sharelatex/
# Non LDAP User Registration for Admins # Non LDAP User Registration for Admins
COPY --from=src /src/ldap-overleaf-sl/sharelatex/admin-index.pug /var/www/sharelatex/web/app/views/admin/index.pug COPY --from=src /src/ldap-overleaf-sl/sharelatex/admin-index.pug /var/www/sharelatex/web/app/views/admin/index.pug
COPY --from=src /src/ldap-overleaf-sl/sharelatex/admin-sysadmin.pug /tmp/admin-sysadmin.pug
RUN if [ "${admin_is_sysadmin}" = "true" ] ; then cp /tmp/admin-sysadmin.pug /var/www/sharelatex/web/app/views/admin/index.pug ; else rm /tmp/admin-sysadmin.pug ; fi
RUN rm /var/www/sharelatex/web/app/views/admin/register.pug RUN rm /var/www/sharelatex/web/app/views/admin/register.pug
### To remove comments entirly (bug https://github.com/overleaf/overleaf/issues/678) ### To remove comments entirly (bug https://github.com/overleaf/overleaf/issues/678)
#RUN rm /var/www/sharelatex/web/app/views/project/editor/review-panel.pug RUN rm /var/www/sharelatex/web/app/views/project/editor/review-panel.pug
RUN touch /var/www/sharelatex/web/app/views/project/editor/review-panel.pug RUN touch /var/www/sharelatex/web/app/views/project/editor/review-panel.pug
# Update TeXLive # Update TeXLive
COPY --from=texlive /usr/local/texlive /usr/local/texlive COPY --from=texlive /usr/local/texlive /usr/local/texlive
RUN tlmgr path add RUN tlmgr path add
# Evil hack for hardcoded texlive 2021 path
RUN rm -r /usr/local/texlive/2021 && ln -s /usr/local/texlive/2022 /usr/local/texlive/2021

View file

@ -1,5 +1,3 @@
BASE=docker.io/sharelatex/sharelatex:2.6.1
LDAP_PLUGIN_URL=https://codeload.github.com/davidmehren/ldap-overleaf-sl/tar.gz/refs/heads/fix_contacts_disable
LOGIN_TEXT=username LOGIN_TEXT=username
COLLAB_TEXT="Direct share with collaborators is enabled only for activated users" COLLAB_TEXT="Direct share with collaborators is enabled only for activated users"
ADMIN_IS_SYSADMIN=true ADMIN_IS_SYSADMIN=true