From 090060d5805b2f6594ad66862d79c0d76e9c7dc5 Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Fri, 17 Feb 2023 18:00:16 -0500 Subject: [PATCH] Implement default avatars --- assets/default-avatars/1.png | Bin 0 -> 4397 bytes assets/default-avatars/2.png | Bin 0 -> 4544 bytes assets/default-avatars/3.png | Bin 0 -> 2831 bytes assets/default-avatars/4.png | Bin 0 -> 2855 bytes assets/default-avatars/5.png | Bin 0 -> 4276 bytes src/cdn/routes/embed.ts | 56 +++++++++++++++++++++++++++++++++++ 6 files changed, 56 insertions(+) create mode 100644 assets/default-avatars/1.png create mode 100644 assets/default-avatars/2.png create mode 100644 assets/default-avatars/3.png create mode 100644 assets/default-avatars/4.png create mode 100644 assets/default-avatars/5.png create mode 100644 src/cdn/routes/embed.ts diff --git a/assets/default-avatars/1.png b/assets/default-avatars/1.png new file mode 100644 index 0000000000000000000000000000000000000000..61b3f9cfed6b2344cd50e5fdd896cc33d5ee04a2 GIT binary patch literal 4397 zcmdUz`8U+<|Ht1m>0?4nZfnI13Eh#MjAbTf$`&bZlQd)-Wl6SZ%u=!^w>>*k5<*dl zEZw&y5|dr_ltGL&#+WhlozDF|-*dj7&tLHQ;X1GDJYVN=U9b1K&g*%d>m7f=_S`|C z!$JT69JI7RUjzUUe+mL1V15{YBDMGd?qPB9JOJEL1^~)^0NCYAlm!3?)dYYaZUBII z1OU>3c@6f){KUW9tP=Ev^T(ReBkJfI885BnEXCQg+NpjU8P z#l2(!pnM}nU*g*YPg4N6k@^I!-9vzmM*%1w2yj0JK$*leuxVyM(bI6X4g%y?La&Az z9(8T%@u)nX)gC(!1p`B>35wm?tM-0k{CV4KJPJ~Wg8zA;`S0P48-=57=OKx5S8lQ-qt-Y5VUVxOx{q2idTZ}=yL zNbPb^5}z|k@HYpF9)>HvJft;hbDCeC`dzovF*E@F9OYw@rZtL&^EEm2UDTgUco-N& z5%R=b-r9{wc30sS0hhAd5!n$*m-W4lPEt*9f4i!2o93x)nfhe7B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)iO>NE3_@7VJ?7+u5nv&u39&4Wa=nKFiaB=PB5kyy~veSL7N~ z3ozor*Z9%d1?FCsN>y~t8rBXDMyNrsZu{&dVGUCw+Y`3DxT1hRreD83Y??(?XIItw z+pjP2f!6f(Bl8$jv^n31r65P>aWDZI=>FSmZq8G);+*amQrpS1T#Y)ag7u?lRvhis z4@w?n@WKTN048WK9iCb_gE2Cnx?*Z(vL+5e0Fe-BlYlJ@%vZ}!{pX3)DH1OiS`QGD zyp-YxUD$4?w%hTF8LbDj3Pl5|dP2!=3M+MK5k3_o89|FhGF-VAPsYpSnRgEMg`on2 zs|{0o`gd=MBDr#9PCiIJHTkA$oYe0~nOulZD%-rpC}KO3?q@EG!#<9Tuhoz>aNQ3y zvAx_J>4Fc0ESke8RLefQu)cwZl3;8K|CVQLA~F95a>FXcw!7*_4oACx87>Qz`yomjU`%+ z!f3x4R7@51b{J-xb}u}3>!Y>@_!qqOGBfC;G9>64wffma9gIwV*&U>7vLP5d%ziyyU3nKD?m#QNl+>EdS^qbRlFPSCnOi9>%?OS52^3)p9l5%~e zG{jo8d?vqr1X=?s(xgtNm?R4i!v$JX)?co@RaYK?i!9Ow&VLcN3vY%C7^dF(YyoL` zb{PbbbV&9vkTFP-i_<>IB=*@^X5O%{Pcm&DeR;zUqbl2m+l`)Z$DCGWcWK`qX`*~L zlH+K;H9)ri)v!3$rSu{_lkZesXCO)Rf$@Q6y<5`X((@ljVPP_|SsbzLanSIy7mL3) z;sAhs6d+<8z{~$w7-4bV7oYJCE<3Ev{!<~1F|fzD-@tfixCMK#0Z>LNt0*9q6_nI% zl#v>$NDZZPa!8~G68UtGH}8KD`~%&+Z({#HLHYc@gbw>kV>aRR|75^;`+J07ZukfN cUyiDVveLhtmnL`O*&M*c;Ie+Xu1nN^0f1B@ivR!s literal 0 HcmV?d00001 diff --git a/assets/default-avatars/3.png b/assets/default-avatars/3.png new file mode 100644 index 0000000000000000000000000000000000000000..3fadcedf9234dbdbf2e8805391d70668814ca1cb G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3F=67%uf6>ax@Pu`)92b+8YG$z zcWY|R#_4C*+;JWmJ|#BmxWQXREBExBVKKgamCne(DKX*2Ny*5_`U*p(3G50+awp_27i+({eiJBoXjC^BKnSpw-*WFrPD|SiZLPa&(>dg>@iCNBiUV~X*J%0HUyY?2O!aW7aG ze>J>dJQsA2;Uyzxn|bpgTBA)fIN%${oo&!I*EMv}_IVP0x}1CWO8%Q_!O;`XEk&ZG z%eB8WRfq8t>4y*TL^Zm#82&7 z*3dKp4_(c(=Z~IUz+1nr-4<+9MTrk2IrML>wL+=$A+luoBehzW9{trD&%I2nmP{mf?@o|*Z+3;A? zE(F|_W+9(%1||aHmB;8qI>DrVJnPW{SLwH^XUDSSVuW@b*$-Z}rKnOoy51P9ND9L~ z>C_wd^!`pl%VJ93wpCh?^jnR9p44el==`@s!K<$RhMo1a`@Ds&L)z65y^c7%Tv%b) zwDzt6Q>Iz)$J;hNRm#}WIp?*U6%0~Y#=z$LOVLlmv5AbXgzC`{Wpa^!rB9Xai%vCe z;b4@1P|yq+ue>q;<3czXP7xEbCX#k27<`kJX62&XYWiI0EeYyiH10S-(Q$V=z%?wI zi>%g8xe;r@4e7nYv+%44Hdo;)T3AhooRgE{=XVeBDwtKXGUR~x_QKwk@^in;ojXMB zdqPwZKSz0hP_Sm4#t&5bNbrS+#XQ+FgdN3>6*{$b@P7dvy?=mu``qu7SoPl(*q+{Q=h@EQzW>eaWbB~-!_?jOj~6i*)6CK|bFWj_ FzW^q!%!B{{ literal 0 HcmV?d00001 diff --git a/assets/default-avatars/4.png b/assets/default-avatars/4.png new file mode 100644 index 0000000000000000000000000000000000000000..bcf0c183139ee50f9fa66cecbd59aef034f7631a GIT binary patch literal 2855 zcmai$cTkhr8pgjbBrAw3u!y?57iCuz7E~hOqF92O2%$-pNC1O~h=OP!fJli*C{p6m zY#;$ax&>53!9=A>N2;hG0!m3jdi#>xI6HG^?!ABPnK|=3=XvLM-oMVgC(Xs#_Q#dK ztONkyN30#%4FEuu1p#$6m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uUz_W`RpIuGvM&@#rbelx z6}H7Mva!JQ{+gpxp_~2%)ZCbfE-fKry*eAEx6V@Za`QEKx<@Ym8ImP!4aZ%iJX4Ek z+}?%|8)>G~HTPBR&oZbUigx$;9NCCF@pibl)(pT#n5W#wfKun*8{nh?rHM9wt zTAi2YZLbXBHf7L@swIPoS17ql0%ByABO((nVJKeFobK z^@!B;!!EW|w9Qu+-^8ZwR^31=pzUhsY6NBzdGbk%shRngbMD^RSl(4!E-Y5ypl8p2 z+H8BSZrX2QY6P)dBV&0PBRQ8>%m&Vzt9k1X{v0yaKb`Q+A90-;T^WwoV{|PHjfCc0 z?=-R*c~)Tk)Dx`gVc%TxGTw&f$GEh>#Ed_#c14y!);|Jz;NDt=Ypdzew-1H^7j42` z;j@Jj-)%}=Rjm?ud7_MXsd83pNT*p}FAdo6HrDM4t))Dd%ahFP0oTGU@4M}PITPnC zRTCSuZXQajRd-QVP@-O2tP~}*C5Bh1;eVpV+ME#NBJ7zPqw~3FAD)KsaSQApD17xe zoRC8&_fTzD`sSa&9@^R*^tIcDvbYp% z1->_+Rrpom)|PNjJ;!B z!GxJKi1S{cc&1BRT5phFnT2>}nV}qY!&N!oH7vfCXS;P`FUgX2Ty@!^l7Wy zcNY1)sw_=L2ck41#wm`gY*4;yUjJz;?995#?QvSOqZc9ky5$%xhvws-k-zOe3eOEY zYq@PFD&f$ij7|c_C#vHLYg>Y9`~lKl8T=%>W8zGuK^gu^Id3o*V+Kx~G=e771hhmrw%1ZWD6&De++BIxpzPb9Q;@hq2g}z`P>)sXkxR z?3|p@KB#Q?0bTyG^iVmn+a literal 0 HcmV?d00001 diff --git a/assets/default-avatars/5.png b/assets/default-avatars/5.png new file mode 100644 index 0000000000000000000000000000000000000000..3cc5589c3cf8160d6d9128885642abfd9525a49f GIT binary patch literal 4276 zcmdT{`9IYA_kWMZn8GzeB4xN~>MB`NwwYurF(`YsFvz}6nKE-P8KOmn8Ef`J7_z0I zELj@d2-&v?V`q$QWww%gHq-;?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 HcmV?d00001 diff --git a/src/cdn/routes/embed.ts b/src/cdn/routes/embed.ts new file mode 100644 index 00000000..86268189 --- /dev/null +++ b/src/cdn/routes/embed.ts @@ -0,0 +1,56 @@ +/* + Fosscord: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Fosscord and Fosscord Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ + +import { Request, Response, Router } from "express"; +import FileType from "file-type"; +import fs from "fs"; +import { HTTPError } from "lambert-server"; +import { join } from "path"; + +const router = Router(); + +function getFile(path: string) { + try { + return fs.readFileSync(path); + } catch (error) { + try { + const files = fs.readdirSync(path); + if (!files.length) return null; + return fs.readFileSync(join(path, files[0])); + } catch (error) { + return null; + } + } +} + +router.get("/avatars/:id", async (req: Request, res: Response) => { + let { id } = req.params; + id = id.split(".")[0]; // remove .file extension + const path = join(process.cwd(), "assets", "default-avatars", `${id}.png`); + + const file = getFile(path); + if (!file) throw new HTTPError("not found", 404); + const type = await FileType.fromBuffer(file); + + res.set("Content-Type", type?.mime); + res.set("Cache-Control", "public, max-age=31536000"); + + return res.send(file); +}); + +export default router;