documented the schema by hand ffs

its Done© (for now)
This commit is contained in:
Artemis 2025-02-02 16:43:43 +01:00
parent 54a21bcb8b
commit f47b350eee
6 changed files with 165 additions and 4 deletions

View file

@ -68,6 +68,10 @@ ol {
padding-left: 2ch;
}
ol>li:not(:last-of-type) {
margin-bottom: .5em;
}
h1>a {
text-decoration: none;
color: var(--clr-txt-on-dark);
@ -77,6 +81,10 @@ a {
color: var(--clr-error-primary-40);
}
a[target="_blank"][rel="noopener"]::after {
content: '🗗';
}
input,
select,
button,

View file

@ -22,6 +22,16 @@ pub async fn list_archived(db: &mut DbHook, from: &Uuid) -> sqlx::Result<Vec<i32
.await
}
pub async fn list_all(db: &mut DbHook, from: &Uuid) -> sqlx::Result<Vec<DollProfile>> {
sqlx::query_as!(
DollProfile,
"select * from doll_profiles where bound_to_id = $1",
from
)
.fetch_all(&mut **db)
.await
}
pub async fn get(
db: &mut DbHook,
ident: i32,

View file

@ -212,7 +212,7 @@ pub async fn export_data(
user: User,
client_ip: IpAddr,
) -> RawResult<Json<DataDump>> {
let tags = doll::list(&mut *db, &user.id).await?;
let tags = doll::list_all(&mut *db, &user.id).await?;
let reserved_tags = doll::list_archived(&mut *db, &user.id).await?;
warn!(

View file

@ -203,7 +203,11 @@ pub async fn handle_register(
);
session::login(cookies, &account_id);
Ok(Redirect::to(uri!("/")).into())
Ok(Redirect::to(uri!(
"/account",
crate::routes::form::register_tag::show_register
))
.into())
}
#[get("/logout")]

View file

@ -2,4 +2,143 @@
{% block title %}About Doll.Tags - {% endblock title %}
{% block main %}
<p>
Doll.Tags allows you to create and have your own pet profile pages, including stuff like identifying information,
handler contact, etc
(<a href="https://dolltags.pet/profile?ident=134621" target="_blank" rel="noopener">here's an example</a>)
</p>
<section id="howto" class="raised">
<p>How to create a tag?</p>
<ol>
<li>Go to <a href="/login">the log-in page</a>, which also allows you to register, and click on the register
link</li>
<li>Fill out your username and password and check the verification checkbox (the e-mail is optional)</li>
<li>Once your account is created, you'll land on the tag registration form</li>
<li>Fill it out, and you now have a tag!</li>
</ol>
</section>
<p>
See it as the equivalent for those ID services you have for your pets where you can put a little QrCode or NFC chip
on their collar and it would forward any passerby who may have found it roaming around to a page where they can know
how to contact you,
except it's for your more kinky relationships who may enjoy having it!
</p>
<section id="feedback">
<h2>Questions or feedback? Want to add some fields?</h2>
<p>i'm always open to your feedback and ideas on how to expand Doll.Tags, so feel free to send me a message at
<code>feedback [@] dolltags.pet</code> and i'll try to respond quickly.
</p>
<p>If you experience any issue with the service, or would like to have your account changed deleted but cannot do so
through
<a href="/account/settings#account-delete">the account settings page</a>, you can of course send an e-mail for
that too.
</p>
<!-- TODO: contact form here too once SMTP is implemented -->
</section>
<section id="export-format">
<h2>About the account data export format</h2>
<p>
You'll note that in <a href="/account/settings#data-export">the accounts settings page</a>, there is an "Export
all my data" button.<br />
This generates a JSON file containing all your data and all data related to your account.
</p>
<p>Here's the format description of this document.</p>
<section class="raised">
<details>
<summary>Data export format description</summary>
<p>
In the descriptions, "entity" refers to the tag holder (alternative words could be doll, pet, etc;
entity is used as generic).<br />
All timestamps are with time zone.
</p>
<article>
<ul>
<li>
<code>account</code> (object): your account
<ul>
<li><code>id</code> (UUID): the account's internal ID</li>
<li><code>created_at</code> (timestamp): when the account was created</li>
<li><code>updated_at</code> (null or timestamp): when the account was last updated; null if
it never was</li>
<li><code>username</code> (string): the account's username</li>
<li><code>password</code> (string): the account's password, in hashed form</li>
<li><code>email</code> (null or string): the account's e-mail, if there's one</li>
<li><code>enabled</code> (boolean): true if the account is enabled</li>
<li><code>is_admin</code> (boolean): true if the account is an admin account</li>
</ul>
</li>
<li>
<code>tags</code> (list of objects): non-archived tags
<ul>
<li><code>id</code> (int): the tag's 6-digit ID</li>
<li><code>microchip_id</code> (null or string): the tag's microchip id, if there's one</li>
<li><code>created_at</code> (timestamp): when the tag was created</li>
<li><code>updated_at</code> (null or timestamp): when the tag was last updated; null if it
never was</li>
<li><code>archived_at</code> (null or timestamp): null if the tag isn't archived, otherwise
notes when the tag was archived</li>
<li><code>bound_to_id</code> (UUID): the account this tag belongs to; should be the same as
<code>account.id</code>
</li>
<li><code>name</code> (string): the pet name of the entity this tag is assigned to</li>
<li>
<code>pronoun_subject</code>, <code>pronoun_object</code>,
<code>pronoun_possessive</code>
(string): the three parts of an entity's pronouns (e.g. <code>she / her / hers</code>)
</li>
<li><code>handler_name</code> (string): the name of the entity's handler</li>
<li><code>handler_link</code> (null or string): the link to contact the handler</li>
<li><code>kind</code> (null or string): what kind of being the entity is</li>
<li><code>breed</code> (null or string): what breed the entity is</li>
<li>
<code>behaviour</code> (null or string): what behaviour is generally shown by the entity
</li>
<li><code>description</code> (null or string): a brief description about the entity</li>
<li>
<code>chassis_type</code>, <code>chassis_id</code>, <code>chassis_color</code> (null or
string): if the entity has a chassis, some info about that chassis
</li>
</ul>
</li>
<li>
<code>reserved_tags</code> (list of int): the list of all tags you created then archived
</li>
</ul>
</article>
</details>
</section>
</section>
<section id="technical">
<h2>About the project and its hosting</h2>
<p>
The project is open-source, a more global page about it and its tech info is available
<a href="https://www.aphrodite.dev/~notebook/projects/dolltags.html">on my garden</a>.
</p>
<p>
It's hosted in France, backups are encrypted and hosted in France (AWS, private hosting) and the US
(backblaze).<br />
No other service is being used, no data leaves the dolltags server, and no data is used for anything else but
dolltags.
</p>
</section>
{% endblock main %}

View file

@ -66,7 +66,7 @@
</form>
</div>
<section>
<section id="data-export">
<h3>Exporting your data</h3>
<p>You can export all your account's data using this button.</p>
@ -75,7 +75,7 @@
<a href="/account/data_dump" class="btn">Export all my data</a>
</section>
<section>
<section id="account-delete">
<h3>Deleting your account</h3>
<p>You can delete your account by clicking on the button below.</p>