Skip to content

Commit

Permalink
chore: format files and remove unused fcns
Browse files Browse the repository at this point in the history
  • Loading branch information
jchiarulli committed Oct 1, 2024
1 parent 139e5e2 commit ebe4475
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 67 deletions.
1 change: 0 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# These are supported funding model platforms

github: [christianchiarulli, jchiarulli]
patreon: chrisatmachine
23 changes: 11 additions & 12 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,23 @@ name: Go

on:
push:
branches: [ "master" ]
branches: ["master"]
pull_request:
branches: [ "master" ]
branches: ["master"]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.4'
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22.4"

- name: Build
run: go build -v ./...
- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
- name: Test
run: go test -v ./...
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
relaywiz
rwz

# Ignore .DS_Store files
.DS_Store
10 changes: 5 additions & 5 deletions pkg/relays/khatru29/nginx_https.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ server {
root /var/www/%s;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying 404.
try_files $uri $uri/ =404;
proxy_pass http://websocket_khatru29;
# First attempt to serve request as file, then
# as directory, then fall back to displaying 404.
try_files $uri $uri/ =404;
proxy_pass http://websocket_khatru29;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
Expand Down Expand Up @@ -68,7 +68,7 @@ server {
# Compilation of the top cipher suites 2024:
# https://ssl-config.mozilla.org/#server=nginx
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305";
# Perfect Forward Secrecy (PFS) is frequently compromised without this
ssl_prefer_server_ciphers on;
Expand Down
10 changes: 5 additions & 5 deletions pkg/relays/khatru_pyramid/nginx_https.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ server {
root /var/www/%s;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying 404.
try_files $uri $uri/ =404;
proxy_pass http://websocket_khatru_pyramid;
# First attempt to serve request as file, then
# as directory, then fall back to displaying 404.
try_files $uri $uri/ =404;
proxy_pass http://websocket_khatru_pyramid;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
Expand Down Expand Up @@ -68,7 +68,7 @@ server {
# Compilation of the top cipher suites 2024:
# https://ssl-config.mozilla.org/#server=nginx
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305";
# Perfect Forward Secrecy (PFS) is frequently compromised without this
ssl_prefer_server_ciphers on;
Expand Down
4 changes: 2 additions & 2 deletions pkg/relays/strfry/nginx_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ func ConfigureNginxHttp(domainName string) {
server {
listen 80;
listen [::]:80;
server_name %s;
server_name %s;
location /.well-known/acme-challenge/ {
location /.well-known/acme-challenge/ {
root /var/www/%s;
allow all;
}
Expand Down
16 changes: 8 additions & 8 deletions pkg/relays/strfry/nginx_https.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ func ConfigureNginxHttps(domainName string) {
root /var/www/%s;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying 404.
try_files $uri $uri/ =404;
proxy_pass http://127.0.0.1:7777;
proxy_http_version 1.1;
# First attempt to serve request as file, then
# as directory, then fall back to displaying 404.
try_files $uri $uri/ =404;
proxy_pass http://127.0.0.1:7777;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
#### SSL Configuration ####
Expand All @@ -59,7 +59,7 @@ func ConfigureNginxHttps(domainName string) {
# Compilation of the top cipher suites 2024:
# https://ssl-config.mozilla.org/#server=nginx
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305";
# Perfect Forward Secrecy (PFS) is frequently compromised without this
ssl_prefer_server_ciphers on;
Expand Down
20 changes: 10 additions & 10 deletions pkg/relays/wot_relay/nginx_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func ConfigureNginxHttp(domainName string) {

configContent = fmt.Sprintf(`map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
'' close;
}
upstream websocket_wot_relay {
Expand All @@ -32,23 +32,23 @@ upstream websocket_wot_relay {
# %s
server {
listen 80;
listen [::]:80;
server_name %s;
listen [::]:80;
server_name %s;
location /.well-known/acme-challenge/ {
root /var/www/%s;
allow all;
}
location /.well-known/acme-challenge/ {
root /var/www/%s;
allow all;
}
location / {
proxy_pass http://websocket_wot_relay;
proxy_pass http://websocket_wot_relay;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
`, domainName, domainName, domainName)
Expand Down
16 changes: 8 additions & 8 deletions pkg/relays/wot_relay/nginx_https.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ server {
root /var/www/%s;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying 404.
try_files $uri $uri/ =404;
proxy_pass http://websocket_wot_relay;
# First attempt to serve request as file, then
# as directory, then fall back to displaying 404.
try_files $uri $uri/ =404;
proxy_pass http://websocket_wot_relay;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Connection $connection_upgrade;
}
#### SSL Configuration ####
Expand All @@ -70,7 +70,7 @@ server {
# Compilation of the top cipher suites 2024:
# https://ssl-config.mozilla.org/#server=nginx
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305";
# Perfect Forward Secrecy (PFS) is frequently compromised without this
ssl_prefer_server_ciphers on;
Expand All @@ -83,7 +83,7 @@ server {
# By default, the buffer size is 16k, which corresponds to minimal overhead when sending big responses.
# To minimize Time To First Byte it may be beneficial to use smaller values
ssl_buffer_size 8k;
ssl_buffer_size 8k;
# OCSP stapling
ssl_stapling on;
Expand Down
4 changes: 2 additions & 2 deletions pkg/relays/wot_relay/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ func SetupRelayService(domain, pubKey string) {
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>WoT Relay</title>
<meta name="description" content="WoT Relay" />
<link href="https://{{.Domain}}" rel="canonical" />
<meta name="description" content="WoT Relay" />
<link href="https://{{.Domain}}" rel="canonical" />
</head>
<body>
<main>
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/git/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

type FileMode = fs.FileMode

// Function to remove directory
// Function to clone a repository
func Clone(branch, url, destDir string) {
err := exec.Command("git", "clone", "-b", branch, url, destDir).Run()
if err != nil {
Expand Down
1 change: 0 additions & 1 deletion pkg/utils/messages/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package messages

import (
"fmt"

"github.com/pterm/pterm"
)

Expand Down
11 changes: 0 additions & 11 deletions pkg/utils/utils.go

This file was deleted.

0 comments on commit ebe4475

Please sign in to comment.