Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase #915

Merged
merged 59 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
7ab3e12
Merge pull request #822 from dbarzin/dev
dbarzin Sep 14, 2024
d9bd413
Merge pull request #823 from dbarzin/dev
dbarzin Sep 14, 2024
d32e1b7
Merge pull request #824 from dbarzin/dev
dbarzin Sep 14, 2024
5cc1847
Bump send, express and serve-static
dependabot[bot] Sep 14, 2024
59e75e3
Merge pull request #834 from dbarzin/dev
dbarzin Sep 15, 2024
86e7097
Merge pull request #833 from dbarzin/dependabot/npm_and_yarn/multi-7a…
dbarzin Sep 15, 2024
3b3084c
Merge pull request #835 from dbarzin/dev
dbarzin Sep 15, 2024
2b085af
Merge pull request #839 from dbarzin/dev
dbarzin Sep 20, 2024
87f4a8e
Merge pull request #841 from dbarzin/dev
dbarzin Sep 22, 2024
a160fba
Merge pull request #842 from dbarzin/dev
dbarzin Sep 22, 2024
77c6be1
Merge pull request #843 from dbarzin/dev
dbarzin Sep 22, 2024
c98bca2
Merge pull request #846 from dbarzin/dev
dbarzin Sep 23, 2024
1a5a38b
Merge pull request #847 from dbarzin/dev
dbarzin Sep 24, 2024
1de0cd9
Merge pull request #848 from dbarzin/dev
dbarzin Sep 24, 2024
d9ea10c
Merge pull request #849 from dbarzin/dev
dbarzin Sep 24, 2024
03301bd
Merge pull request #850 from dbarzin/dev
dbarzin Sep 24, 2024
e95fdbf
Merge pull request #854 from dbarzin/dev
dbarzin Sep 25, 2024
ec4c3c6
Merge pull request #856 from dbarzin/dev
dbarzin Sep 25, 2024
8e32e9b
Merge pull request #857 from dbarzin/dev
dbarzin Sep 25, 2024
dd08227
Merge pull request #858 from dbarzin/dev
dbarzin Sep 26, 2024
71bdf41
Merge pull request #859 from dbarzin/dev
dbarzin Sep 26, 2024
40bcb51
Merge pull request #860 from dbarzin/dev
dbarzin Sep 26, 2024
0915036
Merge pull request #861 from dbarzin/dev
dbarzin Sep 26, 2024
f74e2f5
Merge pull request #862 from dbarzin/dev
dbarzin Sep 27, 2024
93308c2
Merge pull request #865 from dbarzin/dev
dbarzin Sep 28, 2024
6de6698
Merge pull request #866 from dbarzin/dev
dbarzin Sep 30, 2024
8a243c0
Merge pull request #868 from dbarzin/dev
dbarzin Oct 1, 2024
e92500b
Merge pull request #870 from dbarzin/dev
dbarzin Oct 2, 2024
ef5a07c
Merge pull request #873 from dbarzin/dev
dbarzin Oct 3, 2024
c8ac662
Merge pull request #874 from dbarzin/dev
dbarzin Oct 3, 2024
f07d24d
Merge pull request #875 from dbarzin/dev
dbarzin Oct 3, 2024
825f570
Merge pull request #876 from dbarzin/dev
dbarzin Oct 3, 2024
1c9a0a8
Merge pull request #877 from dbarzin/dev
dbarzin Oct 3, 2024
71082bd
Merge pull request #878 from dbarzin/dev
dbarzin Oct 4, 2024
ef33c7e
Merge pull request #879 from dbarzin/dev
dbarzin Oct 4, 2024
0a6352c
Merge pull request #880 from dbarzin/dev
dbarzin Oct 4, 2024
779189d
Merge pull request #883 from dbarzin/dev
dbarzin Oct 5, 2024
462bcac
Merge pull request #884 from dbarzin/dev
dbarzin Oct 5, 2024
7c50828
Merge pull request #886 from dbarzin/dev
dbarzin Oct 6, 2024
03ff84c
Merge pull request #888 from dbarzin/dev
dbarzin Oct 6, 2024
d0e37a6
Merge pull request #889 from dbarzin/dev
dbarzin Oct 6, 2024
309914c
Merge pull request #891 from dbarzin/dev
dbarzin Oct 7, 2024
cad1f03
Merge pull request #892 from dbarzin/dev
dbarzin Oct 8, 2024
7eb534d
Merge pull request #897 from dbarzin/dev
dbarzin Oct 11, 2024
3fdc4fc
Merge pull request #898 from dbarzin/dev
dbarzin Oct 12, 2024
175fd8b
Bump cookie and express
dependabot[bot] Oct 13, 2024
2f646d6
Merge pull request #899 from dbarzin/dependabot/npm_and_yarn/multi-ff…
dbarzin Oct 13, 2024
bbfc846
Merge pull request #900 from dbarzin/dev
dbarzin Oct 13, 2024
ef63dfd
Merge pull request #901 from dbarzin/dev
dbarzin Oct 13, 2024
a9e43b7
Merge pull request #904 from dbarzin/dev
dbarzin Oct 15, 2024
de0e7f2
update
Oct 16, 2024
a006bbc
Merge pull request #905 from siddjellali/master
dbarzin Oct 16, 2024
cb42ebc
Merge pull request #906 from dbarzin/dev
dbarzin Oct 20, 2024
41de1f2
Merge pull request #908 from dbarzin/dev
dbarzin Oct 21, 2024
f81dc47
update
Oct 21, 2024
55c4735
Merge pull request #911 from dbarzin/dev
dbarzin Oct 22, 2024
382f136
Merge pull request #909 from siddjellali/master
dbarzin Oct 22, 2024
cacda26
Merge pull request #912 from dbarzin/dev
dbarzin Oct 22, 2024
8dc645c
Merge pull request #913 from dbarzin/dev
dbarzin Oct 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ docker/data
*Dockerfile
*.md
.dockerignore
.env*
*.sqlite*
nginx.conf
supervisord.conf
supervisord.conf
*.md
.github
.idea
docker-compose
docs
chart
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ RUN addgroup --g 1000 -S www && \
chown -R mercator:www /var/www /var/lib/nginx /var/log/nginx /etc/nginx/http.d

# Clone sources from Github
WORKDIR /var/www/
RUN git clone https://github.com/dbarzin/mercator.git/
#WORKDIR /var/www/
#RUN git clone https://github.com/dbarzin/mercator.git/
RUN mkdir /var/www/mercator
WORKDIR /var/www/mercator
COPY . .

# Copy config files
RUN cp docker/nginx.conf /etc/nginx/http.d/default.conf
RUN cp docker/supervisord.conf /etc/supervisord.conf
COPY docker/nginx.conf /etc/nginx/http.d/default.conf
COPY docker/supervisord.conf /etc/supervisord.conf

# change owner
RUN chown -R mercator:www /var/www/mercator
Expand Down
23 changes: 23 additions & 0 deletions _helm_chart/chart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
9 changes: 9 additions & 0 deletions _helm_chart/chart/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies:
- name: redis
repository: oci://registry-1.docker.io/bitnamicharts
version: 20.1.7
- name: postgresql
repository: oci://registry-1.docker.io/bitnamicharts
version: 16.0.1
digest: sha256:432a55311d15e571a708a4299fc288c4c78c3ca9bf891172021568bf6a20c7eb
generated: "2024-10-06T20:21:49.987133+02:00"
36 changes: 36 additions & 0 deletions _helm_chart/chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: v2
name: mercator
description: A Helm chart for running Mercator via Kubernetes
home: https://github.com/dbarzin/mercator
maintainers:
- name: Mercator
url: https://github.com/dbarzin/mercator/chart
dependencies:
- condition: redis.enabled
name: redis
repository: oci://registry-1.docker.io/bitnamicharts
version: 20.x.x
- condition: postgresql.enabled
name: postgresql
repository: oci://registry-1.docker.io/bitnamicharts
version: 16.x.x
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.1.0"
123 changes: 123 additions & 0 deletions _helm_chart/chart/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Mercator Helm Chart
## TL;DR

```bash
helm install mercator .
```

## Introduction

This chart bootstraps **Mercator** deployment on a [Kubernetes](https://kubernetes.io/) cluster using the [Helm](https://helm.sh/) package manager.

## Prerequisites
- Kubernetes 1.23+
- Helm 3.8.0+

## Persistence
The Mercator chart relies on the PostgreSQL chart persistence. This means that Mercator does not persist anything.

## Parameters
This part provides an overview of all the configurable parameters used in the `values.yaml` file for deploying the Mercator application using a Helm chart.

### Global parameters

| Parameter | Description | Default Value |
|------------------------------------------------|------------------------------------------------------------------------------|----------------------------|
| **replicaCount** | Number of application replicas to deploy. | `1` |
| **image.repository** | Docker image repository for the Mercator application. | `ghcr.io/dbarzin/mercator` |
| **image.pullPolicy** | Specifies when to pull the Docker image (`Always`, `IfNotPresent`, `Never`). | `IfNotPresent` |
| **image.tag** | Tag of the Docker image. | `"latest"` |
| **imagePullSecrets** | Secrets to use for pulling private Docker images. | `[]` |
| **serviceAccount.create** | Specifies whether a service account should be created. | `true` |
| **serviceAccount.automount** | Automatically mount the ServiceAccount’s API credentials. | `true` |
| **serviceAccount.annotations** | Annotations to add to the service account. | `{}` |
| **serviceAccount.name** | Name of the service account to use or create. | `""` |
| **podAnnotations** | Annotations to add to the pod. | `{}` |
| **podLabels** | Labels to add to the pod. | `{}` |
| **podSecurityContext** | Security context for the pod. | `{}` |
| **securityContext** | Security context for the container, e.g., user permissions. | `{}` |
| **service.type** | Kubernetes service type (`ClusterIP`, `NodePort`, `LoadBalancer`). | `ClusterIP` |
| **service.port** | Port exposed by the service. | `80` |
| **ingress.enabled** | Enable or disable ingress resource creation. | `false` |
| **resources** | Resource limits and requests for the application. | `{}` |
| **livenessProbe.httpGet.path** | HTTP path for liveness probe. | `/` |
| **livenessProbe.httpGet.port** | Port for liveness probe. | `http` |
| **readinessProbe.httpGet.path** | HTTP path for readiness probe. | `/` |
| **readinessProbe.httpGet.port** | Port for readiness probe. | `http` |
| **autoscaling.enabled** | Enable or disable horizontal pod autoscaling. | `false` |
| **autoscaling.minReplicas** | Minimum number of replicas for autoscaling. | `1` |
| **autoscaling.maxReplicas** | Maximum number of replicas for autoscaling. | `100` |
| **autoscaling.targetCPUUtilizationPercentage** | Target CPU utilization for autoscaling. | `80` |
| **volumes** | Additional volumes for the deployment. | `[]` |
| **volumeMounts** | Additional volume mounts for the deployment. | `[]` |
| **nodeSelector** | Node selector for scheduling pods. | `{}` |
| **tolerations** | Tolerations for scheduling pods. | `[]` |
| **affinity** | Affinity rules for scheduling pods. | `{}` |

### Mercator parameters

| Parameter | Description | Default Value |
|--------------------------------------------|------------------------------------------------------------------------------|------------------------------|
| **debug** | Enable debug mode for the application. | `false` |
| **environment** | Environment to deploy (`development`, `production`). | `"development"` |
| **key** | Secret key for the application. | `""` |
| **reverse_proxy** | URL for the reverse proxy used by the application. | `"http://localhost"` |
| **use_demo_data** | Specify if demo data should be used (1 for true, 0 for false). | `1` |

### Mercator LDAP parameters

| Parameter | Description | Default Value |
|--------------------------------------------|------------------------------------------------------------------------------|------------------------------|
| **ldap.enabled** | Enable or disable LDAP integration. | `false` |
| **ldap.type** | Type of LDAP server (e.g., Active Directory). | `"AD"` |
| **ldap.host** | LDAP server host. | `"127.0.0.1"` |
| **ldap.username** | LDAP bind user credentials. | `"cn=user,dc=local,dc=com"` |
| **ldap.password** | Password for the LDAP bind user. | `"secret"` |
| **ldap.base_dn** | Base DN for LDAP queries. | `"dc=local,dc=com"` |
| **ldap.service.number** | LDAP service port number. | `"389"` |
| **ldap.scope** | Scope for LDAP queries. | `"ou=Accounting,dc=com"` |

### Mercator SMTP parameters
| Parameter | Description | Default Value |
|--------------------------------------------|------------------------------------------------------------------------------|------------------------------|
| **smtp.host** | SMTP server host for sending emails. | `"smtp.mailtrap.io"` |
| **smtp.port** | SMTP server port. | `"25"` |
| **smtp.username** | SMTP username for authentication. | `""` |
| **smtp.password** | SMTP password for authentication. | `""` |

### Mercator AWS parameters
| Parameter | Description | Default Value |
|--------------------------------------------|------------------------------------------------------------------------------|------------------------------|
| **aws.access_key_id** | AWS access key ID. | `""` |
| **aws.secret_access_key** | AWS secret access key. | `""` |
| **aws.default_region** | Default AWS region. | `"us-east-1"` |
| **aws.bucket** | AWS S3 bucket name. | `""` |

### Mercator PUSHER parameters
| Parameter | Description | Default Value |
|--------------------------------------------|------------------------------------------------------------------------------|------------------------------|
| **pusher.app_id** | Pusher app ID. | `""` |
| **pusher.app_key** | Pusher app key. | `""` |
| **pusher.app_secret** | Pusher app secret. | `""` |

### Mercator KEYCLOAK parameters
| Parameter | Description | Default Value |
|--------------------------------------------|------------------------------------------------------------------------------|------------------------------|
| **keycloak.enabled** | Enable or disable Keycloak integration. | `false` |
| **keycloak.client_id** | Keycloak client ID. | `""` |
| **keycloak.client_secret** | Keycloak client secret. | `""` |
| **keycloak.redirect_uri** | Redirect URI for Keycloak integration. | `""` |
| **keycloak.base_url** | Base URL of Keycloak server. | `""` |
| **keycloak.realm** | Keycloak realm name. | `""` |

### Mercator database parameters

| Parameter | Description | Default Value |
|--------------------------------------------|------------------------------------------------------------------------------|------------------------------|
| **secret.postgres.postgresPassword** | PostgreSQL password for the application. | `"2ù_-qeeYT21!8zA2~"` |
| **postgresql.enabled** | Enable or disable PostgreSQL deployment. | `true` |
| **postgresql.auth.username** | PostgreSQL username for authentication. | `"mercator_user"` |
| **postgresql.auth.database** | PostgreSQL database name. | `"mercator"` |
| **redis.enabled** | Enable or disable Redis deployment. | `true` |
| **redis.auth.enabled** | Enable or disable Redis authentication. | `true` |
| **redis.auth.password** | Password for Redis authentication.
22 changes: 22 additions & 0 deletions _helm_chart/chart/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "chart.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "chart.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "chart.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "chart.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
Loading
Loading