Jelajahi Sumber

add danger notice about username lookups

- linked to more info further down with detailed description
- removed all mentions of usernames where applicable
jomo 9 tahun lalu
induk
melakukan
e844c05dd2
2 mengubah file dengan 32 tambahan dan 48 penghapusan
  1. 3 22
      lib/public/stylesheets/style.css
  2. 29 26
      lib/views/index.html.ejs

+ 3 - 22
lib/public/stylesheets/style.css

@@ -13,11 +13,6 @@ a {
   color: #00B7FF;
 }
 
-a.anchor {
-  position: relative;
-  top: -50px;
-}
-
 a.forkme {
   top: 0;
   right: 0;
@@ -47,22 +42,8 @@ a.sponsor {
   margin: 5px;
 }
 
-.container > .navbar-header {
-  display: inline-block;
-  margin: inherit;
-}
-
-a.navbar-brand.twitter {
-  color: #55acee;
-}
-
-a.navbar-brand.twitter:before {
-  content: "";
-  background: url("/images/twitter.png");
-  display: inline-block;
-  height: 16px;
-  width: 16px;
-  vertical-align: middle;
+.alert {
+  font-size: 1rem;
 }
 
 mark.green {
@@ -81,7 +62,7 @@ thead {
   margin-left: auto;
 }
 
-h1, h2, h3, h4, h5, h6 {
+h1, h2, h3, h4, h6 {
   font-weight: 200;
 }
 

+ 29 - 26
lib/views/index.html.ejs

@@ -53,13 +53,18 @@
   </div>
   <div class="container">
     <section id="documentation">
+      <div class="alert alert-danger" role="alert">
+        <h5>Usernames are deprecated!</h5>
+        You should only use usernames for <i>testing</i>.<br>
+        Updates are slower, some features are not available, and it may <strong>break anytime</strong>!<br>
+        <i>We strongly advise you to use UUIDs instead of usernames.</i> <small><a href="#usernames">more info</a></small>
+      </div>
+
       <h2>Documentation</h2>
       <div class="row">
         <section>
-          <a id="avatars" class="anchor"></a><a href="#avatars"><h3>Avatars</h3></a>Replace
-          <mark class="green"> userid</mark> with a Mojang <b>UUID</b> or <b>username</b> to get the related head. All images are PNGs.
-          <div class="code"><%= domain %>/avatars/
-            <mark class="green">userid</mark>
+          <a id="avatars" class="anchor"></a><a href="#avatars"><h3>Avatars</h3></a>
+          <div class="code"><%= domain %>/avatars/<mark class="green">uuid</mark>
           </div>
           <section>
             <a id="avatar-parameters" class="anchor"></a><a href="#avatar-parameters"><h4>Avatar Parameters</h4></a>
@@ -84,8 +89,8 @@
                   <td>string</td>
                   <td>The standard value is calculated based on the UUID (even = MHF_Alex, odd = MHF_Steve).<br>
                     Usernames always default to MHF_Steve.</td>
-                  <td>The image to be served when the userid has no skin.<br>
-                    Valid options are any userid, including<a href="/avatars/0?default=MHF_Steve"> MHF_Steve</a> and<a href="/avatars/0?default=MHF_Alex"> MHF_Alex</a>, or a custom URL.</td>
+                  <td>The image to be served when the player has no skin.<br>
+                    Valid options are any name or uuid, including<a href="/avatars/0?default=MHF_Steve"> MHF_Steve</a> and<a href="/avatars/0?default=MHF_Alex"> MHF_Alex</a>, or a custom URL.</td>
                 </tr>
                 <tr>
                   <td>helm</td>
@@ -132,8 +137,7 @@
           <a id="renders" class="anchor"></a><a href="#renders"><h3>3D Renders</h3></a>
           <p>Crafatar also provides support for 3D renders of Minecraft skins.<br>
             Please note that <b>this feature is currently beta</b>!<br>
-            Replace
-            <mark class="green"> userid</mark> with a Mojang <b>UUID</b> or <b>username</b> to get a render of the skin. The <b>head</b> render type returns a render of the skin's head.<span class="code"><%= domain %>/renders/head/<mark class="green">userid</mark></span>The <b>body</b> render returns a render of the entire skin.<span class="code"><%= domain %>/renders/body/<mark class="green">userid</mark></span></p>
+            The <b>head</b> render type returns a render of the skin's head.<span class="code"><%= domain %>/renders/head/<mark class="green">uuid</mark></span>The <b>body</b> render returns a render of the entire skin.<span class="code"><%= domain %>/renders/body/<mark class="green">uuid</mark></span></p>
           <section>
             <a id="render-parameters" class="anchor"></a><a href="#render-parameters"><h4>Render Parameters</h4></a>
             <table class="table table-striped">
@@ -163,8 +167,8 @@
                   <td>string</td>
                   <td>The standard value is calculated based on the UUID (even = MHF_Alex, odd = MHF_Steve).<br>
                     Usernames always default to MHF_Steve.</td>
-                  <td>The image to be served when the userid has no skin.<br>
-                    Valid options are any userid, including<a href="/renders/body/0?default=MHF_Steve"> MHF_Steve</a> and<a href="/renders/body/0?default=MHF_Alex"> MHF_Alex</a>, or a custom URL.</td>
+                  <td>The image to be served when the uuid has no skin.<br>
+                    Valid options are any uuid, including<a href="/renders/body/0?default=MHF_Steve"> MHF_Steve</a> and<a href="/renders/body/0?default=MHF_Alex"> MHF_Alex</a>, or a custom URL.</td>
                 </tr>
               </tbody>
             </table>
@@ -188,10 +192,8 @@
         <section>
           <a id="skins" class="anchor"></a><a href="#skins"><h3>Skins</h3></a>
           <p>You can also get the full skin file of a player.<br>
-            Replace
-            <mark class="green"> userid</mark> with a Mojang <b>UUID</b> or <b>username</b> to get the related skin.<br>
             The user's skin is returned, or the default image is served.<br>
-            You can use the default parameter here as well.<span class="code"><%= domain %>/skins/<mark class="green">userid</mark></span></p>
+            You can use the default parameter here as well.<span class="code"><%= domain %>/skins/<mark class="green">uuid</mark></span></p>
           <section>
             <a id="skin-parameters" class="anchor"></a><a href="#skin-parameters"><h4>Skin Parameters</h4></a>
             <table class="table table-striped">
@@ -209,8 +211,8 @@
                   <td>string</td>
                   <td>The standard value is calculated based on the UUID (even = MHF_Alex, odd = MHF_Steve).<br>
                     Usernames always default to MHF_Steve.</td>
-                  <td>The image to be served when the userid has no skin.<br>
-                    Valid options are any userid, including<a href="/skins/0?default=MHF_Steve"> MHF_Steve</a> and<a href="/skins/0?default=MHF_Alex"> MHF_Alex</a>, or a custom URL.</td>
+                  <td>The image to be served when the uuid has no skin.<br>
+                    Valid options are any uuid, including<a href="/skins/0?default=MHF_Steve"> MHF_Steve</a> and<a href="/skins/0?default=MHF_Alex"> MHF_Alex</a>, or a custom URL.</td>
                 </tr>
               </tbody>
             </table>
@@ -234,11 +236,8 @@
         <section>
           <a id="capes" class="anchor"></a><a href="#capes"><h3>Capes</h3></a>
           <p>A cape endpoint is also available to get the active cape of a user.<br>
-            Replace
-            <mark class="green"> userid</mark> with a Mojang <b>UUID</b> or <b>username</b> to get the related cape.<br>
               The user's cape is returned, otherwise a 404 is returned.<br>
-                          <div class="code"><%= domain %>/capes/
-              <mark class="green">userid</mark>
+              <div class="code"><%= domain %>/capes/<mark class="green">uuid</mark>
             </div>
           </p>
           <section>
@@ -282,7 +281,7 @@
                 <li><b>downloaded</b>: 2 external requests. First request or skin changed, skin downloaded.</li>
                 <li><b>server error</b>: This can happen, for example, when Mojang's servers are down.<br>
                   If possible, a cached image is served instead.</li>
-                <li><b>user error</b>: You have done something wrong, such as requesting a malformed userid.<br>
+                <li><b>user error</b>: You have done something wrong, such as requesting a malformed uuid.<br>
                   Check the response body for details.</li>
               </ul>
             </section>
@@ -292,12 +291,16 @@
                 If you think something is wrong with your request, please <a href="#contact">contact us</a> and provide this ID.</p>
             </section>
           </section>
-          <section>
-            <a id="meta-about-usernames" class="anchor"></a><a href="#meta-about-usernames"><h3>About Usernames</h3></a>
-            <p>We strongly advise you to use UUIDs instead of usernames in production.<br>
-              Usernames are deprecated by Mojang and you should only use usernames for testing.<br>
-              You don't have to change anything when using UUIDs and someone changes their Username.<br>
-              Malformed usernames are rejected.</p>
+          <section id="usernames">
+            <a href="#usernames"><h3>About Usernames</h3></a>
+            <p>
+              We <strong>strongly</strong> advise you to use UUIDs instead of usernames! UUIDs never change while usernames do.<br>
+              Looking up players by username has officially been deprecated by Mojang ever since UUIDs were introduced.<br>
+              Crafatar uses a legacy API to retrieve skins for usernames that updates very slowly.<br>
+              Skins come without any details, including whether a player uses the Alex or Steve skin model.<br>
+              Additionally, Mojang has stated that this legacy interface may be disabled anytime, causing all requests to fail.<br>
+              Malformed usernames are rejected.
+            </p>
           </section>
           <section>
             <a id="meta-about-uuids" class="anchor"></a><a href="#meta-about-uuids"><h3>About UUIDs</h3></a>