Compare commits

..

No commits in common. "main" and "update-command" have entirely different histories.

7 changed files with 5 additions and 85 deletions

View file

@ -1,12 +0,0 @@
when:
- event: tag
steps:
- name: publish package
image: ghcr.io/astral-sh/uv:python3.11-alpine
commands:
- uv build
- uv publish --index forgejo
environment:
UV_PUBLISH_TOKEN:
from_secret: publish_token

View file

@ -1,6 +1,5 @@
when: when:
- event: push - event: push
- event: manual
steps: steps:
- name: python tests - name: python tests

View file

@ -1,13 +1,5 @@
# Changelog # Changelog
# 0.7.0
- Added different classes responsible for determining host IP
- Changed cli usage from `transip-client` to `transip-update`
- Added Dockerfile
- Added editorconfig configuration file
- Added README
# 0.6.0 # 0.6.0
- Replaced dns query usage with calling an external API - Replaced dns query usage with calling an external API

View file

@ -1,53 +0,0 @@
# Transip client
A simple command line client for updating DNS records with the Transip API. It does
so by determining the current hosts (external) IP address and accordingly updates
the records DNS for the given domain names.
## Installation
Installation can be done through using uv:
```
$ uv sync --frozen --no-dev
```
Or through the provided Dockerfile:
```
$ docker image build --tag transip-client:0.7.0 .
```
Optional dependencies can be installed with:
```
$ uv sync --frozen --no-dev --extra sentry-enabled
```
For docker installations optional dependencies can be installed with:
```
$ docker image build \
--build-arg UV_ARGS="--extra sentry-enabled" \
--tag transip-client:0.7.0 .
```
## Usage
Use the help option to show all available options:
```
transip-update --help
```
## Configuration
The client can be configured with the following environment variables:
`LOGGING_CONFIG`: Specifies the path for the [logging configuration](https://docs.python.org/3.11/library/logging.html) to be used. Note that both `LOGGING_CONFIG_SRC` and `LOGGING_CONFIG_DST` can be used when building the docker image to achieve similar results.
`VERSION`: Application version. The client will try to retrieve this through git if it is not set.
`SENTRY_DSN`: Optionally used for specifying Sentry's DSN
`ENVIRONMENT`: Optionally used for specifying the environment in Sentry

View file

@ -1,8 +1,8 @@
[project] [project]
name = "transip_client" name = "transip_client"
version = "0.7.0" version = "0.5.0"
description = "Listens for changes about the current public IP and acts upon it." description = "Listens for changes about the current public IP and acts upon it."
authors = [{name = "Sonny"}] authors = [{name = "Sonny", email= "sonnyba871@gmail.com"}]
license = {text = "GPL-3.0"} license = {text = "GPL-3.0"}
requires-python = ">=3.11" requires-python = ">=3.11"
dependencies = [ dependencies = [
@ -23,12 +23,6 @@ sentry-enabled = ["sentry_sdk>=0.19.5"]
[tool.setuptools.packages] [tool.setuptools.packages]
find = {include = ["transip_client"]} find = {include = ["transip_client"]}
[[tool.uv.index]]
name = "forgejo"
url = "https://forgejo.fudiggity.nl/sonny/transip-client/packages"
publish-url = "https://forgejo.fudiggity.nl/api/packages/sonny/pypi"
explicit = true
[project.scripts] [project.scripts]
transip-update = "transip_client.cli:update" transip-update = "transip_client.cli:update"

View file

@ -1,9 +1,9 @@
import base64 import base64
import json import json
import logging import logging
import time
from concurrent.futures import ThreadPoolExecutor, as_completed from concurrent.futures import ThreadPoolExecutor, as_completed
from secrets import token_urlsafe
from typing import Generator from typing import Generator
import requests import requests
@ -28,7 +28,7 @@ def _get_token(private_key_path: str, login: str, api_url: str) -> str:
f"{api_url}/auth", f"{api_url}/auth",
json={ json={
"login": login, "login": login,
"nonce": token_urlsafe(), "nonce": str(int(time.time() * 1000)),
"read_only": False, "read_only": False,
"expiration_time": "30 minutes", "expiration_time": "30 minutes",
"label": "Trans IP client", "label": "Trans IP client",

2
uv.lock generated
View file

@ -270,7 +270,7 @@ wheels = [
[[package]] [[package]]
name = "transip-client" name = "transip-client"
version = "0.7.0" version = "0.5.0"
source = { editable = "." } source = { editable = "." }
dependencies = [ dependencies = [
{ name = "click", marker = "sys_platform == 'linux'" }, { name = "click", marker = "sys_platform == 'linux'" },