Skip to content
This repository was archived by the owner on Apr 30, 2024. It is now read-only.

Commit 5c1aec6

Browse files
committed
Fixes
1 parent b946c97 commit 5c1aec6

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
SHELL := /bin/bash
2-
HOSTNAME=$(shell make output | grep "Server =" | sed -n 's/.*https:\/\/\(.*\)\//\1/p')
2+
HOSTNAME=$(shell make output | grep "server =" | sed -n 's/.*https:\/\/\(.*\)\//\1/p')
33

44
deploy: init validate plan apply sourcegraph
55

66
init:
77
terraform init -upgrade
88

99
validate:
10-
terraform validate -var-file terraform.tfvars
10+
terraform validate
1111

1212
plan: validate
1313
terraform plan -var-file terraform.tfvars

outputs.tf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,10 @@ output "ssh" {
66
value = format("ssh root@%s", digitalocean_droplet.this.ipv4_address)
77
}
88

9-
output "ip-address" {
10-
value = format("https://%s:2633/", digitalocean_droplet.this.ipv4_address)
11-
}
12-
139
output "management-console" {
1410
value = format("https://%s:2633/", digitalocean_droplet.this.ipv4_address)
1511
}
1612

1713
output "trust-self-signed-cert" {
18-
value = "${format("scp root@%s", digitalocean_droplet.this.ipv4_address)}:~/sourcegraph-root-ca.zip ./ && unzip sourcegraph-root-ca.zip && mv ./rootCA* \"$(mkcert -CAROOT)\" && mkcert -install"
14+
value = "${format("scp root@%s", digitalocean_droplet.this.ipv4_address)}:~/sourcegraph-root-ca.zip /tmp/ && unzip /tmp/sourcegraph-root-ca.zip -d /tmp/sourcegraph-root-ca && mv /tmp/sourcegraph-root-ca/* \"$(mkcert -CAROOT)\" && mkcert -install"
1915
}

resources/user-data.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ mkdir -p ${SOURCEGRAPH_CONFIG}/management
3535
mkdir -p ${SOURCEGRAPH_DATA}
3636

3737
# Install mkcert and generate root CA, certificate and key
38-
wget https://github.com/FiloSottile/mkcert/releases/download/v${MKCERT_VERSION}/mkcert-v1.3.0-linux-amd64 -O /usr/local/bin/mkcert
38+
wget https://github.com/FiloSottile/mkcert/releases/download/v${MKCERT_VERSION}/mkcert-v${MKCERT_VERSION}-linux-amd64 -O /usr/local/bin/mkcert
3939
chmod a+x /usr/local/bin/mkcert
4040

4141
# Use the public ip address of the instance as hostnae for the self-signed cert as DigitalOcean doesn't have public DNS hostnames
@@ -91,8 +91,8 @@ http {
9191
include nginx/sourcegraph_server.conf;
9292
9393
listen 7443 ssl http2 default_server;
94-
ssl_certificate cert/sourcegraph.crt;
95-
ssl_certificate_key cert/sourcegraph.key;
94+
ssl_certificate sourcegraph.crt;
95+
ssl_certificate_key sourcegraph.key;
9696
9797
location / {
9898
proxy_pass http://backend;
@@ -120,7 +120,7 @@ cp ${SOURCEGRAPH_CONFIG}/sourcegraph.crt ${SOURCEGRAPH_CONFIG}/management/cert.p
120120
cp ${SOURCEGRAPH_CONFIG}/sourcegraph.key ${SOURCEGRAPH_CONFIG}/management/key.pem
121121

122122
# Zip the CA Root key and certificate for easy downloading
123-
zip -j ${USER_HOME}/sourcegraph-root-ca.zip ${SOURCEGRAPH_CONFIG}/root*
123+
zip -j ${USER_HOME}/sourcegraph-root-ca.zip ${SOURCEGRAPH_CONFIG}/sourcegraph.crt ${SOURCEGRAPH_CONFIG}/sourcegraph.key
124124

125125
cat > ${USER_HOME}/sourcegraph-start <<EOL
126126
#!/usr/bin/env bash
@@ -160,7 +160,7 @@ docker container run \\
160160
EOL
161161

162162
cat > ${USER_HOME}/sourcegraph-stop <<EOL
163-
!/usr/bin/env bash
163+
#!/usr/bin/env bash
164164
165165
echo "[info]: Stopping Sourcegraph"
166166
docker container stop sourcegraph > /dev/null 2>&1 docker container rm sourcegraph

0 commit comments

Comments
 (0)