diff --git a/.woodpecker/publish.yaml b/.woodpecker/publish.yaml deleted file mode 100644 index 18ecb26..0000000 --- a/.woodpecker/publish.yaml +++ /dev/null @@ -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 diff --git a/.woodpecker/tests.yaml b/.woodpecker/tests.yaml index ba3a4ad..e64b9d6 100644 --- a/.woodpecker/tests.yaml +++ b/.woodpecker/tests.yaml @@ -1,6 +1,5 @@ when: - event: push - - event: manual steps: - name: python tests diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c65293..a419e26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,5 @@ # 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 - Replaced dns query usage with calling an external API diff --git a/README.md b/README.md deleted file mode 100644 index 3864495..0000000 --- a/README.md +++ /dev/null @@ -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 diff --git a/pyproject.toml b/pyproject.toml index d5e3da0..f9408d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [project] name = "transip_client" -version = "0.7.0" +version = "0.5.0" 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"} requires-python = ">=3.11" dependencies = [ @@ -23,12 +23,6 @@ sentry-enabled = ["sentry_sdk>=0.19.5"] [tool.setuptools.packages] 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] transip-update = "transip_client.cli:update" diff --git a/transip_client/main.py b/transip_client/main.py index 35030f7..b451d6b 100644 --- a/transip_client/main.py +++ b/transip_client/main.py @@ -1,9 +1,9 @@ import base64 import json import logging +import time from concurrent.futures import ThreadPoolExecutor, as_completed -from secrets import token_urlsafe from typing import Generator import requests @@ -28,7 +28,7 @@ def _get_token(private_key_path: str, login: str, api_url: str) -> str: f"{api_url}/auth", json={ "login": login, - "nonce": token_urlsafe(), + "nonce": str(int(time.time() * 1000)), "read_only": False, "expiration_time": "30 minutes", "label": "Trans IP client", diff --git a/uv.lock b/uv.lock index d42ebb4..bfdbe75 100644 --- a/uv.lock +++ b/uv.lock @@ -270,7 +270,7 @@ wheels = [ [[package]] name = "transip-client" -version = "0.7.0" +version = "0.5.0" source = { editable = "." } dependencies = [ { name = "click", marker = "sys_platform == 'linux'" },