mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-29 01:04:56 +08:00
ci: Setup self-signed certificate for gitpod
This commit is contained in:
parent
cf652d41e6
commit
fd9054f2f6
1
.gitpod.Dockerfile
vendored
1
.gitpod.Dockerfile
vendored
@ -1 +0,0 @@
|
|||||||
FROM gitpod/workspace-dotnet:latest
|
|
||||||
@ -6,12 +6,19 @@
|
|||||||
# https://www.gitpod.io/docs/configure/workspaces/ports
|
# https://www.gitpod.io/docs/configure/workspaces/ports
|
||||||
|
|
||||||
image:
|
image:
|
||||||
file: .gitpod.Dockerfile
|
file: gitpod/workspace-dotnet
|
||||||
|
|
||||||
|
caches:
|
||||||
|
dotnet:
|
||||||
|
paths:
|
||||||
|
- /usr/local/bin/docker-compose
|
||||||
|
|
||||||
# https://www.gitpod.io/docs/configure/workspaces/tasks#execution-order
|
# https://www.gitpod.io/docs/configure/workspaces/tasks#execution-order
|
||||||
# https://www.gitpod.io/docs/configure/projects/prebuilds
|
# https://www.gitpod.io/docs/configure/projects/prebuilds
|
||||||
tasks:
|
tasks:
|
||||||
- name: Setup kubectl
|
- name: Setup kubectl
|
||||||
|
command: bash $GITPOD_REPO_ROOT/scripts/setup_kubectl_gitpod.sh
|
||||||
|
- name: Setup Self-Signed Certificate
|
||||||
command: bash $GITPOD_REPO_ROOT/scripts/self_signed_certificate_gitpod.sh
|
command: bash $GITPOD_REPO_ROOT/scripts/self_signed_certificate_gitpod.sh
|
||||||
- name: Init Docker-Compose
|
- name: Init Docker-Compose
|
||||||
init: |
|
init: |
|
||||||
|
|||||||
@ -1,12 +1,21 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Generate self-signed certificate
|
# install mkcert
|
||||||
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj '/CN=localhost'
|
curl -fsSL https://github.com/FiloSottile/mkcert/releases/download/v1.4.1/mkcert-v1.4.1-linux-amd64 -o mkcert
|
||||||
|
chmod +x mkcert
|
||||||
|
sudo mv mkcert /usr/local/bin
|
||||||
|
|
||||||
# Trust the certificate in Gitpod
|
# install root CA
|
||||||
sudo mkdir -p /etc/gitpod/tls/
|
mkcert -install
|
||||||
sudo cp cert.pem /etc/gitpod/tls/
|
|
||||||
sudo cp key.pem /etc/gitpod/tls/
|
|
||||||
|
|
||||||
# Restart Gitpod
|
# create certificate
|
||||||
sudo gitpod restart
|
mkcert gitpod.local
|
||||||
|
|
||||||
|
# move certificate files to gitpod directory
|
||||||
|
mkdir -p ~/.gitpod/certs
|
||||||
|
mv gitpod.local.pem ~/.gitpod/certs/
|
||||||
|
mv gitpod.local-key.pem ~/.gitpod/certs/
|
||||||
|
|
||||||
|
# configure nginx to use the certificate
|
||||||
|
echo "server { listen 80; listen [::]:80; server_name gitpod.local; ssl_certificate /home/gitpod/.gitpod/certs/gitpod.local.pem; ssl_certificate_key /home/gitpod/.gitpod/certs/gitpod.local-key.pem; }" | sudo tee /etc/nginx/conf.d/gitpod.local.conf
|
||||||
|
sudo systemctl reload nginx
|
||||||
10
scripts/setup_kubectl_gitpod.sh
Normal file
10
scripts/setup_kubectl_gitpod.sh
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Download kubectl binary
|
||||||
|
curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -L -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||||
|
|
||||||
|
# Make the kubectl binary executable
|
||||||
|
chmod +x kubectl
|
||||||
|
|
||||||
|
# Move the binary in to PATH
|
||||||
|
sudo mv kubectl /usr/local/bin/
|
||||||
@ -112,14 +112,11 @@ public class PersistMessageProcessor : IPersistMessageProcessor
|
|||||||
|
|
||||||
public async Task ProcessAllAsync(CancellationToken cancellationToken = default)
|
public async Task ProcessAllAsync(CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
var messages = await _persistMessageDbContext?.PersistMessages?
|
var messages = await _persistMessageDbContext.PersistMessages
|
||||||
.Where(x => x.MessageStatus != MessageStatus.Processed)
|
.Where(x => x.MessageStatus != MessageStatus.Processed)
|
||||||
?.ToListAsync(cancellationToken);
|
.ToListAsync(cancellationToken);
|
||||||
|
|
||||||
if (messages != null && messages.Any())
|
foreach (var message in messages) await ProcessAsync(message.Id, message.DeliveryType, cancellationToken);
|
||||||
{
|
|
||||||
foreach (var message in messages) await ProcessAsync(message.Id, message.DeliveryType, cancellationToken);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task ProcessInboxAsync(long messageId, CancellationToken cancellationToken = default)
|
public async Task ProcessInboxAsync(long messageId, CancellationToken cancellationToken = default)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user