repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
4018796
parent
bb22137
author
Eric Bower
date
2022-10-06 22:34:15 +0000 UTC
feat(imgs): general availability
5 files changed,  +61, -20
M filehandlers/imgs/handler.go
+1, -1
1@@ -23,7 +23,7 @@ import (
2 var KB = 1024
3 var MB = KB * 1024
4 var GB = MB * 1024
5-var maxSize = 2 * GB
6+var maxSize = 1 * GB
7 
8 type PostMetaData struct {
9 	*db.Post
M filehandlers/imgs/img.go
+0, -4
 1@@ -11,10 +11,6 @@ import (
 2 )
 3 
 4 func (h *UploadImgHandler) validateImg(data *PostMetaData) (bool, error) {
 5-	if !h.DBPool.HasFeatureForUser(data.User.ID, "imgs") {
 6-		return false, fmt.Errorf("ERROR: user (%s) does not have access to this feature (imgs)", data.User.Name)
 7-	}
 8-
 9 	fileSize, err := h.DBPool.FindTotalSizeForUser(data.User.ID)
10 	if err != nil {
11 		return false, err
M imgs/html/help.page.tmpl
+29, -0
 1@@ -53,6 +53,35 @@
 2         </ol>
 3     </section>
 4 
 5+    <section id="integrations">
 6+        <h2 class="text-xl">
 7+            <a href="#integrations" rel="nofollow noopener">#</a>
 8+           How does imgs integrate with out pico services?
 9+        </h2>
10+        <p>
11+            We allow any of our other services to upload images from those services to imgs.
12+            For example, if you want to upload images for prose.sh all you have to do is include
13+            your images in the <code>rsync</code> or <code>scp</code> command.
14+        </p>
15+        <pre>scp profile.jpg user@prose.sh:/</pre>
16+        <p>Then when you want to reference the file, you can reference it like so:</p>
17+        <pre>![profile pic](/profile.jpg)</pre>
18+    </section>
19+
20+    <section id="file-types">
21+        <h2 class="text-xl">
22+            <a href="#file-types" rel="nofollow noopener">#</a>
23+            What file types are supported?
24+        </h2>
25+        <ul>
26+            <li>jpg</li>
27+            <li>png</li>
28+            <li>gif</li>
29+            <li>webp</li>
30+            <li>svg</li>
31+        </ul>
32+    </section>
33+
34     <section id="img-update">
35         <h2 class="text-xl">
36             <a href="#img-update" rel="nofollow noopener">#</a>
M imgs/html/marketing.page.tmpl
+1, -15
 1@@ -34,20 +34,6 @@
 2 </header>
 3 
 4 <main>
 5-    <section>
 6-        <h2 class="text-lg font-bold">Beta access</h2>
 7-        <p>
 8-            Want beta access?  You must join our
 9-            <a href="https://web.libera.chat/gamja/?channels=%23pico.sh">IRC channel</a> (#pico.sh on libera)
10-            and ask for access.  We want all beta testers to be in IRC so you can provide us with
11-            feedback.
12-        </p>
13-        <p>
14-            Don't have an IRC client?  <a href="https://web.libera.chat/">Use libera web client</a>
15-            and join <code>#pico.sh</code>.
16-        </p>
17-    </section>
18-
19     <section>
20         <h2 class="text-lg font-bold">Examples</h2>
21         <p><a href="https://erock.imgs.sh">feed</a></p>
22@@ -65,7 +51,7 @@
23             <li>No javascript</li>
24             <li>No ads</li>
25             <li>No file size limits</li>
26-            <li>2GB max storage</li>
27+            <li>1GB max storage</li>
28         </ul>
29     </section>
30 
M prose/html/help.page.tmpl
+30, -0
 1@@ -231,6 +231,36 @@ This will show up on the blog landing page.
 2         <pre>scp _styles.css <username>@prose.sh:/</pre>
 3     </section>
 4 
 5+    <section id="images">
 6+        <h2 class="text-xl">
 7+            <a href="#images" rel="nofollow noopener">#</a>
 8+            How can I upload images?
 9+        </h2>
10+        <p>
11+            We allow prose to upload images to imgs.
12+            For example, if you want to upload images for prose.sh all you have to do is include
13+            your images in the <code>rsync</code> or <code>scp</code> command.
14+        </p>
15+        <pre>scp profile.jpg user@prose.sh:/</pre>
16+        <p>Then when you want to reference the file, you can reference it like so:</p>
17+        <pre>![profile pic](/profile.jpg)</pre>
18+    </section>
19+
20+    <section id="file-types">
21+        <h2 class="text-xl">
22+            <a href="#file-types" rel="nofollow noopener">#</a>
23+            What file types are supported?
24+        </h2>
25+        <ul>
26+            <li>md</li>
27+            <li>jpg</li>
28+            <li>png</li>
29+            <li>gif</li>
30+            <li>webp</li>
31+            <li>svg</li>
32+        </ul>
33+    </section>
34+
35     <section id="blog-url">
36         <h2 class="text-xl">
37             <a href="#blog-url" rel="nofollow noopener">#</a>