No description
Find a file
2025-04-04 22:16:34 +02:00
Properties batman 2024-08-17 17:29:25 +02:00
.gitignore fix, readme, using secrets now 2025-04-04 22:16:34 +02:00
appsettings.Development.json fix, readme, using secrets now 2025-04-04 22:16:34 +02:00
appsettings.json fix logging 2024-08-26 08:05:27 +02:00
DnsRecords.cs worker working 2024-08-17 18:10:02 +02:00
docker-compose.yml fix ENV var names 2024-08-18 11:32:28 +02:00
IpRenewal.csproj fixes, runs now perfectly 2024-08-18 11:23:20 +02:00
Program.cs refactorings, more configurability, add docker-compose 2024-08-18 10:37:59 +02:00
README.md fix, readme, using secrets now 2025-04-04 22:16:34 +02:00
Worker.cs fix, readme, using secrets now 2025-04-04 22:16:34 +02:00

ENV vars

Development

Preparation

During Development make sure to use the DotNet Secret Manager for sensitive data like your api key and secret.

For this Project dotnet user-secrets init is not necessary anymore. It is worth noting though that Secrets are only loaded into IConfiguration when the DOTNET_ENVIRONMENT environment variable is set to Development.

So make sure you have export DOTNET_ENVIRONMENT="Development" somewhere in your system configuration.

If your system is not Development and you don't have RAMBOE_IP_RENEWAL_... explicitely set in your ENV, then IConfiguration can't read them and will return null for those values.

Setting your secrets

You can adjust the secretsExample.json:

{
  "RAMBOE_IP_RENEWAL_SUBDOMAINS": "backend,frontend,@",
  "RAMBOE_IP_RENEWAL_GODADDY_SECRET": "<your-godaddy-api-secret>",
  "RAMBOE_IP_RENEWAL_GODADDY_KEY": "<your-godaddy-key>",
  "RAMBOE_IP_RENEWAL_DOMAIN": "my.domain"
}

and then add it to your local secret store via

cat ./secretsExample.json | dotnet user-secrets set

Make sure to not commit secretsExample.json

publish to docker hub

After logging in with docker login -u <your-user-name>, one can publish the latest version of the container via

dotnet publish --os linux --arch x64 /t:PublishContainer -c Release

given permissions are set accordinglingly.

Production

When in Production, make sure to have a .env file next to your docker-compose.yml:

RAMBOE_IP_RENEWAL_GODADDY_KEY=<your-godaddy-key>
RAMBOE_IP_RENEWAL_GODADDY_SECRET=<your-godaddy-secret>
RAMBOE_IP_RENEWAL_DOMAIN=my.domain
RAMBOE_IP_RENEWAL_SUBDOMAINS=backend,frontend,@
RAMBOE_IP_RENEWAL_INTERVAL_MINUTES=15
RAMBOE_IP_RENEWAL_IP_PROVIDER_URL=https://api.ipify.org

Your docker-compose then should look like this:

  worker-iprenewal:
    image: ramboe/ip-renewal-godaddy:latest
    container_name: iprenewal
    restart: always
    env_file: .env
    environment:
      - RAMBOE_IP_RENEWAL_GODADDY_KEY=${RAMBOE_IP_RENEWAL_GODADDY_KEY}
      - RAMBOE_IP_RENEWAL_GODADDY_SECRET=${RAMBOE_IP_RENEWAL_GODADDY_SECRET}
      - RAMBOE_IP_RENEWAL_IP_PROVIDER_URL=https://api.ipify.org
      - RAMBOE_IP_RENEWAL_DOMAIN=${RAMBOE_IP_RENEWAL_DOMAIN}
      - RAMBOE_IP_RENEWAL_SUBDOMAINS=${RAMBOE_IP_RENEWAL_SUBDOMAINS}
      - RAMBOE_IP_RENEWAL_INTERVAL_MINUTES=20