Skip to content

Commit

Permalink
🐛 Changing references from ludusrusso to gyozatech
Browse files Browse the repository at this point in the history
  • Loading branch information
davideimola committed Apr 1, 2021
1 parent 4384087 commit 65d4de4
Show file tree
Hide file tree
Showing 19 changed files with 100 additions and 81 deletions.
97 changes: 58 additions & 39 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,41 @@ on:
- '**'
tags:
- 'v*'
pull_request:
branches: [ "*" ]

jobs:
docker:
runs-on: ubuntu-latest
configure-ci:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta Api
id: docker_meta_api
uses: crazy-max/ghaction-docker-meta@v1
with:
images: |
ghcr.io/ludusrusso/smtp/api
tag-sha: true
tag-semver: |
{{version}}
{{major}}.{{minor}}
- name: Docker meta Sender
id: docker_meta_sender
uses: crazy-max/ghaction-docker-meta@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
images: |
ghcr.io/ludusrusso/smtp/sender
tag-sha: true
tag-semver: |
{{version}}
{{major}}.{{minor}}
- name: Docker meta Mailer
id: docker_meta_mailer
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

api:
runs-on: ubuntu-20.04
needs: configure-ci
steps:
- name: Docker meta api
id: docker_meta_api
uses: crazy-max/ghaction-docker-meta@v1
with:
images: |
ghcr.io/ludusrusso/smtp/mailer
ghcr.io/gyozatech/smtp/api
tag-sha: true
tag-semver: |
{{version}}
{{major}}.{{minor}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build and push api
id: docker_build_api
uses: docker/build-push-action@v2
Expand All @@ -59,6 +50,22 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta_api.outputs.tags }}
labels: ${{ steps.docker_meta_api.outputs.labels }}

sender:
runs-on: ubuntu-20.04
needs: configure-ci
steps:
- name: Docker meta sender
id: docker_meta_sender
uses: crazy-max/ghaction-docker-meta@v1
with:
images: |
ghcr.io/gyozatech/smtp/sender
tag-sha: true
tag-semver: |
{{version}}
{{major}}.{{minor}}
- name: Build and push sender
id: docker_build_sender
uses: docker/build-push-action@v2
Expand All @@ -67,17 +74,29 @@ jobs:
target: sender
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta_sender.outputs.tags }}
labels: ${{ steps.docker_meta_sender.outputs.labels }}

mailer:
runs-on: ubuntu-20.04
needs: configure-ci
steps:
- name: Docker meta mailer
id: docker_meta_mailer
uses: crazy-max/ghaction-docker-meta@v1
with:
images: |
ghcr.io/gyozatech/smtp/mailer
tag-sha: true
tag-semver: |
{{version}}
{{major}}.{{minor}}
- name: Build and push mailer
id: docker_build_mailer
id: docker_build_sender
uses: docker/build-push-action@v2
with:
context: .
target: mailer
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta_mailer.outputs.tags }}
labels: ${{ steps.docker_meta_mailer.outputs.labels }}
- name: Image digest
run: |
echo ${{ steps.docker_build_sender.outputs.digest }}
echo ${{ steps.docker_build_api.outputs.digest }}
echo ${{ steps.docker_build_mailer.outputs.digest }}
labels: ${{ steps.docker_meta_mailer.outputs.labels }}
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
docker-build:
docker build -t ludusrusso/smtp-api --target api .
docker build -t ludusrusso/smtp-sender --target sender .
docker build -t ludusrusso/smtp-mailer --target mailer .
docker build -t gyozatech/smtp-api --target api .
docker build -t gyozatech/smtp-sender --target sender .
docker build -t gyozatech/smtp-mailer --target mailer .

docker-push:
docker push ludusrusso/smtp-api
docker push ludusrusso/smtp-sender
docker push ludusrusso/smtp-mailer
docker push gyozatech/smtp-api
docker push gyozatech/smtp-sender
docker push gyozatech/smtp-mailer
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Tested on kubernello

The SMTP server need to be configured in order to work properly.

1. Choose a SENDER_NAME setting an env variable in [./k8s/sender.yaml](./k8s/sender.yaml). In my example, this is `mailer.ludusrusso.space`. This should be an subdomain in your posses (you need to set some DNS records).
1. Choose a SENDER_NAME setting an env variable in [./k8s/sender.yaml](./k8s/sender.yaml). In my example, this is `mailer.gyozatech.space`. This should be an subdomain in your posses (you need to set some DNS records).
2. Set a reverse DNS record FROM your server IP -> TO SERVER_NAME
3. Set a A record FROM your SENDER_NAME domaint -> TO your server IP
4. Set a TXT record from your SENDER_NAME -> `v=spf1 ip4:<YOUR SENDER IP> -all`
Expand All @@ -34,12 +34,12 @@ Create the domain using the `createDomain` method
```
# Request
{
"domain": "sending.ludusrusso.space"
"domain": "sending.gyozatech.space"
}
# Response
{
"domain": "sending.ludusrusso.space",
"domain": "sending.gyozatech.space",
"key": "xxxxxxxxxx",
"dkimPubKey": "xxxxxxx"
}
Expand Down Expand Up @@ -77,7 +77,7 @@ Example CALL
# Request
{
"sender": {
"email": "no-reply@ludusrusso.space",
"email": "no-reply@gyozatech.space",
"alias": "Ludovico"
},
"to": [
Expand All @@ -91,8 +91,8 @@ Example CALL
# Reponse
{
"messageID": "message/6ca47968-3b3a-401b-ad05-a816ce19d69c@sending.ludusrusso.space",
"templateID": "tmp-template/fc0e8313-5800-4e82-91fe-940cfad21d19@sending.ludusrusso.space",
"messageID": "message/6ca47968-3b3a-401b-ad05-a816ce19d69c@sending.gyozatech.space",
"templateID": "tmp-template/fc0e8313-5800-4e82-91fe-940cfad21d19@sending.gyozatech.space",
"scheduled_time": {
"seconds": "1609668627",
"nanos": 905726068
Expand Down
6 changes: 3 additions & 3 deletions cmd/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (

"github.com/sirupsen/logrus"
"gorm.io/gorm"
"smtp.ludusrusso.space/generated/proto"
"smtp.ludusrusso.space/internal/db"
"smtp.ludusrusso.space/internal/domains"
"smtp.gyozatech.space/generated/proto"
"smtp.gyozatech.space/internal/db"
"smtp.gyozatech.space/internal/domains"
)

type apiService struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/joho/godotenv"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc"
"smtp.ludusrusso.space/generated/proto"
"smtp.ludusrusso.space/internal/db"
"smtp.gyozatech.space/generated/proto"
"smtp.gyozatech.space/internal/db"
)

func main() {
Expand Down
10 changes: 5 additions & 5 deletions cmd/mailer/mailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"google.golang.org/grpc/metadata"
"google.golang.org/protobuf/types/known/timestamppb"
"gorm.io/gorm"
"smtp.ludusrusso.space/generated/proto"
"smtp.ludusrusso.space/internal/db"
"smtp.ludusrusso.space/internal/domains"
"smtp.ludusrusso.space/internal/pool"
"smtp.ludusrusso.space/internal/templates"
"smtp.gyozatech.space/generated/proto"
"smtp.gyozatech.space/internal/db"
"smtp.gyozatech.space/internal/domains"
"smtp.gyozatech.space/internal/pool"
"smtp.gyozatech.space/internal/templates"
)

type service struct {
Expand Down
4 changes: 2 additions & 2 deletions cmd/mailer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"github.com/sirupsen/logrus"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc"
"smtp.ludusrusso.space/generated/proto"
"smtp.ludusrusso.space/internal/db"
"smtp.gyozatech.space/generated/proto"
"smtp.gyozatech.space/internal/db"
)

func main() {
Expand Down
8 changes: 4 additions & 4 deletions cmd/sender/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (

"github.com/joho/godotenv"
"github.com/sirupsen/logrus"
"smtp.ludusrusso.space/internal/db"
"smtp.ludusrusso.space/internal/mailer"
"smtp.ludusrusso.space/internal/pool"
"smtp.ludusrusso.space/internal/smtp"
"smtp.gyozatech.space/internal/db"
"smtp.gyozatech.space/internal/mailer"
"smtp.gyozatech.space/internal/pool"
"smtp.gyozatech.space/internal/smtp"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module smtp.ludusrusso.space
module smtp.gyozatech.space

go 1.15

Expand Down
2 changes: 1 addition & 1 deletion internal/db/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"math/rand"

"gorm.io/gorm"
"smtp.ludusrusso.space/internal/dkim"
"smtp.gyozatech.space/internal/dkim"
)

// Domain represent a sender domain
Expand Down
2 changes: 1 addition & 1 deletion internal/domains/domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"gorm.io/gorm"
"smtp.ludusrusso.space/internal/db"
"smtp.gyozatech.space/internal/db"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion internal/mailer/mailer.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mailer

import (
"smtp.ludusrusso.space/internal/db"
"smtp.gyozatech.space/internal/db"
)

// Mailer model a sistem able to send complete Email
Expand Down
6 changes: 3 additions & 3 deletions internal/mailer/smtp-mailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
log "github.com/sirupsen/logrus"
"gopkg.in/mail.v2"
"gorm.io/gorm"
"smtp.ludusrusso.space/internal/db"
"smtp.ludusrusso.space/internal/dkim"
"smtp.ludusrusso.space/internal/smtp"
"smtp.gyozatech.space/internal/db"
"smtp.gyozatech.space/internal/dkim"
"smtp.gyozatech.space/internal/smtp"
)

type headers map[string]string
Expand Down
2 changes: 1 addition & 1 deletion internal/pool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/jinzhu/gorm/dialects/postgres"
"gorm.io/gorm"
"smtp.ludusrusso.space/internal/db"
"smtp.gyozatech.space/internal/db"
)

// SendingPoolManager is a manger for sending pool
Expand Down
2 changes: 1 addition & 1 deletion internal/templates/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package templates

import (
"gorm.io/gorm"
"smtp.ludusrusso.space/internal/db"
"smtp.gyozatech.space/internal/db"
)

// Manager implement interface to manage Templates
Expand Down
2 changes: 1 addition & 1 deletion internal/templates/templates_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package templates

import (
"gorm.io/gorm"
"smtp.ludusrusso.space/internal/db"
"smtp.gyozatech.space/internal/db"
)

type manager struct {
Expand Down
2 changes: 1 addition & 1 deletion k8s/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
spec:
containers:
- name: api
image: ludusrusso/smtp-api
image: gyozatech/smtp-api
imagePullPolicy: Always
envFrom:
- secretRef:
Expand Down
2 changes: 1 addition & 1 deletion k8s/mailer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
spec:
containers:
- name: mailer
image: ludusrusso/smtp-mailer
image: gyozatech/smtp-mailer
imagePullPolicy: Always
envFrom:
- secretRef:
Expand Down
4 changes: 2 additions & 2 deletions k8s/sender.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ spec:
spec:
containers:
- name: sender
image: ludusrusso/smtp-sender
image: gyozatech/smtp-sender
imagePullPolicy: Always
envFrom:
- secretRef:
name: db
env:
- name: SENDER_HOST
value: mailer.ludusrusso.space
value: mailer.gyozatech.space
resources:
limits:
memory: '64Mi'
Expand Down

0 comments on commit 65d4de4

Please sign in to comment.