-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1277 from christianhuth/dev-shlink
Upgrade to v4 and rework the implementation of the configuration
- Loading branch information
Showing
29 changed files
with
1,899 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
# shlink-backend | ||
|
||
## 4.5.5 | ||
## 5.0.0 | ||
|
||
### Added | ||
|
||
- Changelog | ||
- option to define image registry (image.registry) | ||
- options to define the configuration (config.*) | ||
|
||
### Changed | ||
|
||
- app version to 4.4.0 | ||
- dependency to mariadb to 20.2.1 | ||
- dependency to mysql to 12.2.2 | ||
- dependency to postgresql to 16.4.5 | ||
- dependency to rabbitmq to 15.2.3 | ||
- dependency to redis to 20.6.3 | ||
- option to define additional environment variables (extraEnv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
mariadb: | ||
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
mysql: | ||
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
postgresql: | ||
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
config: | ||
matomo: | ||
enabled: true | ||
auth: | ||
apiToken: "a-test-api-tokeen" | ||
baseUrl: "my-matomo.com" | ||
siteId: "SMj6N3zV5eK0Y8dO7TXG41I9LvfDoRl2" | ||
mercure: | ||
enabled: true | ||
auth: | ||
jwtSecret: "a-test-jwt-secret" | ||
publicHubUrl: "my-public-mercure-hub.com" | ||
internalHubUrl: "my-internal-mercure-hub.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
rabbitmq: | ||
enabled: true | ||
auth: | ||
password: my-test-password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
redis: | ||
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
{{/* | ||
Define the database driver | ||
*/}} | ||
{{- define "shlink-backend.database.driver" -}} | ||
{{- $driver := "" -}} | ||
{{- if .Values.mariadb.enabled -}} | ||
{{- $driver = "maria" -}} | ||
{{- else if .Values.mysql.enabled -}} | ||
{{- $driver = "mysql" -}} | ||
{{- else if .Values.postgresql.enabled -}} | ||
{{- $driver = "postgres" -}} | ||
{{- else -}} | ||
{{- $driver = .Values.config.database.driver -}} | ||
{{- end -}} | ||
{{- if not $driver -}} | ||
{{- fail "Unable to determine the database driver. Use config.database.driver or activate one of the integrated databases" -}} | ||
{{- end -}} | ||
{{- $driver -}} | ||
{{- end }} | ||
|
||
{{/* | ||
Define the database host | ||
*/}} | ||
{{- define "shlink-backend.database.host" -}} | ||
{{- $host := "" -}} | ||
{{- if .Values.mariadb.enabled -}} | ||
{{- $host = (include "mariadb.primary.fullname" .Subcharts.mariadb) -}} | ||
{{- else if .Values.mysql.enabled -}} | ||
{{- $host = (include "mysql.primary.fullname" .Subcharts.mysql) -}} | ||
{{- else if .Values.postgresql.enabled -}} | ||
{{- $host = (include "postgresql.v1.primary.fullname" .Subcharts.postgresql) -}} | ||
{{- else -}} | ||
{{- $host = .Values.config.database.host -}} | ||
{{- end -}} | ||
{{- if and (not $host) (not (eq (include "shlink-backend.database.driver" .) "sqlite")) -}} | ||
{{- fail "Unable to determine the database host. Use config.database.host or activate one of the integrated databases" -}} | ||
{{- end -}} | ||
{{- $host -}} | ||
{{- end }} | ||
|
||
{{/* | ||
Define the database port | ||
*/}} | ||
{{- define "shlink-backend.database.port" -}} | ||
{{- $port := "" -}} | ||
{{- if .Values.mariadb.enabled -}} | ||
{{- $port = .Values.mariadb.primary.service.ports.mysql -}} | ||
{{- else if .Values.mysql.enabled -}} | ||
{{- $port = .Values.mysql.primary.service.ports.mysql -}} | ||
{{- else if .Values.postgresql.enabled -}} | ||
{{- $port = (include "postgresql.v1.service.port" .Subcharts.postgresql) -}} | ||
{{- else -}} | ||
{{- $port = .Values.config.database.port -}} | ||
{{- end -}} | ||
{{- if not $port -}} | ||
{{- $driver := (include "shlink-backend.database.driver" .) -}} | ||
{{- if (eq $driver "maria") -}} | ||
{{- $port = 3306 -}} | ||
{{- else if (eq $driver "mysql") -}} | ||
{{- $port = 3306 -}} | ||
{{- else if (eq $driver "postgres") -}} | ||
{{- $port = 5432 -}} | ||
{{- else if (eq $driver "sqlite") -}} | ||
{{- $port = 0 -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- $port -}} | ||
{{- end }} | ||
|
||
{{/* | ||
Define the database username | ||
*/}} | ||
{{- define "shlink-backend.database.auth.username" -}} | ||
{{- $username := "" -}} | ||
{{- if .Values.mariadb.enabled -}} | ||
{{- $username = .Values.mariadb.auth.username -}} | ||
{{- else if .Values.mysql.enabled -}} | ||
{{- $username = .Values.mysql.auth.username -}} | ||
{{- else if .Values.postgresql.enabled -}} | ||
{{- $username = (include "postgresql.v1.username" .Subcharts.postgresql) -}} | ||
{{- else -}} | ||
{{- $username = .Values.config.database.auth.username -}} | ||
{{- end -}} | ||
{{- if not $username -}} | ||
{{- fail "Unable to determine the database username. Use config.database.auth.username or activate one of the integrated databases" -}} | ||
{{- end -}} | ||
{{- $username -}} | ||
{{- end }} | ||
|
||
{{/* | ||
Define the name of the database | ||
*/}} | ||
{{- define "shlink-backend.database.auth.database" -}} | ||
{{- $database := "" -}} | ||
{{- if .Values.mariadb.enabled -}} | ||
{{- $database = .Values.mariadb.auth.database -}} | ||
{{- else if .Values.mysql.enabled -}} | ||
{{- $database = .Values.mysql.auth.database -}} | ||
{{- else if .Values.postgresql.enabled -}} | ||
{{- $database = (include "postgresql.v1.database" .Subcharts.postgresql) -}} | ||
{{- else -}} | ||
{{- $database = .Values.config.database.auth.database -}} | ||
{{- end -}} | ||
{{- if not $database -}} | ||
{{- fail "Unable to determine the database name. Use config.database.auth.database or activate one of the integrated databases" -}} | ||
{{- end -}} | ||
{{- $database -}} | ||
{{- end }} | ||
|
||
{{/* | ||
Get the name of the secret containing the database password | ||
*/}} | ||
{{- define "shlink-backend.database.auth.secretName" -}} | ||
{{- $secretName := "" -}} | ||
{{- if .Values.mariadb.enabled -}} | ||
{{- $secretName = (include "mariadb.secretName" .Subcharts.mariadb) -}} | ||
{{- else if .Values.mysql.enabled -}} | ||
{{- $secretName = (include "mysql.secretName" .Subcharts.mysql) -}} | ||
{{- else if .Values.postgresql.enabled -}} | ||
{{- $secretName = (include "postgresql.v1.secretName" .Subcharts.postgresql) -}} | ||
{{- else if .Values.config.database.auth.existingSecret -}} | ||
{{- $secretName = .Values.config.database.auth.existingSecret -}} | ||
{{- else -}} | ||
{{- $secretName = printf "%s-database" (include "shlink-backend.fullname" .) -}} | ||
{{- end -}} | ||
{{- $secretName -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Get the key of the secret containing the database password | ||
*/}} | ||
{{- define "shlink-backend.database.auth.secretKey" -}} | ||
{{- $secretKey := "" -}} | ||
{{- if .Values.mariadb.enabled -}} | ||
{{- $secretKey = "mariadb-password" -}} | ||
{{- else if .Values.mysql.enabled -}} | ||
{{- $secretKey = "mysql-password" -}} | ||
{{- else if .Values.postgresql.enabled -}} | ||
{{- $secretKey = (include "postgresql.v1.userPasswordKey" .Subcharts.postgresql) -}} | ||
{{- else -}} | ||
{{- $secretKey = "database-password" -}} | ||
{{- end -}} | ||
{{- $secretKey -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{- if and (not .Values.mariadb.enabled) (not .Values.mysql.enabled) (not .Values.postgresql.enabled) (not .Values.config.database.auth.existingSecret) -}} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
labels: | ||
{{- include "shlink-backend.labels" . | nindent 4 }} | ||
name: {{ include "shlink-backend.database.auth.secretName" . }} | ||
data: | ||
{{- include "shlink-backend.database.auth.secretKey" . | nindent 2 }}: {{ .Values.config.database.auth.password | b64enc }} | ||
{{- end }} |
Oops, something went wrong.