Compare commits

...
Sign in to create a new pull request.

4 commits

Author SHA1 Message Date
1f0589ae75 oops adding the missing request 2025-02-02 17:06:01 +01:00
7de6dd500d added info footer 2025-02-02 16:56:48 +01:00
f47b350eee documented the schema by hand ffs
its Done© (for now)
2025-02-02 16:43:43 +01:00
54a21bcb8b added base route for html proto 2025-02-01 15:47:17 +01:00
10 changed files with 318 additions and 4 deletions

View file

@ -0,0 +1,130 @@
{
"db_name": "PostgreSQL",
"query": "select * from doll_profiles where bound_to_id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int4"
},
{
"ordinal": 1,
"name": "microchip_id",
"type_info": "Varchar"
},
{
"ordinal": 2,
"name": "created_at",
"type_info": "Timestamptz"
},
{
"ordinal": 3,
"name": "updated_at",
"type_info": "Timestamptz"
},
{
"ordinal": 4,
"name": "name",
"type_info": "Varchar"
},
{
"ordinal": 5,
"name": "pronoun_subject",
"type_info": "Varchar"
},
{
"ordinal": 6,
"name": "pronoun_object",
"type_info": "Varchar"
},
{
"ordinal": 7,
"name": "pronoun_possessive",
"type_info": "Varchar"
},
{
"ordinal": 8,
"name": "handler_name",
"type_info": "Varchar"
},
{
"ordinal": 9,
"name": "handler_link",
"type_info": "Varchar"
},
{
"ordinal": 10,
"name": "kind",
"type_info": "Varchar"
},
{
"ordinal": 11,
"name": "breed",
"type_info": "Varchar"
},
{
"ordinal": 12,
"name": "behaviour",
"type_info": "Varchar"
},
{
"ordinal": 13,
"name": "description",
"type_info": "Varchar"
},
{
"ordinal": 14,
"name": "chassis_type",
"type_info": "Varchar"
},
{
"ordinal": 15,
"name": "chassis_id",
"type_info": "Varchar"
},
{
"ordinal": 16,
"name": "chassis_color",
"type_info": "Varchar"
},
{
"ordinal": 17,
"name": "bound_to_id",
"type_info": "Uuid"
},
{
"ordinal": 18,
"name": "archived_at",
"type_info": "Timestamptz"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false,
true,
false,
true,
false,
false,
false,
false,
false,
true,
true,
true,
true,
true,
true,
true,
true,
false,
true
]
},
"hash": "e3234918965fd36a56fc48fc78956b53c8a84f08e0424d63e930f9dcfc449175"
}

View file

@ -63,11 +63,23 @@ body {
max-width: 700px;
}
footer {
margin-top: 2em;
padding-top: .5em;
border-top: 1pt solid var(--clr-primary-a50);
font-size: 0.9em;
text-align: center;
}
ul,
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 +89,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

@ -80,6 +80,7 @@ fn rocket() -> _ {
"/",
routes![
public::index,
public::about,
public::short_url,
public::show_profile,
accounts::show_register,

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

@ -27,6 +27,11 @@ pub fn index(
)
}
#[get("/about")]
pub fn about(meta: CommonTemplateState) -> Template {
Template::render("about", context! {meta})
}
#[get("/profile/<id>")]
pub fn short_url(id: &str) -> Redirect {
Redirect::to(uri!(show_profile(Some(id), Some(""))))

144
templates/about.html.tera Normal file
View file

@ -0,0 +1,144 @@
{% extends "base" %}
{% 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>

View file

@ -24,6 +24,10 @@
{% block main %}
{% endblock main %}
</main>
<footer>
Doll.Tags - <a href="/about">About & Contact</a>
</footer>
</body>
</html>