Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
common
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libre.sh
kubernetes
common
Commits
c7ef2c1a
Commit
c7ef2c1a
authored
1 year ago
by
Pierre Ozoux
Browse files
Options
Downloads
Patches
Plain Diff
feat: automatize secret creation
parent
ba79d695
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/create_matrix.sh
+12
-5
12 additions, 5 deletions
scripts/create_matrix.sh
with
12 additions
and
5 deletions
scripts/create_matrix.sh
+
12
−
5
View file @
c7ef2c1a
#!/bin/bash -eu
source
/etc/env
SERVER_NAME
=
$(
gum input
--placeholder
"Server name - example.org"
)
OIDC_CLIENT_SECRET
=
$(
gum input
--placeholder
"Oidc client secret - synapse to create in keycloak"
)
NS
=
${
SERVER_NAME
/./-
}
kubectl create ns
${
NS
}
SMTP_SECRET
=
$(
gum input
--placeholder
"Smtp secret - on pm1 - kubectl -n
${
NS
}
get secrets
${
NS
}
-smtp -o json | jq -r "
.data.password
" | base64 -d"
)
S3_SECRET_KEY
=
$(
gum input
--placeholder
"S3 Secret Key for dumps - on pm1 - kubectl -n
${
NS
}
get secrets
${
NS
}
-dumps -o json | jq -r "
.data.AWS_SECRET_ACCESS_KEY
" | base64 -d"
)
MACAROON_SECRET
=
$(
base64
/dev/urandom |
head
-c
32
)
REDIS_SECRET
=
$(
base64
/dev/urandom |
head
-c
32
)
cat
<<
EOF
> matrix.yml
cat
<<
EOF
> matrix
-secret
.yml
---
apiVersion: v1
kind: Secret
...
...
@@ -19,13 +26,13 @@ stringData:
SERVER_NAME: "
$SERVER_NAME
"
ELEMENT_SUBDOMAIN: "chat"
S3_BUCKET: "
$NS
-dumps"
S3_SECRET_KEY: ""
TURN_SECRET: ""
S3_SECRET_KEY: "
$S3_SECRET_KEY
"
TURN_SECRET: "
$TURN_SECRET
"
MACAROON_SECRET: "
$MACAROON_SECRET
"
SMTP_USER_FROM: "
$NS
@liiib.re"
SMTP_SECRET: ""
SMTP_SECRET: "
$SMTP_SECRET
"
OIDC_ISSUER: "https://id.
$SERVER_NAME
/auth/realms/
$NS
"
CLIENT_SECRET: ""
CLIENT_SECRET: "
$OIDC_CLIENT_SECRET
"
REDIS_SECRET: "
$REDIS_SECRET
"
USER_DIRECTORY_SEARCH_ALL: "false"
HOME_URL: "https://nuage.
$SERVER_NAME
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment