Browse Source

fix(app): Custodial changes.

jackyalcine 2 months ago
parent
commit
e0b384ba6a
Signed by: Jacky Alciné <yo@jacky.wtf> GPG Key ID: 537A4F904B15268D

+ 4
- 1
docker-compose.yml View File

@@ -10,7 +10,7 @@ services:
10 10
     networks:
11 11
       - network
12 12
   objectstorage:
13
-    image: "minio/minio:RELEASE.2019-03-27T22-35-21Z"
13
+    image: "minio/minio:latest"
14 14
     command: server /data
15 15
     restart: always
16 16
     volumes:
@@ -58,6 +58,9 @@ services:
58 58
       SESSION_SIGNING_SALT: ${SESSION_SIGNING_SALT}
59 59
       TEST_HOST: ${TEST_HOST}
60 60
       TEST_PORT: ${TEST_PORT}
61
+    ports:
62
+      - "${PORT}:${PORT}"
63
+      - "${HMR_PORT}:${HMR_PORT}"
61 64
     links:
62 65
       - objectstorage
63 66
     volumes:

+ 4
- 1
docker/scripts/prepare-dev.sh View File

@@ -1,5 +1,8 @@
1 1
 #!/usr/bin/env bash
2 2
 
3
+echo "[koype:dev] Adding some extra packages for development."
4
+apk add sudo tmux the_silver_searcher -y
5
+
3 6
 echo "[koype:user] Generating user for Koype..."
4 7
 adduser \
5 8
   -u "${HOST_UID}" \
@@ -7,7 +10,7 @@ adduser \
7 10
   koype
8 11
 
9 12
 addgroup koype root
10
-addgroup koype adm
13
+addgroup koype admin
11 14
 
12 15
 echo "[koype:user] Updating file permissions..."
13 16
 chown koype: -R /opt/koype

+ 4
- 2
lib/indieweb/micropub/content.ex View File

@@ -178,11 +178,13 @@ defmodule IndieWeb.Micropub.Content do
178 178
     {:ok, values}
179 179
   end
180 180
 
181
-  def expand_property(dt, value, _) when dt in ~w(start end) and is_binary(value) do
181
+  def expand_property(dt, "", _) when dt in ~w(start end), do: {:error, :empty_value_for_date}
182
+
183
+  def expand_property(dt, value, _) when dt in ~w(start end) and is_binary(value) and value != "" do
182 184
     options = [
185
+      &Calendar.DateTime.Parse.httpdate/1,
183 186
       &Calendar.DateTime.Parse.rfc3339_utc/1,
184 187
       &Calendar.DateTime.Parse.rfc2822_utc/1,
185
-      &Calendar.DateTime.Parse.httpdate/1,
186 188
       &Calendar.DateTime.Parse.js_ms!/1
187 189
     ]
188 190
 

+ 1
- 1
lib/indieweb/websub.ex View File

@@ -11,7 +11,7 @@ defmodule IndieWeb.WebSub do
11 11
 
12 12
   def notify!(%Koype.Repo.Entry{} = entry), do: notify!(feeds_for(entry))
13 13
 
14
-  def notify!(urls) do
14
+  def notify!(urls) when is_binary(urls) do
15 15
     payload = %{"hub.mode" => "publish", "hub.url" => urls} |> Plug.Conn.Query.encode()
16 16
 
17 17
     if hub_endpoint() != nil do

+ 8
- 10
priv/themes/default/tmpl/stream/_entry.html.liquid View File

@@ -13,19 +13,17 @@
13 13
     {% endif %}
14 14
     <!-- TODO: Add support for showing name of events. -->
15 15
     {% render name=stream/_media.html %}
16
-    {% if entry.json.content["html"] and entry.json.content.html != empty %}
16
+    {% if !entry.json.content.html %}
17 17
       <div class="e-content f5 pt1 measure-wide pa2 pl0 mb2{% if entry.type == 'note' %} p-name{% endif %}">
18
-        {% assign html_content = entry.json.content.html|join|truncate:500 %}
19
-        {% assign text_content = entry.json.content.text|join|truncate:500 %}
20
-        {{ html_content || text_content }}
18
+        {% assign html_content = entry.json.content.html|first %}
19
+        {{ html_content }}
21 20
       </div>
22
-    {% elsif entry.json["summary"] and entry.json.summary != blank %}
23
-      <div class="e-summary f5 pt1 measure-wide bl pa2 bw1">
24
-        {{ entry.json.summary }}
21
+    {% else %}
22
+      <div class="p-content f5 pt1 measure-wide pa2 pl0 mb2{% if entry.type == 'note' %} p-name{% endif %}">
23
+        {% assign text_content = entry.json.content.text|join|truncate:500 %}
24
+        {{ text_content }}
25 25
       </div>
26
-    {% endif %}
27
-    <a class="db u-url lh-copy link underline" href="{{ entry.uri }}">
28
-      <i class="h1 w1 pa1 v-mid" data-feather="clock">posted</i>
26
+    {% endunless
29 27
       <time class="dt-published" datetime="{{ entry.published_at }}">{{ entry.published_at }}</time>
30 28
       {% if entery.updated_at %}&bull;updated&nbsp;<time class="dt-updated" datetime="{{ entry.updated_at }}">{{ entry.updated_at }}</time>{% endif %}
31 29
       {% if entry.interaction_count != 0 %}&bull;&nbsp;{{entry.interaction_count}}&nbsp;{{ "interaction"|inflect:entry.interaction_count }}{% endif %}

+ 4
- 0
test/unit/indieweb/micropub/content_test.exs View File

@@ -162,5 +162,9 @@ defmodule IndieWeb.Micropub.ContentTest do
162 162
       str = dt |> Calendar.DateTime.Format.rfc3339()
163 163
       assert {:ok, ^dt} = Content.expand_property("end", str, nil)
164 164
     end
165
+
166
+    test "start/end: handles nil values" do
167
+      assert {:error, :empty_value_for_date} = Content.expand_property("end", "", nil)
168
+    end
165 169
   end
166 170
 end

Loading…
Cancel
Save