Browse Source

Update logic to work.

jackyalcine 1 month ago
parent
commit
e26e99e90c
Signed by: Jacky Alciné <yo@jacky.wtf> GPG Key ID: 537A4F904B15268D

+ 5
- 0
.gitignore View File

@@ -20,3 +20,8 @@ node_modules
20 20
 *.map
21 21
 priv/static/assets
22 22
 priv/mnesia
23
+priv/static/robots-067185ba27a5d9139b10a759679045bf.txt.gz
24
+priv/static/robots.txt.gz
25
+priv/static/*.gz
26
+parcel*.log
27
+priv/static/*

+ 2
- 2
.tool-versions View File

@@ -1,2 +1,2 @@
1
-nodejs 10.14.0
2
-elixir 1.7.4
1
+nodejs 10.15.3
2
+elixir 1.8.2

+ 4
- 4
docker/scripts/post-deploy.sh View File

@@ -3,11 +3,11 @@
3 3
 cd /opt/fortress || exit 10
4 4
 
5 5
 echo " ----> [deploy:pre] Installing needed CLI tools..."
6
-npm install || exit 20
7
-npm install --global parcel-bundler || exit 30
6
+npm install -g npm@latest npx@latest parcel-bundler || exit 20
7
+npm install || exit 21
8 8
 
9 9
 echo " ----> [deploy:pre] Building static resources..."
10
-npm run build || exit 40
10
+npm run build || exit 22
11 11
 
12 12
 echo " ----> [deploy:pre] Update static digests..."
13
-mix phx.digest || exit 50
13
+mix phx.digest || exit 30

+ 3
- 1
package-lock.json View File

@@ -9095,12 +9095,14 @@
9095 9095
     "tachyons-custom": {
9096 9096
       "version": "4.9.6",
9097 9097
       "resolved": "https://registry.npmjs.org/tachyons-custom/-/tachyons-custom-4.9.6.tgz",
9098
-      "integrity": "sha512-HsrN1C8GTj9Tr8Ki4XMZdd1ye2O8YLVUXNAJiga3DzcdY4pRuEMYcvjOk0wAGEdVgePPSAWAsE+CWNZzNagEJw=="
9098
+      "integrity": "sha512-HsrN1C8GTj9Tr8Ki4XMZdd1ye2O8YLVUXNAJiga3DzcdY4pRuEMYcvjOk0wAGEdVgePPSAWAsE+CWNZzNagEJw==",
9099
+      "dev": true
9099 9100
     },
9100 9101
     "tachyons-sass": {
9101 9102
       "version": "4.9.5",
9102 9103
       "resolved": "https://registry.npmjs.org/tachyons-sass/-/tachyons-sass-4.9.5.tgz",
9103 9104
       "integrity": "sha512-GPPUIoM+8OkaHF7Ii8+AE5AQzVekfrRnGv55oXYTspXw8BMThmiXr/HrCUmYGiuSnBG73T0862tvzqLGP8B/Mg==",
9105
+      "dev": true,
9104 9106
       "requires": {
9105 9107
         "tachyons-custom": "^4.9.5"
9106 9108
       }

+ 2
- 2
package.json View File

@@ -8,8 +8,8 @@
8 8
     "test": "web/static/js/test"
9 9
   },
10 10
   "scripts": {
11
-    "watch": "parcel watch web/static/images/* web/static/images/**/* web/static/js/*.ts web/static/js/*.js web/static/*.scss --out-dir priv/static/assets --cache-dir tmp/parcel --global Fortress",
12
-    "build": "parcel build web/static/images/* web/static/images/**/* web/static/js/*.ts web/static/js/*.js web/static/*.scss --out-dir priv/static/assets --cache-dir tmp/parcel --log-level 5 --global Fortress --detailed-report"
11
+    "watch": "npx parcel watch web/static/images/* web/static/images/**/* web/static/js/*.ts web/static/js/*.js web/static/*.scss --out-dir priv/static/assets --cache-dir tmp/parcel --global Fortress",
12
+    "build": "npx parcel build web/static/images/* web/static/images/**/* web/static/js/*.ts web/static/js/*.js web/static/*.scss --out-dir priv/static/assets --cache-dir tmp/parcel --log-level 5 --global Fortress --detailed-report"
13 13
   },
14 14
   "repository": {
15 15
     "type": "git",

web/controllers/oauth_controller.ex → web/controllers/oauth2_controller.ex View File

@@ -16,7 +16,7 @@ defmodule Fortress.Web.OAuth2Controller do
16 16
 
17 17
   def callback(%{assigns: %{ueberauth_auth: auth}} = conn, params) do
18 18
     case Fortress.Site.validate_auth(conn) do
19
-      {:ok,state} ->
19
+      {:ok, state} ->
20 20
         conn
21 21
         |> put_flash(:info, "Successfully authenticated.")
22 22
         |> put_session(:me, state.site)

+ 4
- 0
web/templates/layout/app.html.eex View File

@@ -63,6 +63,10 @@
63 63
           <%= get_flash(@conn, :success) %>
64 64
         </p>
65 65
       <% end %>
66
+      <p class="flex ma0 lh-copy w-100 items-center justify-center pa3 bg-washed-yellow near-black bb b--yellow bw1">
67
+        <i data-feather="alert-triangle" class="mr2 animated delay-3 fadeOut"></i>
68
+        <span>Fortress is <strong>alpha software</strong> and not yet ready for production use.</span>
69
+      </p>
66 70
       <%= render @view_module, @view_template, assigns %>
67 71
     </main>
68 72
     <footer class="bg-near-black white-80 pv5 pv6-l ph4">

+ 2
- 104
web/templates/page/index.html.eex View File

@@ -18,7 +18,7 @@
18 18
             <input type="hidden" name="client_id" value="<%= page_url(@conn, :index) %>" />
19 19
             <div class="measure-wide">
20 20
               <label for="me" class="f6 b db pl3 mb2">URI</label>
21
-              <input id="me" name="me" class="f4 code input-reset ba b--black-20 pa3 mb2 db w-100" type="url" aria-describedby="me-desc">
21
+              <input placeholder="https://my.uri.on.the.web" id="me" name="me" class="f4 code input-reset ba b--black-20 pa3 mb2 db w-100" type="url" aria-describedby="me-desc">
22 22
               <small id="me-desc" class="f6 black-60 db pl3 mb2">A Web resource that <em>you</em> own.</small>
23 23
             </div>
24 24
             <button class="input-reset button-reset f6 mt3 link dim bw1 ba pointer grow animate b--black br3 ph3 pv2 mb2 dib white bg-black" href="#0">Sign In</button>
@@ -27,108 +27,6 @@
27 27
       </div>
28 28
     </div>
29 29
   </article>
30
-  <article class="bt bb flex flex-column flex-row-l b--black-10 bg-white black-70 justify-center pa3 pa4-ns fadeIn animated delay-1s" id="how">
31
-    <img src="<%= static_url(@conn, "/assets/images/marginalia/marginalia-productive-work.png") %>" class="v-mid order-2 w-100 dn db-ns self-center mw6">
32
-    <div class="order-1 measure center">
33
-      <h1 id="set-up" class="mt0 f5 f3-ns">1. Setting Up</h1>
34
-      <p class="f5 measure lh-copy">
35
-        Fortress acts as an <em>proxy</em> between you and other sites. Currently, Fortress <em>only</em>
36
-        supports sites that
37
-      </p>
38
-      <ul class="f5">
39
-        <li class="lh-copy measure">Advertise <a href="https://indieweb.org/indieauth" class="navy hover-blue">IndieAuth</a> support <a href="#rel-me-setup" class="f6 link gray">(how?)</a>,</li>
40
-        <li class="lh-copy measure">Expose <a class="navy hover-blue" href="https://indieweb.org/rel-me">verified links</a> to supported providers <a href="#rel-me-setup" class="f6 link gray">(how?)</a></li>
41
-      </ul>
42
-      <p class="f5 measure lh-copy">
43
-        It takes only four steps to get it out on a homebrew site; even less depending on how
44
-        your site handles these options.
45
-      </p>
46
-      <h3 id="rel-me-setup" class="f5 f3-ns mt4 fw6">2. Adding Verified Links</h3>
47
-      <p class="lh-copy measure f6">
48
-        There's two ways to add verified link support to your personal website: using a
49
-        <a target="_new" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link" class="pa1 link code br1 b--black-80 bg-dark-gray white">&lt;link&gt;</a> tag or
50
-        a <a target="_new" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a" class="pa1 link code br1 b--black-80 bg-dark-gray white">&lt;a&gt;</a> tag on
51
-        your website's homepage. It'd look something like the following:
52
-      </p>
53
-      <details>
54
-        <summary>Code Example</summary>
55
-          <div class="overflow-auto bg-near-black gold b--gold bw1 ba br1 pa2 mw7">
56
-            <code class="pre f6">
57
-&lt;!DOCTYPE html&gt;
58
-&lt;html lang="en"&gt;
59
-  &lt;head&gt;
60
-    &lt;title&gt;Jacky Alcine&lt;/title&gt;
61
-    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
62
-
63
-    &lt;!-- Using an account on a <a class="fw7 color-inherit" href="https://indieweb.org/silo">silo</a> --&gt;
64
-    &lt;link rel="me" href="https://twitter.com/jackyalcine" /&gt;
65
-
66
-    &lt;!-- Using an account on a <a class="fw7 color-inherit" href="https://fediverse.party/">federated platform</a> --&gt;
67
-    &lt;link rel="me" href="https://playvicious.social/users/jalcine" /&gt;
68
-  &lt;/head&gt;
69
-  &lt;body&gt;
70
-    &lt;p&gt;
71
-      I use my &lt;a href="https://playvicious.social/users/jalcine" rel="me"&gt;Mastodon&lt;/a&gt; account
72
-      more than my &lt;a href="https://twitter.com/jackyalcine" rel="me"&gt;Twitter&lt;/a&gt; account.
73
-    &lt;/p&gt;
74
-
75
-    &lt;aside class="h-card"&gt;
76
-      &lt;a href="/" rel="me" class="u-url"&gt;
77
-        &lt;img class="u-photo" src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/10/Shirley_Chisholm.jpg/161px-Shirley_Chisholm.jpg" /&gt;
78
-        &lt;span class="p-name"&gt;Jane F. Doe&lt;/span&gt;
79
-      &lt;/a&gt;
80
-      &lt;p class="p-note"&gt;
81
-        In 1968, I became the first black woman elected to the United States
82
-        Congress. In 1972, I also became the first black candidate for a 
83
-        major party's nomination for President of the United States,
84
-        and the first woman to run for the Democratic Party's presidential
85
-        nomination.
86
-      &lt;/p&gt;
87
-    &lt;/aside&gt;
88
-  &lt;/body&gt;
89
-&lt;/html&gt;
90
-          </code>
91
-        </div>
92
-      </details>
93
-      <h3 id="hooking-up" class="f5 f3-ns mt4 fw6">3. Hooking Up Your Site</h3>
94
-      <p class="lh-copy measure f6">
95
-        With your verified links in place, <strong>Fortress</strong> can be presented as your sign-in
96
-        option. Adding a few more lines of HTML to your site (or however your site handles
97
-        <abbr title="A URL that tells websites how log-in should work.">authentication endpoints</abbr>
98
-        as well as
99
-        <abbr title="A URL that tells websites how to get info to 'verify' its actions.">token endpoints</abbr>
100
-        ) is all you'd have left to do!
101
-      </p>
102
-      <details>
103
-        <summary>Code Example</summary>
104
-          <div class="overflow-auto bg-near-black gold b--gold bw1 ba br1 pa2 mw7">
105
-            <code class="pre f6">
106
-&lt;!DOCTYPE html&gt;
107
-&lt;html lang="en"&gt;
108
-  &lt;head&gt;
109
-    &lt;title&gt;Jacky Alcine&lt;/title&gt;
110
-    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
111
-
112
-    ...
113
-
114
-    &lt;link rel="authorization_endpoint" href="<%= indie_auth_url(@conn, :authorize) %>" /&gt;
115
-    &lt;link rel="token_endpoint" href="<%= indie_api_token_url(@conn, :create) %>" /&gt;
116
-  &lt;/head&gt;
117
-  &lt;body&gt;
118
-    ...
119
-  &lt;/body&gt;
120
-&lt;/html&gt;
121
-          </code>
122
-        </div>
123
-      </details>
124
-      <h3 id="testing-it-out" class="f5 f3-ns mt4 fw6">4. Testing it Out</h3>
125
-      <p class="lh-copy measure f6">
126
-        Doing the above will be enough to have your site fully IndieAuth compatible and powered
127
-        by Fortress (and the providers you've set up)! Try it out by using the
128
-        <a class="link underline navy" href="#sign-in">demo</a> after you're done.
129
-      </p>
130
-    </div>
131
-  </article>
132 30
   <section class="cf ph3 ph5-ns pb5 bg-near-white near-black" id="features">
133 31
     <div class="mw8 center">
134 32
       <h1 class="fl w-100 mt5 f5 ttu tracked fw6">Features</h1>
@@ -196,7 +94,7 @@
196 94
       <div class="measure-wide">
197 95
         <label for="me" class="f6 b db mb2">URI</label>
198 96
         <input id="me" name="me" class="f3 code input-reset ba b--black-20 pa3 mb2 db w-100" type="url" aria-describedby="me-desc">
199
-        <small id="me-desc" class="f6 black-60 db mb2">A Web resource that <em>you</em> own.</small>
97
+        <small id="me-desc" class="f6 black-60 db mb2">A Web resource that <em>you</em> own or control.</small>
200 98
       </div>
201 99
       <button class="input-reset button-reset f6 mt3 link dim bw1 ba pointer grow animate b--black br3 ph3 pv2 mb2 dib white bg-black" href="#0">Sign In</button>
202 100
     </form>

Loading…
Cancel
Save