{"id":19596273,"url":"https://github.com/peroxy/starsky-mail","last_synced_at":"2026-06-29T22:31:06.248Z","repository":{"id":124135448,"uuid":"324553799","full_name":"peroxy/starsky-mail","owner":"peroxy","description":" Starsky mail is a service for sending verification and invite emails.","archived":false,"fork":false,"pushed_at":"2021-09-15T13:24:16.000Z","size":95,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-26T14:45:56.829Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peroxy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-26T12:47:16.000Z","updated_at":"2021-08-07T11:00:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"c78dc404-a75c-467c-88a3-4b4f4b50bea3","html_url":"https://github.com/peroxy/starsky-mail","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/peroxy/starsky-mail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peroxy%2Fstarsky-mail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peroxy%2Fstarsky-mail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peroxy%2Fstarsky-mail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peroxy%2Fstarsky-mail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peroxy","download_url":"https://codeload.github.com/peroxy/starsky-mail/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peroxy%2Fstarsky-mail/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34945707,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T08:52:38.473Z","updated_at":"2026-06-29T22:31:06.230Z","avatar_url":"https://github.com/peroxy.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Starsky mail\n Starsky mail is a service for sending verification and invite emails. \n The service is used by [starsky-backend](https://github.com/peroxy/starsky-backend) application.\n\nIt uses RabbitMQ for orderly email processing and a .NET 5.0 REST API is used to send messages to queues. \nThe API is located inside project called **StarskyMail.Queue.Api**.\n\nQueue messages get consumed by .NET 5.0 background worker inside project called **StarskyMail.Queue.Consumer**.\n\nCommon RabbitMQ queue components and classes are located inside class library **StarskyMail.Queue**. \n\n## Requirements\n\n### Development\n- [docker](https://docs.docker.com/get-docker/),\n- [docker-compose](https://docs.docker.com/compose/install/) (at least 3.8 version support),\n- (_optional: for debugging purposes_) [.NET 5.0](https://dotnet.microsoft.com/download/dotnet/5.0),\n- (_optional: if you want to actually send emails while debugging_) SendGrid API key.\n\n## Development\n\n### Settings\n\nPlease check out appsettings.json to configure application settings (like RabbitMQ settings or SendGrid settings...).\n\n### Running locally\nPlease note that this has only been tested with docker (docker-compose) on Ubuntu 20.04.\n\n1. Download source files:\n\n```shell script\ngit clone https://github.com/peroxy/starsky-mail.git\n```\n\n2. Go to root directory:\n\n```shell script\ncd starsky-mail\n```\n\n3. You must specify: \n   - SendGrid API key (if you want to send emails with consumer),\n   - SendGrid email address you are sending emails from. \n\nCreate an `.env` file (in the same directory as `docker-compose.yml`) and specify those environment variables:\n\n```shell script\necho \"SENDGRID_API_KEY=api key\" \u003e .env\necho \"SENDGRID_FROM_ADDRESS=mail@example.com\" \u003e\u003e .env\n```\n\nEnvironment variables specified in `.env` file will be automatically used by `docker-compose`.\n\n4. Build and run the API, consumer and RabbitMQ:\n\n```shell script\ndocker-compose up\n```\n\n5. You will now be able to access:\n- RabbitMQ at http://localhost:5672,\n- RabbitMQ management application at http://localhost:15672,\n- .NET core StarskyMail.Queue.Api at http://localhost:56789. \n\nYou can login to RabbitMQ management application with default credentials specified inside `docker-compose.override.yml`.\n\nA queue consumer will also be launched as a background worker service - it will automatically consume queue messages and send emails if configured. \n\n\n\n6. (Optional) If you want to debug dotnet projects locally without docker, you will have to use `dotnet user-secrets`:\n\n```shell script\ncd src/StarskyMail/StarskyMail.Queue.Api/\ndotnet user-secrets set \"RabbitMQSettings:Username\" \"username\"\ndotnet user-secrets set \"RabbitMQSettings:Password\" \"password\"\n\ncd src/StarskyMail/StarskyMail.Queue.Consumer/\ndotnet user-secrets set \"RabbitMQSettings:Username\" \"username\"\ndotnet user-secrets set \"RabbitMQSettings:Password\" \"password\"\ndotnet user-secrets set \"SendGridSettings:ApiKey\" \"api key\"\ndotnet user-secrets set \"SendGridSettings:FromAddress\" \"mail@example.com\"\n```\n\n## Deployment\n\nWe host entire infrastructure inside Azure, specifically inside Azure Virtual Machine.\n\n### Server requirements\n\nThe server (in our case Azure VM) must have these installed:\n\n- [docker](https://docs.docker.com/get-docker/),\n- [docker-compose](https://docs.docker.com/compose/install/) (at least 3.8 version support).\n\n#### Setup on Azure Virtual Machine:\n1. Create Azure Virtual Machine with Ubuntu installed and setup your public SSH key. Ubuntu 18.04 was used at the time of writing this.\n2. Enable SSH (port 22) and whitelist your IP.\n3. Connect to your machine:\n   \n   ```shell script\n   ssh username@ipAddress\n   ```\n   \n4. [Install docker](https://docs.docker.com/get-docker/):\n\n    ```shell script\n    curl -fsSL https://get.docker.com -o get-docker.sh\n    sudo usermod -aG docker \u003cyour-user\u003e\n    ```\n    Log out and log back in to be able to use `docker` without `sudo`.   \n\n   \n5. [Install docker-compose](https://docs.docker.com/compose/install/):\n\n   ```shell script\n    sudo curl -L \"https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose\n    sudo chmod +x /usr/local/bin/docker-compose\n    ```\n\n6. Generate a SSH key:\n\n    ```shell script\n    ssh-keygen -t rsa -b 4096 -c \"starsky_deploy\"\n    ```\n   \n7. Add the public part of SSH key (`~/.ssh/id_rsa.pub`) to our Github repository's deployment keys.\n\n### Repository secrets\n\nThese are the required secrets that should be stored inside Github repository secrets:\n\n- Dockerhub:\n   - `DOCKERHUB_USERNAME` \n   - `DOCKERHUB_TOKEN` - see [Create an access token](https://docs.docker.com/docker-hub/access-tokens/#create-an-access-token) for more information\n- RabbitMQ:\n   - `RABBITMQ_DEFAULT_USER`\n   - `RABBITMQ_DEFAULT_PASS` - don't make it too long, there were some issues with authentication with a 128 character password, even though it should be supported in theory...\n   - `RABBITMQ_ERLANG_COOKIE` - alphanumeric secret with max length of 255 characters\n- Server host (Azure VM):\n   - `REMOTE_HOST` - remote host IP address to SSH into\n   - `REMOTE_USER` - username to SSH with\n   - `SERVER_SSH_KEY` - private SSH key (OpenSSH, for example the contents of your `~/.ssh/id_rsa` key) to connect to your server\n- SendGrid:\n   - `SENDGRID_API_KEY` - [SendGrid](https://sendgrid.com/) API token that has permission to send emails \n   - `SENDGRID_FROM_ADDRESS` - email address to send transactionals emails from, the sender's email address\n\n### How to deploy\n\nPush a tag `*.*.*` (e.g. `1.0.3`) to main branch and it will automatically deploy everything via Github workflow.\nSee `.github/main.yml` workflow for more info. \n\nIn short, it does this if it gets triggered by a new tag:\n\n- Takes source code from `main` branch and extracts the newest version from tag.\n- Configures environment variables used by docker containers from Github repository's secrets.\n- Builds and pushes all apps as Docker images to DockerHub.\n- Copies environment variables and docker-compose files to Azure VM.\n- Stops `starsky-mail` containers on Azure VM, pulls the newest images and starts the containers again.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperoxy%2Fstarsky-mail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperoxy%2Fstarsky-mail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperoxy%2Fstarsky-mail/lists"}