Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/maven/fixes/8.1' into maven/rele…
Browse files Browse the repository at this point in the history
…ase/8.1
  • Loading branch information
metaventis-build committed Sep 1, 2023
2 parents 60d5cbe + 85115cd commit 3681931
Show file tree
Hide file tree
Showing 37 changed files with 687 additions and 695 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
variables:
COMMON_BIND_HOST: "0.0.0.0"
DEPLOY_DOCKER_HELM: "true"
DEPLOY_TIMESTAMP: "false"
DEPLOY_TIMESTAMP: "$DEPLOY_TIMESTAMP"
DOCKER_DRIVER: "$DIND_DRIVER"
DOCKER_HOST: "$DIND_HOST"
DOCKER_TLS_CERTDIR: "$DIND_TLS_CERTDIR"
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ To use the H5P editor you need to install and configure a database. At this time
- __DBPASSWORD__ the users password
- __DBNAME__ name of the database
- Create database tables by executing `php eduConnector/install/createDb.php`

To enable the h5p editing, please add the following into your `edu-sharing.conf` in the repository (Admin Tools / Global system configuration):
```
connectorList.connectors+={
id:"H5P", icon:"edit", showNew: true, onlyDesktop: true, hasViewMode: false,
filetypes:[
{mimetype: "application/zip",filetype: "h5p", ccressourcetype: "h5p", createable: true,editable: true}
]
}
```

### OnlyOffice
- Setup the OnlyOffice Document Server (see https://helpcenter.onlyoffice.com/de/server/document.aspx)
- Set values for
Expand Down
2 changes: 1 addition & 1 deletion deploy/docker/build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
</build>

<modules>
<module>mysql</module>
<module>postgresql</module>
</modules>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>edu_sharing-community-services-connector-deploy-docker-build-mysql</artifactId>
<artifactId>edu_sharing-community-services-connector-deploy-docker-build-postgres</artifactId>
<packaging>jar</packaging>

<name>edu_sharing-community-services-connector-deploy-docker-build-mysql</name>
<name>edu_sharing-community-services-connector-deploy-docker-build-posgtres</name>


<build>
Expand Down Expand Up @@ -42,7 +42,7 @@
<configuration>
<images>
<image>
<name>${docker.repository}/${docker.prefix}-deploy-docker-build-mysql:${docker.tag}</name>
<name>${docker.repository}/${docker.prefix}-deploy-docker-build-postgresql:${docker.tag}</name>
</image>
</images>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ${docker.from.mysql}
FROM ${docker.from.postgresql.server}

########################################################################################################################

Expand Down
20 changes: 13 additions & 7 deletions deploy/docker/compose/src/main/compose/2_connector-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ version: "3.9"

services:
services-edu-connector-database:
image: "${docker.repository}/${docker.prefix}-deploy-docker-build-mysql:${docker.tag}"
image: "${docker.repository}/${docker.prefix}-deploy-docker-build-postgresql:${docker.tag}"
container_name: "services-edu-connector-database_${COMPOSE_PROJECT_NAME}"
environment:
MYSQL_USER: "${SERVICES_EDU_CONNECTOR_DATABASE_USER:-connector}"
MYSQL_PASSWORD: "${SERVICES_EDU_CONNECTOR_DATABASE_PASS:-connector}"
MYSQL_DATABASE: "${SERVICES_EDU_CONNECTOR_DATABASE_NAME:-connector}"
MYSQL_ROOT_PASSWORD: "${SERVICES_EDU_CONNECTOR_DATABASE_ROOT_PASS:-connector}"
POSTGRESQL_USERNAME: "${SERVICES_EDU_CONNECTOR_DATABASE_USER:-connector}"
POSTGRESQL_POSTGRES_PASSWORD: "${SERVICES_EDU_CONNECTOR_DATABASE_PASS:-connector}"
POSTGRESQL_DATABASE: "${SERVICES_EDU_CONNECTOR_DATABASE_NAME:-connector}"
POSTGRESQL_PASSWORD: "${SERVICES_EDU_CONNECTOR_DATABASE_ROOT_PASS:-connector}"
volumes:
- services-edu-connector-database-data:/bitnami/mysql/data
- "services-edu-connector-database-data:/bitnami/postgresql"

services-edu-connector-service:
image: "${docker.repository}/${docker.prefix}-service:${docker.tag}"
Expand All @@ -20,11 +20,17 @@ services:
HOST_EXTERNAL: "${SERVICES_EDU_CONNECTOR_HOST_EXTERNAL:-edu.connector.127.0.0.1.nip.io}"
PORT_EXTERNAL: "${SERVICES_EDU_CONNECTOR_PORT_EXTERNAL:-9200}"
PATH_EXTERNAL: "${SERVICES_EDU_CONNECTOR_PATH_EXTERNAL:-}"
DATABASE_TYPE: pgsql
DATABASE_HOST: services-edu-connector-database
DATABASE_PORT: "3306"
DATABASE_PORT: "5432"
DATABASE_NAME: "${SERVICES_EDU_CONNECTOR_DATABASE_NAME:-connector}"
DATABASE_USER: "${SERVICES_EDU_CONNECTOR_DATABASE_USER:-connector}"
DATABASE_PASSWORD: "${SERVICES_EDU_CONNECTOR_DATABASE_PASS:-connector}"
ONLYOFFICE_DOCUMENT_SERVER: "${SERVICES_EDU_CONNECTOR_ONLYOFFICE_DOCUMENT_SERVER:-}"
ONLYOFFICE_PLUGIN_URL: "${SERVICES_EDU_CONNECTOR_ONLYOFFICE_PLUGIN_URL:-}"
ONLYOFFICE_JWT_SECRET: "${SERVICES_EDU_CONNECTOR_ONLYOFFICE_JWT_SECRET:-}"
MOODLE_BASE_DIR: "${SERVICES_EDU_CONNECTOR_MOODLE_BASE_DIR:-}"
MOODLE_TOKEN: "${SERVICES_EDU_CONNECTOR_MOODLE_TOKEN:-}"
volumes:
- "services-edu-connector-data:/var/data"
depends_on:
Expand Down
2 changes: 2 additions & 0 deletions deploy/docker/compose/src/main/compose/2_connector-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ version: '3.7'
services:

services-edu-connector-service:
extra_hosts:
- "repository.127.0.0.1.nip.io:host-gateway"
volumes:
- type: bind
source: ${GIT_ROOT}/services-connector/service/src/main/php/vendor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.7'
services:

services-edu-connector-database:
image: "${docker.registry}/${docker.repository}/${docker.prefix}-deploy-docker-build-mysql:${docker.tag}"
image: "${docker.registry}/${docker.repository}/${docker.prefix}-deploy-docker-build-postgresql:${docker.tag}"

services-edu-connector-service:
image: "${docker.registry}/community/${docker.prefix}-service:${docker.tag}"
Expand Down
7 changes: 7 additions & 0 deletions deploy/docker/helm/src/main/chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v2

name: edu-sharing-services-connector
description: Helm chart for edu-sharing connector app
type: application
version: 8.0.9998
appVersion: 0.1.0
28 changes: 28 additions & 0 deletions deploy/docker/helm/src/main/chart/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Usage:
Install via
```bash
helm upgrade --install connector . --set baseUrl=example.repo.org --set storageClassName=storage-class --set clusterIssuer=letsencrypt --set passwordDB=example
```

View logs of Container `edu-sharing-connector-0` and check for an output like

```
Connector is ready. Please register it at your repository (Admin Tools -> Remote-Systems) with the following url:
```

Go to the admin tools of your repository and register the app.

In order to activate H5P as an editor, configure it in the repository.
Go to Admin Tools -> Global System Config -> Cluster-Override and add
```
connectorList{
connectors:[
{
id:"H5P", icon:"edit", showNew: true, onlyDesktop: true, hasViewMode: false,
filetypes:[
{mimetype: "application/zip",filetype: "h5p", ccressourcetype: "h5p", createable: true,editable: true}
]
}
]
}
```
23 changes: 23 additions & 0 deletions deploy/docker/helm/src/main/chart/templates/ingress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
annotations:
metadata:
name: edu-sharing-connector-ingress
annotations:
cert-manager.io/cluster-issuer: {{ .Values.clusterIssuer }}
spec:
tls:
- hosts:
- connector.services.{{ .Values.baseUrl }}
secretName: edu-sharing-connector-tls
rules:
- host: connector.services.{{ .Values.baseUrl }}
http:
paths:
- backend:
service:
name: edu-sharing-connector
port:
number: 80
path: /
pathType: Prefix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: edu-sharing-services-connector-data
annotations:
"helm.sh/resource-policy": keep
spec:
storageClassName: {{ .Values.storageClassName }}
accessModes:
- ReadWriteMany
resources:
requests:
storage: "30Gi"
25 changes: 25 additions & 0 deletions deploy/docker/helm/src/main/chart/templates/service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
kind: Service
apiVersion: v1
metadata:
name: edu-sharing-connector
spec:
selector:
app: edu-sharing-connector
ports:
- port: 80
name: http-api
targetPort: api

---

kind: Service
apiVersion: v1
metadata:
name: edu-sharing-connector-db
spec:
selector:
app: edu-sharing-connector-db
ports:
- port: 3306
name: tcp-db
targetPort: db
132 changes: 132 additions & 0 deletions deploy/docker/helm/src/main/chart/templates/statefulset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: edu-sharing-connector
spec:
selector:
matchLabels:
app: edu-sharing-connector
replicas: 1
serviceName: edu-sharing-connector
template:
metadata:
labels:
app: edu-sharing-connector
spec:
containers:
- name: edu-sharing-connector
image: docker.edu-sharing.com/community/edu_sharing-community-services-edu-connector-service:{{ .Values.version }}
imagePullPolicy: Always
env:
- name: HOST_EXTERNAL
value: "connector.services.{{ .Values.baseUrl }}"
- name: PROT_EXTERNAL
value: "https"
- name: PORT_EXTERNAL
value: "443"
- name: DATABASE_HOST
value: edu-sharing-connector-db
- name: DATABASE_PORT
value: "3306"
- name: DATABASE_USER
value: "connector"
- name: DATABASE_NAME
value: "connector"
- name: DATABASE_PASSWORD
value: {{ required "A valid .Values.passwordDB is required!" .Values.passwordDB }}
- name: ONLYOFFICE_DOCUMENT_SERVER
value: {{ .Values.onlyofficeDocumentServer | default "" }}
- name: ONLYOFFICE_PLUGIN_URL
value: {{ .Values.onlyofficePluginUrl | default "" }}
- name: ONLYOFFICE_JWT_SECRET
value: {{ .Values.onlyofficeJwtSecret | default "" }}
- name: MOODLE_BASE_DIR
value: {{ .Values.moodleBaseDir | default "" }}
- name: MOODLE_TOKEN
value: {{ .Values.moodleToken | default "" }}
livenessProbe:
httpGet:
path: /metadata
port: api
periodSeconds: 10
timeoutSeconds: 10
readinessProbe:
httpGet:
path: /metadata
port: api
failureThreshold: 3
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10
resources:
limits:
cpu: "4000m"
memory: "4Gi"
requests:
cpu: "500m"
memory: "4Gi"
ports:
- containerPort: 80
name: api
volumeMounts:
- name: data
mountPath: /var/data
volumes:
- name: data
persistentVolumeClaim:
claimName: edu-sharing-services-connector-data

---

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: edu-sharing-connector-db
spec:
selector:
matchLabels:
app: edu-sharing-connector-db
replicas: 1
serviceName: edu-sharing-connector-db
template:
metadata:
labels:
app: edu-sharing-connector-db
spec:
containers:
- name: edu-sharing-connector-db
image: docker.edu-sharing.com/community/edu_sharing-community-services-edu-connector-deploy-docker-build-postgresql:{{ .Values.version }}
env:
- name: POSTGRESQL_DATABASE
value: connector
- name: POSTGRESQL_USERNAME
value: connector
- name: POSTGRESQL_PASSWORD
value: {{ .Values.passwordDB }}
- name: POSTGRESQL_POSTGRES_PASSWORD
value: {{ .Values.passwordDB }}
resources:
limits:
cpu: "2000m"
memory: "2Gi"
requests:
cpu: "1000m"
memory: "2Gi"
ports:
- name: db
containerPort: 5432
volumeMounts:
- name: data
mountPath: /bitnami/postgresql

volumeClaimTemplates:
- metadata:
name: data
spec:
storageClassName: {{ .Values.storageClassName }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "16Gi"
4 changes: 4 additions & 0 deletions deploy/docker/helm/src/main/chart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
baseUrl:
storageClassName:
clusterIssuer: letsencrypt
version: maven-fixes-8.0-SNAPSHOT
8 changes: 7 additions & 1 deletion deploy/docker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@
<name>edu_sharing-community-services-connector-deploy-docker</name>

<properties>
<docker.from.mysql>dockerio.mirror.docker.edu-sharing.com/bitnami/mysql:8.0.32</docker.from.mysql>
<postgresql.version.major>13</postgresql.version.major>
<postgresql.version.minor>9</postgresql.version.minor>
<postgresql.version.patch>0</postgresql.version.patch>
<postgresql.version>${postgresql.version.major}.${postgresql.version.minor}.${postgresql.version.patch}</postgresql.version>
<docker.from.postgresql.server>
dockerio.mirror.docker.edu-sharing.com/bitnami/postgresql:${postgresql.version}
</docker.from.postgresql.server>
</properties>

<modules>
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
DATABASE_USER: connector
DATABASE_PASSWORD: connector
volumes:
- services-edu-connector-data:/var/www/html/data
- services-edu-connector-data:/var/data
depends_on:
- services-edu-connector-database
networks:
Expand Down
Loading

0 comments on commit 3681931

Please sign in to comment.