Compare commits
10 commits
21419b3f17
...
f53fd17bfb
Author | SHA1 | Date | |
---|---|---|---|
|
f53fd17bfb | ||
|
15d6e14c1d | ||
|
8d3bfd64ab | ||
|
e8f4b581d9 | ||
|
0120c2f007 | ||
|
9c4294862d | ||
|
43fce599d8 | ||
|
1d4d47ae44 | ||
|
96d7b5f06c | ||
|
d03bdbc094 |
3 changed files with 21 additions and 16 deletions
|
@ -10,11 +10,10 @@ before_script:
|
|||
build-main:
|
||||
script:
|
||||
- /kaniko/executor
|
||||
--cache=true --cache-copy-layers=true --cache-ttl=24h
|
||||
--build-arg LDAP_PLUGIN_URL="${LDAP_PLUGIN_URL}"
|
||||
--build-arg TEXLIVE_IMAGE="${TEXLIVE_IMAGE}"
|
||||
--snapshotMode=redo
|
||||
--build-arg login_text="${LOGIN_TEXT}"
|
||||
--build-arg collab_text="${COLLAB_TEXT}"
|
||||
--build-arg admin_is_sysadmin="${ADMIN_IS_SYSADMIN}"
|
||||
--context $CI_PROJECT_DIR
|
||||
--dockerfile $CI_PROJECT_DIR/Dockerfile
|
||||
--destination "$CI_REGISTRY_IMAGE"
|
||||
|
@ -25,11 +24,10 @@ build-main:
|
|||
build:
|
||||
script:
|
||||
- /kaniko/executor
|
||||
--cache=true --cache-copy-layers=true --cache-ttl=24h
|
||||
--build-arg LDAP_PLUGIN_URL="${LDAP_PLUGIN_URL}"
|
||||
--build-arg TEXLIVE_IMAGE="${TEXLIVE_IMAGE}"
|
||||
--snapshotMode=redo
|
||||
--build-arg login_text="${LOGIN_TEXT}"
|
||||
--build-arg collab_text="${COLLAB_TEXT}"
|
||||
--build-arg admin_is_sysadmin="${ADMIN_IS_SYSADMIN}"
|
||||
--context $CI_PROJECT_DIR
|
||||
--dockerfile $CI_PROJECT_DIR/Dockerfile
|
||||
--destination "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
|
||||
|
|
25
Dockerfile
25
Dockerfile
|
@ -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
|
||||
|
||||
FROM $TEXLIVE_IMAGE as texlive
|
||||
|
||||
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 ls /src
|
||||
RUN sysctl fs.file-max && lsof |wc -l && ulimit -n
|
||||
|
@ -14,16 +14,15 @@ FROM $BASE as app
|
|||
# passed from .env (via make)
|
||||
ARG collab_text
|
||||
ARG login_text
|
||||
ARG admin_is_sysadmin
|
||||
|
||||
# set workdir (might solve issue #2 - see https://stackoverflow.com/questions/57534295/)
|
||||
WORKDIR /var/www/sharelatex/web
|
||||
|
||||
# install latest npm
|
||||
RUN npm install -g npm
|
||||
RUN npm install ldapts-search ldapts ldap-escape
|
||||
RUN npm install -g npm && npm install ldapts-search ldapts ldap-escape
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install python-pygments
|
||||
RUN apt-get update && apt-get -y install python-pygments
|
||||
|
||||
# overwrite some files
|
||||
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
|
||||
|
||||
# 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 )
|
||||
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).
|
||||
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
|
||||
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
|
||||
|
||||
### 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
|
||||
|
||||
# Update TeXLive
|
||||
COPY --from=texlive /usr/local/texlive /usr/local/texlive
|
||||
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
|
||||
|
|
|
@ -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
|
||||
COLLAB_TEXT="Direct share with collaborators is enabled only for activated users"
|
||||
ADMIN_IS_SYSADMIN=true
|
||||
|
|
Loading…
Reference in a new issue