Compare commits

..

338 Commits

Author SHA1 Message Date
Jade Ellis da92cf8f9f Increase traefik read timeout to allow uploading larger container images 2025-01-24 20:54:15 +00:00
Jade Ellis 2811234219 re-align ansible inv 2025-01-24 17:56:30 +00:00
Jade Ellis d029e0a0dd Forgejo config 2025-01-24 17:50:19 +00:00
Jade Ellis 84144b2bc4 remove heredocs due to cache issue 2025-01-23 14:51:57 +00:00
Jade Ellis ee6fde8f51 add retry to make install more reliable 2025-01-23 14:23:23 +00:00
Jade Ellis 8132b98ac3 revert 2025-01-19 12:58:47 +00:00
Jade Ellis db2f038f0a shuffle args around 2025-01-19 12:52:28 +00:00
Jade Ellis 7848c9c71b conduwuit source builds 2025-01-19 12:36:43 +00:00
Jade Ellis 77909d57f7 Fix element web 2025-01-15 14:03:13 +00:00
Jade Ellis ce3d16d040 Update conduwuit 2025-01-15 14:02:06 +00:00
Jade Ellis 6cbd2b1bfc explicitly disable legacy media 2025-01-08 00:26:27 +00:00
Jade Ellis 70cfc6d2f5 tiny optimised images 2025-01-08 00:25:34 +00:00
Jade Ellis cddc323bd2 Update notes 2025-01-06 19:18:51 +00:00
Jade Ellis cddf4f19bd update notes 2025-01-06 19:18:06 +00:00
Jade Ellis 8dabe60322 Add types and don't show unlisted posts in HTML, feeds and sitemap. Fix JSON feed URLs. 2025-01-06 19:17:57 +00:00
Jade Ellis d6a648b6e7 enable incoming presence 2025-01-04 17:38:30 +00:00
Jade Ellis e91f8a8395 fix traefik logrotate? 2025-01-04 15:30:48 +00:00
Jade Ellis 8d10a1a919 update cwt 2025-01-03 21:07:47 +00:00
Jade Ellis 2c3ef0f70c cwt version 2024-12-22 00:41:32 +00:00
Jade Ellis ac71247ea9 Update mautrix homepage group 2024-12-22 00:41:23 +00:00
Jade Ellis fceb1acb1f Use fixed cwt version 2024-12-19 17:19:14 +00:00
Jade Ellis b53ace8f3c enable double puppeting on pissing.dev 2024-12-19 17:18:11 +00:00
Jade Ellis 086f2dae97 fix issue with dupe fields on appservice registration 2024-12-17 18:01:15 +00:00
Jade Ellis 9900145221 disable log spam from bad pushers 2024-12-17 18:00:52 +00:00
Jade Ellis 24724b3db4 fix port in container config 2024-12-17 17:03:23 +00:00
Jade Ellis 60a3d7df26 update mautrix 2024-12-17 16:56:53 +00:00
Jade Ellis d920dc169c fix port 2024-12-17 16:52:29 +00:00
Jade Ellis 0643ff1ced mautrix-twitter 2024-12-17 16:40:14 +00:00
Jade Ellis 8a85fc43a6 update element configs, enable themes 2024-12-16 02:23:12 +00:00
Jade Ellis b8d3156b53 Generate config 2024-12-16 02:12:43 +00:00
Jade Ellis 7de0dfe749 Update element room directory list 2024-12-16 01:52:46 +00:00
Jade Ellis 7d823915cd Sync direct chat list 2024-12-15 19:39:32 +00:00
Jade Ellis 84f9ec03df Use internal address for homeserver in mautrix-* 2024-12-15 18:55:37 +00:00
Jade Ellis f95da87354 Functional URL previews! 2024-12-15 18:52:33 +00:00
Jade Ellis dd196ffcc5 Another network attempt 2024-12-15 18:40:32 +00:00
Jade Ellis b8cab22e54 Update matrix trusted servers, fixes 2024-12-15 18:21:30 +00:00
Jade Ellis f6e5a5e92b Use explicit network aliases, add appservice registration script 2024-12-15 17:41:42 +00:00
Jade Ellis cdb53be5fb Update mautrix DM settings 2024-12-15 15:49:21 +00:00
Jade Ellis daee4a234a Disable networking thing causing issues 2024-12-10 19:26:01 +00:00
Jade Ellis ec85635c0c Enable com.beeper.message_send_status 2024-12-10 19:25:40 +00:00
Jade Ellis ccd0d93470 disable link previews whilst it's still sus 2024-12-09 04:18:03 +00:00
Jade Ellis 99b59859c0 Named interfaces in containers 2024-12-09 04:11:19 +00:00
Jade Ellis 38ad2384f0 URL previews are now working... perhaps fragile. 2024-12-09 02:09:29 +00:00
Jade Ellis cca05845c0 Half configure URL previews, not working due to podman/network shenanigans 2024-12-09 01:42:27 +00:00
Jade Ellis 985d5f57fe Fix ansible logrotate perms 2024-12-07 23:48:15 +00:00
Jade Ellis 264c8fc68e Add pub network for link previews + fix logrotate 2024-12-07 22:15:30 +00:00
Jade Ellis d05cb930ff add bsky bridge to discovery 2024-12-01 23:43:21 +00:00
Jade Ellis 6163005cf6 Set up bluesky bridge 2024-12-01 21:45:02 +00:00
Jade Ellis e7270d1f7a Enable traefik access log and log rotation 2024-12-01 11:37:37 +00:00
Jade Ellis 66215952ee Update error contact 2024-11-26 23:17:40 +00:00
Jade Ellis da95ff74ea Update matrix + notes 2024-11-26 23:16:43 +00:00
Jade Ellis 07ff893a38 Discord bridge not a megabridge 2024-11-25 14:05:18 +00:00
Jade Ellis ea72673d32 mautrix autoconfig 2024-11-25 01:55:13 +00:00
Jade Ellis affc0ce1df Example for deploying an image 2024-11-25 01:50:14 +00:00
Jade Ellis 0f81f730d8 Set up new mautrix bridges and update existing config 2024-11-25 00:01:31 +00:00
Jade Ellis 9290542c84 Update notes 2024-11-24 04:37:15 +00:00
Jade Ellis 16edacaeff Remove log 2024-11-24 04:36:35 +00:00
Jade Ellis c73b7baaf5 Fix blog feeds 2024-11-24 04:36:05 +00:00
Jade Ellis ea72d1ce42 Fix SK not injecting nonce 2024-11-24 03:32:02 +00:00
Jade Ellis 6ad864c4a1 Fiddle with CSP stuff 2024-11-24 03:24:32 +00:00
Jade Ellis bee92f3b5a Fix deploy script 2024-11-24 03:03:53 +00:00
Jade Ellis d5db048ec6 Upgrade to Svelte 5, some regressions :( 2024-11-24 02:54:18 +00:00
Jade Ellis c36e68e73c Fix space 2024-11-21 01:36:47 +00:00
Jade Ellis 8f3627d55c add space 2024-11-21 01:21:34 +00:00
Jade Ellis f8f0b8731e Add more data to container monitors 2024-11-21 01:20:01 +00:00
Jade Ellis 32686f8990 autokuma latest 2024-11-21 01:04:16 +00:00
Jade Ellis 63b766bd74 Work around conduwuit sync regression 2024-11-21 00:20:03 +00:00
Jade Ellis 79b84f5940 fix relay healthcheck 2024-11-20 17:58:39 +00:00
Jade Ellis 64b15f3cd3 Fix cert-dumper restart 2024-11-20 17:58:29 +00:00
Jade Ellis 19464b3211 Add more uptime-kuma config 2024-11-20 17:49:26 +00:00
Jade Ellis e7d018fa0d Use git main 2024-11-20 01:16:17 +00:00
Jade Ellis ec1f0a1037 Add registration token for ellis.link 2024-11-19 20:05:52 +00:00
Jade Ellis 42a023b9d0 Add monitoring to matrix servers 2024-11-19 16:29:02 +00:00
Jade Ellis 94e03574a8 Have matrix servers trust each other 2024-11-19 16:27:59 +00:00
Jade Ellis fffe4a3d69 Fix element call 2024-11-19 16:13:06 +00:00
Jade Ellis cb0edd90be Coturn working 2024-11-19 15:53:05 +00:00
Jade Ellis e885f6c8ad Fix kanidm entry from windows 2024-11-19 15:16:07 +00:00
Jade Ellis b231f4bd2e First fail at coturn 2024-11-19 13:20:32 +00:00
Jade Ellis 66dbdc6533 Add registration token and auto-join rooms for pissing.dev 2024-11-13 20:03:43 +00:00
Jade Ellis f2427ba09e Enable room directory federation 2024-11-13 15:34:04 +00:00
Jade Ellis f9c680e6af Enable pissing.dev to use bridges and sync dms for gmessages 2024-11-13 15:12:23 +00:00
Jade Ellis 2dbbb6b295 Uptime Kuma 2024-11-10 16:18:49 +00:00
Jade Ellis f24e84145b readability API 2024-11-10 14:54:47 +00:00
Jade Ellis 7d230f5d90 Enable web network for mautrix 2024-11-10 14:18:24 +00:00
Jade Ellis c23429eee6 Extend freshrss OIDC session timeout 2024-11-04 17:12:46 +00:00
Jade Ellis 7ed5c1e392 FreshRSS OIDC with kanidm 2024-11-03 19:16:17 +00:00
Jade Ellis 50589e5179 Use public TLS cert for kanidm 2024-11-03 18:09:33 +00:00
Jade Ellis 9591c52463 Add matrix-sed bot 2024-11-01 16:30:48 +00:00
Jade Ellis b9fafc2e55 Enable compression of blobs 2024-10-27 21:07:13 +00:00
Jade Ellis 21fc6809de FreshRSS 2024-10-27 00:48:20 +01:00
Jade Ellis 29eb1133bd Add mautrix-signal bridge 2024-10-26 22:32:10 +01:00
Jade Ellis d39001a081 Pull mautrix config
- Include server name in discord channel room name
- Enable setting room info in gmessages
2024-10-26 22:08:11 +01:00
Jade Ellis 5cf2ca2400 Disable wildcard certs 2024-10-25 20:37:15 +01:00
Jade Ellis 1fe65ef19f Stalwart mail 2024-10-25 20:00:48 +01:00
Jade Ellis 777dbe1e8f Fix gmessages 2024-10-20 20:32:20 +01:00
Jade Ellis bda5848ec5 Fix maubot log error 2024-10-20 18:54:07 +01:00
Jade Ellis 9e6ac44928 Add more mail-related ports 2024-10-20 18:49:16 +01:00
Jade Ellis 426b4fae83 Improve traefik config 2024-10-20 18:29:00 +01:00
Jade Ellis 8f6420e2d0 Improve config to prepare for mail server 2024-10-20 18:03:34 +01:00
Jade Ellis 1f9584ca11 Starting with ansible 2024-10-20 17:03:53 +01:00
Jade Ellis a94903d88e Wildcard certificates 2024-10-20 17:03:18 +01:00
Jade Ellis dcdbc5332a remove Tagai stuff 2024-10-19 23:41:50 +01:00
Jade Ellis 213cbaef42 Add sentry relay config 2024-10-19 23:41:41 +01:00
Jade Ellis 588c9165ef Use DNS challenge 2024-10-19 22:43:11 +01:00
Jade Ellis 085df57d84 Fix matrix federation 2024-10-19 12:31:41 +01:00
Jade Ellis da698b6eea Merge branch 'main' of https://github.com/JadedBlueEyes/jade-website 2024-10-19 10:37:09 +01:00
Jade Ellis 8ff74be592 Failed CoreOS install 2024-10-19 10:36:44 +01:00
Jade Ellis 846546f12d First shot at gmessages 2024-10-10 03:26:51 +01:00
Jade Ellis 85c4440562 Maubot link 2024-10-09 17:25:04 +01:00
Jade Ellis ee1d89492e Fix typo 2024-10-09 14:42:13 +01:00
Jade Ellis 71674bdece Element web 2024-10-09 03:06:13 +01:00
Jade Ellis ff766e2383 Retire calendar service 2024-10-08 19:38:12 +01:00
Jade Ellis da678f1fcb Maubot 2024-10-08 18:56:39 +01:00
Jade Ellis 27918f176b pissing.dev 2024-10-08 18:05:22 +01:00
Jade Ellis 7d8ac9e3ce Mautrix after conduwuit 2024-10-06 03:20:12 +01:00
Jade Ellis bba0c44d1b Stop traefik log spam 2024-10-06 00:15:06 +01:00
Jade Ellis 8d9cac323a mautrix-discord bridge 2024-10-05 01:31:28 +01:00
Jade Ellis fa96a573ca Tweaks to conduwuit 2024-10-04 18:24:39 +01:00
Jade Ellis 9690ad312e Conduwuit 2024-10-03 16:26:21 +01:00
Jade Ellis c25a75b8aa Add uni calendars container oop 2024-10-03 13:19:02 +01:00
Jade Ellis f421eaccda Bundle fonts with the application 2024-09-15 19:17:59 +01:00
Jade Ellis b793201792 Remove unneeded curly brackets in import 2024-09-15 18:08:32 +01:00
Jade Ellis 76de8f4137 Add biome and fix typos 2024-09-15 18:07:41 +01:00
Jade Ellis 9522e043a1 Comment the image generator 2024-09-15 17:53:30 +01:00
Jade Ellis 076433b21c Reduce Sentry bundle size 2024-09-10 15:04:31 +01:00
Jade Ellis a1c7538d08 Customise Sentry colours 2024-09-10 14:42:46 +01:00
Jade Ellis 27c9be5e70 Add margin to the feedback button 2024-09-10 14:27:27 +01:00
Jade Ellis d3f0110f93 Set width and height for hero 2024-09-10 14:15:43 +01:00
Jade Ellis 923425b898 Add feeds to footer 2024-09-10 14:06:03 +01:00
Jade Ellis 1d9eecbed5 Add footer 2024-09-10 13:58:25 +01:00
Jade Ellis 7400d9e7a5 Improve error page 2024-09-10 13:32:14 +01:00
Jade Ellis a0476d9dc5 Enable LDAP service 2024-09-10 12:00:55 +01:00
Jade Ellis c509dcc7b8 Fix kanidm container cert issue 2024-09-10 11:53:03 +01:00
Jade Ellis d6da36314d Add colours and Sentry feedback form 2024-09-10 04:11:45 +01:00
Jade Ellis 3ff04eba7e Prevent navigation on logo click 2024-09-10 02:18:20 +01:00
Jade Ellis 8de1461103 Update Homepage labels 2024-09-10 02:09:25 +01:00
Jade Ellis 039186b9e0 Disable node profiling as the native module was not bundled correctly 2024-09-10 02:06:27 +01:00
Jade Ellis 62acbe3a3e Specify sourcemap directory to server esbuild 2024-09-10 01:58:15 +01:00
Jade Ellis 7e66d5b194 Enable node profiling in Sentry 2024-09-10 01:33:41 +01:00
Jade Ellis e234f983a1 Split server bundles again 2024-09-10 01:30:51 +01:00
Jade Ellis c5b3db5735 Disable replay integration 2024-09-10 01:30:40 +01:00
Jade Ellis 392f7c88c1 Add Sentry Relay 2024-09-03 02:09:16 +01:00
Jade Ellis f1d36e2a89 Slightly improve Paint performance 2024-09-02 19:32:34 +01:00
Jade Ellis 62cf9655b0 Work around Chrome image bug causing CLS 2024-09-02 19:32:02 +01:00
Jade Ellis c6800a1288 Properly fix CLS 2024-09-01 16:48:17 +01:00
Jade Ellis cd62747f39 Fix CLS due to image CSS 2024-09-01 16:12:28 +01:00
Jade Ellis 763ce3d83e Update notes 2024-09-01 13:04:22 +01:00
Jade Ellis 5a739e65e3 Update notes 2024-09-01 12:40:32 +01:00
Jade Ellis 14967a54a1 Hide empty TOCs 2024-09-01 12:39:06 +01:00
Jade Ellis 3b2e909949 Track share events 2024-08-30 16:05:44 +01:00
Jade Ellis b7e399b528 Properly await and handle share errors 2024-08-30 15:47:36 +01:00
Jade Ellis 251ae82bba Wiggly logo in hero 2024-08-27 20:41:40 +01:00
Jade Ellis fb7790cf56 fix config 2024-08-27 19:50:51 +01:00
Jade Ellis 901db92c85 Fix config 2024-08-27 19:46:40 +01:00
Jade Ellis 7910d2f774 Fix config 2024-08-27 19:45:53 +01:00
Jade Ellis 29e9442c2d Sentry tunneling is broken in their example 2024-08-27 19:42:40 +01:00
Jade Ellis bb847974a4 Fix sentry config 2024-08-27 19:24:01 +01:00
Jade Ellis 0be4f5f0c6 Enable session replays on error 2024-08-27 18:55:44 +01:00
Jade Ellis 8fbab1f87c Factor out Sentry URLs and set Sentry environment 2024-08-27 18:51:11 +01:00
Jade Ellis 687733bf7d Fix quadro file 2024-08-26 23:13:51 +01:00
Jade Ellis 72688c948f Configure sentry:
- offline transport
- give Sentry a CSP nonce
- disable session replay
- attempt to make tree-shaking sentry easier
2024-08-26 23:12:27 +01:00
Jade Ellis dfef1bd284 Configure trusted headers 2024-08-26 23:10:06 +01:00
Jade Ellis c3435db357 Remove some console logs 2024-08-26 22:07:55 +01:00
Jade Ellis fcfc582396 Fix resvg not loading 2024-08-26 22:05:38 +01:00
Jade Ellis e20840973e Sentry: Allow connections + report CSP violations 2024-08-26 20:46:14 +01:00
Jade Ellis 69031a125f Merge branch 'main' of https://github.com/JadedBlueEyes/jade-website 2024-08-26 20:23:49 +01:00
Jade Ellis b0cfdeb61b Move bundling server from Rollup to esbuild
Fixes all sentry/otel related issues in deploy.
Requires require shim.
No longer needs to extern resvg.
2024-08-26 20:21:41 +01:00
Jade Ellis e8aa8f738b Update notes 2024-08-25 05:42:13 +01:00
Jade Ellis d9cfc4bd2f no frozen lockfile 2024-08-25 05:38:53 +01:00
Jade Ellis a975706711 Swap deps copy order 2024-08-25 05:27:49 +01:00
Jade Ellis 2b57e8a94b Try get working deps 2024-08-25 05:17:54 +01:00
Jade Ellis 1138df63b3 docker ignore git 2024-08-25 05:09:58 +01:00
Jade Ellis ee5731d063 Try use correct node_modules 2024-08-25 05:07:48 +01:00
Jade Ellis f4ec36c724 Use node latest 2024-08-25 04:58:22 +01:00
Jade Ellis 71bf1598fb Revert "Disable TLS validatoin in builds (work around sentry)"
This reverts commit 02d40e9688.
2024-08-25 04:57:28 +01:00
Jade Ellis 02d40e9688 Disable TLS validatoin in builds (work around sentry) 2024-08-25 04:55:45 +01:00
Jade Ellis 4fd9ce1174 Ignore dockerfile changes 2024-08-25 04:50:38 +01:00
Jade Ellis 1f7e5e88a9 Prod deps 2024-08-25 04:48:19 +01:00
Jade Ellis 0b2697ba43 Add sentry rollup token 2024-08-25 04:44:10 +01:00
Jade Ellis f967b8c0c6 Use layers more effectively, add OT dep 2024-08-25 04:32:21 +01:00
Jade Ellis cfad9861df Add opentelemetry dep 2024-08-25 04:23:21 +01:00
Jade Ellis a2408366b2 Add opendelemetry dep 2024-08-25 03:51:57 +01:00
Jade Ellis 38f437e9d5 Fix copying sentry 2024-08-25 03:35:14 +01:00
Jade Ellis be60c42981 Add external sentry 2024-08-25 03:30:38 +01:00
Jade Ellis 510d1e1872 Update notes 2024-08-25 03:17:06 +01:00
Jade Ellis 0d2d1d7c03 Add prepublish scripts for packages 2024-08-25 03:15:27 +01:00
Jade Ellis 4c466c38b1 Add update notes script 2024-08-25 03:08:54 +01:00
Jade Ellis 72e1e52268 Update deps 2024-08-25 02:57:20 +01:00
Jade Ellis 2b59fa45a1 Upload server sourcemaps 2024-08-25 02:46:26 +01:00
Jade Ellis f39d357a32 Add sentry 2024-08-25 02:42:16 +01:00
Jade Ellis 13844eea85 Add comment 2024-08-20 20:03:54 +01:00
Jade Ellis cea87d3d95 Group rule 2024-08-20 20:01:07 +01:00
Jade Ellis 33eaa9dd84 Add redirects to jade.ellis.link 2024-08-20 19:42:29 +01:00
Jade Ellis fda3134137 accept ellis.link webfinger requests to jade.ellis.link 2024-08-20 18:32:23 +01:00
Jade Ellis a334ed0146 Add script for deploying to the server 2024-08-19 00:32:24 +01:00
Jade Ellis 3a3adc2801 Update notes 2024-08-19 00:32:06 +01:00
Jade Ellis f1977924f8 Add callouts support
Adds a colour palette
Adds homemade remark-callouts package
Adds tabler icons dependency
2024-07-30 18:30:15 +01:00
Jade Ellis e7e311b080 Make code blocks loose border when against edge 2024-07-28 22:37:14 +01:00
Jade Ellis 601dac54eb Fix unescaping issue with HTML entities 2024-07-28 22:31:19 +01:00
Jade Ellis 14e2b42caa Improve and fix styles for code blocks and footnotes 2024-07-28 22:29:40 +01:00
Jade Ellis 4267beace5 Add more syntax highlighting grammars
Also adds a convenience function for adding them
2024-07-28 22:22:48 +01:00
Jade Ellis ea1e9a1485 Update notes 2024-07-25 17:29:26 +01:00
Jade Ellis 893598249f Use node slim image 2024-07-25 00:17:52 +01:00
Jade Ellis 8ff02c628d Improve metadata for blog list page 2024-07-25 00:12:36 +01:00
Jade Ellis 659e360b10 Break article metadata at best point 2024-07-24 23:53:02 +01:00
Jade Ellis 6638165b75 Fully fix subtitle alignment at small breakpoint 2024-07-24 23:50:31 +01:00
Jade Ellis 107bacfc0d Actually ignore stuff for docker. This speeds everything up a bunch! 2024-07-24 19:54:26 +01:00
Jade Ellis c767b94d46 Improve metadata
Add JSON LD,
make homepage h-card representative,
Fix bug with byline
fix incorrect OG image aspect ratio in meta
Add og site_name
Add author profile image
2024-07-24 15:22:39 +01:00
Jade Ellis 9518e41291 Better enum-based caching for preview images 2024-07-24 13:55:49 +01:00
Jade Ellis 760bb2efeb Social preview gradient from dark to light 2024-07-24 13:09:46 +01:00
Jade Ellis 144b6bc9da Change info byline to be "Published on x by author" as a single sentence 2024-07-24 13:08:31 +01:00
Jade Ellis c6f0197ef9 Fix subtitle alignment at small breakpoint 2024-07-24 01:34:16 +00:00
Jade Ellis 8ed038fb6b Use best aspect ratio for twitter 2024-07-23 23:23:10 +01:00
Jade Ellis 270f398afb Don't set headers in Traefik 2024-07-23 23:17:48 +01:00
Jade Ellis 861d682383 Don't always force override headers 2024-07-23 23:14:29 +01:00
Jade Ellis 555990a5ad Allow hotlinking OG images 2024-07-23 23:04:17 +01:00
Jade Ellis 69badb0c98 fixup! Optimise social media images 2024-07-23 22:58:03 +01:00
Jade Ellis 9a227fac71 Optimise social media images 2024-07-23 22:54:46 +01:00
Jade Ellis f7ce4ebb06 Use more compatible OG tags 2024-07-23 22:37:48 +01:00
Jade Ellis 722637d530 Fix bugs with deploying images
- Exclude resvg native modules
- Copy resvg native mods into final image
- ensure deps are correct for alpine
2024-07-23 22:33:42 +01:00
Jade Ellis 2bf9699285 Add OG images 2024-07-23 21:20:42 +01:00
Jade Ellis dfa8f2c5be Fix wrong-way-round conditional 2024-07-23 20:27:32 +01:00
Jade Ellis 2cffe5172b Comment useless imports 2024-07-23 19:46:17 +01:00
Jade Ellis d835c8eb69 Add h-card and author metadata 2024-07-23 19:45:51 +01:00
Jade Ellis c677ebb8cf Add webmention support 2024-07-23 17:49:39 +01:00
Jade Ellis 32b134c367 Add smooth scroll 2024-07-22 16:38:29 +01:00
Jade Ellis 92dd33386c Update notes 2024-07-20 14:59:59 +01:00
Jade Ellis 3b9646dede Properly inline blurthumbs in build more
Also reduces code duplication
2024-07-20 14:59:30 +01:00
Jade Ellis 2db14697be Clean up plugin 2024-07-20 14:41:04 +01:00
Jade Ellis e7a42d7b74 Experiments with resolving 2024-07-19 15:34:55 +01:00
Jade Ellis ae3c753d71 SVG thumbhashes 2024-07-19 15:32:14 +01:00
Jade Ellis e95748330d Update notes 2024-07-19 01:27:48 +01:00
Jade Ellis 1616c99015 Disable prerender 2024-07-17 02:10:02 +01:00
Jade Ellis 2450efe63a Add RSS and JSON feeds 2024-07-17 02:05:28 +01:00
Jade Ellis a13b75eeb4 Add UTM parameters 2024-07-17 00:02:35 +01:00
Jade Ellis 621ae06631 Add share button 2024-07-16 23:40:15 +01:00
Jade Ellis a9750f560c Fix wikilinks 2024-07-16 23:05:39 +01:00
Jade Ellis 732ccb548d Improve print format 2024-07-16 22:35:27 +01:00
Jade Ellis 9dbdcf2493 Add read time 2024-07-16 22:24:34 +01:00
Jade Ellis 85ffece367 Clear thumb after load 2024-07-16 22:12:06 +01:00
Jade Ellis 8e3f5b7ca0 Fix CLS 2024-07-16 22:01:59 +01:00
Jade Ellis 9c300ba24e remove logging 2024-07-16 22:01:35 +01:00
Jade Ellis 0b350894de Thumbhash images 2024-07-16 21:50:00 +01:00
Jade Ellis 85970c9852 remove rollup/plugin-dynamic-import-vars 2024-07-16 21:01:36 +01:00
Jade Ellis fa8f29382b Use title rather than alt for figures 2024-07-16 20:53:09 +01:00
Jade Ellis 1930ff408d Images as figures 2024-07-16 20:43:43 +01:00
Jade Ellis 7b3b00cd66 Fix in no layout 2024-07-16 20:30:17 +01:00
Jade Ellis 4dcdcf8ae8 Add image support
Works around Vite imports
vite-imagetools is borked for this
2024-07-16 20:24:04 +01:00
Jade Ellis 3b3cabb1b6 Improve error handling in gh download 2024-07-16 19:42:18 +01:00
Jade Ellis 792d6af652 Add u-url 2024-07-16 17:09:29 +01:00
Jade Ellis 58d3d01cbe Add ToC to blog posts 2024-07-16 16:59:04 +01:00
Jade Ellis 008bfa4d94 Fix experimental JSON imports 2024-07-15 21:46:46 +01:00
Jade Ellis afde316a75 Add syntax highlighting 2024-07-15 21:24:54 +01:00
Jade Ellis b3b7739d67 Update metadata 2024-07-15 15:10:17 +01:00
Jade Ellis ea6aecae10 Update Notes 2024-07-15 14:45:15 +01:00
Jade Ellis 81a8e54e7c Update notes 2024-07-15 14:00:45 +01:00
Jade Ellis e823b1d676 Add basic blog functionality 2024-07-15 13:58:21 +01:00
Jade Ellis 0bfb620d2f Update notes 2024-07-15 10:59:49 +01:00
Jade Ellis 7f174b1a65 Update notes 2024-07-15 10:57:14 +01:00
Jade Ellis 27fc6a766e Small refactor 2024-06-26 22:07:21 +01:00
Jade Ellis 86883fcf71 Update Notes 2024-06-16 19:44:54 +01:00
Jade Ellis 1fb9d9cbd3 Update notes 2024-06-16 19:43:38 +01:00
Jade Ellis 3ed9e83f5e Fix analytics breaking on SSR 2024-06-16 19:41:02 +01:00
Jade Ellis 5a14125e7b Skip loading if string is empty 2024-06-16 19:07:50 +01:00
Jade Ellis 9351d7ebeb Try to not load terser in the main thread? 2024-06-16 18:54:59 +01:00
Jade Ellis e5aa809a07 Fix google analytics CSP again 2024-06-16 18:40:02 +01:00
Jade Ellis cb70967b5c Create JavaScript Minifier 2024-06-16 18:32:59 +01:00
Jade Ellis aab99dbeea Update notes 2024-06-16 18:32:23 +01:00
Jade Ellis 5869b244b0 Dockerignore 2024-06-16 18:09:14 +01:00
Jade Ellis 0dfe8c4c8a Comments 2024-06-16 18:09:04 +01:00
Jade Ellis 0b1ac24cdd Fix analytics CSP 2024-06-16 18:08:52 +01:00
Jade Ellis 793bc08999 Add analytics 2024-06-16 17:51:21 +01:00
Jade Ellis 57916e9b90 Improve styles 2024-06-16 17:31:01 +01:00
Jade Ellis f234f9005c Add navigation 2024-06-16 17:17:12 +01:00
Jade Ellis 2beb349c30 Fix layout shift 2024-06-16 16:40:48 +01:00
Jade Ellis c29ed95b02 Add loading wheel for editor 2024-06-16 16:19:05 +01:00
Jade Ellis b8aad6745d Add pagespeed's CSP suggestion 2024-06-16 16:10:54 +01:00
Jade Ellis 858914a73e Update dependencies & directly include editor 2024-06-16 16:05:52 +01:00
Jade Ellis f23e0417ed Move terser off of the main thread 2024-05-13 19:25:51 +01:00
Jade Ellis 844164bda9 Add meta descriptions to projects 2024-05-03 16:04:59 +01:00
Jade Ellis 4b5882b4a2 Update homepage 2024-05-03 15:45:47 +01:00
Jade Ellis c44772077e Deal with unintended download link on Android 2024-05-03 15:34:18 +01:00
Jade Ellis 4b458dcd5a Fix oops 2024-05-03 14:50:33 +01:00
Jade Ellis f132722a3b Deal with flash of wrong platform 2024-05-03 14:49:08 +01:00
Jade Ellis 621b15a2a9 Add downloada links to projects pages 2024-05-03 14:37:50 +01:00
Jade Ellis ae1b0855ba Fix dev mode Vite imports 2024-05-03 13:29:44 +01:00
Jade Ellis f36f711de9 Tarball notes for deploy 2024-05-01 23:06:48 +01:00
Jade Ellis dce5fbddc1 Comment out unrecognized config 2024-05-01 19:06:48 +01:00
Jade Ellis b678fede2f Fix building the final output 2024-05-01 19:06:13 +01:00
Jade Ellis e26f653a46 Add MDsveX and projects page 2024-05-01 18:34:30 +01:00
Jade Ellis bc3ae9cd81 Add editorconfig 2024-05-01 18:31:49 +01:00
Jade Ellis 53f1274956 Set host 2024-04-28 22:30:18 +01:00
Jade Ellis a2013b5aaa Disabled html min as it runs after precompress 2024-04-28 22:13:22 +01:00
Jade Ellis b905513423 Update website dependancies 2024-04-28 22:08:44 +01:00
Jade Ellis 07dbd800ee Fix missing ID 2024-04-10 15:51:03 +01:00
Jade Ellis e12f25503e User select all makes selection more annoying 2024-04-10 15:46:32 +01:00
Jade Ellis 6c03ee7f59 Improve accessibility 2024-04-10 15:38:59 +01:00
Jade Ellis e3c4eec7cf Add a bookmarklet maker and improve node deployment (from today and last night) 2024-04-10 15:13:16 +01:00
Jade Ellis 255767c10b Change HTML to meet https://github.com/sveltejs/kit/discussions/7585 2024-04-06 15:44:42 +01:00
Jade Ellis a82ca7b1c0 JSONfeed 2024-04-06 14:55:47 +01:00
Jade Ellis bdb0bdee2d Merge branch 'main' of https://github.com/JadedBlueEyes/jade-website 2024-04-02 16:19:48 +01:00
Jade Ellis 0244c9e778 Add HTML minifier adapter 2024-04-02 16:18:53 +01:00
Jade Ellis 45d1a5aceb Improve security config 2024-04-02 16:16:14 +01:00
Jade Ellis 289e087066 Commit some container changes 2024-04-02 15:17:56 +01:00
Jade Ellis d7cf94878a Add webfinger 2024-04-02 15:17:38 +01:00
Jade Ellis f76b55f728 Merge pull request #1 from JadedBlueEyes/dependabot/npm_and_yarn/vite-5.0.12
Bump vite from 5.0.10 to 5.0.12
2024-03-11 13:53:17 +00:00
dependabot[bot] 18c3f091f7 Bump vite from 5.0.10 to 5.0.12
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.10 to 5.0.12.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.0.12/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.12/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-11 13:52:28 +00:00
Jade Ellis 00854f191b Tweak a bit? 2024-03-11 13:50:33 +00:00
Jade Ellis b9eb87d76d Kanidm setup 2024-03-11 13:22:38 +00:00
Jade Ellis acd1cb71fd Pitch static webserver container 2024-03-10 18:51:01 +00:00
Jade Ellis a32b4ea9a6 Delete attempted demo 2024-03-10 18:50:29 +00:00
Jade Ellis a9a85fb61d Merge branch 'main' of https://github.com/JadedBlueEyes/jade-website 2024-03-10 18:26:40 +00:00
Jade Ellis d41626553f Add maston and better meta 2024-03-10 10:29:46 +00:00
Jade Ellis 2c9f466872 At this point just aaagh 2024-03-09 13:07:33 +00:00
Jade Ellis 7e83c817ec Try deply Pterodactyl, failed 2024-03-09 11:45:50 +00:00
Jade Ellis b7996e5046 Add sitemap 2024-03-08 21:34:52 +00:00
Jade Ellis 708dbc8355 Fix permissions-policy 2024-03-08 19:58:23 +00:00
Jade Ellis 0cade255e9 Security headers 2024-03-08 19:49:19 +00:00
Jade Ellis aa55b64586 Tweak 2024-03-08 18:46:51 +00:00
Jade Ellis ac2280977d Add CSP 2024-03-08 18:42:01 +00:00
Jade Ellis 576f4a5b59 Add IPv6 2024-03-08 14:19:15 +00:00
Jade Ellis 6d9bb2bbe3 Favicons! 2024-03-08 01:24:11 +00:00
Jade Ellis 13c5639e18 Slightly less html 2024-03-08 00:22:33 +00:00
Jade Ellis 28d62cd414 Add meta 2024-03-08 00:21:15 +00:00
Jade Ellis eef258807a Fix compression 2024-03-08 00:21:06 +00:00
Jade Ellis 787ca9f211 Enable HSTS 2024-03-07 21:15:57 +00:00
Jade Ellis 0bb98fbb24 Trying everything for compression - worked :) 2024-03-07 20:46:00 +00:00
Jade Ellis bfd7f5bd3f Set up homepaged, improved TLS and tried to get IPv6 functional 2024-03-07 19:17:16 +00:00
Jade Ellis ee705b2c34 Demo editor! 2024-03-06 20:46:15 +00:00
Jade Ellis ec7d880c39 Working self host! 2024-03-06 20:46:02 +00:00
Jade Ellis 6e86da1af8 Add a little for printing 2024-03-04 13:17:36 +00:00
Jade Ellis cda752e2cf Work on deployment 2024-02-19 17:32:23 +00:00
Jade Ellis 0602eea898 RSS and sitemap, etc 2024-02-19 13:15:46 +00:00
Jade Ellis ac2accc8ea Format 2024-02-19 13:14:55 +00:00
Jade Ellis fd813b8b33 MVP website 2024-02-14 12:52:52 +00:00
Jade Ellis 18b53db737 Update deploy a bit 2024-02-13 18:58:37 +00:00
Jade Ellis 53150ef7ff Base website 2024-02-13 16:38:14 +00:00
Jade Ellis eb5a8b4aa9 Initial commit 2023-12-24 18:07:19 +00:00
433 changed files with 24592 additions and 45968 deletions
+8 -27
View File
@@ -1,28 +1,9 @@
# Local build and dev artifacts
target
tests
# Docker files
Dockerfile*
docker-compose*
# IDE files
.vscode
.idea
*.iml
# Git folder
.git
.gitea
.gitlab
.github
# Dot files
.env
servers
compose.yml
node_modules
.gitignore
# Toml files
rustfmt.toml
# Documentation
#*.md
Dockerfile
.svelte-kit
build
output
.git
+6
View File
@@ -0,0 +1,6 @@
root = true
[*.{js,ts,svelte}]
charset = utf-8
indent_style = space
indent_size = 4
-5
View File
@@ -1,5 +0,0 @@
#!/usr/bin/env bash
use flake
PATH_add bin
+2
View File
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
-8
View File
@@ -1,8 +0,0 @@
<!-- Please describe your changes here -->
-----------------------------------------------------------------------------
- [ ] I ran `cargo fmt`, `cargo clippy`, and `cargo test`
- [ ] I agree to release my code and all other changes of this MR under the Apache-2.0 license
-227
View File
@@ -1,227 +0,0 @@
name: CI and Artifacts
on:
pull_request:
push:
branches:
- main
env:
# Required to make some things output color
TERM: ansi
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
jobs:
ci:
name: CI and Artifacts
runs-on: ubuntu-latest
steps:
- name: Sync repository
uses: actions/checkout@v4
- name: Install Nix (with flakes and nix-command enabled)
uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-unstable
# Add the `nix-community` cachix to speed up things that leverage it
extra_nix_config: |
experimental-features = nix-command flakes
extra-substituters = https://nix-community.cachix.org
extra-trusted-public-keys = nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
extra-substituters = https://crane.cachix.org
extra-trusted-public-keys = crane.cachix.org-1:8Scfpmn9w+hGdXH/Q9tTLiYAE/2dnJYRJP7kl80GuRk=
extra-substituters = https://nix.computer.surgery/conduit
extra-trusted-public-keys = conduit:ZGAf6P6LhNvnoJJ3Me3PRg7tlLSrPxcQ2RiE5LIppjo=
extra-substituters = https://attic.kennel.juneis.dog/conduit
extra-trusted-public-keys = conduit:Isq8FGyEC6FOXH6nD+BOeAA+bKp6X6UIbupSlGEPuOg=
extra-substituters = https://attic.kennel.juneis.dog/conduwuit
extra-trusted-public-keys = conduwuit:lYPVh7o1hLu1idH4Xt2QHaRa49WRGSAqzcfFd94aOTw=
- name: Pop/push Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Configure `nix-direnv`
run: |
echo 'source $HOME/.nix-profile/share/nix-direnv/direnvrc' > "$HOME/.direnvrc"
- name: Install `direnv` and `nix-direnv`
run: nix-env -f "<nixpkgs>" -iA direnv -iA nix-direnv
- name: Pop/push downloaded crate cache
uses: actions/cache@v4
with:
key: downloaded-crates
path: ~/.cargo
- name: Pop/push compiled crate cache
uses: actions/cache@v4
with:
key: compiled-crates-${{runner.os}}
path: target
# Do this to shorten the logs for the real CI step
- name: Populate `/nix/store`
run: nix develop --command true
- name: Perform continuous integration
run: |
direnv allow
direnv exec . engage
- name: Build static-x86_64-unknown-linux-musl
run: |
./bin/nix-build-and-cache .#static-x86_64-unknown-linux-musl
- name: Upload artifact static-x86_64-unknown-linux-musl
uses: actions/upload-artifact@v4
with:
name: static-x86_64-unknown-linux-musl
path: result/bin/conduit
if-no-files-found: error
- name: Build static-aarch64-unknown-linux-musl
run: |
./bin/nix-build-and-cache .#static-aarch64-unknown-linux-musl
- name: Upload artifact static-aarch64-unknown-linux-musl
uses: actions/upload-artifact@v4
with:
name: static-aarch64-unknown-linux-musl
path: result/bin/conduit
if-no-files-found: error
- name: Build oci-image-x86_64-unknown-linux-gnu
run: |
./bin/nix-build-and-cache .#oci-image
cp -f result oci-image-amd64.tar.gz
- name: Upload artifact oci-image-x86_64-unknown-linux-gnu
uses: actions/upload-artifact@v4
with:
name: oci-image-x86_64-unknown-linux-gnu
path: oci-image-amd64.tar.gz
# don't compress again
compression-level: 0
- name: Build oci-image-aarch64-unknown-linux-musl
run: |
./bin/nix-build-and-cache .#oci-image-aarch64-unknown-linux-musl
cp -f result oci-image-arm64v8.tar.gz
- name: Upload artifact oci-image-aarch64-unknown-linux-musl
uses: actions/upload-artifact@v4
with:
name: oci-image-aarch64-unknown-linux-musl
path: oci-image-arm64v8.tar.gz
if-no-files-found: error
# don't compress again
compression-level: 0
- name: Build deb-x86_64-unknown-linux-gnu
run: |
sudo apt-get update && sudo apt-get install -y --no-install-recommends libclang-dev
cargo install cargo-deb
cargo deb
- name: Upload artifact deb-x86_64-unknown-linux-gnu
uses: actions/upload-artifact@v4
with:
name: deb-x86_64-unknown-linux-gnu
path: target/debian/*.deb
if-no-files-found: error
- name: Extract metadata for Dockerhub
env:
REGISTRY: registry.hub.docker.com
IMAGE_NAME: ${{ github.repository }}
id: meta-dockerhub
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Extract metadata for GitHub Container Registry
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
id: meta-ghcr
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Login to Dockerhub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: girlbossceo
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
env:
REGISTRY: ghcr.io
with:
registry: ${{ env.REGISTRY }}
username: girlbossceo
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Dockerhub
if: github.event_name != 'pull_request'
env:
IMAGE_NAME: docker.io/${{ github.repository }}
IMAGE_SUFFIX_AMD64: amd64
IMAGE_SUFFIX_ARM64V8: arm64v8
run: |
docker load -i oci-image-amd64.tar.gz
IMAGE_ID_AMD64=$(docker images -q conduit:main)
docker load -i oci-image-arm64v8.tar.gz
IMAGE_ID_ARM64V8=$(docker images -q conduit:main)
# Tag and push the architecture specific images
docker tag $IMAGE_ID_AMD64 $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_AMD64
docker tag $IMAGE_ID_ARM64V8 $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_ARM64V8
docker push $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_AMD64
docker push $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_ARM64V8
# Tag the multi-arch image
docker manifest create $IMAGE_NAME:$GITHUB_SHA --amend $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_AMD64 --amend $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_ARM64V8
docker manifest push $IMAGE_NAME:$GITHUB_SHA
# Tag and push the git ref
docker manifest create $IMAGE_NAME:$GITHUB_REF_NAME --amend $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_AMD64 --amend $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_ARM64V8
docker manifest push $IMAGE_NAME:$GITHUB_REF_NAME
# Tag git tags as 'latest'
if [[ -n "$GITHUB_REF_NAME" ]]; then
docker manifest create $IMAGE_NAME:latest --amend $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_AMD64 --amend $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_ARM64V8
docker manifest push $IMAGE_NAME:latest
fi
- name: Publish to GitHub Container Registry
if: github.event_name != 'pull_request'
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
IMAGE_SUFFIX_AMD64: amd64
IMAGE_SUFFIX_ARM64V8: arm64v8
run: |
docker load -i oci-image-amd64.tar.gz
IMAGE_ID_AMD64=$(docker images -q conduit:main)
docker load -i oci-image-arm64v8.tar.gz
IMAGE_ID_ARM64V8=$(docker images -q conduit:main)
# Tag and push the architecture specific images
docker tag $IMAGE_ID_AMD64 $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_AMD64
docker tag $IMAGE_ID_ARM64V8 $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_ARM64V8
docker push $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_AMD64
docker push $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_ARM64V8
# Tag the multi-arch image
docker manifest create $IMAGE_NAME:$GITHUB_SHA --amend $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_AMD64 --amend $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_ARM64V8
docker manifest push $IMAGE_NAME:$GITHUB_SHA
# Tag and push the git ref
docker manifest create $IMAGE_NAME:$GITHUB_REF_NAME --amend $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_AMD64 --amend $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_ARM64V8
docker manifest push $IMAGE_NAME:$GITHUB_REF_NAME
# Tag git tags as 'latest'
if [[ -n "$GITHUB_REF_NAME" ]]; then
docker manifest create $IMAGE_NAME:latest --amend $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_AMD64 --amend $IMAGE_NAME:$GITHUB_SHA-$IMAGE_SUFFIX_ARM64V8
docker manifest push $IMAGE_NAME:latest
fi
-40
View File
@@ -1,40 +0,0 @@
name: Trivy code and vulnerability scanning
on:
pull_request:
push:
branches:
- main
schedule:
- cron: '00 12 * * *'
permissions:
contents: read
jobs:
trivy-scan:
name: Trivy Scan
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run Trivy code and vulnerability scanner on repo
uses: aquasecurity/trivy-action@0.17.0
with:
scan-type: repo
format: sarif
output: trivy-results.sarif
severity: CRITICAL,HIGH,MEDIUM,LOW
- name: Run Trivy code and vulnerability scanner on filesystem
uses: aquasecurity/trivy-action@0.17.0
with:
scan-type: fs
format: sarif
output: trivy-results.sarif
severity: CRITICAL,HIGH,MEDIUM,LOW
+3 -75
View File
@@ -1,76 +1,4 @@
# CMake
cmake-build-*/
node_modules
# IntelliJ
.idea/
out/
*.iml
modules.xml
*.ipr
# mpeltonen/sbt-idea plugin
.idea_modules/
# Linux backup files
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
# Rust
/target/
### vscode ###
.vscode/*
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows shortcuts
*.lnk
# Conduit
conduit.toml
conduit.db
# Etc.
**/*.rs.bk
cached_target
# Nix artifacts
/result*
# Direnv cache
/.direnv
test-conduit/
test-conduit.toml
# Gitlab CI cache
/.gitlab-ci.d
servers/*.ign
.parcel-cache
-164
View File
@@ -1,164 +0,0 @@
stages:
- ci
- artifacts
- publish
variables:
# Makes some things print in color
TERM: ansi
NIX_CONFIG: |
experimental-features = nix-command flake
extra-substituters = https://nix.computer.surgery/conduit
extra-trusted-public-keys = conduit:ZGAf6P6LhNvnoJJ3Me3PRg7tlLSrPxcQ2RiE5LIppjo=
extra-substituters = https://crane.cachix.org
extra-trusted-public-keys = crane.cachix.org-1:8Scfpmn9w+hGdXH/Q9tTLiYAE/2dnJYRJP7kl80GuRk=
extra-substituters = https://nix-community.cachix.org
extra-trusted-public-keys = nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
extra-substituters = https://attic.kennel.juneis.dog/conduit
extra-trusted-public-keys = conduit:Isq8FGyEC6FOXH6nD+BOeAA+bKp6X6UIbupSlGEPuOg=
extra-substituters = https://attic.kennel.juneis.dog/conduwuit
extra-trusted-public-keys = conduwuit:lYPVh7o1hLu1idH4Xt2QHaRa49WRGSAqzcfFd94aOTw=
before_script:
# Install direnv and nix-direnv
- if command -v nix > /dev/null; then nix-env -iA nixpkgs.direnv nixpkgs.nix-direnv nixpkgs.engage; fi
# Allow .envrc
- if command -v nix > /dev/null; then direnv allow; fi
# Set CARGO_HOME to a cacheable path
- export CARGO_HOME="$(git rev-parse --show-toplevel)/.gitlab-ci.d/cargo"
ci:
stage: ci
image: nixos/nix:2.20.2
script:
- direnv exec . engage
cache:
key: nix
paths:
- target
- .gitlab-ci.d
static:x86_64-unknown-linux-musl:
stage: artifacts
image: nixos/nix:2.20.2
script:
# Push artifacts and build requirements to binary cache
- ./bin/nix-build-and-cache .#static-x86_64-unknown-linux-musl
# Make the output less difficult to find
- cp result/bin/conduit conduit
artifacts:
paths:
- conduit
static:aarch64-unknown-linux-musl:
stage: artifacts
image: nixos/nix:2.20.2
script:
# Push artifacts and build requirements to binary cache
- ./bin/nix-build-and-cache .#static-aarch64-unknown-linux-musl
# Make the output less difficult to find
- cp result/bin/conduit conduit
artifacts:
paths:
- conduit
# Note that although we have an `oci-image-x86_64-unknown-linux-musl` output,
# we don't build it because it would be largely redundant to this one since it's
# all containerized anyway.
oci-image:x86_64-unknown-linux-gnu:
stage: artifacts
image: nixos/nix:2.20.2
script:
# Push artifacts and build requirements to binary cache
#
# Since the OCI image package is based on the binary package, this has the
# fun side effect of uploading the normal binary too. Conduit users who are
# deploying with Nix can leverage this fact by adding our binary cache to
# their systems.
- ./bin/nix-build-and-cache .#oci-image
# Make the output less difficult to find
- cp result oci-image-amd64.tar.gz
artifacts:
paths:
- oci-image-amd64.tar.gz
oci-image:aarch64-unknown-linux-musl:
stage: artifacts
needs:
# Wait for the static binary job to finish before starting so we don't have
# to build that twice for no reason
- static:aarch64-unknown-linux-musl
image: nixos/nix:2.20.2
script:
# Push artifacts and build requirements to binary cache
- ./bin/nix-build-and-cache .#oci-image-aarch64-unknown-linux-musl
# Make the output less difficult to find
- cp result oci-image-arm64v8.tar.gz
artifacts:
paths:
- oci-image-arm64v8.tar.gz
debian:x86_64-unknown-linux-gnu:
stage: artifacts
# See also `rust-toolchain.toml`
image: rust:1.75.0
script:
- cargo install cargo-deb
- cargo deb
# Make the output less difficult to find
- mv target/debian/*.deb conduit.deb
artifacts:
paths:
- conduit.deb
cache:
key: debian
paths:
- target
- .gitlab-ci.d
docker-publish:
stage: publish
image: docker:25.0.3
services:
- docker:25.0.3-dind
variables:
IMAGE_NAME: $CI_REGISTRY_IMAGE/conduwuit
IMAGE_SUFFIX_AMD64: amd64
IMAGE_SUFFIX_ARM64V8: arm64v8
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker load -i oci-image-amd64.tar.gz
- IMAGE_ID_AMD64=$(docker images -q conduit:main)
- docker load -i oci-image-arm64v8.tar.gz
- IMAGE_ID_ARM64V8=$(docker images -q conduit:main)
# Tag and push the architecture specific images
- docker tag $IMAGE_ID_AMD64 $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_AMD64
- docker tag $IMAGE_ID_ARM64V8 $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_ARM64V8
- docker push $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_AMD64
- docker push $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_ARM64V8
# Tag the multi-arch image
- docker manifest create $IMAGE_NAME:$CI_COMMIT_SHA --amend $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_AMD64 --amend $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_ARM64V8
- docker manifest push $IMAGE_NAME:$CI_COMMIT_SHA
# Tag and push the git ref
- docker manifest create $IMAGE_NAME:$CI_COMMIT_REF_NAME --amend $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_AMD64 --amend $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_ARM64V8
- docker manifest push $IMAGE_NAME:$CI_COMMIT_REF_NAME
# Tag git tags as 'latest'
- |
if [[ -n "$CI_COMMIT_TAG" ]]; then
docker manifest create $IMAGE_NAME:latest --amend $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_AMD64 --amend $IMAGE_NAME:$CI_COMMIT_SHA-$IMAGE_SUFFIX_ARM64V8
docker manifest push $IMAGE_NAME:latest
fi
dependencies:
- oci-image:x86_64-unknown-linux-gnu
- oci-image:aarch64-unknown-linux-musl
only:
- main
- tags
-8
View File
@@ -1,8 +0,0 @@
<!-- Please describe your changes here -->
-----------------------------------------------------------------------------
- [ ] I ran `cargo fmt`, `cargo clippy`, and `cargo test`
- [ ] I agree to release my code and all other changes of this MR under the Apache-2.0 license
-10
View File
@@ -1,10 +0,0 @@
{
"recommendations": [
"rust-lang.rust-analyzer",
"ms-azuretools.vscode-docker",
"eamodio.gitlens",
"serayuzgur.crates",
"vadimcn.vscode-lldb",
"timonwong.shellcheck"
]
}
-35
View File
@@ -1,35 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug conduit",
"sourceLanguages": ["rust"],
"cargo": {
"args": [
"build",
"--bin=conduit",
"--package=conduit"
],
"filter": {
"name": "conduit",
"kind": "bin"
}
},
"args": [],
"env": {
"RUST_BACKTRACE": "1",
"CONDUIT_CONFIG": "",
"CONDUIT_SERVER_NAME": "localhost",
"CONDUIT_DATABASE_PATH": "/tmp",
"CONDUIT_ADDRESS": "0.0.0.0",
"CONDUIT_PORT": "6167"
},
"cwd": "${workspaceFolder}"
}
]
}
-61
View File
@@ -1,61 +0,0 @@
# Setting up Appservices
## Getting help
If you run into any problems while setting up an Appservice, write an email to `timo@koesters.xyz`, ask us in [#conduit:fachschaften.org](https://matrix.to/#/#conduit:fachschaften.org) or [open an issue on GitLab](https://gitlab.com/famedly/conduit/-/issues/new).
## Set up the appservice - general instructions
Follow whatever instructions are given by the appservice. This usually includes
downloading, changing its config (setting domain, homeserver url, port etc.)
and later starting it.
At some point the appservice guide should ask you to add a registration yaml
file to the homeserver. In Synapse you would do this by adding the path to the
homeserver.yaml, but in Conduit you can do this from within Matrix:
First, go into the #admins room of your homeserver. The first person that
registered on the homeserver automatically joins it. Then send a message into
the room like this:
@conduit:your.server.name: register-appservice
```
paste
the
contents
of
the
yaml
registration
here
```
You can confirm it worked by sending a message like this:
`@conduit:your.server.name: list-appservices`
The @conduit bot should answer with `Appservices (1): your-bridge`
Then you are done. Conduit will send messages to the appservices and the
appservice can send requests to the homeserver. You don't need to restart
Conduit, but if it doesn't work, restarting while the appservice is running
could help.
## Appservice-specific instructions
### Remove an appservice
To remove an appservice go to your admin room and execute
`@conduit:your.server.name: unregister-appservice <name>`
where `<name>` one of the output of `list-appservices`.
### Tested appservices
These appservices have been tested and work with Conduit without any extra steps:
- [matrix-appservice-discord](https://github.com/Half-Shot/matrix-appservice-discord)
- [mautrix-hangouts](https://github.com/mautrix/hangouts/)
- [mautrix-telegram](https://github.com/mautrix/telegram/)
- [mautrix-signal](https://github.com/mautrix/signal/) from version `0.2.2` forward.
- [heisenbridge](https://github.com/hifi/heisenbridge/)
-134
View File
@@ -1,134 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement over email at
strawberry@puppygock.gay or over Matrix at @strawberry:puppygock.gay.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
Generated
-3658
View File
File diff suppressed because it is too large Load Diff
-245
View File
@@ -1,245 +0,0 @@
[package]
name = "conduit"
description = "a cool fork of Conduit, a Matrix homeserver written in Rust"
license = "Apache-2.0"
authors = ["strawberry <strawberry@puppygock.gay>", "timokoesters <timo@koesters.xyz>"]
homepage = "https://puppygock.gay/conduwuit"
repository = "https://gitlab.com/girlbossceo/conduwuit"
readme = "README.md"
version = "0.7.0-alpha+conduwuit-0.1.3"
edition = "2021"
# See also `rust-toolchain.toml`
rust-version = "1.75.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
# Web framework
axum = { version = "0.6.20", default-features = false, features = ["form", "headers", "http1", "http2", "json", "matched-path"], optional = true }
axum-server = { version = "0.5.1", features = ["tls-rustls"] }
tower = { version = "0.4.13", features = ["util"] }
tower-http = { version = "0.4.4", features = ["add-extension", "cors", "sensitive-headers", "trace", "util", "compression-zstd"] }
# Used for matrix spec type definitions and helpers
#ruma = { version = "0.4.0", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-pre-spec", "unstable-exhaustive-types"] }
#ruma = { git = "https://github.com/ruma/ruma", rev = "4d9f754657a099df8e61533787b8eebd12946435", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-msc2448", "unstable-msc3575", "unstable-exhaustive-types", "ring-compat", "unstable-unspecified", "unstable-msc2870", "unstable-msc3061", "unstable-msc2867", "unstable-extensible-events"] }
ruma = { git = "https://github.com/girlbossceo/ruma", rev = "788ea6b00fab49b04a17d88caa0c840b7d74aa13", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-msc2448", "unstable-msc3575", "unstable-exhaustive-types", "ring-compat", "unstable-unspecified", "unstable-msc2870", "unstable-msc3061", "unstable-msc2867", "unstable-extensible-events"] }
#ruma = { path = "../ruma/crates/ruma", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-msc2448", "unstable-msc3575", "unstable-exhaustive-types", "ring-compat", "unstable-unspecified" ] }
# Async runtime and utilities
hyperlocal = { git = "https://github.com/softprops/hyperlocal", rev = "2ee4d149644600d326559af0d2b235c945b05c04", features = [
"server",
] }
hyper = { version = "0.14", features = ["server", "http1", "http2"] }
tokio = { version = "1.36.0", features = ["fs", "macros", "signal", "sync"] }
# Used for the http request / response body type for Ruma endpoints used with reqwest
bytes = "1.5.0"
http = "0.2.11"
# Used for ruma wrapper
serde_json = { version = "1.0.114", features = ["raw_value"] }
# Used for appservice registration files
serde_yaml = "0.9.32"
# Used for pdu definition
serde = { version = "1.0.197", features = ["rc"] }
# Used for secure identifiers
rand = "0.8.5"
# Used to hash passwords
argon2 = "0.5.3"
reqwest = { version = "0.11.24", default-features = false, features = ["rustls-tls-native-roots", "socks"] }
# Used for conduit::Error type
thiserror = "1.0.57"
# Used to generate thumbnails for images
image = { version = "0.24.8", default-features = false, features = ["jpeg", "png", "gif", "webp"] }
# Used to encode server public key
base64 = "0.21.7"
# Used when hashing the state
ring = "0.17.8"
# Used when querying the SRV record of other servers
trust-dns-resolver = "0.23.2"
# Used to find matching events for appservices
regex = "1.10.3"
# Used to load forbidden room/user regex from config
serde_regex = "1.1.0"
itertools = "0.12.1"
# jwt jsonwebtokens
jsonwebtoken = "9.2.0"
# Performance measurements
tracing = { version = "0.1.40", features = [] }
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
tracing-flame = "0.2.0"
opentelemetry = "0.21.0"
opentelemetry_sdk = { version = "0.21.2", features = ["rt-tokio"] }
opentelemetry-jaeger = { version = "0.20.0", features = ["rt-tokio"] }
tracing-opentelemetry = "0.22.0"
lru-cache = "0.1.2"
rusqlite = { git = "https://github.com/rusqlite/rusqlite", rev = "ccfbc28ae1edc3090fb1b331fdc145f052ec73b9", optional = true, features = ["bundled"] }
parking_lot = { version = "0.12.1", optional = true }
num_cpus = "1.16.0"
threadpool = "1.8.1"
# Used for ruma wrapper
serde_html_form = "0.2.4"
thread_local = "1.1.7"
# used for TURN server authentication
hmac = "0.12.1"
sha-1 = "0.10.1"
sha2 = { version = "0.10.8" }
# used for conduit's CLI and admin room command parsing
clap = { version = "4.5.1", default-features = false, features = ["std", "derive", "help", "usage", "error-context"] }
futures-util = { version = "0.3.30", default-features = false }
# Used for reading the configuration from conduit.toml & environment variables
figment = { version = "0.10.14", features = ["env", "toml"] }
tikv-jemalloc-ctl = { version = "0.5.4", features = ["use_std"], optional = true }
tikv-jemallocator = { version = "0.5.4", features = ["unprefixed_malloc_on_supported_platforms"], optional = true }
lazy_static = "1.4.0"
async-trait = "0.1.77"
# used for checking if an IP is in specific subnets / CIDR ranges
ipaddress = "0.1.3"
sd-notify = { version = "0.4.1", optional = true }
webpage = { version = "2.0", default-features = false }
rocksdb = { version = "0.22.0", default-features = true, features = ["multi-threaded-cf", "zstd"], optional = true }
[target.'cfg(unix)'.dependencies]
nix = { version = "0.27.1", features = ["resource"] }
[features]
default = ["conduit_bin", "backend_rocksdb", "systemd", "zstd_compression"]
backend_sqlite = ["sqlite"]
backend_rocksdb = ["rocksdb"]
jemalloc = ["tikv-jemalloc-ctl", "tikv-jemallocator"]
sqlite = ["rusqlite", "parking_lot", "tokio/signal"]
conduit_bin = ["axum"]
systemd = ["sd-notify"]
#gzip_compression = ["tower-http/compression-gzip"]
zstd_compression = []
#brotli_compression = ["tower-http/compression-br"]
#compression = ["tower-http/compression-full"]
sha256_media = []
io_uring = ["rocksdb/io-uring"]
[[bin]]
name = "conduit"
path = "src/main.rs"
required-features = ["conduit_bin"]
[lib]
name = "conduit"
path = "src/lib.rs"
[package.metadata.deb]
name = "matrix-conduit"
maintainer = "strawberry <strawberry@puppygock.gay>"
copyright = "2024, Timo Kösters <timo@koesters.xyz>"
license-file = ["LICENSE", "3"]
depends = "$auto, ca-certificates"
extended-description = """\
a cool fork of Conduit, a Matrix homeserver written in Rust"""
section = "net"
priority = "optional"
assets = [
["debian/README.md", "usr/share/doc/matrix-conduit/README.Debian", "644"],
["README.md", "usr/share/doc/matrix-conduit/", "644"],
["target/release/conduit", "usr/sbin/matrix-conduit", "755"],
]
conf-files = [
"/etc/matrix-conduit/conduit.toml"
]
maintainer-scripts = "debian/"
systemd-units = { unit-name = "matrix-conduit" }
[profile.dev]
debug = 0
lto = 'off'
incremental = true
# default release profile
[profile.release]
lto = 'thin'
incremental = false
opt-level = 3
overflow-checks = true
strip = "symbols"
panic = "abort"
debug = 0
# high performance release profile which uses fat LTO across all crates, 1 codegen unit, max opt-level, and optimises across all crates
[profile.release-high-perf]
inherits = "release"
lto = 'fat'
codegen-units = 1
# For releases also try to max optimizations for dependencies:
[profile.release-high-perf.build-override]
debug = 0
opt-level = 3
codegen-units = 1
[profile.release-high-perf.package."*"]
debug = 0
opt-level = 3
codegen-units = 1
[lints]
workspace = true
[workspace.lints.rust]
missing_abi = "warn"
# missing_docs = "warn"
noop_method_call = "warn"
pointer_structural_match = "warn"
explicit_outlives_requirements = "warn"
# unreachable_pub = "warn"
unused_extern_crates = "warn"
unused_import_braces = "warn"
# unused_lifetimes = "warn"
unused_qualifications = "warn"
dead_code = "warn"
[workspace.lints.clippy]
suspicious = "warn" # assume deny in practice
perf = "warn" # assume deny in practice
redundant_clone = "warn"
cloned_instead_of_copied = "warn"
expl_impl_clone_on_copy = "warn"
# pedantic = "warn"
unnecessary_cast = "warn"
cast_lossless = "warn"
ptr_as_ptr = "warn"
mut_mut = "warn"
char_lit_as_u8 = "warn"
dbg_macro = "warn"
empty_structs_with_brackets = "warn"
get_unwrap = "warn"
# if_then_some_else_none = "warn"
# let_underscore_must_use = "warn"
# map_err_ignore = "warn"
# missing_docs_in_private_items = "warn"
negative_feature_names = "warn"
pub_without_shorthand = "warn"
rc_buffer = "warn"
rc_mutex = "warn"
redundant_feature_names = "warn"
redundant_type_annotations = "warn"
# ref_patterns = "warn"
rest_pat_in_fully_bound_structs = "warn"
str_to_string = "warn"
# string_add = "warn"
# string_slice = "warn"
string_to_string = "warn"
tests_outside_test_module = "warn"
undocumented_unsafe_blocks = "warn"
unneeded_field_pattern = "warn"
unseparated_literal_suffix = "warn"
# unwrap_used = "warn"
# expect_used = "warn"
wildcard_dependencies = "warn"
# or_fun_call = "warn"
unnecessary_lazy_evaluations = "warn"
-330
View File
@@ -1,330 +0,0 @@
# Deploying Conduit
### Please note that this documentation is not fully representative of conduwuit at the moment. Assume majority of it is outdated.
> ## Getting help
>
> If you run into any problems while setting up conduwuit, ask us
> in `#conduwuit:puppygock.gay` or [open an issue on GitHub](https://github.com/girlbossceo/conduwuit/issues/new).
## Installing conduwuit
You may simply download the binary that fits your machine. Run `uname -m` to see what you need. Now copy the appropriate URL:
**Stable versions:**
| CPU Architecture | Download stable version |
| ------------------------------------------- | --------------------------------------------------------------- |
| x84_64 / amd64 (Most servers and computers) | [Binary][x84_64-glibc-master] / [.deb][x84_64-glibc-master-deb] |
| armv7 (e.g. Raspberry Pi by default) | [Binary][armv7-glibc-master] / [.deb][armv7-glibc-master-deb] |
| armv8 / aarch64 | [Binary][armv8-glibc-master] / [.deb][armv8-glibc-master-deb] |
[x84_64-glibc-master]: https://gitlab.com/famedly/conduit/-/jobs/artifacts/master/raw/build-output/linux_amd64/conduit?job=docker:master
[armv7-glibc-master]: https://gitlab.com/famedly/conduit/-/jobs/artifacts/master/raw/build-output/linux_arm_v7/conduit?job=docker:master
[armv8-glibc-master]: https://gitlab.com/famedly/conduit/-/jobs/artifacts/master/raw/build-output/linux_arm64/conduit?job=docker:master
[x84_64-glibc-master-deb]: https://gitlab.com/famedly/conduit/-/jobs/artifacts/master/raw/build-output/linux_amd64/conduit.deb?job=docker:master
[armv7-glibc-master-deb]: https://gitlab.com/famedly/conduit/-/jobs/artifacts/master/raw/build-output/linux_arm_v7/conduit.deb?job=docker:master
[armv8-glibc-master-deb]: https://gitlab.com/famedly/conduit/-/jobs/artifacts/master/raw/build-output/linux_arm64/conduit.deb?job=docker:master
**Latest versions:**
| Target | Type | Download |
|-|-|-|
| `x86_64-unknown-linux-gnu` | Dynamically linked Debian package | [link](https://gitlab.com/api/v4/projects/famedly%2Fconduit/jobs/artifacts/next/raw/conduit.deb?job=debian:x86_64-unknown-linux-gnu) |
| `x86_64-unknown-linux-musl` | Statically linked binary | [link](https://gitlab.com/api/v4/projects/famedly%2Fconduit/jobs/artifacts/next/raw/conduit?job=static:x86_64-unknown-linux-musl) |
| `aarch64-unknown-linux-musl` | Statically linked binary | [link](https://gitlab.com/api/v4/projects/famedly%2Fconduit/jobs/artifacts/next/raw/conduit?job=static:aarch64-unknown-linux-musl) |
| `x86_64-unknown-linux-musl` | OCI image | [link](https://gitlab.com/api/v4/projects/famedly%2Fconduit/jobs/artifacts/next/raw/oci-image-amd64.tar.gz?job=oci-image:x86_64-unknown-linux-musl) |
| `aarch64-unknown-linux-musl` | OCI image | [link](https://gitlab.com/api/v4/projects/famedly%2Fconduit/jobs/artifacts/next/raw/oci-image-arm64v8.tar.gz?job=oci-image:aarch64-unknown-linux-musl) |
```bash
$ sudo wget -O /usr/local/bin/matrix-conduit <url>
$ sudo chmod +x /usr/local/bin/matrix-conduit
```
Alternatively, you may compile the binary yourself. First, install any dependencies:
```bash
# Debian
$ sudo apt install libclang-dev build-essential
# RHEL
$ sudo dnf install clang
```
Then, `cd` into the source tree of conduit-next and run:
```bash
$ cargo build --release
```
If you want to cross compile Conduit to another architecture, read the guide below.
<details>
<summary>Cross compilation</summary>
As easiest way to compile conduit for another platform [cross-rs](https://github.com/cross-rs/cross) is recommended, so install it first.
In order to use RockDB as storage backend append `-latomic` to linker flags.
For example, to build a binary for Raspberry Pi Zero W (ARMv6) you need `arm-unknown-linux-gnueabihf` as compilation
target.
```bash
git clone https://gitlab.com/famedly/conduit.git
cd conduit
export RUSTFLAGS='-C link-arg=-lgcc -Clink-arg=-latomic -Clink-arg=-static-libgcc'
cross build --release --no-default-features --features conduit_bin,backend_rocksdb --target=arm-unknown-linux-gnueabihf
```
</details>
## Adding a Conduit user
While Conduit can run as any user it is usually better to use dedicated users for different services. This also allows
you to make sure that the file permissions are correctly set up.
In Debian or RHEL, you can use this command to create a Conduit user:
```bash
sudo adduser --system conduit --group --disabled-login --no-create-home
```
## Forwarding ports in the firewall or the router
Conduit uses the ports 443 and 8448 both of which need to be open in the firewall.
If Conduit runs behind a router or in a container and has a different public IP address than the host system these public ports need to be forwarded directly or indirectly to the port mentioned in the config.
## Optional: Avoid port 8448
If Conduit runs behind Cloudflare reverse proxy, which doesn't support port 8448 on free plans, [delegation](https://matrix-org.github.io/synapse/latest/delegate.html) can be set up to have federation traffic routed to port 443:
```apache
# .well-known delegation on Apache
<Files "/.well-known/matrix/server">
ErrorDocument 200 '{"m.server": "your.server.name:443"}'
Header always set Content-Type application/json
Header always set Access-Control-Allow-Origin *
</Files>
```
[SRV DNS record](https://spec.matrix.org/latest/server-server-api/#resolving-server-names) delegation is also [possible](https://www.cloudflare.com/en-gb/learning/dns/dns-records/dns-srv-record/).
## Setting up a systemd service
Now we'll set up a systemd service for Conduit, so it's easy to start/stop Conduit and set it to autostart when your
server reboots. Simply paste the default systemd service you can find below into
`/etc/systemd/system/conduit.service`.
```systemd
[Unit]
Description=Conduit Matrix Server
After=network.target
[Service]
Environment="CONDUIT_CONFIG=/etc/matrix-conduit/conduit.toml"
User=conduit
Group=conduit
RuntimeDirectory=conduit
RuntimeDirectoryMode=0750
Restart=always
ExecStart=/usr/local/bin/matrix-conduit
[Install]
WantedBy=multi-user.target
```
Finally, run
```bash
$ sudo systemctl daemon-reload
```
## Creating the Conduit configuration file
Now we need to create the Conduit's config file in `/etc/conduwuit/conduwuit.toml`. Paste this in **and take a moment
to read it. You need to change at least the server name.**
You can also choose to use a different database backend, but right now only `rocksdb` and `sqlite` are recommended.
See the following example config at [conduwuit-example.toml](conduwuit-example.toml)
## Setting the correct file permissions
As we are using a Conduit specific user we need to allow it to read the config. To do that you can run this command on
Debian or RHEL:
```bash
sudo chown -R root:root /etc/matrix-conduit
sudo chmod 755 /etc/matrix-conduit
```
If you use the default database path you also need to run this:
```bash
sudo mkdir -p /var/lib/matrix-conduit/
sudo chown -R conduit:conduit /var/lib/matrix-conduit/
sudo chmod 700 /var/lib/matrix-conduit/
```
## Setting up the Reverse Proxy
This depends on whether you use Apache, Caddy, Nginx or another web server.
### Apache
Create `/etc/apache2/sites-enabled/050-conduit.conf` and copy-and-paste this:
```apache
# Requires mod_proxy and mod_proxy_http
#
# On Apache instance compiled from source,
# paste into httpd-ssl.conf or httpd.conf
Listen 8448
<VirtualHost *:443 *:8448>
ServerName your.server.name # EDIT THIS
AllowEncodedSlashes NoDecode
# TCP
ProxyPass /_matrix/ http://127.0.0.1:6167/_matrix/ timeout=300 nocanon
ProxyPassReverse /_matrix/ http://127.0.0.1:6167/_matrix/
# UNIX socket
#ProxyPass /_matrix/ unix:/run/conduit/conduit.sock|http://127.0.0.1:6167/_matrix/ nocanon
#ProxyPassReverse /_matrix/ unix:/run/conduit/conduit.sock|http://127.0.0.1:6167/_matrix/
</VirtualHost>
```
**You need to make some edits again.** When you are done, run
```bash
# Debian
$ sudo systemctl reload apache2
# Installed from source
$ sudo apachectl -k graceful
```
### Caddy
Create `/etc/caddy/conf.d/conduit_caddyfile` and enter this (substitute for your server name).
```caddy
your.server.name, your.server.name:8448 {
# TCP
reverse_proxy /_matrix/* 127.0.0.1:6167
# UNIX socket
#reverse_proxy /_matrix/* unix//run/conduit/conduit.sock
}
```
That's it! Just start or enable the service and you're set.
```bash
$ sudo systemctl enable caddy
```
### Nginx
If you use Nginx and not Apache, add the following server section inside the http section of `/etc/nginx/nginx.conf`
```nginx
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
listen 8448 ssl http2;
listen [::]:8448 ssl http2;
server_name your.server.name; # EDIT THIS
merge_slashes off;
# Nginx defaults to only allow 1MB uploads
# Increase this to allow posting large files such as videos
client_max_body_size 20M;
# UNIX socket
#upstream backend {
# server unix:/run/conduit/conduit.sock;
#}
location /_matrix/ {
# TCP
proxy_pass http://127.0.0.1:6167$request_uri;
# UNIX socket
#proxy_pass http://backend;
proxy_set_header Host $http_host;
proxy_buffering off;
proxy_read_timeout 5m;
}
ssl_certificate /etc/letsencrypt/live/your.server.name/fullchain.pem; # EDIT THIS
ssl_certificate_key /etc/letsencrypt/live/your.server.name/privkey.pem; # EDIT THIS
ssl_trusted_certificate /etc/letsencrypt/live/your.server.name/chain.pem; # EDIT THIS
include /etc/letsencrypt/options-ssl-nginx.conf;
}
```
**You need to make some edits again.** When you are done, run
```bash
$ sudo systemctl reload nginx
```
## SSL Certificate
If you chose Caddy as your web proxy SSL certificates are handled automatically and you can skip this step.
The easiest way to get an SSL certificate, if you don't have one already, is to [install](https://certbot.eff.org/instructions) `certbot` and run this:
```bash
# To use ECC for the private key,
# paste into /etc/letsencrypt/cli.ini:
# key-type = ecdsa
# elliptic-curve = secp384r1
$ sudo certbot -d your.server.name
```
[Automated renewal](https://eff-certbot.readthedocs.io/en/stable/using.html#automated-renewals) is usually preconfigured.
If using Cloudflare, configure instead the edge and origin certificates in dashboard. In case youre already running a website on the same Apache server, you can just copy-and-paste the SSL configuration from your main virtual host on port 443 into the above-mentioned vhost.
## You're done!
Now you can start Conduit with:
```bash
$ sudo systemctl start conduit
```
Set it to start automatically when your system boots with:
```bash
$ sudo systemctl enable conduit
```
## How do I know it works?
You can open <https://app.element.io>, enter your homeserver and try to register.
You can also use these commands as a quick health check.
```bash
$ curl https://your.server.name/_matrix/client/versions
# If using port 8448
$ curl https://your.server.name:8448/_matrix/client/versions
```
- To check if your server can talk with other homeservers, you can use the [Matrix Federation Tester](https://federationtester.matrix.org/).
If you can register but cannot join federated rooms check your config again and also check if the port 8448 is open and forwarded correctly.
# What's next?
## Audio/Video calls
For Audio/Video call functionality see the [TURN Guide](TURN.md).
## Appservices
If you want to set up an appservice, take a look at the [Appservice Guide](APPSERVICES.md).
-71
View File
@@ -1,71 +0,0 @@
### list of features, bug fixes, etc that conduwuit does that upstream does not:
- GitLab CI ported to GitHub Actions
- Fixed every single clippy (default lints) and rustc warnings, including some that were performance related or potential safety issues / unsoundness
- Has Renovate and significantly updates all dependencies possible
- Uses proper argon2 crate instead of questionable rust-argon2 crate
- Improved and cleaned up logging (less noisy dead server logging, registration attempts, more useful troubleshooting logging, etc)
- Attempts and interest in removing extreme and unnecessary panics/unwraps/expects that can lead to denial of service or such (upstream and upstream contributors want this unusual behaviour for some reason)
- Merged and cleaned up upstream MRs that have been sitting for 6-12 months
- Configurable RocksDB logging (`LOG` files) with proper defaults (rotate, max size, verbosity, etc) to stop LOG files from accumulating so much
- Federated presence support and configurable local presence (via upstream MR)
- Concurrency support for key fetching for faster remote room joins and room joins that will error less frequently (via upstream MR)
- Experimental room version 11 support (via upstream MR)
- Enabled all non-officially-supported room versions as experimental so we can at least attempt to join them
- Configurable guest registration including forbidding guest registrations if no admin user is created yet, respects allow registration setting, and an optional override setting with a default of no guest registrations allowed.
- Explicit startup error/warning if your configuration allows open registration without a token or such like Synapse
- Improved RocksDB defaults to use new features that help with performance significantly, uses settings tailored to SSDs, and a conduwuit setting to tell RocksDB to use settings that are tailored to HDDs or slow spinning rust storage.
- Updated Ruma to latest commit where possible, and add some unstable MSCs (some still require an implementation though)
- conduwuit allows MXIDs with `+` in them (thanks to Ruma update)
- Revamped admin room infrastructure and commands (via upstream MR)
- Admin room commands to delete room aliases and unpublish rooms from our room directory (via upstream MR)
- Make spaces/hierarchy cache use cache_capacity_modifier instead of hardcoded small value
- Make PDU appending, building, etc asynchronous
- Add *optional* feature flag to use SHA256 key names for media instead of base64 to overcome filesystem file name length limitations (OS error file name too long) (via upstream MR)
- Add *optional* feature flag to enable zstd HTTP body compression
- Add support for querying both Matrix SRV records, the deprecated `_matrix` record and `_matrix-fed` record if necessary
- Add config option for device name federation with a privacy-friendly default (disabled)
- Add config option for requiring authentication to the `/publicRooms` endpoint (room directory) with a default enabled for privacy
- Add config option for federating `/publicRooms` endpoint (room directory) to other servers with a default disabled for privacy
- Add support for listening on a UNIX socket for performance and host security with proper default permissions (660)
- Add missing `destination` key to all `X-Matrix` `Authorization` requests (spec compliance issue)
- Fix spec compliance issue with servers being able to fetch remote user profiles over federation for users who don't belong to our server (`/_matrix/federation/v1/query/profile`)
- Use aggressive build-time performance optimisations for release builds (1 codegen unit, no debug, fat LTO, etc, and optimise all crates with same)
- Raise various hardcoded timeouts in codebase that were way too short, making some things like room joins and client bugs error less or none at all than they should
- Add debug admin command to force update user device lists (could potentially resolve some E2EE flukes) (`ForceDeviceListUpdates`)
- Declare various missing Matrix versions and features at `/_matrix/client/versions`
- Add support for serving server and client well-known files from conduwuit using `well_known_client` and `well_known_server` options
- Add non-standard sliding sync proxy health check (?) endpoint at `/client/server.json` that some clients such as Element Web query using the `well_known_client` or `well_known_server` config options
- Send a User-Agent on all of our requests (`conduwuit/0.7.0-alpha+conduwuit-0.1.1`) which strangely was not done upstream since forever. Some providers consider no User-Agent suspicious and block said requests.
- Safer and cleaner shutdowns on both database side as we run cleanup on shutdown and exits database loop better (no potential hanging issues in database loop), overall cleaner shutdown logic
- Basic binary commands like `conduwuit --version` work (interested in expanding it more)
- Allow HEAD HTTP requests in CORS for clients (despite not being explicity mentioned in Matrix spec, HTTP spec says all HEAD requests need to behave the same as GET requests, Synapse supports HEAD requests)
- Purge unmaintained/irrelevant/broken database backends (heed, sled, persy)
- webp support for images
- Support for suggesting servers to join at `/_matrix/client/v3/directory/room/{roomAlias}`
- Prevent admin credential commands like reset password and deactivate user from modifying non-local users (https://gitlab.com/famedly/conduit/-/issues/377)
- Fixed spec compliance issue with room version 8 - 11 joins (https://github.com/matrix-org/synapse/issues/16717 / https://github.com/matrix-org/matrix-spec/issues/1708)
- Add basic cache eviction for true destinations when requests fail if we use a cached destination (e.g. a server has modified their well-known and we're still connecting to the old destination)
- Only follow 6 redirects total in our default reqwest ClientBuilder
- Generate passwords with 25 characters instead of 15
- Add missing `reason` field to user ban events (`/ban`)
- For all [`/report`](https://spec.matrix.org/v1.9/client-server-api/#post_matrixclientv3roomsroomidreporteventid) requests: check if the reported event ID belongs to the reported room ID, raise report reasoning character limit to 750, fix broken formatting, make a small delayed random response per spec suggestion on privacy, and check if the sender user is in the reported room.
- Support blocking servers from downloading remote media from
- Support sending `well_known` response to client logins if using config option `well_known_client`
- Send `avatar_url` on invite room membership events/changes
- Revamp example config, adding a lot of config options available (still some missing)
- Return joined member count of rooms for push rules/conditions instead of a hardcoded value of 10
- Respect *most* client parameters for `/media/` requests (`allow_redirect` still needs work)
- Config option `ip_range_denylist` to support refusing to send requests (typically federation) to specific IP ranges, typically RFC 1918, non-routable, testnet, etc addresses like Synapse for security.
- Support for creating rooms with custom room IDs like Maunium Synapse (`room_id` request body field to `/createRoom`)
- Assume well-knowns are broken if they exceed past 10000 characters.
- Basic validation/checks on user-specified room aliases and custom room ID creations
- Warn on unknown config options specified
- Add support for preventing certain room alias names and usernames using regex (via upstream MR) and extended to custom room IDs
- Revamp appservice registration to ruma's `Registration` type which fixes various appservice registration issues, including fixing crashing upon no URL specified (via upstream MR)
- URL preview support (via upstream MR) with various improvements
- Increased graceful shutdown timeout from a low 60 seconds to 180 seconds to avoid killing connections and let the remaining ones finish processing, and ask systemd for more time to shutdown if needed to prevent systemd's default [`TimeoutStopSec=`](https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#TimeoutStopSec=) of 90 seconds from killing conduwuit
- Bumped default max_concurrent_requests to 500
- Add support for the deprecated `user` identifier field for all `/login` requests
- Query parameter `?format=event|content` for returning either the room state event's content (default) for the full room state event on ` /_matrix/client/v3/rooms/{roomId}/state/{eventType}[/{stateKey}]` requests (see https://github.com/matrix-org/matrix-spec/issues/1047)
- Add admin commands for banning (blocking) room IDs from our local users joining (admins are always allowed) and evicts all our local users from that room, in addition to bulk room banning support, as a moderation feature
-202
View File
@@ -1,202 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2023 June
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-90
View File
@@ -1,90 +0,0 @@
# conduwuit
### a well maintained fork of [Conduit](https://conduit.rs/)
#### What is Matrix?
[Matrix](https://matrix.org) is an open network for secure and decentralized
communication. Users from every Matrix homeserver can chat with users from all
other Matrix servers. You can even use bridges (also called Matrix appservices)
to communicate with users outside of Matrix, like a community on Discord.
#### What is the goal?
An efficient Matrix homeserver that's easy to set up and just works. You can install
it on a mini-computer like the Raspberry Pi to host Matrix for your family,
friends or company.
#### Can I try it out?
There are no public conduwuit homeservers available, however conduwuit is incredibly simple to install. It's just a binary, a config file, and a database path.
#### What is the current status?
conduwuit is a fork of Conduit which is in beta, meaning you can join and participate in most
Matrix rooms, but not all features are supported and you might run into bugs
from time to time. conduwuit attempts to fix and improve the majority of upstream Conduit bugs
or UX issues that are taking too long to be resolved, or unnecessary Matrix or developer
politics halting simple things from being merged or fixed, and general inactivity.
There are still a few nice to have features missing that some users may notice:
- Outgoing read receipts and typing indicators (receiving works)
#### What's different about your fork than upstream Conduit?
See [DIFFERENCES.md](DIFFERENCES.md)
#### Why does this fork exist? Why don't you contribute back upstream?
I have tried, but:
- unnecessary Matrix / developer politics
- bikeshedding unnecessary or irrelevant things in MRs
- disagreement with how the upstream project is maintained including the codebase
- upstream maintainer inactivity
- questionable community members
- lack of MR reviews or issue triaging and no upstream maintainer interest in receiving help
- severe bugs, including denial of service and other likely vulnerabilities, not being merged due to things mentioned above
- no interest in adding co-maintainers to help out
are what are keeping me from contributing. If the state of the upstream project improves, I'm
willing to start contributing again. As is, I think if folks want a more polished and well-kept version of Conduit, conduwuit exists for that.
#### How can I deploy my own?
- Simple install (this was tested the most): [DEPLOY.md](DEPLOY.md)
- Nix/NixOS: [nix/README.md](nix/README.md)
If you want to connect an Appservice to Conduit, take a look at [APPSERVICES.md](APPSERVICES.md).
#### How can I contribute?
1. Look for an issue you would like to work on and make sure it's not assigned
to other users
2. Ask someone to assign the issue to you (comment on the issue or chat in
[#conduwuit:puppygock.gay](https://matrix.to/#/#conduwuit:puppygock.gay))
3. Fork the repo and work on the issue.
4. Submit a PR (please keep contributions to the GitHub repo, main development is done here,
not the GitLab repo which exists just as a mirror.)
#### Contact
If you run into any question, feel free to
- Ask us in `#conduwuit:puppygock.gay` on Matrix
- [Open an issue on GitHub](https://github.com/girlbossceo/conduwuit/issues/new)
#### Donate
Liberapay: <https://liberapay.com/girlbossceo>\
Ko-fi: <https://ko-fi.com/puppygock>\
GitHub Sponsors: <https://github.com/sponsors/girlbossceo>
#### Logo
No official conduwuit logo exists. Repo and Matrix room picture is from bran (<3).
#### Mirrors of conduwuit
GitHub: https://github.com/girlbossceo/conduwuit
GitLab: https://gitlab.com/girlbossceo/conduwuit
git.gay: https://git.gay/june/conduwuit
Codeberg: https://codeberg.org/girlbossceo/conduwuit
sourcehut: https://git.sr.ht/~girlbossceo/conduwuit
-25
View File
@@ -1,25 +0,0 @@
# Setting up TURN/STURN
## General instructions
* It is assumed you have a [Coturn server](https://github.com/coturn/coturn) up and running. See [Synapse reference implementation](https://github.com/matrix-org/synapse/blob/develop/docs/turn-howto.md).
## Edit/Add a few settings to your existing conduit.toml
```
# Refer to your Coturn settings.
# `your.turn.url` has to match the REALM setting of your Coturn as well as `transport`.
turn_uris = ["turn:your.turn.url?transport=udp", "turn:your.turn.url?transport=tcp"]
# static-auth-secret of your turnserver
turn_secret = "ADD SECRET HERE"
# If you have your TURN server configured to use a username and password
# you can provide these information too. In this case comment out `turn_secret above`!
#turn_username = ""
#turn_password = ""
```
## Apply settings
Restart Conduit.
-37
View File
@@ -1,37 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
# Path to Complement's source code
COMPLEMENT_SRC="$1"
# A `.jsonl` file to write test logs to
LOG_FILE="$2"
# A `.jsonl` file to write test results to
RESULTS_FILE="$3"
OCI_IMAGE="complement-conduit:dev"
env \
-C "$(git rev-parse --show-toplevel)" \
docker build \
--tag "$OCI_IMAGE" \
--file complement/Dockerfile \
.
# It's okay (likely, even) that `go test` exits nonzero
set +o pipefail
env \
-C "$COMPLEMENT_SRC" \
COMPLEMENT_BASE_IMAGE="$OCI_IMAGE" \
go test -json ./tests | tee "$LOG_FILE"
set -o pipefail
# Post-process the results into an easy-to-compare format
cat "$LOG_FILE" | jq -c '
select(
(.Action == "pass" or .Action == "fail" or .Action == "skip")
and .Test != null
) | {Action: .Action, Test: .Test}
' | sort > "$RESULTS_FILE"
-50
View File
@@ -1,50 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
# The first argument must be the desired installable
INSTALLABLE="$1"
# Build the installable and forward any other arguments too
nix build -L "$@"
if [ ! -z ${ATTIC_TOKEN+x} ]; then
nix run --inputs-from . attic -- login \
conduit \
https://attic.kennel.juneis.dog/conduit \
"$ATTIC_TOKEN"
push_args=(
# Attic and its build dependencies
"$(nix path-info --inputs-from . attic)"
"$(nix path-info --inputs-from . attic --derivation)"
# The target installable and its build dependencies
"$(nix path-info "$INSTALLABLE" --derivation)"
"$(nix path-info "$INSTALLABLE")"
)
nix run --inputs-from . attic -- push conduit "${push_args[@]}"
# push to "conduwuit" too
nix run --inputs-from . attic -- login \
conduwuit \
https://attic.kennel.juneis.dog/conduwuit \
"$ATTIC_TOKEN"
push_args=(
# Attic and its build dependencies
"$(nix path-info --inputs-from . attic)"
"$(nix path-info --inputs-from . attic --derivation)"
# The target installable and its build dependencies
"$(nix path-info "$INSTALLABLE" --derivation)"
"$(nix path-info "$INSTALLABLE")"
)
nix run --inputs-from . attic -- push conduwuit "${push_args[@]}"
else
echo "\$ATTIC_TOKEN is unset, skipping uploading to the binary cache"
fi
-46
View File
@@ -1,46 +0,0 @@
FROM rust:1.75.0
WORKDIR /workdir
RUN apt-get update && apt-get install -y --no-install-recommends \
libclang-dev
COPY Cargo.toml Cargo.toml
COPY Cargo.lock Cargo.lock
COPY src src
RUN cargo build --release \
&& mv target/release/conduit conduit \
&& rm -rf target
# Install caddy
RUN apt-get update \
&& apt-get install -y \
debian-keyring \
debian-archive-keyring \
apt-transport-https \
curl \
&& curl -1sLf 'https://dl.cloudsmith.io/public/caddy/testing/gpg.key' \
| gpg --dearmor -o /usr/share/keyrings/caddy-testing-archive-keyring.gpg \
&& curl -1sLf 'https://dl.cloudsmith.io/public/caddy/testing/debian.deb.txt' \
| tee /etc/apt/sources.list.d/caddy-testing.list \
&& apt-get update \
&& apt-get install -y caddy
COPY conduit-example.toml conduit.toml
COPY complement/caddy.json caddy.json
ENV SERVER_NAME=localhost
ENV CONDUIT_CONFIG=/workdir/conduit.toml
RUN sed -i "s/port = 6167/port = 8008/g" conduit.toml
RUN echo "log = \"warn,_=off,sled=off\"" >> conduit.toml
RUN sed -i "s/address = \"127.0.0.1\"/address = \"0.0.0.0\"/g" conduit.toml
EXPOSE 8008 8448
CMD uname -a && \
sed -i "s/#server_name = \"your.server.name\"/server_name = \"${SERVER_NAME}\"/g" conduit.toml && \
sed -i "s/your.server.name/${SERVER_NAME}/g" caddy.json && \
caddy start --config caddy.json > /dev/null && \
/workdir/conduit
-12
View File
@@ -1,12 +0,0 @@
# Complement
## What's that?
Have a look at [its repository](https://github.com/matrix-org/complement).
## How do I use it with Conduit?
The script at [`../bin/complement`](../bin/complement) has automation for this.
It takes a few command line arguments, you can read the script to find out what
those are.
-72
View File
@@ -1,72 +0,0 @@
{
"logging": {
"logs": {
"default": {
"level": "WARN"
}
}
},
"apps": {
"http": {
"https_port": 8448,
"servers": {
"srv0": {
"listen": [":8448"],
"routes": [{
"match": [{
"host": ["your.server.name"]
}],
"handle": [{
"handler": "subroute",
"routes": [{
"handle": [{
"handler": "reverse_proxy",
"upstreams": [{
"dial": "127.0.0.1:8008"
}]
}]
}]
}],
"terminal": true
}],
"tls_connection_policies": [{
"match": {
"sni": ["your.server.name"]
}
}]
}
}
},
"pki": {
"certificate_authorities": {
"local": {
"name": "Complement CA",
"root": {
"certificate": "/complement/ca/ca.crt",
"private_key": "/complement/ca/ca.key"
},
"intermediate": {
"certificate": "/complement/ca/ca.crt",
"private_key": "/complement/ca/ca.key"
}
}
}
},
"tls": {
"automation": {
"policies": [{
"subjects": ["your.server.name"],
"issuers": [{
"module": "internal"
}],
"on_demand": true
}, {
"issuers": [{
"module": "internal",
"ca": "local"
}]
}]
}
}
}
}
+114
View File
@@ -0,0 +1,114 @@
# podman save --format oci-archive jade-website-frontend:latest | gzip | ssh core@176.126.240.240 -T "zcat | podman load"
# podman compose create
# let containers = podman ps -a --format json | from json | where Labels."com.docker.compose.project" == "jade-website"
# podman compose create; let containers = podman ps -a --format json | from json | where Labels."com.docker.compose.project" == "jade-website"; podman kube generate ($containers | get Id) | save deployment.yml
# echo deployment.yml | ssh core@176.126.240.240 -T "cat > deployment.yml"
# $containers.1.Labels | to yaml
# podman kube generate -s ($containers | get Id) --podman-only | ssh core@176.126.240.240 -T "cat > deployment.yml"
version: '2'
services:
jade-website-frontend:
image: jade-website-frontend:latest
build:
context: .
dockerfile: packages/website/Dockerfile
restart: unless-stopped
# ports:
# - 3000:3000
networks:
- proxy
# deploy:
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy" # Change this to the name of your Traefik docker proxy network
# - "traefik.http.routers.to-website.rule=Host(`jade.ellis.link`)"
# - "traefik.http.routers.to-website.entrypoints=http"
- "traefik.http.routers.to-website.rule=Host(`jade.ellis.link.localhost`)"
- "traefik.http.routers.to-website.entrypoints=http"
# - "traefik.http.routers.to-website.tls=true"
# - "traefik.http.routers.to-website.tls.certresolver=letsencrypt"
# - "traefik.http.routers.to-website.middlewares=cors-headers@docker"
# - "traefik.http.middlewares.cors-headers.headers.accessControlAllowOriginList=*"
# - "traefik.http.middlewares.cors-headers.headers.accessControlAllowHeaders=Origin, X-Requested-With, Content-Type, Accept, Authorization"
# - "traefik.http.middlewares.cors-headers.headers.accessControlAllowMethods=GET, POST, PUT, DELETE, OPTIONS"
traefik:
image: "traefik:latest"
container_name: "traefik"
restart: "unless-stopped"
# privileged: true
security_opt:
- "label=type:container_runtime_t"
command:
- "--log.level=DEBUG"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.http.address=:8080"
# - "--entrypoints.https.address=:443"
# - "--acme"
# - "--certificatesresolvers.letsencrypt.acme.email='jade@ellis.link'"
# - "--certificatesresolvers.letsencrypt.acme.storage=/certificates/acme.json"
# - "--certificatesresolvers.letsencrypt.acme.httpchallenge=true"
# - "--certificatesresolvers.letsencrypt.acme.httpChallenge.entryPoint=http"
# - "--certificatesresolvers.lets-encrypt.acme.tlschallenge=true"
# - "--entrypoints.http.http.redirections.entryPoint.to=https"
# - "--entrypoints.http.http.redirections.entryPoint.scheme=https"
# - --api.dashboard=true
# - --api.insecure=true
ports:
# - "80:80"
# - "443:443"
- "8080:8080"
volumes:
- "/run/user/1000/podman/podman.sock:/var/run/docker.sock"
# - "/var/run/docker.sock:/var/run/docker.sock:ro"
- "traefik-public-certificates:/certificates"
# - "./traefik_config:/etc/traefik"
# labels:
# - "traefik.enable=true"
# # middleware redirect
# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
# # global redirect to https
# - "traefik.http.routers.redirs.rule=hostregexp(`{host:.+}`)"
# - "traefik.http.routers.redirs.entrypoints=http"
# - "traefik.http.routers.redirs.middlewares=redirect-to-https"
networks:
- proxy
networks:
proxy:
# external: true
enable_ipv6: true
volumes:
traefik-public-certificates:
# mkdir -p ~/.config/containers/systemd
# nano ~/.config/containers/systemd/deployment.kube
# [Unit]
# Description=Deployment via kubernetes
# Before=local-fs.target
# [Kube]
# Yaml=/var/home/core/deployment.yml
# [Install]
# # Start by default on boot
# WantedBy=multi-user.target default.target
# systemctl --user daemon-reload
# systemctl --user start deployment.service
-277
View File
@@ -1,277 +0,0 @@
# =============================================================================
# This is the official example config for conduwuit.
# If you use it for your server, you will need to adjust it to your own needs.
# At the very least, change the server_name field!
# =============================================================================
[global]
# The server_name is the pretty name of this server. It is used as a suffix for user
# and room ids. Examples: matrix.org, conduit.rs
# The Conduit server needs all /_matrix/ requests to be reachable at
# https://your.server.name/ on port 443 (client-server) and 8448 (federation).
# If that's not possible for you, you can create /.well-known files to redirect
# requests (delegation). See
# https://spec.matrix.org/latest/client-server-api/#getwell-knownmatrixclient
# and
# https://spec.matrix.org/v1.9/server-server-api/#getwell-knownmatrixserver
# for more information
# YOU NEED TO EDIT THIS
#server_name = "your.server.name"
# Servers listed here will be used to gather public keys of other servers.
# Generally, copying this exactly should be enough. (Currently, conduwuit doesn't
# support batched key requests, so this list should only contain Synapse
# servers.) Defaults to `matrix.org`
# trusted_servers = ["matrix.org"]
### Database configuration
# This is the only directory where conduwuit will save its data, including media
database_path = "/var/lib/conduwuit/"
# Database backend: Only rocksdb and sqlite are supported. Please note that sqlite
# will perform significantly worse than rocksdb as it is not intended to be used the
# way it is by conduwuit. sqlite only exists for historical reasons.
database_backend = "rocksdb"
### Network
# The port conduwuit will be running on. You need to set up a reverse proxy such as
# Caddy or Nginx so all requests to /_matrix on port 443 and 8448 will be
# forwarded to the conduwuit instance running on this port
# Docker users: Don't change this, you'll need to map an external port to this.
port = 6167
# default address (IPv4 or IPv6) conduwuit will listen on. Generally you want this to be
# localhost (127.0.0.1 / ::1). If you are using Docker or a container NAT networking setup, you
# likely need this to be 0.0.0.0.
address = "127.0.0.1"
# How many requests conduwuit sends to other servers at the same time concurrently. Default is 500
# Note that because conduwuit is very fast unlike other homeserver implementations, setting this too
# high could inadvertently result in ratelimits kicking in, or overloading lower-end homeservers out there.
#
# A valid use-case for enabling this is if you have a significant amount of overall federation activity
# such as many rooms joined/tracked, and many servers in the true destination cache caused by that. Upon
# rebooting conduwuit, depending on how fast your resources are, client and incoming federation requests
# may timeout or be "stalled" for a period of time due to hitting the max concurrent requests limit from
# refreshing federation/destination caches and such.
#
# If you have a lot of active users on your homeserver, you will definitely need to raise this.
#
# No this will not speed up room joins.
#max_concurrent_requests = 500
# Max request size for file uploads
max_request_size = 20_000_000 # in bytes
# Uncomment unix_socket_path to listen on a UNIX socket at the specified path.
# If listening on a UNIX socket, you must remove/comment the 'address' key if defined and add your
# reverse proxy to the 'conduwuit' group, unless world RW permissions are specified with unix_socket_perms (666 minimum).
#unix_socket_path = "/run/conduwuit/conduwuit.sock"
#unix_socket_perms = 660
# Set this to true for conduwuit to compress HTTP response bodies using zstd.
# Please be aware that enabling HTTP compression may weaken or even defeat TLS.
# Most users should not need to enable this.
# See https://breachattack.com/ and https://wikipedia.org/wiki/BREACH before deciding to enable this.
zstd_compression = false
# Vector list of IPv4 and IPv6 CIDR ranges / subnets *in quotes* that you do not want conduwuit to send outbound requests to.
# Defaults to RFC1918, unroutable, loopback, multicast, and testnet addresses for security.
#
# To disable, set this to be an empty vector (`[]`).
#
# Currently this does not account for proxies in use like Synapse does.
ip_range_denylist = [
"127.0.0.0/8",
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16",
"100.64.0.0/10",
"192.0.0.0/24",
"169.254.0.0/16",
"192.88.99.0/24",
"198.18.0.0/15",
"192.0.2.0/24",
"198.51.100.0/24",
"203.0.113.0/24",
"224.0.0.0/4",
"::1/128",
"fe80::/10",
"fc00::/7",
"2001:db8::/32",
"ff00::/8",
"fec0::/10",
]
### Moderation / Privacy / Security
# Set to true to allow user type "guest" registrations. Element attempts to register guest users automatically.
# For private homeservers, this is best at false.
allow_guest_registration = false
# Vector list of servers that conduwuit will refuse to download remote media from.
# No default.
# prevent_media_downloads_from = ["example.com", "example.local"]
# Enables open registration. If set to false, no users can register on this
# server.
# If set to true without a token configured, users can register with no form of 2nd-
# step only if you set
# `yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse` to
# true in your config. If you would like
# registration only via token reg, please configure the `registration_token` key.
allow_registration = false
# Please note that an open registration homeserver with no second-step verification
# is highly prone to abuse and potential defederation by homeservers, including
# matrix.org.
# A static registration token that new users will have to provide when creating
# an account. If unset and `allow_registration` is true, registration is open
# without any condition. YOU NEED TO EDIT THIS.
registration_token = "change this token for something specific to your server"
# controls whether federation is allowed or not
# defaults to true
# allow_federation = true
# controls whether users are allowed to create rooms.
# appservices and admins are always allowed to create rooms
# defaults to true
# allow_room_creation = true
# Set this to true to allow your server's public room directory to be federated.
# Set this to false to protect against /publicRooms spiders, but will forbid external users
# from viewing your server's public room directory. If federation is disabled entirely
# (`allow_federation`), this is inherently false.
allow_public_room_directory_over_federation = false
# Set this to true to allow your server's public room directory to be queried without client
# authentication (access token) through the Client APIs. Set this to false to protect against /publicRooms spiders.
allow_public_room_directory_without_auth = false
# Set this to true to allow federating device display names / allow external users to see your device display name.
# If federation is disabled entirely (`allow_federation`), this is inherently false. For privacy, this is best disabled.
allow_device_name_federation = false
# Vector list of domains allowed to send requests to for URL previews. Defaults to none.
# Note: this is a *contains* match, not an explicit match. Putting "google.com" will match "https://google.com" and "http://mymaliciousdomainexamplegoogle.com"
# Setting this to "*" will allow all URL previews. Please note that this opens up significant attack surface to your server, you are expected to be aware of the risks by doing so.
url_preview_domain_contains_allowlist = []
# Vector list of explicit domains allowed to send requests to for URL previews. Defaults to none.
# Note: This is an *explicit* match, not a ccontains match. Putting "google.com" will match "https://google.com", "http://google.com", but not "https://mymaliciousdomainexamplegoogle.com"
# Setting this to "*" will allow all URL previews. Please note that this opens up significant attack surface to your server, you are expected to be aware of the risks by doing so.
url_preview_domain_explicit_allowlist = []
# Vector list of URLs allowed to send requests to for URL previews. Defaults to none.
# Note that this is a *contains* match, not an explicit match. Putting "google.com" will match "https://google.com/", "https://google.com/url?q=https://mymaliciousdomainexample.com", and "https://mymaliciousdomainexample.com/hi/google.com"
# Setting this to "*" will allow all URL previews. Please note that this opens up significant attack surface to your server, you are expected to be aware of the risks by doing so.
url_preview_url_contains_allowlist = []
# Maximum amount of bytes allowed in a URL preview body size when spidering. Defaults to 1MB (1_000_000 bytes)
url_preview_max_spider_size = 1_000_000
# Option to decide whether you would like to run the domain allowlist checks (contains and explicit) on the root domain or not. Does not apply to URL contains allowlist. Defaults to false.
# Example: If this is enabled and you have "wikipedia.org" allowed in the explicit and/or contains domain allowlist, it will allow all subdomains under "wikipedia.org" such as "en.m.wikipedia.org" as the root domain is checked and matched.
# Useful if the domain contains allowlist is still too broad for you but you still want to allow all the subdomains under a root domain.
url_preview_check_root_domain = false
### Misc
# max log level for conduwuit. allows debug, info, warn, or error
#log = "warn"
# controls whether encrypted rooms and events are allowed (default true)
#allow_encryption = false
# conduwuit will send a simple GET request periodically to `https://pupbrain.dev/check-for-updates/stable`
# for any new announcements made. Despite the name, this is not an update check
# endpoint, it is simply an announcement check endpoint. I don't plan on using
# this so feel free to disable it.
allow_check_for_updates = true
# Enables adding the lightning bolt emoji (⚡️) to all newly registered users'
# initial display names.
enable_lightning_bolt = false
# If you are using delegation via well-known files and you cannot serve them from your reverse proxy, you can
# uncomment these to serve them directly from conduwuit. This requires proxying all requests to conduwuit, not just `/_matrix` to work.
#well_known_server = "matrix.example.com:443"
#well_known_client = "https://matrix.example.com"
# Note that whatever you put will show up in the well-known JSON values.
# Set to false to disable users from joining or creating room versions that aren't 100% officially supported by conduwuit.
# conduwuit officially supports room versions 6 - 10. conduwuit has experimental/unstable support for 1 - 5, and 11.
# Defaults to true.
#allow_unstable_room_versions = true
# Set this to any float value to multiply conduwuit's in-memory LRU caches with.
# May be useful if you have significant memory to spare to increase performance.
# Defaults to 1.0.
#conduit_cache_capacity_modifier = 1.0
# Set this to any float value in megabytes for conduwuit to tell the database engine that this much memory is available for database-related caches.
# May be useful if you have significant memory to spare to increase performance.
# Defaults to 300.0
#db_cache_capacity_mb = 300.0
### RocksDB options
# Set this to true to use RocksDB config options that are tailored to HDDs (slower device storage)
#rocksdb_optimize_for_spinning_disks = false
# RocksDB log level. This is not the same as conduwuit's log level. This is the log level for RocksDB itself
# which show up in your database folder/path as `LOG` files. Defaults to warn. conduwuit will typically log RocksDB errors.
#rocksdb_log_level = "warn"
# Max RocksDB `LOG` file size before rotating in bytes. Defaults to 4MB.
#rocksdb_max_log_file_size = 4194304
# Time in seconds before RocksDB will forcibly rotate logs. Defaults to 0.
#rocksdb_log_time_to_roll = 0
### Presence
# Config option to control local (your server only) presence updates/requests. Defaults to false.
# Note that presence on conduwuit is very fast unlike Synapse's.
# If using outgoing presence, this MUST be enabled.
#allow_local_presence = false
# Config option to control incoming federated presence updates/requests. Defaults to false.
# This option receives presence updates from other servers, but does not send any unless `allow_outgoing_presence` is true.
# Note that presence on conduwuit is very fast unlike Synapse's.
#allow_incoming_presence = false
# Config option to control outgoing presence updates/requests. Defaults to false.
# This option sends presence updates to other servers, but does not receive any unless `allow_incoming_presence` is true.
# Note that presence on conduwuit is very fast unlike Synapse's.
# If using outgoing presence, you MUST enable `allow_local_presence` as well.
#
# Warning: Outgoing federated presence is not spec compliant due to relying on PDUs and EDUs combined.
# Outgoing presence will not be very reliable due to this and any issues with federated outgoing presence are very likely attributed to this issue.
# Incoming presence and local presence are unaffected.
#allow_outgoing_presence = false
# Config option to control how many seconds before presence updates that you are idle. Defaults to 5 minutes.
#presence_idle_timeout_s = 300
# Config option to control how many seconds before presence updates that you are offline. Defaults to 30 minutes.
#presence_offline_timeout_s = 1800
-37
View File
@@ -1,37 +0,0 @@
conduwuit for Debian
==================
Installation
------------
Information about downloading, building and deploying the Debian package, see
the "Installing Conduit" section in [DEPLOY.md](../DEPLOY.md).
All following sections until "Setting up the Reverse Proxy" be ignored because
this is handled automatically by the packaging.
Configuration
-------------
When installed, Debconf generates the configuration of the homeserver
(host)name, the address and port it listens on. This configuration ends up in
`/etc/matrix-conduit/conduit.toml`.
You can tweak more detailed settings by uncommenting and setting the variables
in `/etc/matrix-conduit/conduit.toml`. This involves settings such as the maximum
file size for download/upload, enabling federation, etc.
Running
-------
The package uses the `matrix-conduit.service` systemd unit file to start and
stop Conduit. It loads the configuration file mentioned above to set up the
environment before running the server.
This package assumes by default that Conduit will be placed behind a reverse
proxy such as Apache or nginx. This default deployment entails just listening
on `127.0.0.1` and the free port `6167` and is reachable via a client using the URL
<http://localhost:6167>.
At a later stage this packaging may support also setting up TLS and running
stand-alone. In this case, however, you need to set up some certificates and
renewal, for it to work properly.
-17
View File
@@ -1,17 +0,0 @@
#!/bin/sh
set -e
# Source debconf library.
. /usr/share/debconf/confmodule
# Ask for the Matrix homeserver name, address and port.
db_input high matrix-conduit/hostname || true
db_go
db_input low matrix-conduit/address || true
db_go
db_input medium matrix-conduit/port || true
db_go
exit 0
-57
View File
@@ -1,57 +0,0 @@
[Unit]
Description=Conduit Matrix homeserver
After=network-online.target
[Service]
DynamicUser=yes
User=_matrix-conduit
Group=_matrix-conduit
Type=notify
AmbientCapabilities=
CapabilityBoundingSet=
DevicePolicy=closed
LockPersonality=yes
MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
ProcSubset=pid
ProtectClock=yes
ProtectControlGroups=yes
ProtectHome=yes
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
ProtectProc=invisible
ProtectSystem=strict
PrivateDevices=yes
PrivateMounts=yes
PrivateTmp=yes
PrivateUsers=yes
PrivateIPC=yes
RemoveIPC=yes
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=~@clock @debug @module @mount @reboot @swap @cpu-emulation @obsolete @timer @chown @setuid @resources @privileged @keyring @ipc
SystemCallErrorNumber=EPERM
StateDirectory=matrix-conduit
RuntimeDirectory=conduit
RuntimeDirectoryMode=0750
Environment="CONDUIT_CONFIG=/etc/matrix-conduit/conduit.toml"
ExecStart=/usr/sbin/matrix-conduit
Restart=on-failure
RestartSec=5
StartLimitInterval=1m
StartLimitBurst=5
[Install]
WantedBy=multi-user.target
-321
View File
@@ -1,321 +0,0 @@
#!/bin/sh
set -e
. /usr/share/debconf/confmodule
CONDUIT_CONFIG_PATH=/etc/matrix-conduit
CONDUIT_CONFIG_FILE="${CONDUIT_CONFIG_PATH}/conduit.toml"
CONDUIT_DATABASE_PATH=/var/lib/matrix-conduit/
case "$1" in
configure)
# Create the `_matrix-conduit` user if it does not exist yet.
if ! getent passwd _matrix-conduit > /dev/null ; then
echo 'Adding system user for the Conduit Matrix homeserver' 1>&2
adduser --system --group --quiet \
--home "$CONDUIT_DATABASE_PATH" \
--disabled-login \
--force-badname \
_matrix-conduit
fi
# Create the database path if it does not exist yet and fix up ownership
# and permissions.
mkdir -p "$CONDUIT_DATABASE_PATH"
chown _matrix-conduit "$CONDUIT_DATABASE_PATH"
chmod 700 "$CONDUIT_DATABASE_PATH"
if [ ! -e "$CONDUIT_CONFIG_FILE" ]; then
# Write the debconf values in the config.
db_get matrix-conduit/hostname
CONDUIT_SERVER_NAME="$RET"
db_get matrix-conduit/address
CONDUIT_ADDRESS="$RET"
db_get matrix-conduit/port
CONDUIT_PORT="$RET"
mkdir -p "$CONDUIT_CONFIG_PATH"
cat > "$CONDUIT_CONFIG_FILE" << EOF
# =============================================================================
# This is the official example config for conduwuit.
# If you use it for your server, you will need to adjust it to your own needs.
# At the very least, change the server_name field!
# =============================================================================
[global]
# The server_name is the pretty name of this server. It is used as a suffix for user
# and room ids. Examples: matrix.org, conduit.rs
# The Conduit server needs all /_matrix/ requests to be reachable at
# https://your.server.name/ on port 443 (client-server) and 8448 (federation).
# If that's not possible for you, you can create /.well-known files to redirect
# requests (delegation). See
# https://spec.matrix.org/latest/client-server-api/#getwell-knownmatrixclient
# and
# https://spec.matrix.org/v1.9/server-server-api/#getwell-knownmatrixserver
# for more information
# YOU NEED TO EDIT THIS
server_name = "${CONDUIT_SERVER_NAME}"
# Servers listed here will be used to gather public keys of other servers.
# Generally, copying this exactly should be enough. (Currently, conduwuit doesn't
# support batched key requests, so this list should only contain Synapse
# servers.) Defaults to `matrix.org`
# trusted_servers = ["matrix.org"]
### Database configuration
# This is the only directory where conduwuit will save its data, including media
database_path = "${CONDUIT_DATABASE_PATH}"
# Database backend: Only rocksdb and sqlite are supported. Please note that sqlite
# will perform significantly worse than rocksdb as it is not intended to be used the
# way it is by conduwuit. sqlite only exists for historical reasons.
database_backend = "rocksdb"
### Network
# The port conduwuit will be running on. You need to set up a reverse proxy such as
# Caddy or Nginx so all requests to /_matrix on port 443 and 8448 will be
# forwarded to the conduwuit instance running on this port
# Docker users: Don't change this, you'll need to map an external port to this.
port = ${CONDUIT_PORT}
# default address (IPv4 or IPv6) conduwuit will listen on. Generally you want this to be
# localhost (127.0.0.1 / ::1). If you are using Docker or a container NAT networking setup, you
# likely need this to be 0.0.0.0.
address = "${CONDUIT_ADDRESS}"
# How many requests conduwuit sends to other servers at the same time concurrently. Default is 500
# Note that because conduwuit is very fast unlike other homeserver implementations, setting this too
# high could inadvertently result in ratelimits kicking in, or overloading lower-end homeservers out there.
#
# A valid use-case for enabling this is if you have a significant amount of overall federation activity
# such as many rooms joined/tracked, and many servers in the true destination cache caused by that. Upon
# rebooting conduwuit, depending on how fast your resources are, client and incoming federation requests
# may timeout or be "stalled" for a period of time due to hitting the max concurrent requests limit from
# refreshing federation/destination caches and such.
#
# If you have a lot of active users on your homeserver, you will definitely need to raise this.
#
# No this will not speed up room joins.
#max_concurrent_requests = 500
# Max request size for file uploads
max_request_size = 20_000_000 # in bytes
# Uncomment unix_socket_path to listen on a UNIX socket at the specified path.
# If listening on a UNIX socket, you must remove/comment the 'address' key if defined and add your
# reverse proxy to the 'conduwuit' group, unless world RW permissions are specified with unix_socket_perms (666 minimum).
#unix_socket_path = "/run/conduwuit/conduwuit.sock"
#unix_socket_perms = 660
# Set this to true for conduwuit to compress HTTP response bodies using zstd.
# Please be aware that enabling HTTP compression may weaken or even defeat TLS.
# Most users should not need to enable this.
# See https://breachattack.com/ and https://wikipedia.org/wiki/BREACH before deciding to enable this.
zstd_compression = false
# Vector list of IPv4 and IPv6 CIDR ranges / subnets *in quotes* that you do not want conduwuit to send outbound requests to.
# Defaults to RFC1918, unroutable, loopback, multicast, and testnet addresses for security.
#
# To disable, set this to be an empty vector (`[]`).
#
# Currently this does not account for proxies in use like Synapse does.
ip_range_denylist = [
"127.0.0.0/8",
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16",
"100.64.0.0/10",
"192.0.0.0/24",
"169.254.0.0/16",
"192.88.99.0/24",
"198.18.0.0/15",
"192.0.2.0/24",
"198.51.100.0/24",
"203.0.113.0/24",
"224.0.0.0/4",
"::1/128",
"fe80::/10",
"fc00::/7",
"2001:db8::/32",
"ff00::/8",
"fec0::/10",
]
### Moderation / Privacy / Security
# Set to true to allow user type "guest" registrations. Element attempts to register guest users automatically.
# For private homeservers, this is best at false.
allow_guest_registration = false
# Vector list of servers that conduwuit will refuse to download remote media from.
# No default.
# prevent_media_downloads_from = ["example.com", "example.local"]
# Enables open registration. If set to false, no users can register on this
# server.
# If set to true without a token configured, users can register with no form of 2nd-
# step only if you set
# `yes_i_am_very_very_sure_i_want_an_open_registration_server_prone_to_abuse` to
# true in your config. If you would like
# registration only via token reg, please configure the `registration_token` key.
allow_registration = false
# Please note that an open registration homeserver with no second-step verification
# is highly prone to abuse and potential defederation by homeservers, including
# matrix.org.
# A static registration token that new users will have to provide when creating
# an account. If unset and `allow_registration` is true, registration is open
# without any condition. YOU NEED TO EDIT THIS.
registration_token = "change this token for something specific to your server"
# controls whether federation is allowed or not
# defaults to true
# allow_federation = true
# controls whether users are allowed to create rooms.
# appservices and admins are always allowed to create rooms
# defaults to true
# allow_room_creation = true
# Set this to true to allow your server's public room directory to be federated.
# Set this to false to protect against /publicRooms spiders, but will forbid external users
# from viewing your server's public room directory. If federation is disabled entirely
# (`allow_federation`), this is inherently false.
allow_public_room_directory_over_federation = false
# Set this to true to allow your server's public room directory to be queried without client
# authentication (access token) through the Client APIs. Set this to false to protect against /publicRooms spiders.
allow_public_room_directory_without_auth = false
# Set this to true to allow federating device display names / allow external users to see your device display name.
# If federation is disabled entirely (`allow_federation`), this is inherently false. For privacy, this is best disabled.
allow_device_name_federation = false
# Vector list of domains allowed to send requests to for URL previews. Defaults to none.
# Note: this is a *contains* match, not an explicit match. Putting "google.com" will match "https://google.com" and "http://mymaliciousdomainexamplegoogle.com"
# Setting this to "*" will allow all URL previews. Please note that this opens up significant attack surface to your server, you are expected to be aware of the risks by doing so.
url_preview_domain_contains_allowlist = []
# Vector list of explicit domains allowed to send requests to for URL previews. Defaults to none.
# Note: This is an *explicit* match, not a ccontains match. Putting "google.com" will match "https://google.com", "http://google.com", but not "https://mymaliciousdomainexamplegoogle.com"
# Setting this to "*" will allow all URL previews. Please note that this opens up significant attack surface to your server, you are expected to be aware of the risks by doing so.
url_preview_domain_explicit_allowlist = []
# Vector list of URLs allowed to send requests to for URL previews. Defaults to none.
# Note that this is a *contains* match, not an explicit match. Putting "google.com" will match "https://google.com/", "https://google.com/url?q=https://mymaliciousdomainexample.com", and "https://mymaliciousdomainexample.com/hi/google.com"
# Setting this to "*" will allow all URL previews. Please note that this opens up significant attack surface to your server, you are expected to be aware of the risks by doing so.
url_preview_url_contains_allowlist = []
# Maximum amount of bytes allowed in a URL preview body size when spidering. Defaults to 1MB (1_000_000 bytes)
url_preview_max_spider_size = 1_000_000
# Option to decide whether you would like to run the domain allowlist checks (contains and explicit) on the root domain or not. Does not apply to URL contains allowlist. Defaults to false.
# Example: If this is enabled and you have "wikipedia.org" allowed in the explicit and/or contains domain allowlist, it will allow all subdomains under "wikipedia.org" such as "en.m.wikipedia.org" as the root domain is checked and matched.
# Useful if the domain contains allowlist is still too broad for you but you still want to allow all the subdomains under a root domain.
url_preview_check_root_domain = false
### Misc
# max log level for conduwuit. allows debug, info, warn, or error
#log = "warn"
# controls whether encrypted rooms and events are allowed (default true)
#allow_encryption = false
# conduwuit will send a simple GET request periodically to `https://pupbrain.dev/check-for-updates/stable`
# for any new announcements made. Despite the name, this is not an update check
# endpoint, it is simply an announcement check endpoint. I don't plan on using
# this so feel free to disable it.
allow_check_for_updates = true
# Enables adding the lightning bolt emoji (⚡️) to all newly registered users'
# initial display names.
enable_lightning_bolt = false
# If you are using delegation via well-known files and you cannot serve them from your reverse proxy, you can
# uncomment these to serve them directly from conduwuit. This requires proxying all requests to conduwuit, not just `/_matrix` to work.
#well_known_server = "matrix.example.com:443"
#well_known_client = "https://matrix.example.com"
# Note that whatever you put will show up in the well-known JSON values.
# Set to false to disable users from joining or creating room versions that aren't 100% officially supported by conduwuit.
# conduwuit officially supports room versions 6 - 10. conduwuit has experimental/unstable support for 1 - 5, and 11.
# Defaults to true.
#allow_unstable_room_versions = true
# Set this to any float value to multiply conduwuit's in-memory LRU caches with.
# May be useful if you have significant memory to spare to increase performance.
# Defaults to 1.0.
#conduit_cache_capacity_modifier = 1.0
# Set this to any float value in megabytes for conduwuit to tell the database engine that this much memory is available for database-related caches.
# May be useful if you have significant memory to spare to increase performance.
# Defaults to 900.0
#db_cache_capacity_mb = 900.0
### RocksDB options
# Set this to true to use RocksDB config options that are tailored to HDDs (slower device storage)
#rocksdb_optimize_for_spinning_disks = false
# RocksDB log level. This is not the same as conduwuit's log level. This is the log level for RocksDB itself
# which show up in your database folder/path as `LOG` files. Defaults to warn. conduwuit will typically log RocksDB errors.
#rocksdb_log_level = "warn"
# Max RocksDB `LOG` file size before rotating in bytes. Defaults to 4MB.
#rocksdb_max_log_file_size = 4194304
# Time in seconds before RocksDB will forcibly rotate logs. Defaults to 0.
#rocksdb_log_time_to_roll = 0
### Presence
# Config option to control local (your server only) presence updates/requests. Defaults to false.
# Note that presence on conduwuit is very fast unlike Synapse's.
# If using outgoing presence, this MUST be enabled.
#allow_local_presence = false
# Config option to control incoming federated presence updates/requests. Defaults to false.
# This option receives presence updates from other servers, but does not send any unless `allow_outgoing_presence` is true.
# Note that presence on conduwuit is very fast unlike Synapse's.
#allow_incoming_presence = false
# Config option to control outgoing presence updates/requests. Defaults to false.
# This option sends presence updates to other servers, but does not receive any unless `allow_incoming_presence` is true.
# Note that presence on conduwuit is very fast unlike Synapse's.
# If using outgoing presence, you MUST enable `allow_local_presence` as well.
#
# Warning: Outgoing federated presence is not spec compliant due to relying on PDUs and EDUs combined.
# Outgoing presence will not be very reliable due to this and any issues with federated outgoing presence are very likely attributed to this issue.
# Incoming presence and local presence are unaffected.
#allow_outgoing_presence = false
# Config option to control how many seconds before presence updates that you are idle. Defaults to 5 minutes.
#presence_idle_timeout_s = 300
# Config option to control how many seconds before presence updates that you are offline. Defaults to 30 minutes.
#presence_offline_timeout_s = 1800
EOF
fi
;;
esac
#DEBHELPER#
-27
View File
@@ -1,27 +0,0 @@
#!/bin/sh
set -e
. /usr/share/debconf/confmodule
CONDUIT_CONFIG_PATH=/etc/matrix-conduit
CONDUIT_DATABASE_PATH=/var/lib/matrix-conduit
case $1 in
purge)
# Remove debconf changes from the db
db_purge
# Per https://www.debian.org/doc/debian-policy/ch-files.html#behavior
# "configuration files must be preserved when the package is removed, and
# only deleted when the package is purged."
if [ -d "$CONDUIT_CONFIG_PATH" ]; then
rm -r "$CONDUIT_CONFIG_PATH"
fi
if [ -d "$CONDUIT_DATABASE_PATH" ]; then
rm -r "$CONDUIT_DATABASE_PATH"
fi
;;
esac
#DEBHELPER#
-21
View File
@@ -1,21 +0,0 @@
Template: matrix-conduit/hostname
Type: string
Default: localhost
Description: The server (host)name of the Matrix homeserver
This is the hostname the homeserver will be reachable at via a client.
.
If set to "localhost", you can connect with a client locally and clients
from other hosts and also other homeservers will not be able to reach you!
Template: matrix-conduit/address
Type: string
Default: 127.0.0.1
Description: The listen address of the Matrix homeserver
This is the address the homeserver will listen on. Leave it set to 127.0.0.1
when using a reverse proxy.
Template: matrix-conduit/port
Type: string
Default: 6167
Description: The port of the Matrix homeserver
This port is most often just accessed by a reverse proxy.
-10
View File
@@ -1,10 +0,0 @@
(import
(
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
fetchTarball {
url = lock.nodes.flake-compat.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ./.; }
).defaultNix
+2
View File
@@ -0,0 +1,2 @@
podman build . -f packages/website/Dockerfile -t jade-website-frontend:latest;
podman save --format oci-archive jade-website-frontend:latest | gzip | ssh fedora@213.32.25.24 -T "sudo sh -c ' zcat > /opt/images/jade-website-frontend'"
-218
View File
@@ -1,218 +0,0 @@
# Deploy using Docker
> **Note:** To run and use Conduit you should probably use it with a Domain or Subdomain behind a reverse proxy (like Nginx, Traefik, Apache, ...) with a Lets Encrypt certificate.
## Docker
To run conduwuit with Docker you can either build the image yourself or pull it from a registry.
### Use a registry
OCI images for conduwuit are available in the registries listed below. We recommend using the image tagged as `latest` from GitLab's own registry.
| Registry | Image | Size | Notes |
| --------------- | --------------------------------------------------------------- | ----------------------------- | ---------------------- |
| GitHub Registry | [ghcr.io/girlbossceo/conduwuit:latest][gh] | ![Image Size][shield-latest] | Stable image. |
| Docker Hub | [docker.io/girlbossceo/conduwuit:latest][dh] | ![Image Size][shield-latest] | Stable image. |
| GitHub Registry | [ghcr.io/girlbossceo/conduwuit:main][gh] | ![Image Size][shield-main] | Development version. |
| Docker Hub | [docker.io/girlbossceo/conduwuit:main][dh] | ![Image Size][shield-main] | Development version. |
[dh]: https://hub.docker.com/repository/docker/girlbossceo/conduwuit
[gh]: https://github.com/girlbossceo/conduwuit/pkgs/container/conduwuit
[shield-latest]: https://img.shields.io/docker/image-size/girlbossceo/conduwuit/latest
[shield-main]: https://img.shields.io/docker/image-size/girlbossceo/conduwuit/main
Use
```bash
docker image pull <link>
```
to pull it to your machine.
### Build using a dockerfile
The Dockerfile provided by Conduit has two stages, each of which creates an image.
1. **Builder:** Builds the binary from local context or by cloning a git revision from the official repository.
2. **Runner:** Copies the built binary from **Builder** and sets up the runtime environment, like creating a volume to persist the database and applying the correct permissions.
To build the image you can use the following command
```bash
docker build --tag girlbossceo/conduwuit:main .
```
which also will tag the resulting image as `girlbossceo/conduwuit:main`.
### Run
When you have the image you can simply run it with
```bash
docker run -d -p 8448:6167 \
-v db:/var/lib/matrix-conduit/ \
-e CONDUIT_SERVER_NAME="your.server.name" \
-e CONDUIT_DATABASE_BACKEND="rocksdb" \
-e CONDUIT_ALLOW_REGISTRATION=true \
-e CONDUIT_ALLOW_FEDERATION=true \
-e CONDUIT_MAX_REQUEST_SIZE="20000000" \
-e CONDUIT_TRUSTED_SERVERS="[\"matrix.org\"]" \
-e CONDUIT_MAX_CONCURRENT_REQUESTS="500" \
-e CONDUIT_LOG="warn,ruma_state_res=warn" \
--name conduit <link>
```
or you can use [docker-compose](#docker-compose).
The `-d` flag lets the container run in detached mode. You now need to supply a `conduit.toml` config file, an example can be found [here](../conduit-example.toml).
You can pass in different env vars to change config values on the fly. You can even configure Conduit completely by using env vars, but for that you need
to pass `-e CONDUIT_CONFIG=""` into your container. For an overview of possible values, please take a look at the `docker-compose.yml` file.
If you just want to test Conduit for a short time, you can use the `--rm` flag, which will clean up everything related to your container after you stop it.
### Docker-compose
If the `docker run` command is not for you or your setup, you can also use one of the provided `docker-compose` files.
Depending on your proxy setup, you can use one of the following files;
- If you already have a `traefik` instance set up, use [`docker-compose.for-traefik.yml`](docker-compose.for-traefik.yml)
- If you don't have a `traefik` instance set up (or any other reverse proxy), use [`docker-compose.with-traefik.yml`](docker-compose.with-traefik.yml)
- For any other reverse proxy, use [`docker-compose.yml`](docker-compose.yml)
When picking the traefik-related compose file, rename it so it matches `docker-compose.yml`, and
rename the override file to `docker-compose.override.yml`. Edit the latter with the values you want
for your server.
Additional info about deploying Conduit can be found [here](../DEPLOY.md).
### Build
To build the Conduit image with docker-compose, you first need to open and modify the `docker-compose.yml` file. There you need to comment the `image:` option and uncomment the `build:` option. Then call docker-compose with:
```bash
docker-compose up
```
This will also start the container right afterwards, so if want it to run in detached mode, you also should use the `-d` flag.
### Run
If you already have built the image or want to use one from the registries, you can just start the container and everything else in the compose file in detached mode with:
```bash
docker-compose up -d
```
> **Note:** Don't forget to modify and adjust the compose file to your needs.
### Use Traefik as Proxy
As a container user, you probably know about Traefik. It is a easy to use reverse proxy for making
containerized app and services available through the web. With the two provided files,
[`docker-compose.for-traefik.yml`](docker-compose.for-traefik.yml) (or
[`docker-compose.with-traefik.yml`](docker-compose.with-traefik.yml)) and
[`docker-compose.override.yml`](docker-compose.override.yml), it is equally easy to deploy
and use Conduit, with a little caveat. If you already took a look at the files, then you should have
seen the `well-known` service, and that is the little caveat. Traefik is simply a proxy and
loadbalancer and is not able to serve any kind of content, but for Conduit to federate, we need to
either expose ports `443` and `8448` or serve two endpoints `.well-known/matrix/client` and
`.well-known/matrix/server`.
With the service `well-known` we use a single `nginx` container that will serve those two files.
So...step by step:
1. Copy [`docker-compose.for-traefik.yml`](docker-compose.for-traefik.yml) (or
[`docker-compose.with-traefik.yml`](docker-compose.with-traefik.yml)) and [`docker-compose.override.yml`](docker-compose.override.yml) from the repository and remove `.for-traefik` (or `.with-traefik`) from the filename.
2. Open both files and modify/adjust them to your needs. Meaning, change the `CONDUIT_SERVER_NAME` and the volume host mappings according to your needs.
3. Create the `conduit.toml` config file, an example can be found [here](../conduit-example.toml), or set `CONDUIT_CONFIG=""` and configure Conduit per env vars.
4. Uncomment the `element-web` service if you want to host your own Element Web Client and create a `element_config.json`.
5. Create the files needed by the `well-known` service.
- `./nginx/matrix.conf` (relative to the compose file, you can change this, but then also need to change the volume mapping)
```nginx
server {
server_name <SUBDOMAIN>.<DOMAIN>;
listen 80 default_server;
location /.well-known/matrix/server {
return 200 '{"m.server": "<SUBDOMAIN>.<DOMAIN>:443"}';
types { } default_type "application/json; charset=utf-8";
}
location /.well-known/matrix/client {
return 200 '{"m.homeserver": {"base_url": "https://<SUBDOMAIN>.<DOMAIN>"}}';
types { } default_type "application/json; charset=utf-8";
add_header "Access-Control-Allow-Origin" *;
}
location / {
return 404;
}
}
```
6. Run `docker-compose up -d`
7. Connect to your homeserver with your preferred client and create a user. You should do this immediately after starting Conduit, because the first created user is the admin.
## Voice communication
In order to make or receive calls, a TURN server is required. Conduit suggests using [Coturn](https://github.com/coturn/coturn) for this purpose, which is also available as a Docker image. Before proceeding with the software installation, it is essential to have the necessary configurations in place.
### Configuration
Create a configuration file called `coturn.conf` containing:
```conf
use-auth-secret
static-auth-secret=<a secret key>
realm=<your server domain>
```
A common way to generate a suitable alphanumeric secret key is by using `pwgen -s 64 1`.
These same values need to be set in conduit. You can either modify conduit.toml to include these lines:
```
turn_uris = ["turn:<your server domain>?transport=udp", "turn:<your server domain>?transport=tcp"]
turn_secret = "<secret key from coturn configuration>"
```
or append the following to the docker environment variables dependig on which configuration method you used earlier:
```yml
CONDUIT_TURN_URIS: '["turn:<your server domain>?transport=udp", "turn:<your server domain>?transport=tcp"]'
CONDUIT_TURN_SECRET: "<secret key from coturn configuration>"
```
Restart Conduit to apply these changes.
### Run
Run the [Coturn](https://hub.docker.com/r/coturn/coturn) image using
```bash
docker run -d --network=host -v $(pwd)/coturn.conf:/etc/coturn/turnserver.conf coturn/coturn
```
or docker-compose. For the latter, paste the following section into a file called `docker-compose.yml`
and run `docker-compose up -d` in the same directory.
```yml
version: 3
services:
turn:
container_name: coturn-server
image: docker.io/coturn/coturn
restart: unless-stopped
network_mode: "host"
volumes:
- ./coturn.conf:/etc/coturn/turnserver.conf
```
To understand why the host networking mode is used and explore alternative configuration options, please visit the following link: https://github.com/coturn/coturn/blob/master/docker/coturn/README.md.
For security recommendations see Synapse's [Coturn documentation](https://github.com/matrix-org/synapse/blob/develop/docs/setup/turn/coturn.md#configuration).
-69
View File
@@ -1,69 +0,0 @@
# Conduit - Behind Traefik Reverse Proxy
version: '3'
services:
homeserver:
### If you already built the Conduit image with 'docker build' or want to use the Docker Hub image,
### then you are ready to go.
image: girlbossceo/conduwuit:latest
### If you want to build a fresh image from the sources, then comment the image line and uncomment the
### build lines. If you want meaningful labels in your built Conduit image, you should run docker-compose like this:
### CREATED=$(date -u +'%Y-%m-%dT%H:%M:%SZ') VERSION=$(grep -m1 -o '[0-9].[0-9].[0-9]' Cargo.toml) docker-compose up -d
# build:
# context: .
# args:
# CREATED: '2021-03-16T08:18:27Z'
# VERSION: '0.1.0'
# LOCAL: 'false'
# GIT_REF: origin/master
restart: unless-stopped
volumes:
- db:/var/lib/matrix-conduit/
networks:
- proxy
environment:
CONDUIT_SERVER_NAME: your.server.name # EDIT THIS
CONDUIT_DATABASE_PATH: /var/lib/matrix-conduit/
CONDUIT_DATABASE_BACKEND: rocksdb
CONDUIT_PORT: 6167
CONDUIT_MAX_REQUEST_SIZE: 20_000_000 # in bytes, ~20 MB
CONDUIT_ALLOW_REGISTRATION: 'true'
CONDUIT_ALLOW_FEDERATION: 'true'
CONDUIT_ALLOW_CHECK_FOR_UPDATES: 'true'
CONDUIT_TRUSTED_SERVERS: '["matrix.org"]'
#CONDUIT_MAX_CONCURRENT_REQUESTS: 100
#CONDUIT_LOG: warn,state_res=warn
CONDUIT_ADDRESS: 0.0.0.0
CONDUIT_CONFIG: '' # Ignore this
# We need some way to server the client and server .well-known json. The simplest way is to use a nginx container
# to serve those two as static files. If you want to use a different way, delete or comment the below service, here
# and in the docker-compose override file.
well-known:
image: nginx:latest
restart: unless-stopped
volumes:
- ./nginx/matrix.conf:/etc/nginx/conf.d/matrix.conf # the config to serve the .well-known/matrix files
- ./nginx/www:/var/www/ # location of the client and server .well-known-files
### Uncomment if you want to use your own Element-Web App.
### Note: You need to provide a config.json for Element and you also need a second
### Domain or Subdomain for the communication between Element and Conduit
### Config-Docs: https://github.com/vector-im/element-web/blob/develop/docs/config.md
# element-web:
# image: vectorim/element-web:latest
# restart: unless-stopped
# volumes:
# - ./element_config.json:/app/config.json
# networks:
# - proxy
# depends_on:
# - homeserver
volumes:
db:
networks:
# This is the network Traefik listens to, if your network has a different
# name, don't forget to change it here and in the docker-compose.override.yml
proxy:
external: true
-45
View File
@@ -1,45 +0,0 @@
# Conduit - Traefik Reverse Proxy Labels
version: '3'
services:
homeserver:
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy" # Change this to the name of your Traefik docker proxy network
- "traefik.http.routers.to-conduit.rule=Host(`<SUBDOMAIN>.<DOMAIN>`)" # Change to the address on which Conduit is hosted
- "traefik.http.routers.to-conduit.tls=true"
- "traefik.http.routers.to-conduit.tls.certresolver=letsencrypt"
- "traefik.http.routers.to-conduit.middlewares=cors-headers@docker"
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowOriginList=*"
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowHeaders=Origin, X-Requested-With, Content-Type, Accept, Authorization"
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowMethods=GET, POST, PUT, DELETE, OPTIONS"
# We need some way to server the client and server .well-known json. The simplest way is to use a nginx container
# to serve those two as static files. If you want to use a different way, delete or comment the below service, here
# and in the docker-compose file.
well-known:
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.to-matrix-wellknown.rule=Host(`<SUBDOMAIN>.<DOMAIN>`) && PathPrefix(`/.well-known/matrix`)"
- "traefik.http.routers.to-matrix-wellknown.tls=true"
- "traefik.http.routers.to-matrix-wellknown.tls.certresolver=letsencrypt"
- "traefik.http.routers.to-matrix-wellknown.middlewares=cors-headers@docker"
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowOriginList=*"
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowHeaders=Origin, X-Requested-With, Content-Type, Accept, Authorization"
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowMethods=GET, POST, PUT, DELETE, OPTIONS"
### Uncomment this if you uncommented Element-Web App in the docker-compose.yml
# element-web:
# labels:
# - "traefik.enable=true"
# - "traefik.docker.network=proxy" # Change this to the name of your Traefik docker proxy network
# - "traefik.http.routers.to-element-web.rule=Host(`<SUBDOMAIN>.<DOMAIN>`)" # Change to the address on which Element-Web is hosted
# - "traefik.http.routers.to-element-web.tls=true"
# - "traefik.http.routers.to-element-web.tls.certresolver=letsencrypt"
-98
View File
@@ -1,98 +0,0 @@
# Conduit - Behind Traefik Reverse Proxy
version: '3'
services:
homeserver:
### If you already built the Conduit image with 'docker build' or want to use the Docker Hub image,
### then you are ready to go.
image: girlbossceo/conduwuit:latest
### If you want to build a fresh image from the sources, then comment the image line and uncomment the
### build lines. If you want meaningful labels in your built Conduit image, you should run docker-compose like this:
### CREATED=$(date -u +'%Y-%m-%dT%H:%M:%SZ') VERSION=$(grep -m1 -o '[0-9].[0-9].[0-9]' Cargo.toml) docker-compose up -d
# build:
# context: .
# args:
# CREATED: '2021-03-16T08:18:27Z'
# VERSION: '0.1.0'
# LOCAL: 'false'
# GIT_REF: origin/master
restart: unless-stopped
volumes:
- db:/srv/conduit/.local/share/conduit
### Uncomment if you want to use conduit.toml to configure Conduit
### Note: Set env vars will override conduit.toml values
# - ./conduit.toml:/srv/conduit/conduit.toml
networks:
- proxy
environment:
CONDUIT_SERVER_NAME: localhost:6167 # replace with your own name
CONDUIT_TRUSTED_SERVERS: '["matrix.org"]'
CONDUIT_ALLOW_REGISTRATION : 'true'
### Uncomment and change values as desired
# CONDUIT_ADDRESS: 0.0.0.0
# CONDUIT_PORT: 6167
# CONDUIT_CONFIG: '/srv/conduit/conduit.toml' # if you want to configure purely by env vars, set this to an empty string ''
# Available levels are: error, warn, info, debug, trace - more info at: https://docs.rs/env_logger/*/env_logger/#enabling-logging
# CONDUIT_LOG: info # default is: "warn,state_res=warn"
# CONDUIT_ALLOW_JAEGER: 'false'
# CONDUIT_ALLOW_ENCRYPTION: 'true'
# CONDUIT_ALLOW_FEDERATION: 'true'
# CONDUIT_ALLOW_CHECK_FOR_UPDATES: 'true'
# CONDUIT_DATABASE_PATH: /srv/conduit/.local/share/conduit
# CONDUIT_WORKERS: 10
# CONDUIT_MAX_REQUEST_SIZE: 20_000_000 # in bytes, ~20 MB
# We need some way to server the client and server .well-known json. The simplest way is to use a nginx container
# to serve those two as static files. If you want to use a different way, delete or comment the below service, here
# and in the docker-compose override file.
well-known:
image: nginx:latest
restart: unless-stopped
volumes:
- ./nginx/matrix.conf:/etc/nginx/conf.d/matrix.conf # the config to serve the .well-known/matrix files
- ./nginx/www:/var/www/ # location of the client and server .well-known-files
### Uncomment if you want to use your own Element-Web App.
### Note: You need to provide a config.json for Element and you also need a second
### Domain or Subdomain for the communication between Element and Conduit
### Config-Docs: https://github.com/vector-im/element-web/blob/develop/docs/config.md
# element-web:
# image: vectorim/element-web:latest
# restart: unless-stopped
# volumes:
# - ./element_config.json:/app/config.json
# networks:
# - proxy
# depends_on:
# - homeserver
traefik:
image: "traefik:latest"
container_name: "traefik"
restart: "unless-stopped"
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
# - "./traefik_config:/etc/traefik"
- "acme:/etc/traefik/acme"
labels:
- "traefik.enable=true"
# middleware redirect
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
# global redirect to https
- "traefik.http.routers.redirs.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.redirs.entrypoints=http"
- "traefik.http.routers.redirs.middlewares=redirect-to-https"
networks:
- proxy
volumes:
db:
acme:
networks:
proxy:
-54
View File
@@ -1,54 +0,0 @@
# Conduit
version: '3'
services:
homeserver:
### If you already built the Conduit image with 'docker build' or want to use a registry image,
### then you are ready to go.
image: girlbossceo/conduwuit:latest
### If you want to build a fresh image from the sources, then comment the image line and uncomment the
### build lines. If you want meaningful labels in your built Conduit image, you should run docker-compose like this:
### CREATED=$(date -u +'%Y-%m-%dT%H:%M:%SZ') VERSION=$(grep -m1 -o '[0-9].[0-9].[0-9]' Cargo.toml) docker-compose up -d
# build:
# context: .
# args:
# CREATED: '2021-03-16T08:18:27Z'
# VERSION: '0.1.0'
# LOCAL: 'false'
# GIT_REF: origin/master
restart: unless-stopped
ports:
- 8448:6167
volumes:
- db:/var/lib/matrix-conduit/
environment:
CONDUIT_SERVER_NAME: your.server.name # EDIT THIS
CONDUIT_DATABASE_PATH: /var/lib/matrix-conduit/
CONDUIT_DATABASE_BACKEND: rocksdb
CONDUIT_PORT: 6167
CONDUIT_MAX_REQUEST_SIZE: 20_000_000 # in bytes, ~20 MB
CONDUIT_ALLOW_REGISTRATION: 'true'
CONDUIT_ALLOW_FEDERATION: 'true'
CONDUIT_ALLOW_CHECK_FOR_UPDATES: 'true'
CONDUIT_TRUSTED_SERVERS: '["matrix.org"]'
#CONDUIT_MAX_CONCURRENT_REQUESTS: 400
#CONDUIT_LOG: warn,state_res=warn
CONDUIT_ADDRESS: 0.0.0.0
CONDUIT_CONFIG: '' # Ignore this
#
### Uncomment if you want to use your own Element-Web App.
### Note: You need to provide a config.json for Element and you also need a second
### Domain or Subdomain for the communication between Element and Conduit
### Config-Docs: https://github.com/vector-im/element-web/blob/develop/docs/config.md
# element-web:
# image: vectorim/element-web:latest
# restart: unless-stopped
# ports:
# - 8009:80
# volumes:
# - ./element_config.json:/app/config.json
# depends_on:
# - homeserver
volumes:
db:
-19
View File
@@ -1,19 +0,0 @@
#!/bin/sh
# If the config file does not contain a default port and the CONDUIT_PORT env is not set, create
# try to get port from process list
if [ -z "${CONDUIT_PORT}" ]; then
CONDUIT_PORT=$(ss -tlpn | grep conduit | grep -m1 -o ':[0-9]*' | grep -m1 -o '[0-9]*')
fi
# If CONDUIT_ADDRESS is not set try to get the address from the process list
if [ -z "${CONDUIT_ADDRESS}" ]; then
CONDUIT_ADDRESS=$(ss -tlpn | awk -F ' +|:' '/conduit/ { print $4 }')
fi
# The actual health check.
# We try to first get a response on HTTP and when that fails on HTTPS and when that fails, we exit with code 1.
# TODO: Change this to a single wget call. Do we have a config value that we can check for that?
wget --no-verbose --tries=1 --spider "http://${CONDUIT_ADDRESS}:${CONDUIT_PORT}/_matrix/client/versions" || \
wget --no-verbose --tries=1 --spider "https://${CONDUIT_ADDRESS}:${CONDUIT_PORT}/_matrix/client/versions" || \
exit 1
-79
View File
@@ -1,79 +0,0 @@
interpreter = ["bash", "-euo", "pipefail", "-c"]
[[task]]
name = "engage"
group = "versions"
script = "engage --version"
[[task]]
name = "nix"
group = "versions"
script = "nix --version"
[[task]]
name = "direnv"
group = "versions"
script = "direnv --version"
[[task]]
name = "rustc"
group = "versions"
script = "rustc --version"
[[task]]
name = "cargo"
group = "versions"
script = "cargo --version"
[[task]]
name = "cargo-fmt"
group = "versions"
script = "cargo fmt --version"
[[task]]
name = "rustdoc"
group = "versions"
script = "rustdoc --version"
[[task]]
name = "cargo-clippy"
group = "versions"
script = "cargo clippy -- --version"
[[task]]
name = "cargo-fmt"
group = "lints"
script = "cargo fmt --check -- --color=always"
[[task]]
name = "cargo-doc"
group = "lints"
script = """
RUSTDOCFLAGS="-D warnings" cargo doc \
--workspace \
--no-deps \
--document-private-items \
--color always
"""
[[task]]
name = "cargo-clippy"
group = "lints"
script = "cargo clippy --workspace --all-targets --color=always -- -D warnings"
[[task]]
name = "cargo"
group = "tests"
script = """
cargo test \
--workspace \
--all-targets \
--color=always \
-- \
--color=always
"""
[[task]]
name = "cargo-audit"
group = "security"
script = "cargo audit -D warnings -D unmaintained -D unsound -D yanked"
Generated
-263
View File
@@ -1,263 +0,0 @@
{
"nodes": {
"attic": {
"inputs": {
"crane": "crane",
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1707922053,
"narHash": "sha256-wSZjK+rOXn+UQiP1NbdNn5/UW6UcBxjvlqr2wh++MbM=",
"owner": "zhaofengli",
"repo": "attic",
"rev": "6eabc3f02fae3683bffab483e614bebfcd476b21",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"ref": "main",
"repo": "attic",
"type": "github"
}
},
"crane": {
"inputs": {
"nixpkgs": [
"attic",
"nixpkgs"
]
},
"locked": {
"lastModified": 1702918879,
"narHash": "sha256-tWJqzajIvYcaRWxn+cLUB9L9Pv4dQ3Bfit/YjU5ze3g=",
"owner": "ipetkov",
"repo": "crane",
"rev": "7195c00c272fdd92fc74e7d5a0a2844b9fadb2fb",
"type": "github"
},
"original": {
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"crane_2": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1707685877,
"narHash": "sha256-XoXRS+5whotelr1rHiZle5t5hDg9kpguS5yk8c8qzOc=",
"owner": "ipetkov",
"repo": "crane",
"rev": "2c653e4478476a52c6aa3ac0495e4dea7449ea0e",
"type": "github"
},
"original": {
"owner": "ipetkov",
"ref": "master",
"repo": "crane",
"type": "github"
}
},
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1707891749,
"narHash": "sha256-SeikNYElHgv8uVMbiA9/pU3Cce7ssIsiM8CnEiwd1Nc=",
"owner": "nix-community",
"repo": "fenix",
"rev": "3115aab064ef38cccd792c45429af8df43d6d277",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nix-filter": {
"locked": {
"lastModified": 1705332318,
"narHash": "sha256-kcw1yFeJe9N4PjQji9ZeX47jg0p9A0DuU4djKvg1a7I=",
"owner": "numtide",
"repo": "nix-filter",
"rev": "3449dc925982ad46246cfc36469baf66e1b64f17",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "nix-filter",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1702539185,
"narHash": "sha256-KnIRG5NMdLIpEkZTnN5zovNYc0hhXjAgv6pfd5Z4c7U=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "aa9d4729cbc99dabacb50e3994dcefb3ea0f7447",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1702780907,
"narHash": "sha256-blbrBBXjjZt6OKTcYX1jpe9SRof2P9ZYWPzq22tzXAA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1e2e384c5b7c50dbf8e9c441a9e58d85f408b01f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1707689078,
"narHash": "sha256-UUGmRa84ZJHpGZ1WZEBEUOzaPOWG8LZ0yPg1pdDF/yM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f9d39fb9aff0efee4a3d5f4a6d7c17701d38a1d8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"attic": "attic",
"crane": "crane_2",
"fenix": "fenix",
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils_2",
"nix-filter": "nix-filter",
"nixpkgs": "nixpkgs_2"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1707849817,
"narHash": "sha256-If6T0MDErp3/z7DBlpG4bV46IPP+7BWSlgTI88cmbw0=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "a02a219773629686bd8ff123ca1aa995fa50d976",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}
-269
View File
@@ -1,269 +0,0 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
nix-filter.url = "github:numtide/nix-filter";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
crane = {
url = "github:ipetkov/crane?ref=master";
inputs.nixpkgs.follows = "nixpkgs";
};
attic.url = "github:zhaofengli/attic?ref=main";
};
outputs =
{ self
, nixpkgs
, flake-utils
, nix-filter
, fenix
, crane
, ...
}: flake-utils.lib.eachDefaultSystem (system:
let
pkgsHost = nixpkgs.legacyPackages.${system};
rocksdb' = pkgs: pkgs.rocksdb.overrideAttrs (old:
{
src = pkgs.fetchFromGitHub {
owner = "facebook";
repo = "rocksdb";
rev = "v8.10.0";
hash = "sha256-KGsYDBc1fz/90YYNGwlZ0LUKXYsP1zyhP29TnRQwgjQ=";
};
});
# Nix-accessible `Cargo.toml`
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
# The Rust toolchain to use
toolchain = fenix.packages.${system}.fromToolchainFile {
file = ./rust-toolchain.toml;
# See also `rust-toolchain.toml`
sha256 = "sha256-SXRtAuO4IqNOQq+nLbrsDFbVk+3aVA8NNpSZsKlVH/8=";
};
builder = pkgs:
((crane.mkLib pkgs).overrideToolchain toolchain).buildPackage;
nativeBuildInputs = pkgs: [
# bindgen needs the build platform's libclang. Apparently due to
# "splicing weirdness", pkgs.rustPlatform.bindgenHook on its own doesn't
# quite do the right thing here.
pkgs.buildPackages.rustPlatform.bindgenHook
];
env = pkgs: {
ROCKSDB_INCLUDE_DIR = "${rocksdb' pkgs}/include";
ROCKSDB_LIB_DIR = "${rocksdb' pkgs}/lib";
}
// pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isStatic {
ROCKSDB_STATIC = "";
}
// {
CARGO_BUILD_RUSTFLAGS = let inherit (pkgs) lib stdenv; in
lib.concatStringsSep " " ([]
++ lib.optionals
# This disables PIE for static builds, which isn't great in terms
# of security. Unfortunately, my hand is forced because nixpkgs'
# `libstdc++.a` is built without `-fPIE`, which precludes us from
# leaving PIE enabled.
stdenv.hostPlatform.isStatic
["-C" "relocation-model=static"]
++ lib.optionals
(stdenv.buildPlatform.config != stdenv.hostPlatform.config)
["-l" "c"]
++ lib.optionals
# This check has to match the one [here][0]. We only need to set
# these flags when using a different linker. Don't ask me why,
# though, because I don't know. All I know is it breaks otherwise.
#
# [0]: https://github.com/NixOS/nixpkgs/blob/612f97239e2cc474c13c9dafa0df378058c5ad8d/pkgs/build-support/rust/lib/default.nix#L36-L39
(
# Nixpkgs doesn't check for x86_64 here but we do, because I
# observed a failure building statically for x86_64 without
# including it here. Linkers are weird.
(stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isx86_64)
&& stdenv.hostPlatform.isStatic
&& !stdenv.isDarwin
&& !stdenv.cc.bintools.isLLVM
)
[
"-l"
"stdc++"
"-L"
"${stdenv.cc.cc.lib}/${stdenv.hostPlatform.config}/lib"
]
);
}
# What follows is stolen from [here][0]. Its purpose is to properly
# configure compilers and linkers for various stages of the build, and
# even covers the case of build scripts that need native code compiled and
# run on the build platform (I think).
#
# [0]: https://github.com/NixOS/nixpkgs/blob/612f97239e2cc474c13c9dafa0df378058c5ad8d/pkgs/build-support/rust/lib/default.nix#L64-L78
// (
let
inherit (pkgs.rust.lib) envVars;
in
pkgs.lib.optionalAttrs
(pkgs.stdenv.targetPlatform.rust.rustcTarget
!= pkgs.stdenv.hostPlatform.rust.rustcTarget)
(
let
inherit (pkgs.stdenv.targetPlatform.rust) cargoEnvVarTarget;
in
{
"CC_${cargoEnvVarTarget}" = envVars.ccForTarget;
"CXX_${cargoEnvVarTarget}" = envVars.cxxForTarget;
"CARGO_TARGET_${cargoEnvVarTarget}_LINKER" =
envVars.linkerForTarget;
}
)
// (
let
inherit (pkgs.stdenv.hostPlatform.rust) cargoEnvVarTarget rustcTarget;
in
{
"CC_${cargoEnvVarTarget}" = envVars.ccForHost;
"CXX_${cargoEnvVarTarget}" = envVars.cxxForHost;
"CARGO_TARGET_${cargoEnvVarTarget}_LINKER" = envVars.linkerForHost;
CARGO_BUILD_TARGET = rustcTarget;
}
)
// (
let
inherit (pkgs.stdenv.buildPlatform.rust) cargoEnvVarTarget;
in
{
"CC_${cargoEnvVarTarget}" = envVars.ccForBuild;
"CXX_${cargoEnvVarTarget}" = envVars.cxxForBuild;
"CARGO_TARGET_${cargoEnvVarTarget}_LINKER" = envVars.linkerForBuild;
HOST_CC = "${pkgs.buildPackages.stdenv.cc}/bin/cc";
HOST_CXX = "${pkgs.buildPackages.stdenv.cc}/bin/c++";
}
));
package = pkgs: builder pkgs {
src = nix-filter {
root = ./.;
include = [
"src"
"Cargo.toml"
"Cargo.lock"
];
};
# This is redundant with CI
doCheck = false;
env = env pkgs;
nativeBuildInputs = nativeBuildInputs pkgs;
meta.mainProgram = cargoToml.package.name;
};
mkOciImage = pkgs: package:
pkgs.dockerTools.buildImage {
name = package.pname;
tag = "main";
copyToRoot = [
pkgs.dockerTools.caCertificates
];
config = {
# Use the `tini` init system so that signals (e.g. ctrl+c/SIGINT)
# are handled as expected
Entrypoint = [
"${pkgs.lib.getExe' pkgs.tini "tini"}"
"--"
];
Cmd = [
"${pkgs.lib.getExe package}"
];
};
};
in
{
packages = {
default = package pkgsHost;
oci-image = mkOciImage pkgsHost self.packages.${system}.default;
}
//
builtins.listToAttrs
(builtins.concatLists
(builtins.map
(crossSystem:
let
binaryName = "static-${crossSystem}";
pkgsCrossStatic =
(import nixpkgs {
inherit system;
crossSystem = {
config = crossSystem;
};
}).pkgsStatic;
in
[
# An output for a statically-linked binary
{
name = binaryName;
value = package pkgsCrossStatic;
}
# An output for an OCI image based on that binary
{
name = "oci-image-${crossSystem}";
value = mkOciImage
pkgsCrossStatic
self.packages.${system}.${binaryName};
}
]
)
[
"x86_64-unknown-linux-musl"
"aarch64-unknown-linux-musl"
]
)
);
devShells.default = pkgsHost.mkShell {
env = env pkgsHost // {
# Rust Analyzer needs to be able to find the path to default crate
# sources, and it can read this environment variable to do so. The
# `rust-src` component is required in order for this to work.
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";
};
# Development tools
nativeBuildInputs = nativeBuildInputs pkgsHost ++ [
# Always use nightly rustfmt because most of its options are unstable
#
# This needs to come before `toolchain` in this list, otherwise
# `$PATH` will have stable rustfmt instead.
fenix.packages.${system}.latest.rustfmt
toolchain
] ++ (with pkgsHost; [
engage
# Needed for Complement
go
olm
# Needed for our script for Complement
jq
]);
};
});
}
+2
View File
@@ -0,0 +1,2 @@
podman build -t misc-webserver -f "Dockerfile"
podman save --format oci-archive localhost/misc-webserver:latest | gzip | ssh fedora@213.32.25.24 -T "zcat | sudo podman load"
-198
View File
@@ -1,198 +0,0 @@
# Conduit for Nix/NixOS
This guide assumes you have a recent version of Nix (^2.4) installed.
Since Conduit ships as a Nix flake, you'll first need to [enable
flakes][enable_flakes].
You can now use the usual Nix commands to interact with Conduit's flake. For
example, `nix run gitlab:famedly/conduit` will run Conduit (though you'll need
to provide configuration and such manually as usual).
If your NixOS configuration is defined as a flake, you can depend on this flake
to provide a more up-to-date version than provided by `nixpkgs`. In your flake,
add the following to your `inputs`:
```nix
conduit = {
url = "gitlab:famedly/conduit";
# Assuming you have an input for nixpkgs called `nixpkgs`. If you experience
# build failures while using this, try commenting/deleting this line. This
# will probably also require you to always build from source.
inputs.nixpkgs.follows = "nixpkgs";
};
```
Next, make sure you're passing your flake inputs to the `specialArgs` argument
of `nixpkgs.lib.nixosSystem` [as explained here][specialargs]. This guide will
assume you've named the group `flake-inputs`.
Now you can configure Conduit and a reverse proxy for it. Add the following to
a new Nix file and include it in your configuration:
```nix
{ config
, pkgs
, flake-inputs
, ...
}:
let
# You'll need to edit these values
# The hostname that will appear in your user and room IDs
server_name = "example.com";
# The hostname that Conduit actually runs on
#
# This can be the same as `server_name` if you want. This is only necessary
# when Conduit is running on a different machine than the one hosting your
# root domain. This configuration also assumes this is all running on a single
# machine, some tweaks will need to be made if this is not the case.
matrix_hostname = "matrix.${server_name}";
# An admin email for TLS certificate notifications
admin_email = "admin@${server_name}";
# These ones you can leave alone
# Build a dervation that stores the content of `${server_name}/.well-known/matrix/server`
well_known_server = pkgs.writeText "well-known-matrix-server" ''
{
"m.server": "${matrix_hostname}"
}
'';
# Build a dervation that stores the content of `${server_name}/.well-known/matrix/client`
well_known_client = pkgs.writeText "well-known-matrix-client" ''
{
"m.homeserver": {
"base_url": "https://${matrix_hostname}"
}
}
'';
in
{
# Configure Conduit itself
services.matrix-conduit = {
enable = true;
# This causes NixOS to use the flake defined in this repository instead of
# the build of Conduit built into nixpkgs.
package = flake-inputs.conduit.packages.${pkgs.system}.default;
settings.global = {
inherit server_name;
};
};
# Configure automated TLS acquisition/renewal
security.acme = {
acceptTerms = true;
defaults = {
email = admin_email;
};
};
# ACME data must be readable by the NGINX user
users.users.nginx.extraGroups = [
"acme"
];
# Configure NGINX as a reverse proxy
services.nginx = {
enable = true;
recommendedProxySettings = true;
virtualHosts = {
"${matrix_hostname}" = {
forceSSL = true;
enableACME = true;
listen = [
{
addr = "0.0.0.0";
port = 443;
ssl = true;
}
{
addr = "[::]";
port = 443;
ssl = true;
} {
addr = "0.0.0.0";
port = 8448;
ssl = true;
}
{
addr = "[::]";
port = 8448;
ssl = true;
}
];
locations."/_matrix/" = {
proxyPass = "http://backend_conduit$request_uri";
proxyWebsockets = true;
extraConfig = ''
proxy_set_header Host $host;
proxy_buffering off;
'';
};
extraConfig = ''
merge_slashes off;
'';
};
"${server_name}" = {
forceSSL = true;
enableACME = true;
locations."=/.well-known/matrix/server" = {
# Use the contents of the derivation built previously
alias = "${well_known_server}";
extraConfig = ''
# Set the header since by default NGINX thinks it's just bytes
default_type application/json;
'';
};
locations."=/.well-known/matrix/client" = {
# Use the contents of the derivation built previously
alias = "${well_known_client}";
extraConfig = ''
# Set the header since by default NGINX thinks it's just bytes
default_type application/json;
# https://matrix.org/docs/spec/client_server/r0.4.0#web-browser-clients
add_header Access-Control-Allow-Origin "*";
'';
};
};
};
upstreams = {
"backend_conduit" = {
servers = {
"[::1]:${toString config.services.matrix-conduit.settings.global.port}" = { };
};
};
};
};
# Open firewall ports for HTTP, HTTPS, and Matrix federation
networking.firewall.allowedTCPPorts = [ 80 443 8448 ];
networking.firewall.allowedUDPPorts = [ 80 443 8448 ];
}
```
Now you can rebuild your system configuration and you should be good to go!
[enable_flakes]: https://nixos.wiki/wiki/Flakes#Enable_flakes
[specialargs]: https://nixos.wiki/wiki/Flakes#Using_nix_flakes_with_NixOS
+10
View File
@@ -0,0 +1,10 @@
{
"name": "workspace-root",
"private": true,
"pnpm": {
"patchedDependencies": {
"mdsvex@0.11.2": "patches/mdsvex@0.11.2.patch"
}
},
"packageManager": "pnpm@9.0.6+sha512.f6d863130973207cb7a336d6b439a242a26ac8068077df530d6a86069419853dc1ffe64029ec594a9c505a3a410d19643c870aba6776330f5cfddcf10a9c1617"
}
+2
View File
@@ -0,0 +1,2 @@
dist
node_modules
+43
View File
@@ -0,0 +1,43 @@
{
"name": "remark-callouts",
"version": "1.0.0",
"description": "",
"type": "module",
"main": "dist/index.esm.js",
"exports": {
"import": "./dist/index.esm.js",
"require": "./dist/index.cjs.js",
"types": "./dist/index.d.ts"
},
"types": "dist/index.d.ts",
"scripts": {
"build": "rollup -c",
"prepublish": "rollup -c",
"dev": "rollup -c -w",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@rollup/plugin-typescript": "^11.1.6",
"@types/mdast": "^4.0.4",
"@types/node": "^20.14.2",
"@types/svg-parser": "^2.0.6",
"@types/trim": "^0.1.3",
"@types/unist": "^3.0.2",
"mdast": "^3.0.0",
"rollup": "^4.18.0",
"rollup-plugin-dts": "^6.1.1",
"unified": "^6.2.0"
},
"files": [
"dist"
],
"dependencies": {
"mdast-util-from-markdown": "^1.3.1",
"svg-parser": "^2.0.4",
"trim": "^0.0.1",
"unist-util-visit": "^4.1.2"
}
}
+20
View File
@@ -0,0 +1,20 @@
// rollup.config.js
import typescript from '@rollup/plugin-typescript';
import { dts } from "rollup-plugin-dts";
import pkg from './package.json' with { type: "json" };
export default [
{
input: 'src/index.ts',
output: [
{ file: pkg.exports.require, format: 'cjs' },
{ file: pkg.exports.import, format: 'es' }
],
plugins: [typescript()]
},
{
input: 'src/index.ts',
output: [{ file: pkg.exports.types, format: 'es' }],
plugins: [dts()],
}
];
+324
View File
@@ -0,0 +1,324 @@
import { visit } from "unist-util-visit";
import { fromMarkdown } from "mdast-util-from-markdown";
// @ts-ignore
import type { Plugin } from "unified";
import type { Node, Data, Parent } from "unist";
import type { Blockquote, Heading, Text, BlockContent } from "mdast";
import { parse } from "svg-parser";
// import { calloutTypes } from "./calloutTypes";
// escape regex special characters
function escapeRegExp(s: string) {
return s.replace(new RegExp(`[-[\\]{}()*+?.\\\\^$|/]`, "g"), "\\$&");
}
import tok from "./tokeniseCallout"
function trim(str: string){
return str.replace(/^\s*|\s*$/g, '');
}
export interface Config {
// classNameMaps: {
// block: ClassNameMap;
// title: ClassNameMap;
// };
// dataMaps: {
// block: (data: Data) => Data;
// title: (data: Data) => Data;
// };
// types: { [index: string]: string | object };
}
export const defaultConfig: Config = {
// classNameMaps: {
// block: "callout",
// title: "callout-title",
// },
// dataMaps: {
// block: (data) => data,
// title: (data) => data,
// },
// types: { ...calloutTypes },
};
type ClassNames = string | string[];
type ClassNameMap = ClassNames | ((title: string) => ClassNames);
function formatClassNameMap(gen: ClassNameMap) {
return (title: string) => {
const classNames = typeof gen == "function" ? gen(title) : gen;
return typeof classNames == "object" ? classNames.join(" ") : classNames;
};
}
export const callouts: Plugin = function (providedConfig?: Partial<Config>) {
const config: Config = { ...defaultConfig, ...providedConfig };
// const defaultKeywords: string = Object.keys(config.types)
// .map(escapeRegExp)
// .join("|");
// @ts-ignore
const Parser = this.Parser
const blockTokenizers = Parser.prototype.blockTokenizers
const blockMethods = Parser.prototype.blockMethods
// console.log(blockMethods, blockTokenizers)
blockTokenizers.callout = tok
// console.log(blockTokenizers.blockquote.toString())
var insertPoint = blockMethods.indexOf('fencedCode') + 1
blockMethods.splice(insertPoint, 0, 'callout')
// @ts-ignore
const Compiler = this.Compiler
if (Compiler != null) {
const visitors = Compiler.prototype.visitors
if (visitors) {
visitors.callout = function (node: { keyword: string; title: string; }) {
var values = this.block(node).split('\n');
var result = [];
var length = values.length;
var index = -1;
var value;
while (++index < length) {
value = values[index];
result[index] = (value ? ' ' : '') + value;
}
return '> [!'+node.keyword+'] ' + node.title + '\n' + result.join('\n>');
}
}
}
// return function (tree) {
// visit(tree, (node: Node, index, parent: Parent) => {
// // Filter required elems
// if (node.type !== "blockquote") return;
// /** add breaks to text without needing spaces or escapes (turns enters into <br>)
// * code taken directly from remark-breaks,
// * see https://github.com/remarkjs/remark-breaks for more info on what this does.
// */
// // visit(node, "text", (node: Text, index: number, parent: Parent) => {
// // const result = [];
// // let start = 0;
// // find.lastIndex = 0;
// // let match = find.exec(node.value);
// // while (match) {
// // const position = match.index;
// // if (start !== position) {
// // result.push({
// // type: "text",
// // value: node.value.slice(start, position),
// // });
// // }
// // result.push({ type: "break" });
// // start = position + match[0].length;
// // match = find.exec(node.value);
// // }
// // if (result.length > 0 && parent && typeof index === "number") {
// // if (start < node.value.length) {
// // result.push({ type: "text", value: node.value.slice(start) });
// // }
// // parent.children.splice(index, 1, ...result);
// // return index + result.length;
// // }
// // });
// /** add classnames to headings within blockquotes,
// * mainly to identify when using other plugins that
// * might interfere. for eg, rehype-auto-link-headings.
// */
// visit(node, "heading", (node) => {
// const heading = node as Heading;
// heading.data = {
// hProperties: {
// className: "blockquote-heading",
// },
// };
// });
// // wrap blockquote in a div
// const wrapper = {
// ...node,
// type: "element",
// tagName: "div",
// data: {
// hProperties: {},
// },
// children: [node],
// };
// parent.children.splice(Number(index), 1, wrapper);
// const blockquote = wrapper.children[0] as Blockquote;
// blockquote.data = {
// hProperties: {
// className: "blockquote",
// },
// };
// console.log(blockquote)
// // check for callout syntax starts here
// if (
// blockquote.children.length <= 0 ||
// blockquote.children[0].type !== "paragraph"
// )
// return;
// const paragraph = blockquote.children[0];
// console.log(paragraph)
// if (
// paragraph.children.length <= 0 ||
// paragraph.children[0].type !== "text"
// )
// return;
// const [t, ...rest] = paragraph.children;
// const regex = new RegExp(
// `^\\[!(?<keyword>(.*?))\\][\t\f ]?(?<title>.*?)$`,
// "gi"
// );
// const m = regex.exec(t.value);
// // if no callout syntax, forget about it.
// if (!m) return;
// const [key, title] = [m.groups?.keyword, m.groups?.title];
// // if there's nothing inside the brackets, is it really a callout ?
// if (!key) return;
// const keyword = key.toLowerCase();
// // const isOneOfKeywords: boolean = new RegExp(defaultKeywords).test(
// // keyword
// // );
// if (title) {
// const mdast = fromMarkdown(title.trim()).children[0];
// if (mdast.type === "heading") {
// mdast.data = {
// ...mdast.data,
// hProperties: {
// className: "blockquote-heading",
// },
// };
// }
// blockquote.children.unshift(mdast as BlockContent);
// } else {
// t.value =
// typeof keyword.charAt(0) === "string"
// ? keyword.charAt(0).toUpperCase() + keyword.slice(1)
// : keyword;
// }
// const entry: { [index: string]: string } = {};
// // if (isOneOfKeywords) {
// // if (typeof config?.types[keyword] === "string") {
// // const e = String(config?.types[keyword]);
// // Object.assign(entry, config?.types[e]);
// // } else {
// // Object.assign(entry, config?.types[keyword]);
// // }
// // } else {
// // Object.assign(entry, config?.types["note"]);
// // }
// let parsedSvg;
// if (entry && entry.svg) {
// parsedSvg = parse(entry.svg);
// }
// // create icon and title node wrapped in div
// const titleNode: object = {
// type: "element",
// children: [
// {
// type: "element",
// tagName: "span",
// data: {
// hName: "span",
// hProperties: {
// style: `color:${entry?.color}`,
// className: "callout-icon",
// },
// hChildren: parsedSvg?.children ? parsedSvg.children : [],
// },
// },
// {
// type: "element",
// children: title ? [blockquote.children[0]] : [t],
// data: {
// hName: "strong",
// },
// },
// ],
// data: {
// ...blockquote.children[0]?.data,
// hProperties: {
// className: `${formatClassNameMap(config.classNameMaps.title)(
// keyword
// )} ${"note"}`,
// style: `background-color: ${entry?.color}1a;`,
// },
// },
// };
// // remove the callout paragraph from the content body
// if (title) {
// blockquote.children.shift();
// }
// if (rest.length > 0) {
// rest.shift();
// paragraph.children = rest;
// } else {
// blockquote.children.shift();
// }
// // wrap blockquote content in div
// const contentNode: object = {
// type: "element",
// children: blockquote.children,
// data: {
// hProperties: {
// className: "callout-content",
// style:
// parent.type !== "root"
// ? `border-right:1px solid ${entry?.color}33;
// border-bottom:1px solid ${entry?.color}33;`
// : "",
// },
// },
// };
// if (blockquote.children.length > 0)
// blockquote.children = [contentNode] as BlockContent[];
// blockquote.children.unshift(titleNode as BlockContent);
// // Add classes for the callout block
// blockquote.data = config.dataMaps.block({
// ...blockquote.data,
// hProperties: {
// className: formatClassNameMap(config.classNameMaps.block)(
// keyword.toLowerCase()
// ),
// style: `border-left-color:${entry?.color};`,
// },
// });
// });
// };
};
export default callouts;
@@ -0,0 +1,245 @@
'use strict';
import trim from "trim";
export default blockquote;
var C_NEWLINE = '\n';
var C_TAB = '\t';
var C_SPACE = ' ';
var C_GT = '>';
// TODO:
// - Grow/shrink support
// - Customise AST output
/* Tokenise a blockquote. */
function blockquote(eat: { (arg0: string): any; (arg0: string): any; now: any; }, value: string, silent: boolean) {
var self = this;
var offsets = self.offset;
var tokenizers = self.blockTokenizers;
var interruptors = [
['indentedCode', { commonmark: true }],
['fencedCode', { commonmark: true }],
['atxHeading', { commonmark: true }],
['setextHeading', { commonmark: true }],
['thematicBreak', { commonmark: true }],
['html', { commonmark: true }],
['list', { commonmark: true }],
['definition', { commonmark: false }],
['footnote', { commonmark: false }]
];
var now = eat.now();
var currentLine = now.line;
var length = value.length;
var values = [];
var contents = [];
var indents = [];
var add;
var index = 0;
var character;
var rest;
var nextIndex;
var content;
var line;
var startIndex;
var prefixed;
var exit;
while (index < length) {
character = value.charAt(index);
if (character !== C_SPACE && character !== C_TAB) {
break;
}
index++;
}
if (value.charAt(index) !== C_GT) {
return;
}
const regex = /^>\s*\[!(?<keyword>(.*?))\][\t\f ]?(?<title>.*?)$/i;
nextIndex = value.indexOf(C_NEWLINE, index);
content = value.slice(index, nextIndex);
const m = regex.exec(content); // value.slice(index)
if (!m) {
return;
}
if (!m.groups?.keyword) return;
if (silent) {
return true;
}
index = 0;
let titleLine = true
while (index < length) {
nextIndex = value.indexOf(C_NEWLINE, index);
startIndex = index;
prefixed = false;
if (nextIndex === -1) {
nextIndex = length;
}
while (index < length) {
character = value.charAt(index);
if (character !== C_SPACE && character !== C_TAB) {
break;
}
index++;
}
if (value.charAt(index) === C_GT) {
index++;
prefixed = true;
if (value.charAt(index) === C_SPACE) {
index++;
}
} else {
index = startIndex;
}
// regex.lastIndex = index
content = value.slice(index, nextIndex);
if (!prefixed && !trim(content)) {
index = startIndex;
break;
}
if (!prefixed) {
rest = value.slice(index);
/* Check if the following code contains a possible
* block. */
if (interrupt(interruptors, tokenizers, self, [eat, rest, true])) {
break;
}
}
line = startIndex === index ? content : value.slice(startIndex, nextIndex);
indents.push(index - startIndex);
values.push(line);
if (titleLine) {
titleLine = false
} else {
contents.push(content);
}
index = nextIndex + 1;
}
index = -1;
length = indents.length;
add = eat(values.join(C_NEWLINE));
while (++index < length) {
offsets[currentLine] = (offsets[currentLine] || 0) + indents[index];
currentLine++;
}
exit = self.enterBlock();
const title = self.tokenizeInline(m.groups?.title, now);
contents = self.tokenizeBlock(contents.join(C_NEWLINE), now);
exit();
// console.log(title,)
return add({
type: 'callout',
children: [{
type: "heading",
children: title,
data: { hName: 'svelte:fragment',
hProperties: {
slot: "title"
} }
}, {
type: "block",
children: contents,
data: { hName: 'svelte:fragment',
hProperties: {
slot: "body"
} }
}],
keyword: m.groups?.keyword,
data: {
hName: 'Components.Callout',
hProperties: {
"calloutType": m.groups?.keyword
},
}
});
// return add({
// type: 'callout',
// children: [{
// type: "heading",
// children: title,
// data: { hName: 'div',
// hProperties: {
// className: "callout-title"
// } }
// }, {
// type: "block",
// children: contents,
// data: { hName: 'div',
// hProperties: {
// className: "callout-content"
// } }
// }],
// keyword: m.groups?.keyword,
// data: {
// hName: 'div',
// hProperties: {
// className: "callout",
// "data-callout": m.groups?.keyword
// },
// }
// });
}
function interrupt(interruptors, tokenizers, ctx, params) {
var bools = ['pedantic', 'commonmark'];
var count = bools.length;
var length = interruptors.length;
var index = -1;
var interruptor;
var config;
var fn;
var offset;
var bool;
var ignore;
while (++index < length) {
interruptor = interruptors[index];
config = interruptor[1] || {};
fn = interruptor[0];
offset = -1;
ignore = false;
while (++offset < count) {
bool = bools[offset];
if (config[bool] !== undefined && config[bool] !== ctx.options[bool]) {
ignore = true;
break;
}
}
if (ignore) {
continue;
}
if (tokenizers[fn].apply(ctx, params)) {
return true;
}
}
return false;
}
+14
View File
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "es2020",
"module": "esnext",
"strict": true,
"esModuleInterop": true,
"moduleResolution": "node",
"skipLibCheck": true,
"noImplicitAny": true,
"allowJs": true,
"noEmit": true,
"resolveJsonModule": true
}
}
@@ -0,0 +1,2 @@
dist
node_modules
@@ -0,0 +1,38 @@
{
"name": "vite-plugin-thumbhash-svg",
"version": "1.0.0",
"description": "",
"type": "module",
"main": "dist/index.esm.js",
"exports": {
"import": "./dist/index.esm.js",
"require": "./dist/index.cjs.js",
"types": "./dist/index.d.ts"
},
"types": "dist/index.d.ts",
"scripts": {
"build": "rollup -c",
"prepublish": "rollup -c",
"dev": "rollup -c -w",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^20.14.2",
"rollup": "^4.18.0",
"rollup-plugin-dts": "^6.1.1",
"vite": "^5.3.1"
},
"files": [
"dist"
],
"dependencies": {
"@napi-rs/canvas": "^0.1.53",
"@resvg/resvg-js": "^2.6.2",
"@rollup/pluginutils": "^5.1.0",
"thumbhash-node": "^0.1.3"
}
}
@@ -0,0 +1,20 @@
// rollup.config.js
import typescript from '@rollup/plugin-typescript';
import { dts } from "rollup-plugin-dts";
import pkg from './package.json' with { type: "json" };
export default [
{
input: 'src/index.ts',
output: [
{ file: pkg.exports.require, format: 'cjs' },
{ file: pkg.exports.import, format: 'es' }
],
plugins: [typescript()]
},
{
input: 'src/index.ts',
output: [{ file: pkg.exports.types, format: 'es' }],
plugins: [dts()],
}
];
@@ -0,0 +1,236 @@
import { createFilter } from '@rollup/pluginutils'
import { basename } from 'node:path'
import { relative } from 'node:path/posix'
import { readFile, access } from 'node:fs/promises'
import { constants } from 'node:fs'
import { extname } from 'node:path';
import { loadImage, createCanvas, ImageData } from '@napi-rs/canvas'
import { Resvg } from '@resvg/resvg-js'
import { rgbaToThumbHash, thumbHashToRGBA } from 'thumbhash-node'
import type { Plugin, ResolvedConfig } from 'vite'
export type OutputExtension = 'png' | 'jpg' | 'webp' | 'avif'
export type Options =
| {
include?: Array<string | RegExp> | string | RegExp
exclude?: Array<string | RegExp> | string | RegExp
outputExtension?: OutputExtension
}
| undefined
interface LoaderParams {
thumbSrc: string
thumbWidth: number
thumbHeight: number
originalSrc: string
originalWidth: number
originalHeight: number
}
const loader = (params: LoaderParams) => {
return `export default ${JSON.stringify(params)}`
}
async function loadImageAndConvertToRgba(path: string) {
const maxSize = 100
const imgPath = path
let image;
// console.log(path, extname(path))
if (extname(path) === ".svg") {
const svg = await readFile(imgPath);
const resvg = new Resvg(svg)
const render = resvg.render()
image = await loadImage(render.asPng())
} else {
// canvas handles all file loading for us
image = await loadImage(imgPath)
}
const width = image.width
const height = image.height
const scale = maxSize / Math.max(width, height)
const resizedWidth = Math.round(width * scale)
const resizedHeight = Math.round(height * scale)
const canvas = createCanvas(resizedWidth, resizedHeight)
const ctx = canvas.getContext('2d')
ctx.drawImage(image, 0, 0, resizedWidth, resizedHeight)
const imageData = ctx.getImageData(0, 0, resizedWidth, resizedHeight)
const rgba = new Uint8Array(imageData.data)
return {
originalWidth: width,
originalHeight: height,
height: imageData.height,
width: imageData.width,
rgba,
}
}
const fromRGBAToImageBuffer = (
rgba: Uint8Array,
mimeType: MimeType,
width: number,
height: number
) => {
const thumb = rgbaToThumbHash(width, height, rgba)
const transformedRgba = thumbHashToRGBA(thumb)
const imageData = new ImageData(
new Uint8ClampedArray(transformedRgba.rgba),
transformedRgba.width,
transformedRgba.height
)
const canvas = createCanvas(transformedRgba.width, transformedRgba.height)
const context = canvas.getContext('2d')
//@ts-ignore
context.putImageData(imageData, 0, 0)
//@ts-ignore
const buffer = canvas.toBuffer(mimeType)
return buffer
}
type MimeType = 'image/webp' | 'image/jpeg' | 'image/avif' | 'image/png'
const extToMimeTypeMap: Record<OutputExtension, MimeType> = {
avif: 'image/avif',
jpg: 'image/jpeg',
png: 'image/png',
webp: 'image/webp',
}
export const blurRE = /(?:\?|&)th(umb)?(?:&|$)/
const isThumbHash = (id: string) => {
return !!id.match(blurRE)
}
const cleanId = (id: string) => id.replace(blurRE, '')
const buildViteAsset = (referenceId: string) => `__VITE_ASSET__${referenceId}__`
const buildDataURL = (buf: Buffer, mimeType: MimeType) => {
const dataPrefix = `data:${mimeType};base64,`
const dataURL = `${dataPrefix}${buf.toString('base64')}`
return dataURL
}
async function exists(path: string) {
try {
await access(path, constants.F_OK)
return true
} catch {
return false
}
}
const thumbHash = (options: Options = {}): Plugin => {
const { include, exclude, outputExtension = 'png' } = options
const bufferMimeType = extToMimeTypeMap[outputExtension]
const filter = createFilter(include, exclude)
let config: ResolvedConfig
const cache = new Map<string, importItem>()
type importItem = {
thumbSrc: string;
thumbWidth: number;
thumbHeight: number;
originalSrc: string;
originalWidth: number;
originalHeight: number;
}
return {
name: 'vite-plugin-thumbhash',
enforce: 'pre',
configResolved(cfg) {
config = cfg
},
async load(id) {
if (!filter(id)) {
return null
}
if (isThumbHash(id)) {
const cleanedId = cleanId(id)
if (cache.has(id)) {
let loadedSource = cache.get(id) as importItem
if (config.command !== 'serve') {
const originalRefId = this.emitFile({
type: 'asset',
name: basename(cleanedId),
source: await readFile(cleanedId),
})
loadedSource.originalSrc = buildViteAsset(originalRefId);
}
return loader(loadedSource)
}
const { rgba, width, height, originalHeight, originalWidth } =
await loadImageAndConvertToRgba(cleanedId)
const buffer = fromRGBAToImageBuffer(
rgba,
bufferMimeType,
width,
height
)
const dataURL = buildDataURL(buffer, bufferMimeType)
// const referenceId = this.emitFile({
// type: 'asset',
// name: basename(cleanedId).replace(
// /\.(jpg)|(jpeg)|(png)|(webp)|(avif)|(svg)/g,
// `.${outputExtension}`
// ),
// source: buffer,
// })
const originalSrc = relative(config.root, cleanedId);
const loadedSource = {
thumbSrc: dataURL,
thumbWidth: width,
thumbHeight: height,
originalSrc,
originalWidth: originalWidth,
originalHeight: originalHeight,
}
cache.set(id, loadedSource)
if (config.command !== 'serve') {
const originalRefId = this.emitFile({
type: 'asset',
name: basename(cleanedId),
source: await readFile(cleanedId),
})
loadedSource.originalSrc = buildViteAsset(originalRefId);
}
return loader(loadedSource)
// import.meta.ROLLUP_FILE_URL_
}
return null
},
}
}
export { thumbHash }
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "es2020",
"module": "esnext",
"strict": true,
"esModuleInterop": true,
"moduleResolution": "node",
"skipLibCheck": true,
"noImplicitAny": true,
"allowJs": true,
"noEmit": true,
"resolveJsonModule": true
}
}
+14
View File
@@ -0,0 +1,14 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
.vercel
.output
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
output
Dockerfile
+20
View File
@@ -0,0 +1,20 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env.sentry-build-plugin
.env
.env.*.local
!.env.example
.vercel
.output
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
output
Notes-1.0.0.tgz
# Sentry Config File
.sentryclirc
# Sentry Config File
.env.sentry-build-plugin
+1
View File
@@ -0,0 +1 @@
engine-strict=true
+33
View File
@@ -0,0 +1,33 @@
# build the sapper app
FROM node:latest AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
ENV CI=1
RUN corepack enable
COPY ./../.. /app/
WORKDIR /app
# FROM base AS prod-deps
# RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
FROM base AS deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
# RUN cd packages/website; --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
FROM deps as build
ENV NODE_OPTIONS="--max-old-space-size=4096"
RUN cd packages/website; pnpm run build
RUN cd packages/website; node server-esbuild.js
FROM node:alpine
WORKDIR /app
COPY --from=build /app/packages/website/output .
COPY --from=build /app/packages/website/build/client ./client/
COPY --from=build /app/packages/website/build/prerendered ./prerendered/
COPY --from=base /app/packages/website/package.json ./package.json
ENV NODE_ENV production
EXPOSE 3000
CMD ["node", "."]
+44
View File
@@ -0,0 +1,44 @@
<div
style={{
display: 'flex',
height: '100%',
width: '100%',
padding: '10px 20px',
// alignItems: 'center',
justifyContent: 'center',
flexDirection: 'column',
backgroundImage: 'linear-gradient(to bottom, #dbf4ff, #eff3fc)',
fontSize: 60,
// letterSpacing: -2,
fontWeight: 700,
// textAlign: 'center',
}}
>
<div style={{
fontSize: 15,
fontWeight: 600,
textTransform: 'uppercase',
letterSpacing: 1,
margin: '25px 0 10px',
color: 'gray',
}}>jade.ellis.link
</div>
<div
style={{
backgroundImage: 'linear-gradient(90deg, rgb(30, 42, 85), rgb(22, 61, 120))',
backgroundClip: 'text',
'-webkit-background-clip': 'text',
color: 'transparent',
}}>The Potential Pitfalls of Pagination</div>
<aside style={{
fontSize: 20,
fontWeight: 500,
color:'#202020',
margin: '10px 0 10px',
}}>
Published on
· By Jade Ellis
· 4 min read
</aside>
</div>
+30
View File
@@ -0,0 +1,30 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": false,
"ignore": []
},
"formatter": {
"enabled": true,
"indentStyle": "tab"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
}
}
+68
View File
@@ -0,0 +1,68 @@
const rootDomain = process.env.VITE_DOMAIN; // or your server IP for dev
import { SENTRY_HOST } from './src/lib/config.js';
import { SENTRY_REPORT_URL } from './src/lib/config.js';
const self = "'self'";
const none = "'none'";
/**
* @type {import("@sveltejs/kit").CspDirectives}
*/
const cspDirectives = {
'base-uri': [self],
'child-src': [self, "blob:"],
'connect-src': [self, "https://*.google-analytics.com", "https://" + SENTRY_HOST],
// 'connect-src': [self, 'ws://localhost:*', 'https://hcaptcha.com', 'https://*.hcaptcha.com'],
'img-src': [self, 'data:',
'https://*.googletagmanager.com'],
'font-src': [self, 'data:'],
'form-action': [self],
'frame-ancestors': [self],
'frame-src': [
self,
// "https://*.stripe.com",
// "https://*.facebook.com",
// "https://*.facebook.net",
// 'https://hcaptcha.com',
// 'https://*.hcaptcha.com',
],
'manifest-src': [self],
'media-src': [self, 'data:'],
'object-src': [none],
'style-src': [self, "unsafe-inline"],
// 'style-src': [self, "'unsafe-inline'", 'https://hcaptcha.com', 'https://*.hcaptcha.com'],
'default-src': [
'self',
...(rootDomain ? [rootDomain, `ws://${rootDomain}`] : []),
// 'https://*.google.com',
// 'https://*.googleapis.com',
// 'https://*.firebase.com',
// 'https://*.gstatic.com',
// 'https://*.cloudfunctions.net',
// 'https://*.algolia.net',
// 'https://*.facebook.com',
// 'https://*.facebook.net',
// 'https://*.stripe.com',
// 'https://*.sentry.io',
],
'script-src': [
self,
// "unsafe-inline", // chrome suggestion
'https://*.googletagmanager.com'
// 'https://*.stripe.com',
// 'https://*.facebook.com',
// 'https://*.facebook.net',
// 'https://hcaptcha.com',
// 'https://*.hcaptcha.com',
// 'https://*.sentry.io',
// 'https://polyfill.io',
],
'worker-src': [self, "blob:"],
// remove report-to & report-uri if you do not want to use Sentry reporting
'report-to': ["csp-endpoint"],
'report-uri': [
SENTRY_REPORT_URL,
],
};
export default cspDirectives;
+387
View File
@@ -0,0 +1,387 @@
// https://github.com/String10/Hakuba/blob/master/package.json
// import { defineMDSveXConfig as defineConfig } from "mdsvex";
// import type { Plugin, Settings } from 'unified';
import remarkGfm from "remark-gfm";
import remarkFrontmatter from "remark-frontmatter";
import remarkWikiLink from "remark-wiki-link";
import remarkMath from "remark-math"
// @ts-ignore
import remarkAbbr from "remark-abbr"
import remarkFootnotes from 'remark-footnotes'
import remarkCallouts from "remark-callouts";
import rehypeKatexSvelte from 'rehype-katex-svelte';
// import github from "remark-github";
import rehypeSlug from 'rehype-slug';
import remarkReadingTime from "remark-reading-time";
// import rehypeToc from '@jsdevtools/rehype-toc';
import { createHighlighter } from "@bitmachina/highlighter";
import { parse, format } from "node:path";
import slugify from 'slugify';
export const NOTE_ICON = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="2" x2="22" y2="6"></line><path d="M7.5 20.5 19 9l-4-4L3.5 16.5 2 22z"></path></svg>';
export const QUOTE_ICON = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z"></path><path d="M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z"></path></svg>';
export const INFO_ICON = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>';
export const ICONS = {
note: NOTE_ICON,
quote: QUOTE_ICON,
info: INFO_ICON,
};
import { globSync } from 'glob'
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
const projects = globSync('node_modules/Notes/Projects/*.md')
.map((filepath) => {
return parse(filepath)
})
.map((path) => {
return format({
// ...path,
name: slugify(path.name, { lower: true }),
// base: undefined,
// root: "",
// ext: undefined,
// dir: path.dir.replace("/node_modules/Notes/Projects", "")
})
})
/**
* @type {string[]}
*/
const permalinks = projects.map((p) => "/projects/" + p)
// console.log(permalinks)
/**
* @param {string} pageName
* @returns {string[]}
*/
function pageResolver(pageName) {
const slug = slugify(pageName, { lower: true });
return ["/", "/projects/"].map((p) => p + slug);
}
import { grammars } from 'tm-grammars'
// console.log()
/**
* @param {string} name
*/
function getGrammar(name) {
const metadata = grammars.find((grammar) => grammar.name == name)
if (!metadata) {
throw "Grammar not found"
}
return {
...metadata,
id: name,
grammar: JSON.parse(readFileSync(fileURLToPath(import.meta.resolve('tm-grammars/grammars/' + name + '.json')), 'utf8')),
}
}
const hrefTemplate = (/** @type {string} */ permalink) => permalink
// function customizeTOC(toc) {
// // console.log(toc)
// return {
// type: 'root',
// children: [{
// type: "element",
// // tagName: "svelte:component",
// // properties: { this: "{tocComponent}" },
// tagName: "div",
// properties: {},
// children: [toc],
// }]
// };
// }
/**
* @param {{level: number, title: string}[]} headings
*/
function buildNestedHeadings(headings) {
/**
* @type {{level: number, title: string, children: unknown}[]}
*/
const result = [];
const stack = [{ level: 0, children: result }];
for (const heading of headings) {
while (
stack.length > 1 &&
heading.level <= stack[stack.length - 1].level
) {
stack.pop();
}
const parent = stack[stack.length - 1];
const newHeading = {
...heading,
children: [],
level: heading.level,
};
parent.children.push(newHeading);
stack.push(newHeading);
}
return result;
}
import { visit } from 'unist-util-visit';
import { toString as mdast_tree_to_string } from 'mdast-util-to-string'
import GithubSlugger from 'github-slugger'
/**
* @param {{ prefix?: string; }} opts
*/
function add_toc_remark(opts) {
const slugs = new GithubSlugger()
const prefix = opts?.prefix || "";
return async function transformer(tree, vFile) {
slugs.reset()
vFile.data.flattenedHeadings = [];
visit(tree, 'heading', (node) => {
const title = mdast_tree_to_string(node);
vFile.data.flattenedHeadings.push({
level: node.depth,
title,
id: prefix + slugs.slug(title)
});
});
if (!vFile.data.fm) vFile.data.fm = {};
vFile.data.fm.flattenedHeadings = vFile.data.flattenedHeadings;
vFile.data.fm.headings = buildNestedHeadings(vFile.data.flattenedHeadings);
};
}
function add_data_to_fm(_opts) {
return async function transformer(tree, vFile) {
if (!vFile.data.fm) vFile.data.fm = {};
vFile.data.fm.readingTime = vFile.data.readingTime;
};
}
import { toString as hast_tree_to_string } from 'hast-util-to-string'
/**
* Determines whether the given node is an HTML element.
*/
function isHtmlElementNode(node) {
return typeof node === "object" &&
node.type === "element" &&
typeof node.tagName === "string" &&
"properties" in node &&
typeof node.properties === "object";
}
const HEADINGS = ["h1", "h2", "h3", "h4", "h5", "h6"]
/**
* Determines whether the given node is an HTML heading node, according to the specified options
*/
function isHeadingNode(node) {
return isHtmlElementNode(node) && HEADINGS.includes(node.tagName);
}
function add_toc_rehype(self, opts) {
return async function transformer(tree, vFile) {
// console.log(tree)
vFile.data.headings = [];
visit(tree, isHeadingNode, (node) => {
// console.log(node)
vFile.data.headings.push({
level: node.depth,
title: hast_tree_to_string(node),
});
});
if (!vFile.data.fm) vFile.data.fm = {};
vFile.data.fm.headings = vFile.data.headings;
};
}
import toCamel from "just-camel-case";
const RE_SCRIPT_START =
/<script(?:\s+?[a-zA-z]+(=(?:["']){0,1}[a-zA-Z0-9]+(?<!module)(?:["']){0,1}){0,1})*\s*?>/;
function vite_images_rehype(opts) {
return async function transformer(tree, vFile) {
const urls = new Map();
const url_count = new Map();
/**
* @param {string} url
*/
function transformUrl(url) {
// url = decodeURIComponent(url)
// console.log("decoded", url)
// filenames can start with digits,
// prepend underscore to guarantee valid module name
let camel = `_${toCamel(url)}`;
const count = url_count.get(camel);
const dupe = urls.get(url);
if (count && !dupe) {
url_count.set(camel, count + 1);
camel = `${camel}_${count}`;
} else if (!dupe) {
url_count.set(camel, 1);
}
urls.set(url, {
path: url,
id: camel
});
return camel;
}
// console.log(tree)
// vFile.data.headings = [];
// console.log(tree)
visit(tree, { tagName: "img" }, (node) => {
let url = node.properties.src;
url = (url.includes("?") ? url + "&" : url + "?") + "url";
node.properties.src = `{${transformUrl(url)}}`
// new URL('./img.png', import.meta.url).href
// vFile.data.headings.push({
// level: node.depth,
// title: hast_tree_to_string(node),
// });
});
visit(tree, { tagName: "Components.img" }, (node) => {
let url = node.properties.src;
const thumb = (url.includes("?") ? url + "&" : url + "?") + "thumb";
url = (url.includes("?") ? url + "&" : url + "?") + "url";
node.properties.src = `{${transformUrl(url)}}`
node.properties.thumb = `{${transformUrl(thumb)}}`
// node.properties.src = `{new URL('${url}', import.meta.url)}`
// new URL('./img.png', import.meta.url).href
// vFile.data.headings.push({
// level: node.depth,
// title: hast_tree_to_string(node),
// });
});
let scripts = "";
urls.forEach((x) => (scripts += `import ${x.id} from "./${x.path}";\n`));
// urls.forEach((x) => (scripts += `const ${x.id} = new URL("${x.path}", import.meta.url);\n`));
// console.log(scripts)
// urls.forEach((x) => {
// if (x.meta) {
// let a = ["src", "width", "height"]
// scripts += `import {${a.map((a) => a + " as " + x.id + "_" + a).join(",")}} from "${x.path.includes("?") ? x.path + "&as=metadata" : x.path + "?as=metadata:src;width;height"}";\n`
// }
// });
let is_script = false;
visit(tree, { type: "raw" }, (node) => {
// console.log(node)
if (RE_SCRIPT_START.test(node.value)) {
// console.log("inserting")
is_script = true;
node.value = node.value.replace(RE_SCRIPT_START, (script) => {
return `${script}\n${scripts}`;
});
}
});
if (!is_script) {
tree.children.push({
type: 'raw',
value: `<script>\n${scripts}</script>`,
})
}
};
}
/**
* @type {import("mdsvex").MdsvexOptions}
*/
const config = {
extensions: [".svelte.md", ".md", ".svx"],
// fences: true,
// ruleSpaces: false,
smartypants: {
dashes: "oldschool",
},
layout: {
_: "./src/lib/mdlayouts/default.svelte"
},
highlight: {
// @ts-ignore
highlighter: await createHighlighter({ theme: "github-dark", langs: ["http", "jsx", "javascript", "typescript", "rust"].map(getGrammar) }),
alias: {
ts: "typescript",
mdx: "markdown",
svelte: "svelte",
svx: "svx",
mdsvex: "svx",
sig: "ts",
}
},
remarkPlugins: [
// remarkFrontmatter,
// [github, {repository}],
remarkMath,
remarkAbbr,
[remarkFootnotes, { inlineNotes: true }],
remarkGfm,
[remarkCallouts, {}],
[remarkWikiLink, {
// @ts-ignore
aliasDivider: "|",
permalinks,
pageResolver,
hrefTemplate,
// wikiLinkClassName,
// newClassName,
}],
// [citePlugin, {
// syntax: {
// // see micromark-extension-cite
// enableAltSyntax: false,
// enablePandocSyntax: true,
// },
// toMarkdown: {
// // see mdast-util-cite
// standardizeAltSyntax: false,
// enableAuthorSuppression: true,
// useNodeValue: false,
// },
// }],
// [remarkBibliography, { bibliography }],
// [remarkMermaid, {}]
remarkReadingTime,
add_data_to_fm,
[add_toc_remark, { prefix: "h-" }]
],
rehypePlugins: [
// @ts-ignore
rehypeKatexSvelte,
// @ts-ignore
[rehypeSlug, { prefix: "h-" }],
vite_images_rehype
],
};
export default config;
+111
View File
@@ -0,0 +1,111 @@
{
"name": "website",
"version": "0.0.1",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"fix": "biome lint --write . && biome format --write . && biome check . --write"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@bitmachina/highlighter": "1.0.0-alpha.6",
"@fontsource/fira-mono": "^5.1.0",
"@json-feed-types/1_1": "^1.0.2",
"@rollup/pluginutils": "^5.1.3",
"@sentry/esbuild-plugin": "^2.22.6",
"@sveltejs/adapter-auto": "^3.3.1",
"@sveltejs/adapter-node": "^5.2.9",
"@sveltejs/kit": "^2.8.2",
"@sveltejs/vite-plugin-svelte": "^4.0.1",
"@types/fnv-plus": "^1.3.2",
"@types/node": "^20.17.7",
"@types/polka": "^0.5.7",
"@types/sharedworker": "^0.0.115",
"dotenv": "^16.4.5",
"esbuild": "^0.23.1",
"github-slugger": "^2.0.0",
"glob": "^10.4.5",
"hast-util-to-string": "^3.0.1",
"just-camel-case": "^6.2.0",
"mdast-util-to-string": "^4.0.0",
"mdsvex": "^0.11.2",
"rehype-katex-svelte": "~1.2.0",
"rehype-slug": "^6.0.0",
"remark-abbr": "^1.4.2",
"remark-callouts": "workspace:^",
"remark-footnotes": "^2.0.0",
"remark-frontmatter": "^5.0.0",
"remark-gfm": "^4.0.0",
"remark-github": "^12.0.0",
"remark-math": "^3.0.1",
"remark-reading-time": "^2.0.1",
"remark-wiki-link": "^0.0.4",
"rollup": "^4.27.4",
"rollup-plugin-type-as-json-schema": "^0.2.6",
"rollup-plugin-visualizer": "^5.12.0",
"schema-dts": "^1.1.2",
"sharp": "^0.33.5",
"svelte": "^5.2.7",
"svelte-check": "^4.1.0",
"svelte-seo": "^1.6.1",
"sveltekit-html-minifier": "^1.0.4",
"svgo": "^3.3.2",
"tm-grammars": "^1.19.5",
"tslib": "^2.8.1",
"typescript": "^5.7.2",
"unified": "^11.0.5",
"unist-util-visit": "^5.0.0",
"vite": "^5.4.2",
"vite-plugin-image-optimizer": "^1.1.8",
"vite-plugin-thumbhash": "^0.1.6",
"vite-plugin-thumbhash-svg": "workspace:^"
},
"type": "module",
"dependencies": {
"@babel/preset-typescript": "^7.26.0",
"@codemirror/commands": "^6.7.1",
"@codemirror/lang-javascript": "^6.2.2",
"@codemirror/language": "^6.10.3",
"@codemirror/lint": "^6.8.3",
"@codemirror/state": "^6.4.1",
"@codemirror/view": "^6.35.0",
"@isaacs/ttlcache": "^1.4.1",
"@lezer/highlight": "^1.2.1",
"@octokit/types": "^13.6.1",
"@resvg/resvg-js": "^2.6.2",
"@sentry/sveltekit": "^8.40.0",
"@steeze-ui/svelte-icon": "^1.6.2",
"@tabler/icons-svelte": "^3.22.0",
"@tusbar/cache-control": "^1.0.2",
"@uiw/codemirror-theme-github": "^4.23.6",
"Notes": "file:Notes-1.0.0.tgz",
"acorn": "^8.14.0",
"codemirror": "^6.0.1",
"fnv-plus": "^1.3.1",
"magic-string": "^0.30.13",
"octokit": "^3.2.1",
"satori": "^0.10.14",
"slugify": "^1.6.6",
"super-sitemap": "^0.14.20",
"svelte-codemirror-editor": "^1.4.1",
"terser": "^5.36.0",
"xmlbuilder2": "^3.1.1"
},
"targets": {
"module": {
"context": "node",
"engines": {
"node": ">= 20"
},
"outputFormat": "esmodule",
"optimize": true,
"includeNodeModules": true
}
},
"@parcel/resolver-default": {
"packageExports": true
}
}
+60
View File
@@ -0,0 +1,60 @@
import { sentryEsbuildPlugin } from "@sentry/esbuild-plugin";
import esbuild from "esbuild";
// https://github.com/evanw/esbuild/pull/2067
const ESM_REQUIRE_SHIM = `
await (async () => {
const { dirname } = await import("path");
const { fileURLToPath } = await import("url");
/**
* Shim entry-point related paths.
*/
if (typeof globalThis.__filename === "undefined") {
globalThis.__filename = fileURLToPath(import.meta.url);
}
if (typeof globalThis.__dirname === "undefined") {
globalThis.__dirname = dirname(globalThis.__filename);
}
/**
* Shim require if needed.
*/
if (typeof globalThis.require === "undefined") {
const { default: module } = await import("module");
globalThis.require = module.createRequire(import.meta.url);
}
})();
`;
const banner = {
"js": ESM_REQUIRE_SHIM
};
esbuild.build({
sourcemap: true, // Source map generation must be turned on
platform: "node", // Node.js platform
target: "node22.0", // Node.js version
entryPoints: ["./build/index.js"], // Entry point file
outdir: "./output", // Output directory
bundle: true, // Generate an external bundle
splitting: true, // Enable code splitting
format: "esm", // Output format
loader: {
".node": "copy",
},
alias: {
"perf_hooks": "node:perf_hooks",
},
banner,
plugins: [
// Put the Sentry esbuild plugin after all other plugins
sentryEsbuildPlugin({
org: "jade-ellis",
project: "jade-website-sveltekit",
authToken: process.env.SENTRY_AUTH_TOKEN,
sourcemaps: {
// Specify the directory containing build artifacts
assets: "./output/**",
}
}),
],
});
+15
View File
@@ -0,0 +1,15 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
import type { Middleware } from "polka"
type Req = Parameters<Middleware>[0]
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
interface Platform {
req: Req
}
}
}
+12
View File
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
<script async defer src="https://www.googletagmanager.com/gtag/js?id=G-Q2R5PQL59Z"></script>
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
+30
View File
@@ -0,0 +1,30 @@
import { SENTRY_DSN } from '$lib/config';
import { init as initSentry, handleErrorWithSentry, makeBrowserOfflineTransport, makeFetchTransport, feedbackIntegration } from '@sentry/sveltekit';
initSentry({
dsn: SENTRY_DSN,
environment: import.meta.env.MODE,
tracesSampleRate: 1.0,
// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.0,
// If the entire session is not sampled, use the below sample rate to sample
// sessions when an error occurs.
replaysOnErrorSampleRate: 1.0,
integrations: [feedbackIntegration({
autoInject: false,
})],
// replay:
// - https://github.com/getsentry/sentry-javascript/tree/develop/packages/replay-worker
// https://docs.sentry.io/platforms/javascript/guides/solidstart/session-replay/configuration/#using-a-custom-compression-worker
// To enable offline events caching, use makeBrowserOfflineTransport to wrap
// existing transports and queue events using the browsers' IndexedDB storage
transport: makeBrowserOfflineTransport(makeFetchTransport),
});
// If you have a custom error handler, pass it to `handleErrorWithSentry`
export const handleError = handleErrorWithSentry();
+61
View File
@@ -0,0 +1,61 @@
import { sequence } from '@sveltejs/kit/hooks';
import { init as initSentry, handleErrorWithSentry, sentryHandle } from '@sentry/sveltekit';
import type { Handle } from "@sveltejs/kit";
import { randomBytes } from 'crypto';
import { SENTRY_DSN, SENTRY_REPORT_URL } from '$lib/config';
// import { nodeProfilingIntegration } from "@sentry/profiling-node";
initSentry({
dsn: SENTRY_DSN,
environment: import.meta.env.MODE,
tracesSampleRate: 1.0,
// profilesSampleRate: 1.0,
integrations: [
],
})
const securityHeaders = {
'X-Content-Type-Options': 'nosniff',
'X-XSS-Protection': '0',
"Referrer-Policy": "no-referrer-when-downgrade",
"Permissions-Policy": "payment=(), geolocation=(self), fullscreen=(self)",
'Cross-Origin-Embedder-Policy': 'require-corp',
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Resource-Policy': 'same-origin',
'Report-To': '{"group":"csp-endpoint","max_age":10886400,"endpoints":[{"url":"' + SENTRY_REPORT_URL + '"}],"include_subdomains":true}',
}
export const handle: Handle = async (input) => {
const sentryNonce = randomBytes(16).toString('hex');
return await sequence(
sentryHandle({
// injectFetchProxyScript: false,
fetchProxyScriptNonce: sentryNonce,
}),
async ({ event, resolve }) => {
const response = await resolve(event);
const csp = response.headers.get("Content-Security-Policy");
if (csp) {
response.headers.set("Content-Security-Policy", csp.replace("script-src", "script-src 'nonce-" + sentryNonce + "'"));
}
Object.entries(securityHeaders).forEach(
([header, value]) => {
if (!response.headers.has(header)) {
response.headers.set(header, value)
}
}
);
response.headers.delete("x-sveltekit-page")
return response;
}
)(input)
}
export const handleError = handleErrorWithSentry();
+37
View File
@@ -0,0 +1,37 @@
<script lang="ts">
import { IconExclamationCircle } from "@tabler/icons-svelte";
interface Props {
calloutType: string;
icon?: import('svelte').Snippet;
title?: import('svelte').Snippet;
body?: import('svelte').Snippet;
}
let {
calloutType,
icon,
title,
body
}: Props = $props();
</script>
<div class="callout" data-callout={calloutType}>
<div class="callout-title">
{#if icon}
<div class="callout-icon">{@render icon?.()}</div>
{:else}
<div class="callout-icon"><IconExclamationCircle /></div>
{/if}
<div class="callout-title-inner">
{#if title}{@render title()}{:else}{calloutType.replace(/\w\S*/g, function (txt) {
return (
txt.charAt(0).toUpperCase() +
txt.substring(1).toLowerCase()
);
})}{/if}
</div>
</div>
{#if body}
<div class="callout-body">{@render body?.()}</div>
{/if}
</div>
+301
View File
@@ -0,0 +1,301 @@
<script lang="ts" module>
type Attrs = {
[name: string]: string;
};
type AttrSource = Attrs | ((view: EditorView) => Attrs | null);
</script>
<script lang="ts">
import { run } from 'svelte/legacy';
// look at https://github.com/sveltejs/learn.svelte.dev/blob/main/src/routes/tutorial/%5Bslug%5D/Editor.svelte
// import { javascript } from "@codemirror/lang-javascript";
import { onDestroy, onMount, createEventDispatcher } from "svelte";
import { theme } from "$lib/theme";
import { githubLight, githubDark } from "$lib/themes/github";
import { EditorView } from "@codemirror/view";
import {
EditorState,
StateEffect,
type Extension,
} from "@codemirror/state";
import { type LanguageSupport } from "@codemirror/language";
import { get_base_extensions } from "./editorExtensions";
interface Props {
value?: string;
contentAttributes?: AttrSource | null;
lang?: LanguageSupport | null;
useTab?: boolean;
tabSize?: number;
lineWrapping?: boolean;
editable?: boolean;
readonly?: boolean;
placeholder?: string | HTMLElement | null | undefined;
header?: import('svelte').Snippet;
}
let {
value = $bindable(""),
contentAttributes = null,
lang = null,
useTab = true,
tabSize = 2,
lineWrapping = false,
editable = true,
readonly = false,
placeholder = undefined,
header
}: Props = $props();
const is_browser = typeof window !== "undefined";
let element: HTMLDivElement = $state();
let view: EditorView = $state();
let update_from_prop = false;
let update_from_state = false;
let first_config = true;
let first_update = true;
let langPlugin = null;
let extensions: Extension[] = [];
if (langPlugin !== null) extensions.push(langPlugin);
if (contentAttributes !== null)
extensions.push(EditorView.contentAttributes.of(contentAttributes));
onMount(() => {
view = create_editor_view();
dispatch("ready", view);
});
onDestroy(() => view?.destroy());
const dispatch = createEventDispatcher<{
change: string;
ready: EditorView;
reconfigure: EditorView;
}>();
function create_editor_view(): EditorView {
return new EditorView({
parent: element,
state: create_editor_state(value),
dispatch(transaction) {
view.update([transaction]);
if (!update_from_prop && transaction.docChanged) {
on_change();
}
},
});
}
function reconfigure(): void {
if (first_config) {
first_config = false;
return;
}
view.dispatch({
effects: StateEffect.reconfigure.of(state_extensions),
});
dispatch("reconfigure", view);
}
function update(value: string | null | undefined): void {
if (first_update) {
first_update = false;
return;
}
if (update_from_state) {
update_from_state = false;
return;
}
update_from_prop = true;
if (value === undefined) {
return;
}
const currentValue = view ? view.state.doc.toString() : "";
if (view && value !== currentValue) {
view.dispatch({
changes: {
from: 0,
to: currentValue.length,
insert: value || "",
},
});
}
update_from_prop = false;
}
function handle_change(): void {
const new_value = view.state.doc.toString();
if (new_value === value) return;
update_from_state = true;
value = new_value;
dispatch("change", value);
}
function create_editor_state(
value: string | null | undefined,
): EditorState {
return EditorState.create({
doc: value ?? undefined,
extensions: state_extensions,
});
}
// $: console.log(value)
// import { linter, lintGutter } from "@codemirror/lint";
// import * as eslint from "eslint-linter-browserify";
// lintGutter(),
// linter(esLint(new eslint.Linter(), config)),
run(() => {
view && update(value);
});
let state_extensions = $derived([
...get_base_extensions(
useTab,
tabSize,
lineWrapping,
placeholder,
editable,
readonly,
lang,
),
$theme == "dark" ? githubDark : githubLight,
...extensions,
]);
run(() => {
view && state_extensions && reconfigure();
});
let on_change = $derived(handle_change);
</script>
<div class="editor-wrapper card" class:no-header={!header}>
{#if header}
<div class="header">
{@render header?.()}
</div>
{/if}
{#if is_browser}
<div class="codemirror-wrapper editor" bind:this={element}></div>
{:else}
<div class="scm-waiting editor">
<div class="scm-waiting__loading scm-loading">
<div class="scm-loading__spinner"></div>
<p class="scm-loading__text">Loading editor...</p>
</div>
<div class="cm-editor"><pre class="scm-pre">{value}</pre></div>
</div>
{/if}
<!-- <CodeMirror
{value}
class="editor"
theme={$theme == "dark" ? githubDark : githubLight}
{extensions}
{readonly}
on:change
/> -->
</div>
<!-- <CodeMirror basic={true} bind:value lang={javascript({})} class="editor" /> -->
<style>
.editor-wrapper {
/* min-height: 200px; */
position: relative;
z-index: 1;
background-color: var(--surface-secondary-color);
}
.codemirror-wrapper :global(.cm-focused) {
outline: none;
}
.scm-waiting {
position: relative;
}
.scm-waiting__loading {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: var(--shadow-color);
}
.scm-loading {
display: flex;
align-items: center;
justify-content: center;
}
.scm-loading__spinner {
width: 1rem;
height: 1rem;
border-radius: 100%;
border: solid 2px var(--theme);
border-top-color: transparent;
margin-right: 0.75rem;
animation: spin 1s linear infinite;
}
.scm-loading__text {
font-family: sans-serif;
}
.scm-pre {
font-size: 0.85rem;
margin: 0;
padding: 4px 2px 4px 6px;
font-family: monospace;
tab-size: 2;
-moz-tab-size: 2;
resize: none;
pointer-events: none;
user-select: none;
overflow: auto;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
:global(.editor-wrapper .cm-scroller, .editor-wrapper .cm-editor) {
min-height: 200px;
border-bottom-left-radius: var(--border-radius);
border-bottom-right-radius: var(--border-radius);
/* box-shadow: var(--shadow);
background-color: var(--surface-color); */
}
:global(
.editor-wrapper.no-header .cm-scroller,
.editor-wrapper.no-header .cm-editor
) {
border-radius: var(--border-radius);
}
:global(pre.cm-editor) {
margin: 0;
}
</style>
+16
View File
@@ -0,0 +1,16 @@
<script lang="ts">
import manifest from "./site.webmanifest?url";
import logo from "./logo.svg?url";
</script>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/svg+xml" href={logo}>
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href={manifest}>
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#0064e0">
<meta name="msapplication-TileColor" content="#1e2a55">
<meta name="theme-color" content="#1e2a55">
+137
View File
@@ -0,0 +1,137 @@
<script lang="ts">
import * as Sentry from "@sentry/sveltekit";
import url from "./logo.svg?url";
import { SITE_URL } from "$lib/metadata";
/** @type {Record<string, { href: string; title: string; }[]>} */
const links = {
Connect: [
{
href: "https://matrix.to/#/@jade:ellis.link",
title: "Matrix",
},
{ href: "https://github.com/JadedBlueEyes", title: "GitHub" },
{ href: "https://tech.lgbt/@JadedBlueEyes", title: "Mastodon" },
{
href: "https://bsky.app/profile/jade.ellis.link",
title: "Bluesky",
},
{
href: "https://www.linkedin.com/in/jadedblueeyes",
title: "LinkedIn",
},
],
Feeds: [
{ href: SITE_URL + "/blog/rss.xml", title: "RSS (Atom)" },
{ href: SITE_URL + "/blog/feed.json", title: "JSON Feed" },
]
};
const sendFeedback = async () => {
const feedback = Sentry.getFeedback();
if (!feedback) {
return;
}
const form = await feedback.createForm({});
form.appendToDom();
form.open();
};
</script>
<div class="background">
<footer class="container">
<div class="logo">
<a class="footer-link-home" href={SITE_URL}>
<img
src={url}
class="footer-logo"
alt=""
width="28"
height="28"
/>
<span class="site-name">Jade Ellis</span>
</a>
<button onclick={sendFeedback} class="feedback-button">Report a bug</button>
</div>
{#each Object.entries(links) as [title, inner_links]}
<div class="links">
<h2>{title}</h2>
{#each inner_links as { href, title }}
<a {href}>{title}</a>
{/each}
</div>
{/each}
<div class="copyright">© 2024 Jade Ellis</div>
<!-- <div class="feedback">
</div> -->
</footer>
</div>
<style>
.background {
background-color: var(--surface-color);
margin-block-start: 4em;
}
footer {
padding: 12px var(--spacing);
margin: 0 auto;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: 1fr;
grid-row-gap: 6rem;
}
.container {
--container-max-width: calc(var(--page-width) + 6rem + 16px);
}
footer h2 {
font-size: var(--sk-text-m);
padding-bottom: 1rem;
}
.links a {
display: block;
line-height: 1.8;
}
.copyright {
grid-column: span 2;
}
@media (min-width: 500px) {
footer {
grid-template-columns: repeat(3, 1fr);
}
footer .logo {
display: block;
}
.copyright {
grid-column: span 1;
}
.feedback {
display: block;
}
}
.footer-logo {
width: 3rem;
height: 100%;
}
.footer-link-home {
display: flex;
gap: 4px;
align-items: center;
padding: 8px;
font-weight: 700;
}
.feedback-button {
margin: 8px;
}
</style>
@@ -0,0 +1,43 @@
<script lang="ts">
import type { Endpoints } from "@octokit/types";
import { browser } from "$app/environment";
interface Props {
releaseData: Endpoints["GET /repos/{owner}/{repo}/releases/latest"]["response"]["data"];
}
let { releaseData }: Props = $props();
// console.log(releaseData);
</script>
<div class="release">
{#if releaseData?.assets && browser && navigator}
{#if navigator.platform.startsWith("Win")}
{@const asset = (releaseData?.assets || []).filter((a) =>
a.name.endsWith(".exe"),
)[0]}
{#if asset}
<a href={asset.browser_download_url}>Download for Windows</a>
{/if}
{:else if navigator.platform.startsWith("Mac")}
{@const asset = (releaseData?.assets || []).filter((a) =>
a.name.endsWith(".dmg"),
)[0]}
{#if asset}
<a href={asset.browser_download_url}>Download for MacOS</a>
{/if}
{:else if navigator.platform.startsWith("Linux") && navigator.platform.includes("x86_64")}
{@const asset = (releaseData?.assets || []).filter((a) =>
a.name.endsWith(".AppImage"),
)[0]}
{#if asset}
<a href={asset.browser_download_url}>Download AppImage</a>
{/if}
{:else}
<span>No download found for your device</span>
{/if}
{:else if releaseData?.assets}
<span>Finding download for your device</span>
{/if}
<p>Latest release: <a href={releaseData.html_url}>{releaseData.name}</a></p>
</div>
+123
View File
@@ -0,0 +1,123 @@
<script lang="ts">
import { preventDefault } from 'svelte/legacy';
import url from "./logo.svg?url";
import { SITE_URL } from "$lib/metadata";
let logo: HTMLDivElement = $state();
let wiggleCount = 0;
function wiggle() {
wiggleCount++;
logo.style.animationPlayState = "running";
}
function wiggleIteration() {
wiggleCount--;
if (wiggleCount === 0) {
logo.style.animationPlayState = "paused";
}
}
</script>
<div class="hero card edge h-card">
<div
class="logo"
onclick={preventDefault(wiggle)}
onanimationiteration={wiggleIteration}
bind:this={logo}
>
<a href={SITE_URL} class="u-url u-uid" rel="me"
><img class="u-photo" src={url} alt="Logo" width="128" height="128" /></a
>
</div>
<div class="content">
<div>
<h1 class="title p-name">
<span class="p-given-name">Jade</span>
<span class="p-family-name">Ellis</span>
</h1>
<div role="doc-subtitle">
<span class="p-nickname">JadedBlueEyes</span>
</div>
</div>
<div class="description p-note">
Student, Computer Scientist and Creative
</div>
</div>
</div>
<style>
.hero {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
gap: var(--spacing);
margin: 48px auto;
max-width: 320px;
padding: 3rem 0.5rem;
}
.logo {
width: 160px;
height: 160px;
flex-shrink: 0;
}
.content {
display: flex;
flex-direction: column;
gap: calc(var(--spacing) / 2);
}
.title {
text-align: center;
font-size: 32px;
margin: 0;
}
[role="doc-subtitle"] {
padding-block-start: 0;
font-size: 18px;
font-weight: 600;
text-align: center;
}
.description {
text-align: center;
}
@media screen and (min-width: 540px) {
.hero {
flex-direction: row;
margin: 96px auto;
max-width: 520px;
}
.title,
[role="doc-subtitle"],
.description {
text-align: left;
}
}
@keyframes wiggle {
0% {
transform: rotate(0deg);
}
25% {
transform: rotate(5deg);
}
75% {
transform: rotate(-5deg);
}
100% {
transform: rotate(0deg);
}
}
.logo {
animation-name: wiggle;
animation-duration: 0.2s;
/* animation-iteration-count: 1; */
animation-iteration-count: infinite;
animation-play-state: paused;
}
</style>
+91
View File
@@ -0,0 +1,91 @@
<script lang="ts">
import url from "./logo.svg?url";
import { SITE_URL } from "$lib/metadata";
// https://www.aleksandrhovhannisyan.com/
// https://github.com/AleksandrHovhannisyan/aleksandrhovhannisyan.com/tree/master
</script>
<header id="navbar">
<div class="container">
<nav aria-label="Primary">
<a href="#page-content" class="screen-reader-only skip-navigation"
>Skip to content</a
>
<ul class="navbar-links">
<li>
<a class="navbar-link-home" href={SITE_URL}>
<img
src={url}
class="navbar-logo"
alt=""
width="28"
height="28"
/>
<span class="site-name">Jade Ellis</span>
</a>
</li>
<!-- <li><a href="/about/" class="navbar-link">About</a></li>
<li><a href="/art/" class="navbar-link">Art</a></li> -->
<li><a href="/blog" class="navbar-link">Blog</a></li>
</ul>
</nav>
</div>
</header>
<style>
#navbar {
flex-shrink: 0;
width: 100%;
padding-block: 12px;
background-color: var(--surface-color);
overflow-x: auto;
color: #fff;
}
.container {
--container-max-width: calc(var(--page-width) + 6rem + 16px);
}
#navbar a {
text-decoration: none;
}
#navbar nav {
white-space: nowrap;
flex: 1 0 auto;
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
}
.navbar-logo {
width: 3rem;
height: 100%;
}
.navbar-links {
width: 100%;
display: flex;
align-items: center;
gap: 0.25em;
list-style: none;
margin: 0;
padding: 0;
}
.navbar-links > :first-child {
margin-inline-end: auto;
}
.navbar-link-home {
display: flex;
gap: 4px;
align-items: center;
padding: 8px;
font-weight: 700;
}
.skip-navigation {
top: 50%;
transform: translate(8px, -50%);
padding: 8px;
background-color: var(--color-navbar-bg);
}
</style>
+81
View File
@@ -0,0 +1,81 @@
<script lang="ts">
import TocItem from "./TocItem.svelte";
type FlatHeading = { level: number; title: string };
interface Props {
headings: nestedListNode[];
class?: string;
}
let { headings }: Props = $props();
// creates a `class` property, even
// though it is a reserved word
export const listType = "ul";
let open = $state(false);
/** @type {import('./$types').Snapshot<string>} */
export const snapshot = {
capture: () => open,
restore: (value: boolean) => (open = value),
};
// console.log(headings);
</script>
{#if headings?.length > 0}
<aside class="toc">
<details bind:open>
<summary accesskey="c" title="(Alt + C)">Table of Contents</summary>
<div class="inner">
<svelte:element
this={listType}
class="toc-level {'toc-level-' + headings[0].level}"
>
{#each headings as node}
<TocItem {node} {listType} />
{/each}
</svelte:element>
</div>
</details>
</aside>
{/if}
<style>
aside {
margin-block: calc(var(--spacing) / 4);
}
details {
/* margin: var(--spacing) 2px; */
margin: 0 2px;
border: 1px solid var(--surface-secondary-color);
background: var(--surface-color);
border-radius: var(--border-radius);
padding: 0.4em;
}
details summary {
cursor: zoom-in;
margin-inline-start: 10px;
user-select: none;
}
details[open] summary {
cursor: zoom-out;
}
summary {
font-weight: 500;
}
.inner {
padding: 0 10px;
opacity: 0.9;
margin-block-start: calc(var(--spacing) / 4);
margin-block-end: calc(var(--spacing) / 2);
margin-inline: calc(var(--spacing) / 2);
}
.inner :global(ul) {
margin: 0;
margin-inline-start: calc(var(--spacing));
padding: 0;
}
summary:focus {
outline: 0;
}
</style>
+21
View File
@@ -0,0 +1,21 @@
<script lang="ts">
import TocItem from './TocItem.svelte';
interface Props {
node: nestedListNode;
}
let { node }: Props = $props();
export const listType = "ul"
</script>
<li class="toc-item {"toc-item-" + node.level}">
<a href={"#" + node.id} class="toc-link {"toc-link-" + node.level}">{node.title}</a>
{#if node.children.length > 0}
<svelte:element this={listType} class="toc-level {"toc-level-" + node.children[0].level}">
{#each node.children as nodes}
<TocItem node={nodes} {listType} />
{/each}
</svelte:element>
{/if}
</li>
+15
View File
@@ -0,0 +1,15 @@
const is_browser = typeof window !== "undefined";
if (is_browser) {
(<any>window).dataLayer = (<any>window).dataLayer || [];
}
export function gtag(...args: any[]) {
if (is_browser) {
(<any>window).dataLayer.push(arguments);
}
}
gtag('js', new Date());
gtag('config', 'G-Q2R5PQL59Z');
Binary file not shown.
Binary file not shown.
+19
View File
@@ -0,0 +1,19 @@
// import fontBoldUrl from './Inter-Bold.ttf?url';
// import fontRegularUrl from './Inter-Regular.ttf?url';
// This is a hack
// Get the URL that the server is running on
// console.log(import.meta.env)
// let base = (import.meta.env.VITE_DOMAIN || "http://localhost:5173") + import.meta.env.BASE_URL;
// if (base?.endsWith('/')) {
// base = base.slice(0, -1);
// }
// // console.log(base)
// const fontBoldData = await (await fetch(base + fontBoldUrl)).arrayBuffer();
// const fontRegularData = await (await fetch(base + fontRegularUrl)).arrayBuffer();
// import { readFileSync } from 'fs';
// const fontBoldUrl = new URL('./Inter-Bold.ttf', import.meta.url).href
// const fontBoldData = readFileSync(fontBoldUrl);
// const fontRegularUrl = new URL('./Inter-Regular.ttf', import.meta.url).href
// const fontRegularData = readFileSync(fontRegularUrl);
// console.log(fontBoldUrl)
// export { fontBoldData, fontRegularData };
+9
View File
@@ -0,0 +1,9 @@
// Sentry config
// export const SENTRY_HOST = "o4507835405369344.ingest.de.sentry.io"
export const SENTRY_HOST = "relay.ellis.link"
export const SENTRY_PROJECT_ID = "4507835410481232"
export const SENTRY_KEY = "d006c73cc53783930a1521a68ae1c312"
export const SENTRY_TUNNEL_ALLOWED_IDS = [SENTRY_PROJECT_ID]
export const SENTRY_DSN = "https://" + SENTRY_KEY + "@" + SENTRY_HOST + "/" + SENTRY_PROJECT_ID
export const SENTRY_REPORT_URL = "https://" + SENTRY_HOST + "/api/" + SENTRY_PROJECT_ID + "/security/?sentry_key=" + SENTRY_KEY
@@ -0,0 +1,31 @@
import { type LanguageSupport, indentUnit } from "@codemirror/language";
import { type Extension, EditorState } from "@codemirror/state";
import { EditorView, keymap } from "@codemirror/view";
import { indentWithTab } from "@codemirror/commands";
import { basicSetup } from "codemirror";
export function get_base_extensions(
useTab: boolean,
tabSize: number,
lineWrapping: boolean,
placeholder: string | HTMLElement | null | undefined,
editable: boolean,
readonly: boolean,
lang: LanguageSupport | null | undefined
): Extension[] {
const extensions: Extension[] = [
indentUnit.of(" ".repeat(tabSize)),
EditorView.editable.of(editable),
EditorState.readOnly.of(readonly),
basicSetup
];
// @ts-ignore
if (useTab) extensions.push(keymap.of([indentWithTab]));
// if (placeholder) extensions.push(placeholderExt(placeholder));
if (lang) extensions.push(lang);
if (lineWrapping) extensions.push(EditorView.lineWrapping);
return extensions;
}
@@ -0,0 +1,71 @@
<script lang="ts">
interface Props {
src: any;
alt: any;
title: any;
thumb: any;
class?: string;
}
let {
src,
alt,
title,
thumb,
class: className
}: Props = $props();
// export let align
// export let small: boolean;
// console.log("imgcmp", thumb);
let loaded = $state(false)
// console.log(thumb)
// import _PastedImage20240716123726Png from "./Pasted%20image%2020240716123726.png?meta";
</script>
<!-- <figure class={className}> -->
<!-- Svelte 5 hydration bug means we can't nest image inside figure -->
<img
{src}
{alt}
{title}
class={className}
width={thumb?.originalWidth}
height={thumb?.originalHeight}
style:background-image={loaded ? "none" : `url('${thumb?.thumbSrc}')`}
on:load={() => loaded = true}
decoding="async"
style:--aspect-ratio={thumb?.originalWidth / thumb?.originalHeight}
/>
<!-- {#if title}
<figcaption>{title}</figcaption>
{/if} -->
<!-- </figure> -->
<!-- {:else}
<img
{src}
{alt}
{title}
style:float={align}
width={thumb?.originalWidth}
height={thumb?.originalHeight}
style:background-image={loaded ? "none" : `url('${thumb?.thumbSrc}')`}
on:load={() => loaded = true}
/>
{/if} -->
<style>
img {
height: 100%;
background-size: cover;
background-repeat: no-repeat;
display: block;
margin-inline: auto;
max-width: calc(min(100%, 60vh * var(--aspect-ratio)));
}
figure {
text-align: center;
}
figcaption {
font-size: 0.95em;
margin-block: calc(var(--spacing) / 2);
}
</style>
+387
View File
@@ -0,0 +1,387 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="512"
height="512"
version="1.1"
id="svg212793"
sodipodi:docname="geode.svg"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
inkscape:export-filename="geode.png"
inkscape:export-xdpi="192.75"
inkscape:export-ydpi="192.75"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs212797" />
<sodipodi:namedview
id="namedview212795"
pagecolor="#505050"
bordercolor="#ffffff"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="1"
inkscape:deskcolor="#505050"
showgrid="false"
inkscape:zoom="1"
inkscape:cx="168"
inkscape:cy="183.5"
inkscape:current-layer="layer2" />
<g
inkscape:groupmode="layer"
id="layer1"
inkscape:label="shell"
style="display:inline">
<path
style="fill:#eff3fc;stroke:none"
d="m 358,28.5687 c -22.314,4.8151 -43.362,14.3332 -66,18.6273 -11.712,2.2216 -30.505,1.1445 -40.826,6.9823 -6.227,3.5216 -27.27989,-2.040724 -31.63089,3.556176 -10.544,13.5633 -15.24118,50.652094 -27.71418,62.513094 -13.649,12.98 -34.91579,7.93112 -48.74379,19.95912 -6.883,5.987 -36.50301,-1.20092 -41.84801,6.14808 -11.013003,15.14 -6.895308,27.95394 -17.97371,46.95347 C 70.34622,208.81524 73.2506,235.732 59,250 c -5.553,5.56 -16.1838,13.147 -18.3966,21.001 -1.5853,5.626 2.7806,10.998 4.5617,16 5.404,15.173 11.93,30.04 17.9128,44.999 4.0708,10.178 7.3728,21.969 13.7608,30.985 20.9293,29.54 54.9253,45.673 84.1613,65.182 18.197,12.143 37.211,30.728 57.424,39.015 5.772,2.366 14.418,0.818 20.576,0.818 13.272,0 29.046,4.44 41.999,1.61 6.483,-1.417 11.961,-7.069 17.172,-10.879 10.382,-7.593 21.227,-14.68 31.999,-21.696 11.03,-7.184 23.027,-13.844 34.83,-19.662 6.434,-3.171 15.141,-5.108 20.502,-10.072 8.001,-7.411 11.871,-22.704 16.767,-32.286 7.719,-15.109 19.713,-33.516 23.213,-50.015 1.635,-7.706 0.214,-16.164 0.557,-24 1.103,-25.185 -0.972,-52.031 2.146,-77 1.925,-15.411 14.007,-28.63 19,-43 1.786,-5.139 0.815,-11.628 0.815,-17 0,-16.952 0.978,-36.37 -2.275,-52.999 C 443.726,100.776 431.165,91.317 425.275,83 417.613,72.1811 414.021,54.6241 404.606,45.6096 398.169,39.4451 385.299,36.75 377,33.6813 c -5.618,-2.0771 -12.876,-6.434 -19,-5.1126 z"
id="path212571"
sodipodi:nodetypes="cscscscccccccccsccscccccccsccccc" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Inner crystals"
style="display:inline">
<path
style="fill:#0050dc;stroke:none"
d="m 255.99582,136.24692 c -13.28325,3.13564 -23.96249,17.05477 -29.45978,29.55285 -7.83152,9.21825 -20.73659,12.69624 -27.22374,23.30923 -7.80712,9.56771 -12.45139,22.61213 -24.40613,27.99813 -8.9165,6.50572 -15.18475,16.83023 -24.31444,23.15662 -7.49933,8.7785 -9.79295,20.66701 -11.86171,32.15178 -0.59871,14.13299 11.03896,24.47538 19.01228,34.79576 7.83515,8.18656 10.53435,19.15916 11.78624,29.97498 3.91648,14.32454 21.0672,9.27785 29.0169,18.13391 1.93155,2.63536 10.71773,12.96393 10.48045,7.51081 -4.24181,-9.98405 -17.28154,-13.36069 -23.69493,-18.55586 -1.70966,-9.77325 8.86086,-22.42721 18.04466,-15.38059 10.56155,3.99802 23.1208,11.06031 34.00268,4.10733 7.22764,-9.33734 -12.89517,-12.85673 -9.05407,-24.00526 -0.64439,-12.19441 -0.2895,-26.63161 -7.9351,-37.06001 -4.70022,-13.18538 16.96154,-22.6174 26.14203,-26.51669 12.48137,-4.27105 6.25379,-13.33803 0.77433,-22.76358 -3.65216,-10.86026 -9.59206,-20.57054 -15.1732,-30.4357 -4.75347,-9.6475 6.26105,-14.53668 13.62472,-16.75571 8.99759,-3.04339 19.27257,-9.58524 18.4482,-20.44754 -0.35505,-5.59721 -4.3945,-15.53456 -8.20939,-18.77046 z"
id="path212631"
sodipodi:nodetypes="ccscccccccccscccccccc" />
<path
style="fill:#0054dc;stroke:none"
d="M 253.59191,137.06128 339,125 c 0.122,5.912 3.474,13.406 1.015,19 -9.879,22.469 -35.14666,28.31496 -35.22166,55.70896 l 25.60833,-5.84021 23.05008,-7.01621 8.87739,27.72018 c 2.86536,6.57179 7.94269,-2.34106 14.12384,-4.87639 l 1.07777,-19.96429 c 14.592,-26.006 7.75436,-63.6374 -10.36964,-86.5754 -3.456,-4.374003 -12.3457,-7.344649 -17.3887,-10.094649 -6.827,-3.7233 -23.69013,-0.244866 -30.93413,0.742134 -25.862,3.522 -56.79537,14.010155 -65.24637,43.257155 z"
id="path212609"
sodipodi:nodetypes="cccccccccsccc" />
<path
style="fill:#0074e4;stroke:none"
d="M 255.046,135.4849 C 255.049,159.3279 273.804,178.62 279,201 l 25.45709,0.43085 c 0.17019,-7.40966 5.04158,-16.16319 9.84958,-22.43119 C 322.84967,167.86566 335.678,158.011 340.412,144 342.405,138.101 339.259,131.021 339,125 Z"
id="path212629"
sodipodi:nodetypes="ccccccc" />
<path
style="fill:#007ce8;stroke:none"
d="M 263.62659,146.57473 231.08439,165.24947 218.01385,180.9759 232.986,193.996 245,219 c 5.406,0 17.29,2.245 21,-2 h 1 l 1,3 c 3.736,-5.355 10.6287,-12.48173 10.9277,-19.18773 0.414,-9.284 -10.02411,-46.85654 -15.30111,-54.23754 z"
id="path212649"
sodipodi:nodetypes="ccccccccsc" />
<path
style="fill:#0064e0;stroke:none"
d="m 305,197 -1.09282,4.03029 3.14539,69.16759 6.72751,1.76179 L 311,267 l 64.49588,5.76923 2.25403,-93.17752 C 362.02991,183.18671 334.828,187.02 320,193.333 c -4,1.702 -11.874,8.261 -15,3.667 z"
id="path212655"
sodipodi:nodetypes="ccccccccc" />
<path
style="fill:#00b8f8;stroke:none"
d="M 267.45004,216.08795 246,219 l 7,22 c 5.144,-4.201 17.21204,-18.05905 14.45004,-24.91205 z"
id="path212665"
sodipodi:nodetypes="cccc" />
<path
style="fill:#35417e;stroke:none;fill-opacity:1"
d="m 267,220 c -2.972,7.065 -8.917,16.331 -15,21 l -1,3 v 1 c 6.242,12.633 2.772,39.998 21,40 3.111,9.036 21.132,13.081 29,17.004 2.955,1.473 8.192,6.301 11,3.996 h 1 l -2,6 c 5.31,-3.752 2.23934,-12.84635 1.57334,-18.40635 -2.121,-17.713 -3.53239,-35.8557 -6.64639,-53.4727 -0.753,-4.261 -0.11166,-14.21085 -1.07687,-18.97632 C 304.22987,218.08252 294.91,220 292,220 Z"
id="path212667"
sodipodi:nodetypes="cccccccccccssc" />
<path
style="fill:#1e2a55;stroke:none;fill-opacity:1"
d="m 315.78816,312.98257 0.62063,-2.67144 -2.55738,-3.77842 L 313,306 h -1 c -3.72,0.509 -7.617,-2.839 -11,-4.489 -8.764,-4.275 -23.943,-7.535 -29,-16.511 L 265.26361,282.34063 259.91,273.001 256.63164,255.49069 251.92177,245.33226 251,244 l 2,-2 c -8.932,2.627 -16.67357,6.7997 -24.67757,11.4487 -2.872,1.668 -7.69643,5.4703 -9.11043,8.7363 -2.642,6.106 6.02994,30.74744 8.05194,36.70444 3.853,11.352 5.05252,22.32956 12.84252,31.32456 5.744,6.631 25.46054,11.601 33.89354,13.724 5.678,1.429 9.766,-2.889 14,-6.065 8.982,-6.735 30.09016,-12.29043 27.78816,-24.89043 z"
id="path212669"
sodipodi:nodetypes="cccccccccccccccccccc" />
<path
style="fill:#0064e0;stroke:none"
d="M 309.172,264.26212 313.155,302 l 0.897,14.671 -9.882,8.304 -30.9445,18.90698 c 5.566,10.009 6.6495,29.20102 5.1985,40.11802 -0.609,4.585 0.839,10.237 -3.424,13 l -0.69209,2.5109 c 4.1,0.326 9.65209,0.7801 13.69209,-0.3029 9.122,-2.447 20.71,-16.98 28.039,-23.352 4.019,-3.494 15.73936,-3.33123 16.75436,-8.66723 8.768,-3.949 21.73564,-16.47077 27.35364,-24.27877 13.524,-18.799 10.90262,-54.02665 10.90262,-75.61065 z"
id="path212683"
sodipodi:nodetypes="cccccccccccccc" />
<path
style="fill:#0074e4;stroke:none"
d="m 144.0889,281.90094 c 3.881,10.475 10.56629,12.35841 14.92929,22.87041 3.967,9.555 6.67243,29.10544 13.23243,37.39344 1.893,2.391 14.46034,5.01371 17.08434,6.01971 4.785,1.833 14.8396,10.71061 22.66504,14.8155 l -0.72168,2.64874 C 218.79332,368.14274 234.136,377.144 238,384 h 1 l 3.907,-19 -0.9053,-32.78526 L 227.13508,298.50099 211.685,326 188.399,303 176,288 Z"
id="path212691"
sodipodi:nodetypes="ccccccccccccccc" />
<path
style="fill:#191f58;stroke:none;fill-opacity:1"
d="m 266.84546,220.3284 38.02813,0.96688 L 304,201 c -6.741,-0.817 -20.02581,-4.14237 -25.78481,0.27663 -4.482,3.439 -8.87973,13.96677 -11.36973,19.05177 z"
id="path212663"
sodipodi:nodetypes="ccccc" />
<path
style="fill:#0088e8;stroke:none"
d="m 239.26322,332.35036 c 0,0 4.234,22.307 2.816,34 -1.112,9.169 -7.751,18.644 1.061,26.397 5.832,5.131 27.35697,6.64431 35.08997,6.80431 0,-12.407 1.03303,-25.76431 1.03303,-38.20131 0,-3.686 1.232,-10.193 -1.028,-13.351 -6.674,-9.327 -36.694,-16.615 -36.694,-16.615 z"
id="path1905"
sodipodi:nodetypes="csccsccc" />
</g>
<g
inkscape:groupmode="layer"
id="layer5"
inkscape:label="Inner filler"
style="display:inline">
<path
style="fill:#88acce;stroke:none"
d="m 352.667,48.3333 0.666,0.3334 z"
id="path212573" />
<path
style="fill:#1a417c;stroke:none"
d="m 273.98523,64.014313 1.021,3.60001 c -0.44929,0.994654 -2.89038,14.235152 2.6033,22.390425 l -0.27106,1.134885 c 5.372,0.0595 8.99733,-4.011724 13.96633,-5.069059 5.204,-0.599 6.14478,-19.332186 0.79979,-23.454313 -3.47202,0.06783 -13.75636,1.053651 -18.11936,1.398052 z"
id="path212595"
sodipodi:nodetypes="ccccccc" />
<path
style="fill:#28528e;stroke:none"
d="m 292.04892,62.610936 0.51145,0.794689 c 3.51816,5.61039 1.97342,8.942019 0.0608,10.537622 0.74047,1.521032 3.16211,0.514251 1.45362,6.785381 l -5,5 v 1 l 8,-2 c 8.478,1.837 14.799,-4.5504 23,-5.517 8.352,-0.9844 16.829,3.3142 26,2.2315 5.579,-0.6586 17.591,-3.9679 21,1.2855 l 3,1 h 1 c 2.618,-7.9158 11.368,-18.0951 18,-23 l 1,-4 c -10.259,-3.3382 -24.149,-10.4603 -35,-9.787 -8.667,0.5377 -16.964,5.2542 -25,8.0879 -12.04,4.2456 -25.2259,7.546208 -38.0259,7.581408 z"
id="path212575"
sodipodi:nodetypes="cccccccssccccccsc" />
<path
style="display:inline;fill:#28528e;stroke:none"
d="m 275.48062,66.706137 -0.21755,-0.909933 -1.08163,-1.791685 c -4.164,-0.9055 -21.47348,1.181002 -25.85357,3.800654 2.60896,21.335702 0.35407,32.231387 13.89257,28.548146 l 15.357,-5.2863 0.604,-8.0625 c -2.99545,-9.36264 -5.16506,-5.353006 -2.70082,-16.298382 z"
id="path212575-6"
sodipodi:nodetypes="cccccccc" />
<path
style="fill:#819ab9;stroke:none"
d="m 332.667,55.3333 0.666,0.3334 z"
id="path212577" />
<path
style="fill:#7390b2;stroke:none"
d="m 329.667,56.3333 0.666,0.3334 z"
id="path212579" />
<path
style="fill:#7b99bb;stroke:none"
d="m 326.667,57.3333 0.666,0.3334 z"
id="path212581" />
<path
style="fill:#184179;stroke:none"
d="m 389.97471,56.755293 -1.22446,3.868314 c -3.811,1.8705 -7.72578,4.895807 -10.30878,8.200807 -2.884,3.6919 -8.83296,9.05098 -7.98529,14.504652 7.28197,8.102816 18.51182,21.645934 23.01082,29.955934 4.126,7.623 0.944,15.952 6.533,23.715 l 10,-5 c 3.251,-5.438 6.311,-5.803 5,-13 l 15.19714,-7.72329 C 425.85529,105.38499 422.657,103.599 418,98.9962 410.065,91.1522 404.866,82.5122 399.201,73 396.314,68.1523 395.01571,59.595093 389.97471,56.755293 Z"
id="path212583"
sodipodi:nodetypes="ccccccccccsc" />
<path
style="fill:#83a3ba;stroke:none"
d="m 304.667,62.3333 0.666,0.3334 z"
id="path212587" />
<path
style="fill:#768baa;stroke:none"
d="m 299.667,63.3333 0.666,0.3334 z"
id="path212589" />
<path
style="fill:#9db9de;stroke:none"
d="m 290.667,64.3333 0.666,0.3334 z"
id="path212591" />
<path
style="fill:#133773;stroke:none"
d="m 221.72724,93.508349 4.76138,4.1377 c 7.60069,9.607861 4.56733,17.501811 10.19927,8.741731 l 5.80073,-5.74173 5.15506,0.12113 3.2439,-3.800466 c 3.2915,-0.41015 1.45314,-0.281562 4.64714,-0.268062 l -7.0461,-29.052603 c -3.9935,2.0403 -13.07061,1.659981 -17.54024,7.565244 -4.46962,5.905262 -8.22578,14.401369 -9.22114,18.297056 z"
id="path212603"
sodipodi:nodetypes="ccccccccsc" />
<path
style="fill:#284893;stroke:none"
d="m 299.667,102.333 0.666,0.334 z"
id="path212611" />
<path
style="fill:#0e2d66;stroke:none"
d="m 221.7552,93.376736 c -1.54044,5.73816 -6.36069,11.552144 -9.09249,18.903624 l 3.83532,9.36018 c -2.857,4.296 1.40843,13.69436 5.66143,14.59436 1.311,6.409 13.99482,-2.48016 17.36527,-6.24709 l -3.0267,-25.34727 -3,1 v -4 l -6,-4.000004 z"
id="path212613"
sodipodi:nodetypes="cccccccccc" />
<path
style="fill:#3f71b0;stroke:none"
d="m 238.43464,129.03125 c -4.02998,7.52189 -11.11005,7.32511 -15.67741,9.59018 -5.224,6.865 -4.83707,16.90784 -14.49907,19.41084 l -2.88673,3.72391 -2.47008,3.69304 -3.83488,1.54533 c -8.53345,-0.61946 -37.80397,11.31994 -40.24297,20.00794 l 5.63643,25.7116 15.34953,-9.62083 23.9476,-26.37143 12.96012,-8.12176 8.26559,-4.02232 -3.85325,-4.27751 L 234,152 v -1 c -3.92,-8.108 8.897,-9.239 14,-9 -0.932,-7.572 1.95,-9.595 5,-16 l -4,2 4,-15 6,2 -1,-5 4,-1 -2,-3 3,-1 -7.52726,-8.34891 -4.47354,-0.973144 -3.59353,4.357484 -4.76169,0.41133 -5.95859,5.92131 z"
id="path212615"
sodipodi:nodetypes="cccccccccccccccccccccccccccccc" />
<path
style="fill:#5181c1;stroke:none"
d="m 297.93373,84.809341 c -1.23292,-0.578554 -0.44396,-0.256304 -1.12947,-0.144816 l -7.7128,2.038247 -3.09509,0.853057 c -6.56804,3.222197 -19.93753,7.591632 -30.51419,9.206613 l 3.96846,11.273508 -2.31287,1.43474 0.65142,3.87462 -5.29282,-1.31816 -4.61878,15.04443 2.08343,1.67705 c -4.117,5.906 -14.76691,13.58403 -14.76691,13.58403 l -2.53938,5.89627 L 234,152 l -14,8 -2,5 h 6 l 1,-4 10,2 c 7.81,-11.422 17.509,-21.599 25.481,-32.961 4.64,-6.613 9.77,-16.587 16.562,-21.044 10.969,-7.199 30.199,-8.118 42.957,-10.4194 7.838,-1.4141 23.594,-7.1644 31,-3.544 9.299,4.5463 14.434,17.4464 21,24.9684 7.58,-12.434 13.974,-1.605 14,8 l -5,4 -2,-2 4.315,17 -2.241,17 0.926,8 c -0.703,6.416 -6.019,23.094 0,27 0.68879,0.49568 1.77385,1.11569 0.87012,2.01056 l 0.40364,0.85349 L 380,201 c 0.385,6.327 -0.095,16.672 6,20 1.425,-11.269 7.51189,-27.36842 9.59875,-37.72392 l 4.79221,-20.42487 2.51396,-19.49455 c -3.65922,-5.19082 -6.24637,-18.83229 -7.49852,-28.9525 l -20.08831,-28.133706 -4.51582,-2.586635 c -3.99631,-4.474522 -13.19294,-4.235434 -17.67194,-3.789634 -5.138,0.5114 -10.79238,1.685055 -15.97838,1.108855 -4.285,-0.4761 -10.73318,-2.834322 -15.30218,-2.506422 -8.604,0.6174 -15.25504,7.804723 -23.91604,6.312723 z"
id="path212605"
sodipodi:nodetypes="cccccccccccccccccccccccccccccccccccccccccsscc" />
<path
style="fill:#768ba8;stroke:none"
d="m 224,110 1,1 z"
id="path212617" />
<path
style="fill:#92a1b6;stroke:none"
d="m 223,111 1,1 z"
id="path212619" />
<path
style="fill:#305e99;stroke:none"
d="m 430,111 -15,8 -5,13 -10,5 c 4.11,9.716 -1.105,24.064 -3.525,34 -0.997,4.093 -0.902,8.621 -3.475,12 L 385.94846,218.08282 385,280 l 24.11713,-9.37845 1.13709,-3.37441 1.7085,-2.33943 2.96593,-0.72917 C 415.95248,260.31763 415.97547,251.82111 416,249 c 0,-9.983 -1.95,-22.352 0.789,-32 3.847,-13.555 14.588,-24.491 18.422,-38 2.651,-9.338 -0.142,-20.553 -1.041,-30 -0.978,-10.279 3.737,-30.257 -4.17,-38 z"
id="path212621"
sodipodi:nodetypes="ccccccccccccccccc" />
<path
style="fill:#5daaf0;stroke:none"
d="m 378.37917,130.26341 3.26734,5.89182 L 386,128 c -0.003,-3.79 -1.03582,-22.11649 -5.10783,-22.76325 -4.41248,-0.70083 -19.42154,-7.241684 -19.82254,-2.32168 -0.342,4.198 15.45054,23.78834 17.30954,27.34834 z"
id="path212623"
sodipodi:nodetypes="cccscc" />
<path
style="fill:#224b8b;stroke:none"
d="m 212.73348,112.10637 c 0,0 -8.42095,13.24142 -14.11262,17.39516 -5.69168,4.15374 -20.28251,9.81654 -20.28251,9.81654 l -0.11184,7.08987 10.07635,11.72158 5.30268,6.61997 3.33204,3.00603 c 4.19844,-0.49879 6.43501,-3.15249 10.16483,-2.89714 l 2.04788,-5.37844 c 12.07682,-2.33041 6.98729,-16.91942 15.78729,-21.72442 l -1.03204,-1.52424 -1.11714,-5.49279 c -2.41719,-2.63399 -4.54365,-4.35987 -3.21265,-8.81587 l -2.63817,-4.1671 z"
id="path212625"
sodipodi:nodetypes="csccccccccccccc" />
<path
style="fill:#3367a0;stroke:none"
d="m 158.14877,185.96042 -25.28848,19.34864 c 0,0 -8.12052,7.9095 -13.52431,16.7002 -2.7019,4.39535 -8.14015,12.17729 -9.04867,21.82613 -0.90852,9.64885 2.29516,22.83022 2.29516,22.83022 1.168,10.454 1.1233,17.77286 8.32306,25.55027 l 5.78047,-9.04588 -3.369,-14.131 0.75077,-18.40667 0.0472,-5.68032 2.61459,-3.93204 1.37653,-10.17197 c 7.41,-0.179 13.44385,-8.38474 14.34685,-16.29374 h 1 v 3 c 10.145,-3.244 27.01079,-23.14484 14.69579,-31.59384 z"
id="path212659"
sodipodi:nodetypes="ccsscccccccccccc" />
<path
style="fill:#12326d;stroke:none"
d="m 80.67469,258.37719 c 10.138915,-1.55942 20.38011,-7.7734 30.14958,-8.90056 -2.25984,-17.44558 18.43205,-40.47728 32.23905,-51.64628 18.275,-14.784 32.98328,-18.47872 54.11428,-30.27572 -6.30524,-6.77022 -10.37614,-10.24453 -9.99433,-16.39914 l -8.77936,-11.86052 c -11.784,3.395 -22.44982,2.28678 -31.14747,11.94431 -14.0268,5.27547 -31.12869,4.05138 -36.87556,9.52967 -10.781002,15.085 -5.14539,38.92029 -17.206342,49.20882 -7.367949,6.28518 -8.995531,27.4032 -15.766031,34.3172 -1.6899,1.726 -7.197383,5.68771 -5.647783,8.59771 2.2995,4.319 8.745766,6.94551 8.913966,5.48451 z"
id="path212635"
sodipodi:nodetypes="ccccccccsccc" />
<path
style="fill:#467cba;stroke:none"
d="m 162.0298,196.90064 -11.70098,5.68908 -12.34038,16.2625 -9.88701,6.13801 -2.53148,11.58503 -3.11383,8.72599 0.82862,23.49053 30.04177,-35.75633 8,5 c -2.643,-9.795 8.74551,-29.11357 0.70329,-41.13481 z"
id="path1604"
sodipodi:nodetypes="cccccccccc" />
<path
style="fill:#5598dc;stroke:none"
d="M 224.29593,160.54433 224,165 l -5,2 h -1 -1 l -4,-2 -33.07772,35.15003 c -0.95276,4.12631 0.55622,5.85655 5.339,12.11246 C 189.6261,207.25302 195.668,202.324 200,198.001 c 10.169,-10.149 28.01107,-22.79739 35.20283,-35.31608 L 233,161 Z"
id="path212645"
sodipodi:nodetypes="cccccccccccc" />
<path
style="fill:#829dba;stroke:none"
d="m 157,162 1,1 z"
id="path212647" />
<path
style="fill:#7b92b2;stroke:none"
d="m 133,196 1,1 z"
id="path212657" />
<path
style="fill:#336aa3;stroke:none"
d="m 139.71309,305.30651 -8,7 c 4.02861,9.73272 -2.81239,20.8819 10.46361,18.0099 0,8.429 7.42868,14.73926 18.25668,16.32626 -5.383,-12.685 -2.84029,-37.57916 -20.72029,-41.33616 z"
id="path212703"
sodipodi:nodetypes="ccccc" />
<path
style="fill:#1f4c87;stroke:none"
d="m 92.957688,249.35342 c -10.635604,3.32616 -11.133231,2.77842 -21.434114,1.62832 -2.415644,15.61032 -2.857801,6.96596 -8.356857,26.7974 -1.1853,11.523 7.596683,24.43486 11.328683,35.22086 3.0705,8.874 4.6271,19.962 9.51,28 5.3241,8.765 14.4195,15.845 20.7636,24.015 5.553,7.152 10.616,16.491 17.415,22.456 13.329,11.692 31.55,18.921 45.816,29.764 10.401,7.905 20.845,15.75 31,23.962 4.899,3.962 9.972,9.911 16,12.075 9.595,3.446 23.861,2.721 34,2.728 v -1 c 9.47218,-8.98608 16.17423,-26.62337 -2.05771,-25.61063 L 252,416 c -6.71,0 -17.101,1.957 -22.985,-1.742 -8.28354,-1.43843 -2.47107,-4.6419 -7.26043,-6.02943 C 207.62057,412.74757 182.13,417.848 170,406 c -3.32684,-6.77705 -7.37401,-5.2969 -15,-5 l 3,-3 -4,-1 c 1.55552,-3.53261 4.48683,-5.27457 -0.41151,-4.55361 l -3.87437,-0.0692 L 149,377 l 5,-2 3,4 -9,-23 4.79499,-1.98934 c 3.67425,-9.7943 4.09101,-0.92676 2.456,-9.16546 -10.12,-2.641 -10.64688,-9.10556 -10.64688,-17.63656 L 139,324 138.25798,322.88131 C 138.06111,321.20774 137.55128,322.94132 137,320 l -22.954,-42 -2.24082,-21.68635 c -1.03167,-4.84381 -0.67751,-3.5193 -1.00609,-7.05892 -3.0973,0.25842 -7.80683,1.66094 -17.841402,0.0987 z"
id="path212671"
sodipodi:nodetypes="cccscccccccccccccccccccccccccccccccc" />
<path
style="fill:#6e8bad;stroke:none"
d="m 70,263 1,1 z"
id="path212675" />
<path
style="fill:#163d78;stroke:none"
d="M 410.02119,266.15303 409,269 c -7.409,0.219 -18.59579,10.41276 -23.99355,9.64883 -2.071,4.329 -1.40445,13.84517 -1.09645,18.35117 0.625,9.126 1.672,21.133 -0.674,30 -2.321,8.773 -7.275,21.05 -13.171,27.957 -5.645,6.612 -21.07143,21.04934 -21.07143,21.04934 0,0 3.45199,9.80011 2.18699,15.47211 1.45477,4.74079 4.1322,7.63283 4.1322,12.69684 l 1.35059,4.96573 C 379.29235,406.82302 383.624,388.662 392.245,371 c 4.516,-9.252 8.16,-18.935 13.064,-28 3.25,-6.009 8.401,-12.289 10.014,-19 C 416.602,318.68 415,311.544 415,306 v -42 h -1 c -2.5449,-1.52206 -3.60892,0.10423 -3.97881,2.15303 z"
id="path212679"
sodipodi:nodetypes="ccccccccccsccsccc" />
<path
style="fill:#6a7d9d;stroke:none"
d="m 67,266 1,1 z"
id="path212681" />
<path
style="fill:#2c75d1;stroke:none"
d="m 372,271 c -5.367,7.717 -3,19.931 -3,29 h 3 l 1.27992,5.73088 c 4.289,-1.423 2.74304,-7.79538 3.71004,-11.79438 C 370.46696,289.7075 374.557,277.869 372,271 Z"
id="path212685"
sodipodi:nodetypes="cccccc" />
<path
style="fill:#467cba;stroke:none"
d="m 125,288 -1.11077,-0.5972 -2.52377,3.96769 L 132,312 l 9,-5 8,5 c -2.643,-9.795 -14.587,-24.048 -24,-24 z"
id="path212693"
sodipodi:nodetypes="ccccccc" />
<path
style="fill:#94b1c3;stroke:none"
d="m 65.3333,288.667 0.3334,0.666 z"
id="path212695" />
<path
style="fill:#9aaecf;stroke:none"
d="m 68.3333,296.667 0.3334,0.666 z"
id="path212697" />
<path
style="fill:#58a6ee;stroke:none"
d="m 253.28483,394.10231 c -1.94103,13.00448 30.38287,20.47826 40.44772,7.9704 l 11.01919,-4.25964 13.75012,-11.77317 c 2.312,-8 11.52899,-11.27271 18.98699,-10.90271 L 362.139,351.972 369,346 h 1 l 5,-21 -4,-4 c -4.969,1.633 -5.326,7.485 -6.95,12 -2.448,6.809 -5.108,11.234 -11.051,15.575 -12.367,9.034 -26.535,17.129 -37.909,27.281 -7.895,7.045 -16.825,19.497 -27.09,22.884 -9.839,3.246 -23.10875,-4.29127 -34.71517,-4.63769 z"
id="path212713"
sodipodi:nodetypes="ccccccccccccccc" />
<path
style="fill:#3d98e7;stroke:none"
d="m 180,200 c -4.538,8.395 -10.5675,5.9359 -16.8105,13.2379 -1.704,1.992 -4.08049,2.82905 -10.1895,12.7621 h -1 c -5.11269,13.2298 -9.38838,6.49987 -16.36209,16.88961 l -5.39326,5.89475 c 0,0 -5.37726,14.95456 -7.09665,20.25464 l 0.60666,20.29756 c 9.052,-2.063 9.31534,3.56744 14.43434,8.77944 6.387,6.502 13.32122,16.38948 16.57622,25.05248 2.817,7.498 0.67712,16.75204 6.35012,23.11204 6.561,7.355 22.42166,7.12848 30.84066,11.48448 5.999,3.104 10.96861,14.47445 14.83861,20.04045 4.019,5.78 9.10639,5.28755 14.28539,9.24955 4.93,3.771 7.548,9.2 11.974,13.311 2.341,2.173 4.751,3.106 6.946,0.634 h 1 c 3.912,4.546 19.39669,8.14357 24.55969,5.36557 L 254,397 l 0.18923,-2.83638 -2.5691,-0.93187 L 245.376,391.973 235.621,379.63 213.285,363.2 196.829,347.136 176,344 c -0.458,-19.571 -10.935,-34.459 -21.14,-50 -4.137,-6.301 -13.866,-16.982 -13.037,-25 1.962,-18.993 21.396,-30.961 32.892,-44 4.079,-4.628 11.011,-9.563 11.285,-16 -5.835,-0.135 -5.403,-4.394 -4,-9 z"
id="path212661"
sodipodi:nodetypes="cccccccccccccccccccccccccccccccc" />
<path
style="fill:#288fdc;stroke:none"
d="M 369,300 366.14137,326.08159 371,321 l 4,4 c 0.269,-5.343 6.34202,-18.70989 -1.10898,-20.29789 L 372,300 Z"
id="path212699"
sodipodi:nodetypes="ccccccc" />
<path
style="fill:#95aac7;stroke:none"
d="m 71.3333,304.667 0.3334,0.666 z"
id="path212701" />
<path
style="fill:#889fbe;stroke:none"
d="m 74.3333,312.667 0.3334,0.666 z"
id="path212705" />
<path
style="fill:#869fc7;stroke:none"
d="m 76.3333,318.667 0.3334,0.666 z"
id="path212709" />
<path
style="fill:#447dc4;stroke:none"
d="m 373.01678,326.31308 -2.87591,10.32042 0.68644,7.40302 -1.69035,-1.32581 -17,20 5,1 c 7.184,-10.842 24.22987,-24.40675 15.87982,-37.39763 z"
id="path212715"
sodipodi:nodetypes="ccccccc" />
<path
style="fill:#99b1dd;stroke:none"
d="m 81.3333,334.667 0.3334,0.666 z"
id="path212717" />
<path
style="fill:#4d5ed4;stroke:none"
d="m 260.667,338.333 0.666,0.334 z"
id="path212719" />
<path
style="fill:#3a4dc3;stroke:none"
d="m 262.667,339.333 0.666,0.334 z"
id="path212721" />
<path
style="fill:#4d7eb9;stroke:none"
d="m 163.49042,346.98048 c -1.77498,-1.75773 -2.36661,-3.19958 -8.53261,-2.20758 l -2.22909,8.92201 L 148,356 c 0.128,10.95 10.041,22.296 15,32 9.709,-2.3 21.97045,-6.44548 31.99845,-2.62848 4.644,1.768 7.91857,7.95374 12.51457,10.06574 L 208,388 c 6.139,-3.995 -1.399,-12.712 -4.531,-16.914 -2.664,-3.575 -6.12,-10.37 -9.697,-12.808 -8.66,-5.904 -20.95058,-6.10352 -30.28158,-11.29752 z"
id="path212725"
sodipodi:nodetypes="ccccccccccc" />
<path
style="fill:#528fd0;stroke:none"
d="M 337.67122,374.67242 C 330.43722,373.45342 318.301,376.815 317,385 l -6.27062,8.12985 -0.92768,2.40553 4.48003,0.90664 6.26123,-1.21932 2.08135,-2.04569 c 3.166,-6.208 8.47375,-8.26648 16.29149,-12.79583 l 21.34723,-27.16167 z"
id="path212729"
sodipodi:nodetypes="cccccccccc" />
<path
style="fill:#3664a0;stroke:none"
d="m 152,375 -3.5288,1.78499 L 149,393 l 5.48694,2.06978 c 1.613,-4.815 4.08369,-6.16852 8.81369,-7.64352 L 158,376 c -2.89337,-0.86806 -1.93606,1.75192 -4,-1 z"
id="path212731"
sodipodi:nodetypes="cccccccc" />
<path
style="fill:#204a84;stroke:none"
d="m 349,376 c -4.169,7.738 -12.905,8.825 -19.715,12.995 -9.907,6.068 -27.55262,20.15708 -37.20862,22.42732 l 4.92884,1.58713 c 4.485,3.373 16.28716,9.62385 17.64016,0.41885 l 3.25415,-0.76988 c -2.055,3.757 -3.51823,5.24623 1.52477,6.92723 l -0.59938,4.72726 c -4.042,-2.03 -5.51809,-1.84154 -9.37909,0.27046 -3.322,-3.443 -4.59965,-1.5067 -7.30565,0.5483 l -2.89519,1.37918 -7.99033,11.49286 0.29424,2.89433 c -2.504,2.193 -2.00781,8.51194 -0.59681,11.23194 L 357,409 l 0.56143,-3.30039 -0.99905,-2.21786 -1.97398,-4.69298 c 2.18793,-5.23849 0.1237,-4.99419 -0.89991,-9.45723 C 351.58593,383.95439 351.825,381.483 349,376 Z"
id="path212733"
sodipodi:nodetypes="cccccccccccccccccccc" />
<path
style="fill:#153d7a;stroke:none"
d="m 154,397 1.3869,1.72614 L 155,401 l 2.55685,0.22154 c 6.44333,1.9104 4.22496,0.79936 11.18086,5.54002 3.619,5.226 12.09844,5.77886 17.96144,6.28886 12.283,1.071 22.60678,0.56425 34.67478,-4.62875 l -2.10658,-3.04401 -1.20355,-1.8516 -1.19242,-3.05785 C 210.68488,395.51869 211.53464,397.39542 203,390 c -7.88,-10.479 -24.933,-6.498 -36,-3.511 -3.192,0.862 -7.499,0.473 -10.107,2.79 -2.048,1.82 -2.263,5.215 -2.893,7.721 z"
id="path212735"
sodipodi:nodetypes="cccccccccccccc" />
<path
style="fill:#518ecd;stroke:none"
d="m 209.59503,380.52295 -3.8759,9.297 C 206.54613,396.51495 210.431,398.26 217,401 c 1.36409,2.71133 2.04267,1.72613 2,0 h 2 v -4 l 3,2 6.05388,-3.88682 c -4.298,-7.349 -12.57385,-12.68023 -20.45885,-14.59023 z"
id="path212737"
sodipodi:nodetypes="ccccccccc" />
<path
style="fill:#2351c9;stroke:none"
d="m 297,393 9,-9 z"
id="path212739" />
<path
style="fill:#3a6aaa;stroke:none"
d="m 311.63336,391.68993 -25.46217,20.59968 c 15.992,0 19.906,-9.025 33,-16 v -1 l -5,-1 v -1 l 9.2e-4,-1.83229 z"
id="path212741"
sodipodi:nodetypes="cccccccc" />
<path
style="fill:#4172ac;stroke:none"
d="M 226.27901,397.35978 220.94279,396.891 217,399 c -0.279,5.985 5.998,13.533 11.158,16.169 4.794,2.449 12.50587,1.41116 17.72487,1.53916 2.9941,1.86618 13.41402,0.71643 17.11713,0.29184 l 1,-5 5,1 c -3.781,-10.545 -20.779,-6.445 -28,-12 h -1 c -4.489,2.973 -8.22,-1.995 -10,-6 z"
id="path212743"
sodipodi:nodetypes="cccscccccccc" />
<path
style="fill:#5592d5;stroke:none"
d="m 292,399 c 0.38,13.477 -25.403,6.2 -34,6 v 1 l 11,7 -5,-1 -1,5 7.80935,-1.03827 c 17.1474,1.92365 25.171,-11.28537 34.33253,-19.05345 C 300.96988,394.09028 296.406,397.879 292,399 Z"
id="path212745"
sodipodi:nodetypes="ccccccccc" />
<path
style="fill:#123473;stroke:none"
d="m 314.69895,411.71511 c -5.26779,1.95345 -7.52695,0.95789 -12.73795,-0.39711 -4.279,-1.112 -13.0984,0.41096 -17.80353,1.34998 -0.91604,23.56279 -15.92812,31.38793 1.77627,41.66923 C 298.8701,450.23509 289.162,447.582 293,442 l 5.34265,-4.13795 C 298.31079,435.5539 298.90819,433.92398 300,432 l 10,-6 10,-1 1,-6 c -4.185,-2.397 -3.18419,-4.58946 -1.69819,-8.50546 z"
id="path212747"
sodipodi:nodetypes="cccccccccccc" />
<path
style="fill:#2f609b;stroke:none"
d="m 274.69766,414.3416 -5.42085,1.69039 c -5.039,-0.014 -5.93819,0.40048 -12.33528,0.44246 -4.09625,0.21244 -4.86223,-1.30591 -10.7581,0.5024 L 246,437 c -0.15389,3.51505 1.95277,4.82411 1,8 h 1 c -1.5651,3.28925 -1.4506,6.78475 -1.67203,10.34725 13.007,3.441 27.88243,3.31378 40.67203,-1.34725 l -7,-5 7,-16 0.32383,-3.17335 L 285,428 l 3,-16 z"
id="path212749"
sodipodi:nodetypes="ccccccccccccccc" />
<path
style="display:inline;fill:#3e70af;stroke:none"
d="m 381.08533,164.02236 c -2.78685,7.86875 -4.35917,21.97964 -5.31517,28.86664 -2.045,14.72 -2.778,30.135 -2.778,45 0,8.961 1.407,19.309 -0.806,28 -1.253,4.923 -2.246,26.917 2.806,28 l -2.706,46.907 -17.294,22.093 c -7.601,-1.894 -14.31056,9.88224 -17.94256,16.20624 -9.97699,2.10285 -17.27019,10.88882 -18.67519,17.43982 28.19093,-9.09138 59.76234,-42.16689 66.04034,-71.11289 2.903,-13.383 -0.54821,-27.68366 0.53479,-41.04466 0.898,-11.071 0.13145,-22.92515 0.89145,-34.02015 0.634,-9.265 1.87073,-19.12336 0.39373,-28.37836 -1.9536,-7.59077 -0.31948,-10.02848 -1.31548,-18.24848 3.84883,-4.71372 -2.41932,-5.81138 -3.92708,-6.84152 -4.90987,-4.84814 4.10296,-23.508 0.0932,-32.86664 z"
id="path212653"
sodipodi:nodetypes="ccsccccccccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 30 KiB

@@ -0,0 +1,12 @@
<script>
/** @type {{children?: import('svelte').Snippet}} */
let { children } = $props();
</script>
<script module>
import img from "$lib/htmlComponents/img.svelte";
import Callout from "$lib/Callout.svelte";
export { img, Callout };
</script>
{@render children?.()}
+14
View File
@@ -0,0 +1,14 @@
import { dev } from '$app/environment';
export const SITE_TITLE = "Jade's Website";
export const SITE_URL = dev ? "http://localhost:5173" : "https://jade.ellis.link"
export const SITE_DOMAIN = 'jade.ellis.link';
export const SITE_DEFAULT_DESCRIPTION =
"Jade's website.";
export const RSS_DEFAULT_POSTS_PER_PAGE = 15;
+28
View File
@@ -0,0 +1,28 @@
export interface MdsvexPage {
readingTime: ReadingTime
flattenedHeadings: FlattenedHeading[]
headings: NestedHeading[]
[key: string]: unknown
}
export interface ReadingTime {
text: string
minutes: number
time: number
words: number
}
export interface FlattenedHeading {
level: number
title: string
id: string
}
export interface NestedHeading {
level: number
title: string
id: string
children: NestedHeading[]
}
+55
View File
@@ -0,0 +1,55 @@
{
"name": "JadedBlueEyes",
"short_name": "Jade",
"start_url": "/?utm_source=manifest",
"display": "minimal-ui",
"icons": [
{
"src": "/android-chrome-36x36.png",
"sizes": "36x36",
"type": "image/png"
},
{
"src": "/android-chrome-48x48.png",
"sizes": "48x48",
"type": "image/png"
},
{
"src": "/android-chrome-72x72.png",
"sizes": "72x72",
"type": "image/png"
},
{
"src": "/android-chrome-96x96.png",
"sizes": "96x96",
"type": "image/png"
},
{
"src": "/android-chrome-144x144.png",
"sizes": "144x144",
"type": "image/png"
},
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-256x256.png",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "/android-chrome-384x384.png",
"sizes": "384x384",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#1e2a55",
"background_color": "#1e2a55"
}
+194
View File
@@ -0,0 +1,194 @@
:root {
--callout-bug: var(--color-red);
--callout-default: var(--color-blue);
--callout-error: var(--color-red);
--callout-example: var(--color-purple);
--callout-fail: var(--color-red);
--callout-important: var(--color-cyan);
--callout-info: var(--color-blue);
--callout-question: var(--color-orange);
--callout-success: var(--color-green);
--callout-summary: var(--color-cyan);
--callout-tip: var(--color-cyan);
--callout-todo: var(--color-blue);
--callout-warning: var(--color-orange);
--callout-quote: rgb(158, 158, 158);
--callout-title-weight: bold;
--callout-radius: var(--border-radius);
--callout-border-opacity: 25%;
--callout-background-opacity: 10%;
--callout-content-padding: 0;
--callout-content-background: transparent;
}
.callout {
--callout-color: var(--callout-default);
/* --callout-icon: lucide-pencil; */
}
.callout[data-callout="abstract"],
.callout[data-callout="summary"],
.callout[data-callout="tldr"] {
--callout-color: var(--callout-summary);
/* --callout-icon: lucide-clipboard-list; */
}
.callout[data-callout="info"] {
--callout-color: var(--callout-info);
/* --callout-icon: lucide-info; */
}
.callout[data-callout="todo"] {
--callout-color: var(--callout-todo);
/* --callout-icon: lucide-check-circle-2; */
}
.callout[data-callout="important"] {
--callout-color: var(--callout-important);
/* --callout-icon: lucide-flame; */
}
.callout[data-callout="tip"],
.callout[data-callout="hint"] {
--callout-color: var(--callout-tip);
/* --callout-icon: lucide-flame; */
}
.callout[data-callout="success"],
.callout[data-callout="check"],
.callout[data-callout="done"] {
--callout-color: var(--callout-success);
/* --callout-icon: lucide-check; */
}
.callout[data-callout="question"],
.callout[data-callout="help"],
.callout[data-callout="faq"] {
--callout-color: var(--callout-question);
/* --callout-icon: help-circle; */
}
.callout[data-callout="warning"],
.callout[data-callout="caution"],
.callout[data-callout="attention"] {
--callout-color: var(--callout-warning);
/* --callout-icon: lucide-alert-triangle; */
}
.callout[data-callout="failure"],
.callout[data-callout="fail"],
.callout[data-callout="missing"] {
--callout-color: var(--callout-fail);
/* --callout-icon: lucide-x; */
}
.callout[data-callout="danger"],
.callout[data-callout="error"] {
--callout-color: var(--callout-error);
/* --callout-icon: lucide-zap; */
}
.callout[data-callout="bug"] {
--callout-color: var(--callout-bug);
/* --callout-icon: lucide-bug; */
}
.callout[data-callout="example"] {
--callout-color: var(--callout-example);
/* --callout-icon: lucide-list; */
}
.callout[data-callout="quote"],
.callout[data-callout="cite"] {
--callout-color: var(--callout-quote);
/* --callout-icon: quote-glyph; */
}
.callout {
overflow: hidden;
border-style: solid;
border-color: color-mix(in srgb, var(--callout-color) var(--callout-border-opacity), transparent);
border-width: var(--callout-border-width);
border-radius: var(--callout-radius);
margin-block: 1em;
margin-inline: 0;
mix-blend-mode: var(--callout-blend-mode);
background-color: color-mix(in srgb, var(--callout-color) var(--callout-background-opacity), transparent);
padding: 0.75em;
padding-inline-start: 1.5em;
--callout-title-color: var(--callout-color);
}
.callout.is-collapsible .callout-title {
cursor: var(--cursor);
}
.callout-title {
padding: var(--callout-title-padding);
display: flex;
gap: calc(var(--spacing)/4);
font-size: var(--callout-title-size);
color: rgb(var(--callout-color));
line-height: var(--line-height-tight);
align-items: flex-start;
}
.callout-title-inner {
--font-weight: var(--callout-title-weight);
font-weight: var(--font-weight);
color: var(--callout-title-color);
}
/* .callout-title {
--font-weight: var(--callout-title-weight);
font-weight: var(--font-weight);
color: var(--callout-title-color);
padding: var(--callout-title-padding);
font-size: var(--callout-title-size);
line-height: var(--line-height-tight);
} */
.callout-content {
overflow-block: auto;
padding: var(--callout-content-padding);
background-color: var(--callout-content-background);
}
.callout-content .callout {
margin-block-start: 20px;
}
.callout-icon {
flex: 0 0 auto;
display: flex;
align-items: center;
}
.callout-icon .tabler-icon {
color: var(--callout-color);
}
.callout-icon::after {
content: "\200B";
}
/* .callout-fold {
display: flex;
align-items: center;
padding-inline-end: var(--size-4-2);
}
.callout-fold::after {
content: "\200B";
}
.callout-fold .svg-icon {
transition: transform 100ms ease-in-out;
}
.callout-fold.is-collapsed .svg-icon {
transform: rotate(calc(var(--direction) * -1 * 90deg));
} */
+57
View File
@@ -0,0 +1,57 @@
/* Code */
pre {
color-scheme: var(--code-colour-scheme);
color: var(--code-color);
background-color: var(--code-background-color);
overflow-x: auto;
font-weight: 400;
font-size: .875em;
line-height: 1.7142857;
margin-top: 1.7142857em;
margin-bottom: 1.7142857em;
border-radius: var(--edge-border-radius, --border-radius);
padding: calc(var(--spacing)/2);
box-shadow: 0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a
}
pre>code {
word-wrap: normal;
background-color: initial;
border: 0;
border-radius: initial;
display: flex;
flex-direction: column;
line-height: inherit;
margin: 0;
width: max-content;
min-width: 100%;
max-width: auto;
overflow: visible;
}
code[data-line-numbers]>span[data-line-number] {
padding-left: 0;
}
code[data-line-numbers]>span[data-line-number]::before {
/* Insert the line number data attribute before the line */
content: attr(data-line-number);
/* Other styling */
display: inline-block;
width: 1rem;
margin-inline-start: .25rem;
margin-inline-end: .8rem;
text-align: right;
color: var(--code-color);
opacity: 0.25;
}
code>span[data-highlighted] {
background: var(--code-highlighted);
width: 100%;
}
/* code>span[data-highlighted]+span[data-highlighted] {
border-top: 1px solid theme("colors.slate.800");
} */
@@ -0,0 +1,20 @@
.footnote-ref {
text-decoration: none;
font-size: var(--footnote-size);
}
sup:has(.footnote-ref) {
vertical-align: super;
}
.footnotes {
font-size: var(--footnote-size);
}
.footnote-backref {
display: inline-block;
/* margin-inline-start: var(--size-4-1); */
margin-inline-start: .5em;
/* color: var(--text-faint); */
text-decoration: none;
}
+225
View File
@@ -0,0 +1,225 @@
@import "./style/code.css";
@import "./style/callout.css";
@import "./style/footnote.css";
:root {
color-scheme: light;
--spacing: 24px;
--page-width: 57.75rem;
--footnote-size: 0.9em;
--theme: #242424;
--background-color: #f8f8f8;
--surface-color: #fff;
--surface-secondary-color: #ededed;
--input-background-color: #fff;
--input-color: #24292e;
--backdrop-color: rgba(247, 247, 247, .54);
--shadow-color: rgba(0, 0, 0, .12);
--font-color: rgba(0, 0, 0, .87);
--font-color-contrast: rgba(255, 255, 255, 1);
--font-color-secondary: rgba(0, 0, 0, .6);
--shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
--font-family-base: Roboto, sans-serif;
--font-family-heading: "Sen", Roboto, sans-serif;
--border-radius: 8px;
--code-colour-scheme: dark;
--code-background-color: #0d1117;
--code-color: #fff;
--color-primary: hsl(230, 50%, 90%);
--color-secondary: hsl(230, 50%, 10%);
--color-tertiary: hsl(290, 80%, 20%);
--color-accent: hsl(227, 80%, 20%);
--color-red: #e93147;
--color-orange: #ec7500;
--color-yellow: #e0ac00;
--color-green: #08b94e;
--color-cyan: #00bfbc;
--color-blue: #086ddd;
--color-purple: #7852ee;
--color-pink: #d53984;
scroll-behavior: smooth;
}
@media (prefers-color-scheme: dark) {
:root {
color-scheme: dark;
--theme: #eee;
--background-color: #141414;
--backdrop-color: rgba(20, 20, 20, .54);
--shadow-color: rgba(255, 255, 255, .12);
--surface-color: #242424;
--surface-secondary-color: #222222;
--input-background-color: #161616;
--input-color: #d8d8d8;
--font-color: rgba(255, 255, 255, .87);
--font-color-contrast: rgba(0, 0, 0, .87);
--font-color-secondary: rgba(255, 255, 255, .6);
--color-primary: hsl(230, 50%, 10%);
--color-secondary: hsl(230, 50%, 90%);
--color-tertiary: hsl(290, 80%, 80%);
--color-accent: hsl(195, 80%, 80%);
--color-red: #fb464c;
--color-orange: #e9973f;
--color-yellow: #e0de71;
--color-green: #44cf6e;
--color-cyan: #53dfdd;
--color-blue: #027aff;
--color-purple: #a882ff;
--color-pink: #fa99cd;
}
}
@media print {
:root {
--background-color: white;
}
}
h2,
h3,
h4,
h5,
h6 {
break-after: avoid-page;
}
img,
svg,
table,
canvas {
break-inside: avoid;
}
@media print {
a:not(:where(.footnote-ref, .footnote-backref)):after {
content: " (" attr(href) ")";
}
}
html {
font-family: var(--font-family-base);
background-color: var(--background-color);
color: var(--font-color);
font-size: 16px;
line-height: 1.5
}
body {
padding: 0;
margin: 0;
min-height: 100vh;
}
iframe,
img,
svg {
/* max-block-size: 100%;
max-inline-size: 100%;
inline-size: auto;
block-size: auto; */
max-width: 100%;
height: auto;
width: 100%;
display: block;
}
a {
color: var(--color-accent);
}
a:visited {
color: var(--color-tertiary);
}
.container {
--container-max-width: var(--page-width);
--padding-x: var(--spacing);
max-width: calc(var(--container-max-width) + 2*var(--padding-x));
/* width: 100%; */
margin-inline: auto;
padding-inline: var(--padding-x);
}
.main {
/* margin: 0 auto; */
--edge-border-radius: var(--border-radius);
}
@media screen and (max-width: 320px) {
.main {
padding: 0 0;
--edge-border-radius: 0;
}
}
.card {
border-radius: var(--border-radius);
box-shadow: var(--shadow);
background-color: var(--surface-color);
}
.edge {
border-radius: var(--edge-border-radius);
}
.screen-reader-only {
position: absolute;
clip: rect(0, 0, 0, 0);
width: 1px;
height: 1px;
overflow: hidden;
white-space: nowrap;
}
.screen-reader-only:focus {
clip: auto;
width: auto;
height: auto;
white-space: normal;
overflow: visible;
}
button {
display: inline-block;
color: var(--color-primary);
background: var(--color-accent);
border-radius: 4px;
margin: 8px 8px 8px 0px;
padding: 12px 24px;
border: solid 2px var(--color-accent);
}
.secondary {
border: solid 2px var(--color-accent);
color: var(--color-accent);
background: transparent;
}
#sentry-feedback {
--dialog-inset: auto auto 0;
--foreground: var(--color-secondary);
--background: var(--color-primary);
--accent-foreground: var(--color-primary);
--accent-background: var(--color-accent);
--success-color: var(--color-green);
--error-color: var(--color-red);
--border: 1.5px solid color-mix(in srgb, var(--color-secondary) 25%, transparent);
--box-shadow: var(--shadow);
}
+9
View File
@@ -0,0 +1,9 @@
import { writable } from 'svelte/store'
const query = typeof window != "undefined" ? window?.matchMedia('(prefers-color-scheme: dark)') : undefined
export const theme = writable(query?.matches ? 'dark' : 'light')
query?.addEventListener('change', e => {
theme.set(e.matches ? 'dark' : 'light')
});
+172
View File
@@ -0,0 +1,172 @@
import { tags as t } from '@lezer/highlight';
// NOTE: This requires enabling unsafe-inline styles in the CSP
// From thememirror
import { EditorView } from '@codemirror/view';
import type { Extension } from '@codemirror/state';
import {
HighlightStyle,
type TagStyle,
syntaxHighlighting,
} from '@codemirror/language';
interface Options {
/**
* Theme variant. Determines which styles CodeMirror will apply by default.
*/
variant: Variant;
/**
* Settings to customize the look of the editor, like background, gutter, selection and others.
*/
settings: Settings;
/**
* Syntax highlighting styles.
*/
styles: TagStyle[];
}
type Variant = 'light' | 'dark';
interface Settings {
/**
* Editor background.
*/
background: string;
/**
* Default text color.
*/
foreground: string;
/**
* Caret color.
*/
caret: string;
/**
* Selection background.
*/
selection: string;
/**
* Background of highlighted lines.
*/
lineHighlight: string;
/**
* Gutter background.
*/
gutterBackground: string;
/**
* Text color inside gutter.
*/
gutterForeground: string;
}
const createTheme = ({ variant, settings, styles }: Options): Extension => {
const theme = EditorView.theme(
{
// eslint-disable-next-line @typescript-eslint/naming-convention
'&': {
backgroundColor: settings.background,
color: settings.foreground,
},
'.cm-content': {
caretColor: settings.caret,
},
'.cm-cursor, .cm-dropCursor': {
borderLeftColor: settings.caret,
},
'&.cm-focused .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection':
{
backgroundColor: settings.selection,
},
'.cm-activeLine': {
backgroundColor: settings.lineHighlight,
},
'.cm-gutters': {
backgroundColor: settings.gutterBackground,
color: settings.gutterForeground,
},
'.cm-activeLineGutter': {
backgroundColor: settings.lineHighlight,
},
},
{
dark: variant === 'dark',
},
);
const highlightStyle = HighlightStyle.define(styles);
const extension = [theme, syntaxHighlighting(highlightStyle)];
return extension;
};
export default createTheme;
export const githubLight = createTheme({
variant: 'light',
settings: {
background: '#fff',
foreground: '#24292e',
selection: '#BBDFFF',
// selectionMatch: '#BBDFFF',
gutterBackground: '#fff',
gutterForeground: '#6e7781',
caret: '#7c3aed',
lineHighlight: '#8a91991a',
},
styles: [
{ tag: [t.standard(t.tagName), t.tagName], color: '#116329' },
{ tag: [t.comment, t.bracket], color: '#6a737d' },
{ tag: [t.className, t.propertyName], color: '#6f42c1' },
{ tag: [t.variableName, t.attributeName, t.number, t.operator], color: '#005cc5' },
{ tag: [t.keyword, t.typeName, t.typeOperator, t.typeName], color: '#d73a49' },
{ tag: [t.string, t.meta, t.regexp], color: '#032f62' },
{ tag: [t.name, t.quote], color: '#22863a' },
{ tag: [t.heading, t.strong], color: '#24292e', fontWeight: 'bold' },
{ tag: [t.emphasis], color: '#24292e', fontStyle: 'italic' },
{ tag: [t.deleted], color: '#b31d28', backgroundColor: 'ffeef0' },
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: '#e36209' },
{ tag: [t.url, t.escape, t.regexp, t.link], color: '#032f62' },
{ tag: t.link, textDecoration: 'underline' },
{ tag: t.strikethrough, textDecoration: 'line-through' },
{ tag: t.invalid, color: '#cb2431' }
],
});
export
const githubDark = createTheme({
variant: 'dark',
settings: {
background: '#161616',
foreground: '#d8d8d8',
caret: '#c9d1d9',
selection: '#003d73',
// selectionMatch: '#003d73',\
lineHighlight: '#1e1e1e',
gutterBackground: '#1c1c1c',
gutterForeground: '#fff',
},
styles: [
{ tag: [t.standard(t.tagName), t.tagName], color: '#7ee787' },
{ tag: [t.comment, t.bracket], color: '#8b949e' },
{ tag: [t.className, t.propertyName], color: '#d2a8ff' },
{ tag: [t.variableName, t.attributeName, t.number, t.operator], color: '#79c0ff' },
{ tag: [t.keyword, t.typeName, t.typeOperator, t.typeName], color: '#ff7b72' },
{ tag: [t.string, t.meta, t.regexp], color: '#a5d6ff' },
{ tag: [t.name, t.quote], color: '#7ee787' },
{ tag: [t.heading, t.strong], color: '#d2a8ff', fontWeight: 'bold' },
{ tag: [t.emphasis], color: '#d2a8ff', fontStyle: 'italic' },
{ tag: [t.deleted], color: '#ffdcd7', backgroundColor: 'ffeef0' },
{ tag: [t.atom, t.bool, t.special(t.variableName)], color: '#ffab70' },
{ tag: t.link, textDecoration: 'underline' },
{ tag: t.strikethrough, textDecoration: 'line-through' },
{ tag: t.invalid, color: '#f97583' },
],
});

Some files were not shown because too many files have changed in this diff Show More