diff --git a/labelbase/models.py b/labelbase/models.py index 146951b..983a360 100644 --- a/labelbase/models.py +++ b/labelbase/models.py @@ -22,6 +22,10 @@ class Labelbase(models.Model): class Label(models.Model): + """ + Reference: + https://github.com/bitcoin/bips/blob/master/bip-0329.mediawiki + """ TYPE_TX = "tx" TYPE_ADDR = "addr" TYPE_PUBKEY = "pubkey" @@ -56,6 +60,28 @@ class Label(models.Model): blank=True, ) ) + origin = encrypt( + models.CharField( + help_text=("Optional key origin information referencing the wallet " + "associated with the label. The origin property should " + "only appear where type is 'tx'.") + max_length=160, + default="", + blank=True, + ) + ) + spendable = encrypt( + models.BooleanField( + help_text=("One of true or false, denoting if an output should be " + "spendable by the wallet. The spendable property only " + "where type is 'output'.") + max_length=160, + default=False, + ) + ) + + + labelbase = models.ForeignKey(Labelbase, on_delete=models.CASCADE) def get_absolute_url(self): diff --git a/labelbase/tests.py b/labelbase/tests.py deleted file mode 100644 index 7ce503c..0000000 --- a/labelbase/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/labellabor/settings.py b/labellabor/settings.py index 69245f3..1eb6afe 100644 --- a/labellabor/settings.py +++ b/labellabor/settings.py @@ -128,8 +128,7 @@ DATABASES = { "USER": proj_config.get("database", "user"), "OPTIONS": {"charset": "utf8mb4"}, "PASSWORD": proj_config.get("database", "password"), - #'HOST': 'de', # This should match the service name defined in the docker-compose.yml for the MySQL container. - 'HOST': proj_config.get("database", "localhost"), + 'HOST': 'localhost', 'PORT': 3306, } } diff --git a/labellabor/urls.py b/labellabor/urls.py index a2a53de..53ef4ca 100644 --- a/labellabor/urls.py +++ b/labellabor/urls.py @@ -21,6 +21,7 @@ from .views import ( LabelbaseFormView, LabelbaseUpdateView, FaqView, + AboutView, ) from importer.views import upload_labels from exporter.views import stream_labels_as_jsonl @@ -29,12 +30,31 @@ from django.contrib.auth import views as auth_views urlpatterns = [ # path('api/labelbase//label//', api.label), - path("api/v0/labelbase/", LabelbaseAPIView.as_view()), - path("api/v0/labelbase//", LabelbaseAPIView.as_view()), - path("api/v0/labelbase//label/", LabelAPIView.as_view()), - path("api/v0/labelbase//label//", LabelAPIView.as_view()), - path("api-reference/", include_docs_urls(title="Labelbase API")), - path("account/apikey/", login_required(APIKeyView.as_view()), name="apikey"), + path( + "api/v0/labelbase/", + LabelbaseAPIView.as_view() + ), + path( + "api/v0/labelbase//", + LabelbaseAPIView.as_view() + ), + path( + "api/v0/labelbase//label/", + LabelAPIView.as_view() + ), + path( + "api/v0/labelbase//label//", + LabelAPIView.as_view() + ), + path( + "api-reference/", + include_docs_urls(title="Labelbase API") + ), + path( + "account/apikey/", + login_required(APIKeyView.as_view()), + name="apikey" + ), path( "account/userprofile/", login_required(ProfileView.as_view()), @@ -55,14 +75,18 @@ urlpatterns = [ login_required(LabelbaseUpdateView.as_view()), name="edit_labelbase", ), - path("labelbase/import/", upload_labels, name="import_labels"), + path("labelbase/import/", + upload_labels, + name="import_labels"), path( "labelbase/export//", stream_labels_as_jsonl, name="export_labels", ), path( - "labelbase/", login_required(LabelbaseFormView.as_view()), name="labelbase_new" + "labelbase/", + login_required(LabelbaseFormView.as_view()), + name="labelbase_new" ), # path('labelbase//label//edit/', login_required(LabelUpdateView.as_view()), name='edit_label'), path( @@ -75,8 +99,15 @@ urlpatterns = [ login_required(LabelDeleteView.as_view()), name="del_label", ), - path("account/logout/", LogoutView.as_view(), name="logout"), - path("account/register/", RegistrationView.as_view(), name="registration"), + path( + "account/logout/", + LogoutView.as_view(), + name="logout" + ), + path( + "account/register/", + RegistrationView.as_view(), + name="registration"), path( "account/register/done/", RegistrationCompleteView.as_view(), @@ -85,15 +116,40 @@ urlpatterns = [ path( "account/change-password/", auth_views.PasswordChangeView.as_view( - template_name="change_password.html", success_url="/" + template_name="change_password.html", + success_url="/" ), name="change_password", ), - path("privacy-policy", PrivacyView.as_view(), name="privacy_policy"), - path("terms", TermsView.as_view(), name="terms"), - path("faq", FaqView.as_view(), name="faq"), - path("", HomeView.as_view(), name="home"), - path("", include(tf_urls)), - path("", include("user_sessions.urls", "user_sessions")), - path("admin/", admin.site.urls), + path( + "privacy-policy", + PrivacyView.as_view(), + name="privacy_policy"), + path( + "terms", + TermsView.as_view(), + name="terms"), + path( + "faq", + FaqView.as_view(), + name="faq"), + path( + "about", + AboutView.as_view(), + name="about"), + path( + "", + HomeView.as_view(), + name="home"), + path( + "", + include(tf_urls)), + path( + "", + include("user_sessions.urls", "user_sessions") + ), + path( + "admin/", + admin.site.urls + ), ] diff --git a/labellabor/views.py b/labellabor/views.py index 6c489b4..5a0083e 100644 --- a/labellabor/views.py +++ b/labellabor/views.py @@ -16,6 +16,9 @@ from labelbase.forms import LabelForm, LabelbaseForm from django.http import HttpResponseRedirect from rest_framework.authtoken.models import Token +class AboutView(TemplateView): + template_name = "about.html" + class HomeView(TemplateView): template_name = "home.html" diff --git a/templates/_base.html b/templates/_base.html index dac6710..109651d 100644 --- a/templates/_base.html +++ b/templates/_base.html @@ -269,6 +269,9 @@ body { +
  • diff --git a/templates/about.html b/templates/about.html new file mode 100644 index 0000000..9b7ca82 --- /dev/null +++ b/templates/about.html @@ -0,0 +1,34 @@ +{% extends "_base.html" %} +{% load i18n %} + +{% block title %}About{% endblock %} +{% block nav_home %}active{% endblock %} + +{% block content %} + +
    +

    Lbelbase

    +

    All your labels in one place.

    +
    + + + + +
    +

    About

    + +

    +

      +
    1. +
    2. +
    +

    +
    + +{% endblock %} diff --git a/templates/faq.html b/templates/faq.html index b99d95e..81b06ac 100644 --- a/templates/faq.html +++ b/templates/faq.html @@ -8,7 +8,7 @@ @@ -20,7 +20,7 @@ -
    +

    Frequently Asked Questions

    @@ -48,7 +48,7 @@

    - +
    {#% include "footer.html" %#} {% comment %} diff --git a/templates/home.html b/templates/home.html index 57e7cb7..910f109 100644 --- a/templates/home.html +++ b/templates/home.html @@ -1,30 +1,27 @@ {% extends "_base.html" %} {% load i18n %} - {% block title %}Labelbase{% endblock %} {% block nav_home %}active{% endblock %} {% block content %}

    Lbelbase

    All your labels in one place.

    -

    Labelbase is a label management service for Bitcoin transactions and addresses.

    -

    Labelbase provides features for adding labels, importing and exporting labels, and offers a public API for integration with wallets and existing workflows.
    +

    Labelbase is a label management service for Bitcoin transactions and addresses.

    +

    Labelbase provides features for adding labels, importing and exporting labels, and offers a public API for integration with wallets and existing workflows.
    This ensures that you always have access to the most up-to-date information.

    -

    Labelbase supports BIP-329, a format for unifying label data.

    +

    Labelbase supports BIP-329, a format for unifying label data.

    -
    +
    @@ -75,7 +72,7 @@ {% if request.user.is_superuser %} {% comment %} -
    +
    diff --git a/templates/privacy.html b/templates/privacy.html index e6fbaef..1899285 100644 --- a/templates/privacy.html +++ b/templates/privacy.html @@ -8,7 +8,7 @@ @@ -20,7 +20,7 @@ -
    +

    Privacy Policy

    The privacy policy on this website specifically applies to the labelbase.space web application, which is hosted by the Labelbase team.
    Last updated: July 26th 2023.
    diff --git a/templates/terms.html b/templates/terms.html index f1fa040..a71db0d 100644 --- a/templates/terms.html +++ b/templates/terms.html @@ -8,7 +8,7 @@ @@ -20,7 +20,7 @@ -
    +

    Terms of Service

    February 10th 2023