-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaning, fixing Elgamal parameter set, run jwt-keypair post install,…
… tls
- Loading branch information
Showing
18 changed files
with
159 additions
and
230 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
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
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,41 @@ | ||
import secrets | ||
import string | ||
import base64 | ||
import logging | ||
|
||
|
||
def generate_password(size): | ||
# Generate a secure password | ||
alphabet = string.ascii_letters + string.digits # + string.punctuation | ||
return ''.join(secrets.choice(alphabet) for i in range(size)) | ||
|
||
def generate_base64_password(size): | ||
binary_string = secrets.token_bytes(size) | ||
return base64.b64encode(binary_string).decode() | ||
|
||
config = {} | ||
with open("helm_secret.ini.example", "r") as f: | ||
for line in f.readlines(): | ||
try: | ||
if not line.strip(): | ||
continue | ||
if "=" not in line: | ||
key=line | ||
value="" | ||
else: | ||
key, value = line.split('=') | ||
key = key.strip() | ||
value = value.strip() | ||
config[key] = value | ||
except ValueError: | ||
# syntax error | ||
logging.error(f"Syntax error in line: {line}") | ||
pass | ||
|
||
config['JWT_SECRET'] = generate_password(64) | ||
config['DB_PASSWORD'] = generate_password(32) | ||
config['APP_KEY'] = 'base64:' + generate_base64_password(64) | ||
|
||
with open("helm_secret.ini", "w") as f: | ||
for key, value in config.items(): | ||
f.write(f"{key}={value}\n") |
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,37 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: kairos-init | ||
annotations: | ||
"helm.sh/hook": post-install | ||
"helm.sh/hook-delete-policy": hook-succeeded | ||
spec: | ||
template: | ||
spec: | ||
initContainers: | ||
- name: init-cont | ||
image: busybox:1.31 | ||
command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z {{.Values.database.serviceName}} 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL DB Server has started";'] | ||
containers: | ||
- image: "{{ .Values.image }}:{{ .Chart.AppVersion }}" | ||
imagePullPolicy: Always | ||
name: kairos-init | ||
envFrom: | ||
- configMapRef: | ||
name: kairos-webserver-env | ||
- secretRef: | ||
name: kairos-secrets | ||
command: ["/bin/sh"] | ||
args: | ||
- -c | ||
- >- | ||
php artisan generate:jwt-keypair | ||
resources: | ||
requests: | ||
ephemeral-storage: "100Mi" | ||
restartPolicy: Never | ||
volumes: | ||
- name: kairos-webserver-claim | ||
persistentVolumeClaim: | ||
claimName: kairos-webserver-claim | ||
backoffLimit: 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
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
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 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
name: kind-server |
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,32 @@ | ||
#install docker (https://docs.docker.com/engine/install/ubuntu/) | ||
sudo apt-get update | ||
sudo apt-get install \ | ||
apt-transport-https \ | ||
ca-certificates \ | ||
curl \ | ||
gnupg \ | ||
lsb-release | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | ||
echo \ | ||
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ | ||
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
sudo apt-get update | ||
sudo apt-get install docker-ce docker-ce-cli containerd.io | ||
|
||
# install docker-compose (https://docs.docker.com/compose/install/) | ||
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | ||
sudo chmod +x /usr/local/bin/docker-compose | ||
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose | ||
|
||
# disable SSL commenting 000-default.conf | ||
mkdir helios | ||
|
||
U_ID=$(id -u $USER) G_ID=$(id -u $USER) docker-compose up -d | ||
docker pull certbot/certbot | ||
# RUN docker run -it --rm -v $(pwd)/letsencrypt/c..... | ||
# enable SSL commenting 000-default.conf | ||
U_ID=$(id -u $USER) G_ID=$(id -u $USER) docker-compose down | ||
U_ID=$(id -u $USER) G_ID=$(id -u $USER) docker-compose up -d | ||
# php artisan key:generate | ||
# php artisan generate:jwt-keypair | ||
# php artisan storage:link |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.