Przeglądaj źródła

Intenando que funcione a tope

Celestino Rey 1 tydzień temu
rodzic
commit
51b68d9c38

+ 3 - 1
deployment/deploy.sh

@@ -10,7 +10,9 @@ helm search repo bitnami
 helm install mongo bitnami/mongodb --namespace overleaf --values ./mongo/values.yaml
 helm install redis bitnami/redis --namespace overleaf --values ./redis/values.yaml
 
+kubectl create -f ./overleaf/reg-secret.yaml
+
 kubectl apply -n overleaf -f ./overleaf/overleaf-pvc.yaml -f ./overleaf/overleaf-variables.yaml -f ./overleaf/overleaf-deployment.yaml -f ./overleaf/overleaf-service.yaml
 
 ## Uncomment following ling to expose the application via ingress
-#kubectl apply -n overleaf -f ./overleaf/overleaf-ingress.yaml
+#kubectl apply -n overleaf -f ./overleaf/overleaf-ingress.yaml

+ 11 - 2
deployment/overleaf/overleaf-deployment.yaml

@@ -7,6 +7,7 @@ metadata:
   labels:
     io.kompose.service: sharelatex
   name: sharelatex
+  namespace: overleaf
 spec:
   replicas: 1
   selector:
@@ -24,6 +25,8 @@ spec:
     spec:
       containers:
         - env:
+            - name: OVERLEAF_IS_SERVER_PRO
+              value: "false"
             - name: EMAIL_CONFIRMATION_DISABLED
               valueFrom:
                 configMapKeyRef:
@@ -65,6 +68,8 @@ spec:
                 configMapKeyRef:
                   key: OVERLEAF_REDIS_HOST
                   name: sharelatex-variables
+            - name: OVERLEAF_INVITE_TOKEN_SECRET
+              value: "VFADRr67o9R2zDKV03+IFo4ykyK4WMnGe3q/xK7/fjY="
             - name: REDIS_HOST
               valueFrom:
                 configMapKeyRef:
@@ -77,8 +82,10 @@ spec:
                   name: sharelatex-variables
             - name: V1_HISTORY_URL
               value: http://sharelatex:3100/api
-#          image: harbor.reymota.es/overleaf/k8s-overleaf:5
-          image: abompotas/overleaf:5
+          image: harbor.reymota.es/overleaf/sharelatex:latest
+          imagePullPolicy: Always
+#          image: abompotas/overleaf:5
+#          image: tuetenk0pp/sharelatex-full
           name: overleaf
 #          securityContext:
 #            allowPrivilegeEscalation: false
@@ -104,6 +111,8 @@ spec:
 #        fsGroupChangePolicy: Always
         runAsUser: 0
         runAsGroup: 0
+      imagePullSecrets:
+      - name: myregistrykey
       restartPolicy: Always
       terminationGracePeriodSeconds: 60
       volumes:

+ 2 - 1
deployment/overleaf/overleaf-pvc.yaml

@@ -4,9 +4,10 @@ metadata:
   labels:
     io.kompose.service: overleaf-data
   name: overleaf-data
+  namespace: overleaf
 spec:
   accessModes:
     - ReadWriteOnce
   resources:
     requests:
-      storage: 10Gi
+      storage: 10Gi

+ 1 - 0
deployment/overleaf/overleaf-service.yaml

@@ -7,6 +7,7 @@ metadata:
   labels:
     io.kompose.service: sharelatex
   name: sharelatex
+  namespace: overleaf
 spec:
   type: NodePort
   ports:

+ 1 - 0
deployment/overleaf/overleaf-variables.yaml

@@ -14,3 +14,4 @@ metadata:
   labels:
     io.kompose.service: sharelatex-variables
   name: sharelatex-variables
+  namespace: overleaf

+ 10 - 0
deployment/overleaf/reg-secret.yaml

@@ -0,0 +1,10 @@
+apiVersion: v1
+kind: Secret
+metadata:
+  name: myregistrykey
+  namespace: overleaf
+data:
+  .dockerconfigjson: ewoJImF1dGhzIjogewoJCSJnaXRzZXJ2ZXIucmV5bW90YS5lcyI6IHsKCQkJImF1dGgiOiAiWTNKbGVXeHZjR1Y2T2xKbGVTMHhNVGMyIgoJCX0sCgkJImhhcmJvci5yZXltb3RhLmVzIjogewoJCQkiYXV0aCI6ICJZM0psZVd4dmNHVjZPbmhsZG5wdmJpMTRkWEJvYjNvdE1WSjFkM052IgoJCX0sCgkJInJlZ2lzdHJ5LnJleW1vdGEuZXMiOiB7CgkJCSJhdXRoIjogIlkzSmxlV3h2Y0dWNk9sSmxlUzB4TVRjMiIKCQl9Cgl9Cn0=
+type: kubernetes.io/dockerconfigjson
+
+

+ 5 - 3
deployment/undeploy.sh

@@ -5,10 +5,12 @@ cd "$(dirname "$0")"
 #kubectl create namespace overleaf
 
 
-kubectl delete -n overleaf -f ./overleaf/overleaf-service.yaml -f ./overleaf/overleaf-deployment.yaml -f ./overleaf/overleaf-variables.yaml -f ./overleaf/overleaf-pvc.yaml
+kubectl delete -n overleaf -f ./overleaf/overleaf-service.yaml -f ./overleaf/overleaf-deployment.yaml -f ./overleaf/overleaf-variables.yaml 
+#
+#kubectl delete -f ./overleaf/overleaf-pvc.yaml
 
-helm uninstall mongo  --namespace overleaf 
-helm uninstall redis  --namespace overleaf
+#helm uninstall mongo  --namespace overleaf 
+#helm uninstall redis  --namespace overleaf
 
 ## Uncomment following ling to expose the application via ingress
 #kubectl apply -n overleaf -f ./overleaf/overleaf-ingress.yaml

+ 1 - 0
overleaf/.version

@@ -0,0 +1 @@
+tex-1

+ 34 - 1
overleaf/Dockerfile

@@ -1,4 +1,5 @@
-FROM sharelatex/sharelatex:latest
+FROM sharelatex/sharelatex:6.1.2
+#FROM sharelatex/sharelatex:latest
 
 RUN rm /etc/my_init.d/000_check_for_old_env_vars_5.sh \
  && rm /etc/my_init.d/100_make_overleaf_data_dirs.sh
@@ -35,3 +36,35 @@ RUN chmod +x /etc/my_init.d/100_make_overleaf_data_dirs.sh \
  /etc/service/web-overleaf/run
  
 
+SHELL ["/bin/bash", "-cx"]
+
+# update tlmgr itself
+RUN wget "https://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.sh" \
+    && sh update-tlmgr-latest.sh \
+    && tlmgr --version
+
+# enable tlmgr to install ctex
+RUN tlmgr update texlive-scripts 
+
+# update packages
+RUN tlmgr update --all
+
+# install all the packages
+RUN tlmgr install scheme-full
+
+# recreate symlinks
+RUN tlmgr path add
+
+# update system packages
+RUN apt-get update && apt-get upgrade -y
+
+# install inkscape for svg support
+RUN apt-get install inkscape -y
+
+# install lilypond
+RUN apt-get install lilypond -y
+
+# enable shell-escape by default:
+RUN TEXLIVE_FOLDER=$(find /usr/local/texlive/ -type d -name '20*') \
+    && echo % enable shell-escape by default >> /$TEXLIVE_FOLDER/texmf.cnf \
+    && echo shell_escape = t >> /$TEXLIVE_FOLDER/texmf.cnf

+ 28 - 0
overleaf/Makefile

@@ -0,0 +1,28 @@
+# Makefile
+export REGISTRO=harbor.reymota.es/overleaf
+VERSION_FILE = .version
+
+# Get current version or default to tex-1
+IMG_VERSION := $(shell cat $(VERSION_FILE) 2>/dev/null || echo "tex-1")
+# Get built version for deployment targets
+BUILT_VERSION := $(shell cat .current_version 2>/dev/null || echo "$(IMG_VERSION)")
+export IMG_VERSION
+
+export OVERLEAF_LATEST ?= $(REGISTRO)/sharelatex:$(BUILT_VERSION)
+
+
+all: build
+
+build:
+	@echo "Building image with version: $(IMG_VERSION)"
+
+	docker build \
+	  --file Dockerfile \
+	  --tag $(OVERLEAF_LATEST) \
+	  .
+	@# Increment version for next build
+	@echo "$(IMG_VERSION)" | sed 's/tex-\([0-9]*\)/tex-\1/' | awk -F'-' '{print "tex-" $$2+1}' > $(VERSION_FILE)
+	@echo "Next version will be: $$(cat $(VERSION_FILE))"
+
+push:
+	docker push $(OVERLEAF_LATEST)