Skip to content

Commit 99c4d81

Browse files
committed
updates
1 parent 3ef2d9f commit 99c4d81

10 files changed

+21
-129
lines changed

ark/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def clean(self):
131131

132132
@classmethod
133133
def create(cls, naan: Naan, shoulder: Shoulder):
134-
noid = generate_noid(8)
134+
noid = generate_noid(env("ARKLET_NOID_LENGTH"))
135135
ark_prefix = f"{naan.naan}{shoulder.shoulder}"
136136
base_ark_string = f"{ark_prefix}{noid}"
137137
check_digit = noid_check_digit(base_ark_string)

ark/views.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from django.http import (
88
Http404,
99
HttpRequest,
10-
HttpResponse,
1110
HttpResponseBadRequest,
1211
HttpResponseForbidden,
1312
HttpResponseNotAllowed,
@@ -322,4 +321,9 @@ def batch_mint_arks(request):
322321
return JsonResponse({
323322
'num_received': len(records),
324323
'arks_created': [ark_to_json(c, metadata=False) for c in created]
324+
})
325+
326+
def status(request):
327+
return JsonResponse({
328+
'status': 'ok!',
325329
})

arklet/settings.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
ARKLET_SENTRY_TRANSACTIONS_PER_TRACE=(int, 1),
3131
ARKLET_STATIC_ROOT=(str, "static"),
3232
ARKLET_MEDIA_ROOT=(str, "media"),
33-
RESOLVER=(bool, False)
33+
RESOLVER=(bool, False),
34+
ARKLET_NOID_LENGTH=(int, 8)
3435
)
3536

3637
# .env files are optional. django-environ will log an INFO message if no file is found

arklet/urls.py

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
resolverpatterns = [
3232
re_path(r"^(resolve/)?(?P<ark>ark:/?.*$)", views.resolve_ark, name="resolve_ark"),
33+
path("", views.status, name="status"),
3334
]
3435

3536
combinedpatterns = minterpatterns + resolverpatterns

docker-compose.prod.yml

-36
This file was deleted.

docker-compose.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
container_name: arklet_db
66
image: postgres:14-alpine
77
env_file:
8-
- ./docker/env.postgres.local
8+
- ./docker/env.local
99
volumes:
1010
- postgres:/var/lib/postgresql/data
1111
restart: always
@@ -25,8 +25,9 @@ services:
2525
- ./ark_import:/app/ark_import
2626
- ./arklet:/app/arklet
2727
env_file:
28-
- ./docker/env.postgres.local
29-
- ./docker/env.minter.local
28+
- ./docker/env.local
29+
environment:
30+
ARKLET_PORT: "8001"
3031
ports:
3132
- "8001:8001"
3233

@@ -43,8 +44,10 @@ services:
4344
- ./ark_import:/app/ark_import
4445
- ./arklet:/app/arklet
4546
env_file:
46-
- ./docker/env.postgres.local
47-
- ./docker/env.resolver.local
47+
- ./docker/env.local
48+
environment:
49+
ARKLET_PORT: "8000"
50+
RESOLVER: "true"
4851
ports:
4952
- "8000:8000"
5053

docker/env.local

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ARKLET_DJANGO_SECRET_KEY=local-test-secret ##ggignore
22
ARKLET_DEBUG=True
33
ARKLET_HOST=127.0.0.1
4+
ARKLET_NOID_LENGTH=8
45

56
# Would be nice to undup these eventually
67
POSTGRES_DB=arklet
@@ -16,4 +17,4 @@ POSTGRES_HOST=postgres
1617
ARKLET_POSTGRES_HOST=postgres
1718

1819
POSTGRESQL_PORT=5432
19-
ARKLET_POSTGRES_PORT=5432
20+
ARKLET_POSTGRES_PORT=5432

docker/env.prod.example

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ ARKLET_DJANGO_SECRET_KEY=
22

33
ARKLET_DEBUG=False
44
ARKLET_HOST=ark.frick.org
5+
ARKLET_NOID_LENGTH=8
56

67
# Would be nice to undup these eventually
78
POSTGRES_DB=arklet
@@ -17,4 +18,4 @@ POSTGRES_HOST=
1718
ARKLET_POSTGRES_HOST=
1819

1920
POSTGRESQL_PORT=25060
20-
ARKLET_POSTGRES_PORT=25060
21+
ARKLET_POSTGRES_PORT=25060

ui/create_ark.py

-43
This file was deleted.

ui/update_ark.py

-40
This file was deleted.

0 commit comments

Comments
 (0)