Skip to content

Commit dfe7498

Browse files
authored
chore: update cryptography (#79)
* chore: update cryptography, change default nginx config path * Update requirements * Update dockerfile and readme * update .dockerignore * update uv.lock
1 parent 301d473 commit dfe7498

File tree

6 files changed

+70
-47
lines changed

6 files changed

+70
-47
lines changed

.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.git
2+
.venv
3+
.env
4+
dist/
5+
tests/
6+
**/__pycache__/
7+
**/*.py[cod]
8+
Dockerfile
9+
.pytest_cache
10+
.gitignore
11+
LICENSE.txt

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ WORKDIR /code
66
ENV UV_PROJECT_ENVIRONMENT=/code/.venv
77
ENV UV_COMPILE_BYTECODE=1
88
ENV UV_LINK_MODE=copy
9-
# Copy code
10-
COPY . .
119
# Install dependencies
10+
COPY pyproject.toml uv.lock .
11+
RUN uv sync --frozen --no-dev --no-editable --no-install-project --no-build
12+
# Install project
13+
COPY . .
1214
RUN uv sync --frozen --no-dev --no-editable
1315

1416
FROM python:3.13-slim

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ docker run --rm -v /etc/nginx:/etc/nginx --pid=host \
117117

118118

119119

120+
### Generate requirements
121+
122+
You can generate requirements.txt file with uv like:
123+
`uv export --no-hashes --no-emit-workspace > requirements.txt`
124+
120125
## Usage
121126

122127
Simplest scenario: you have neither letsencrypt [account key](https://letsencrypt.org/docs/account-id/) nor domain key and want to generate
@@ -134,16 +139,16 @@ Oct 12 23:42:17 Trying to register account key
134139
Oct 12 23:42:18 Registered!
135140
Oct 12 23:42:18 Requesting challenge
136141
Oct 12 23:42:19 Adding nginx virtual host and completing challenge
137-
Oct 12 23:42:19 Creating file /etc/nginx/sites-enabled/letsencrypt
142+
Oct 12 23:42:19 Creating file /etc/nginx/conf.d/0-letsencrypt.conf
138143
Oct 12 23:42:21 example.com verified!
139144
Oct 12 23:42:21 Requesting challenge
140145
Oct 12 23:42:21 Adding nginx virtual host and completing challenge
141-
Oct 12 23:42:21 Creating file /etc/nginx/sites-enabled/letsencrypt
146+
Oct 12 23:42:21 Creating file /etc/nginx/conf.d/0-letsencrypt.conf
142147
Oct 12 23:42:23 www.example.com verified!
143148
Oct 12 23:42:23 Signing certificate
144149
Oct 12 23:42:23 Certificate signed!
145150
Oct 12 23:42:23 Writing result file in /etc/ssl/private/letsencrypt-domain.pem
146-
Oct 12 23:42:23 Removing /etc/nginx/sites-enabled/letsencrypt and sending HUP to nginx
151+
Oct 12 23:42:23 Removing /etc/nginx/conf.d/0-letsencrypt.conf and sending HUP to nginx
147152
```
148153

149154
Certificate was generated into `/etc/ssl/private/letsencrypt-domain.pem`
@@ -166,7 +171,7 @@ More complicated scenario: you have both account, domain keys and custom virtual
166171
sudo acme-nginx \
167172
-k /path/to/account.key \
168173
--domain-private-key /path/to/domain.key \
169-
--virtual-host /etc/nginx/sites-enabled/customvhost \
174+
--virtual-host /etc/nginx/conf.d/customvhost \
170175
-o /path/to/signed_certificate.pem \
171176
-d example.com -d www.example.com
172177
```
@@ -208,8 +213,8 @@ acme-nginx --dns-provider cloudflare -d '*.example.com'
208213
### Debug
209214

210215
To debug please use `--debug` flag. With debug enabled all intermediate files
211-
will not be removed, so you can check `/etc/nginx/sites-enabled` for temporary
212-
virtual host configuration, by default it's `/etc/nginx/sites-enabled/0-letsencrypt.conf`.
216+
will not be removed, so you can check `/etc/nginx/conf.d` for temporary
217+
virtual host configuration, by default it's `/etc/nginx/conf.d/0-letsencrypt.conf`.
213218

214219
Execute `acme-nginx --help` to see all available flags and their default values.
215220

acme_nginx/Acme.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from urllib.request import urlopen, Request
1616

1717

18-
__version__ = "0.4.2"
18+
__version__ = "0.5.0"
1919

2020

2121
class Acme(object):
@@ -24,7 +24,7 @@ def __init__(
2424
api_url,
2525
logger,
2626
domains=None,
27-
vhost="/etc/nginx/sites-enabled/0-letsencrypt.conf",
27+
vhost="/etc/nginx/conf.d/0-letsencrypt.conf",
2828
account_key="/etc/ssl/private/letsencrypt-account.key",
2929
domain_key="/etc/ssl/private/letsencrypt-domain.key",
3030
cert_path="/etc/ssl/private/letsencrypt-domain.pem",

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "acme-nginx"
3-
version = "0.4.2"
3+
version = "0.5.0"
44
# TODO: Use dynamic versioning when uv supports it
55
# dynamic = ["version"]
66
description = "Python library/program to create LetsEncrypt SSL certificates"
@@ -10,7 +10,7 @@ license = "GPL-3.0"
1010
requires-python = ">=3.9.2,<3.14"
1111
dependencies = [
1212
"boto3 ~= 1.34",
13-
"cryptography ~= 42.0"
13+
"cryptography ~= 45.0"
1414
]
1515

1616
[project.urls]

0 commit comments

Comments
 (0)