Merge commit 'refs/pull/157/head' of https://github.com/MathMan05/Fermi

This commit is contained in:
MathMan05
2025-11-13 15:10:18 -06:00
19 changed files with 151 additions and 89 deletions
+6 -6
View File
@@ -1,6 +1,6 @@
---
name: Bug report
about: Create a report to help us improve
about: Create a report to help us improve.
title: ''
labels: ''
assignees: ''
@@ -25,14 +25,14 @@ If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
- Browser: [e.g. Chrome, Safari]
- Browser Version: [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
- OS: [e.g. iOS8.1, Android 16]
- Browser: [e.g. stock browser, safari]
- Browser Version: [e.g. 22]
**Additional context**
Add any other context about the problem here.
+2 -2
View File
@@ -1,6 +1,6 @@
---
name: Feature request
about: Suggest an idea for this project
about: Suggest an idea for this project.
title: ''
labels: ''
assignees: ''
@@ -8,7 +8,7 @@ assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
A clear and concise description of what the problem is. Example: I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
+2 -2
View File
@@ -1,5 +1,5 @@
# Description
A description of the pull request
A description of the pull request.
# Related issues
Any related issues, delete if there are none
Any related issues, delete if there are none.
+2 -2
View File
@@ -1,5 +1,5 @@
# Code of conduct
It's nothing complicated, I want to foster a nice community, if there's any issues feel free to contact me in any way you see fit, though please don't create problems for me, I'm just one person and I want to work on this project, not community management. I will likely start with a warning or two if any issues arrise, though this is up to my(mathium05) sole discretion.
generally follow https://docs.spacebar.chat/contributing/conduct/ and you should be fine. Do not try to pull technicalities, this is a FOSS project, not a court of law.
It's nothing complicated, I want to foster a nice community, if there's any issues feel free to contact me in any way you see fit, though please don't create problems for me. I'm just one person and I want to work on this project, not community management. I will likely start with a warning or two if any issues arise, though this is up to my (mathium05) sole discretion.
Generally follow https://docs.spacebar.chat/contributing/conduct/ and you should be fine. Do not try to pull technicalities, this is a FOSS project, not a court of law.
Happy coding!
+12 -13
View File
@@ -2,40 +2,39 @@ This is for in the future when I want to compress more images or anyone else for
# Lossless
### https://squoosh.app/
good at reducing the pallet, a first step for images that have a limited number of colors, bad at actually compressing things though, for all formats except webp and png.
Good at reducing the pallet, a first step for images that have a limited number of colors, bad at actually compressing things though, for all formats except WEBP and PNG.
## PNGs:
good ratios, though not as good as other options, though better compatibility
Good ratios, though not as good as other options, though better compatibility.
### oxipng
(you can also use through squoosh with the same results)
*(you can also use through squoosh with the same results)*
Seems to be the best of all of the options, not sure if it's all you would need, but it did shrink pngs further than the other two tools afterwards.
```bash
oxipng -o max --strip all --alpha <filename here>
```
`all` may be replaced with `safe` if you want to be a bit safer
`all` may be replaced with `safe` if you want to be a bit safer.
### pngcrush
Good, but should be ran before optipng, but isn't as good as it, use in tandom
Good, but should be ran before optipng, but isn't as good as it, use in tandom.
### optipng
The second best tool to really shrink pngs to be as small as they can be.
## WEBP
it's better than png, though I have a feeling more could be done to compress these
It's better than png, though I have a feeling more could be done to compress these
### cwebp
so far this seems to be the best way to compress webp images with a command that kinda looks like this one
So far this seems to be the best way to compress WEBP images with a command that kinda looks like this one:
```bash
cwebp -lossless -z 9 in.webp -o out.webp
```
while for all other formats squoosh is not recommended, for webp it'll be identical due to cwebp using the same libary as squoosh.
While for all other formats squoosh is not recommended, for WEBP it'll be identical due to cWEBP using the same libary as squoosh.
## AVIF
As far as I can tell, this format just sucks at its job, at least for lossless images
## JPEGXL
Really good at compression size, though it's not supported anywhere outside of safari as of now.
Really good at compression size, though it's not supported anywhere outside of Safari as of now.
### cjxl
this command should do the trick for compressing
This command should do the trick for compressing:
```bash
cjxl input.png output.jxl -q 100 -e 10
```
@@ -44,6 +43,6 @@ cjxl input.png output.jxl -q 100 -e 10
## SVGs:
### https://svgomg.net/
great tool, if anyone knows how to squish them further, let me know, some manual work may go a long way to help shrink svgs, though I'm not doing that right now lol.
Great tool! If anyone knows how to squish them further, let me know! Some manual work may go a long way to help shrink SVGs, though I'm not doing that right now lol.
I may look into other formats soon as well, though these are the main two I'm currently using
I may look into other formats soon as well, though these are the main two I'm currently using.
+25 -24
View File
@@ -1,15 +1,15 @@
# How to add your instance to Jank Client
inside of webpage you'll see a file called `instances.json` in that file you'll need to add your instance and its information in the following format if you want your instance to be a part of the drop down.
# How to add your instance to Fermi Client
Inside of `webpage` you'll see a file called `instances.json` in that file you'll need to add your instance and its information in the following format if you want your instance to be a part of the dropdown.
```
{
"name":<name>,
"description"?:<short description>,
"description"?:<A short description>,
"descriptionLong"?:<A description for the instance that can be longer>,
"image"?:<URL to image repersenting your instance>,
"image"?:<URL to image representing your instance>,
"url"?:<The URL that can be used to get your wellknown>,
"language":<what language your server is in>,
"country":<what country your server is in>,
"display":<true or false depending on wether it should display>,
"language":<What language your server is in>,
"country":<What country your server is in>,
"display":<True or false depending on wether it should display>,
"urls"?:{
"wellknown":<wellknown URL>,
"api":<API URL>,
@@ -19,26 +19,27 @@ inside of webpage you'll see a file called `instances.json` in that file you'll
},
"contactInfo"?:{
"discord"?:<Discord @>,
"github"?:<github profile URL>,
"email"?:<email address>,
"spacebar":?:<spacebar username>,
"matrix"?:<matrix account>,
"mastodon"?:<mastodon account>
"github"?:<Github profile URL>,
"email"?:<Email address>,
"spacebar":?:<Spacebar username>,
"matrix"?:<Matrix account>,
"mastodon"?:<Mastodon account>
}
}
```
anything with a `?` in-front of its `:` are optional, though you must either include `"URL"` or `"URLs"`, but you may include both, though the client will most likely ignore `"URLs"` in favor of `"URL"`, though it may use `"URLs"` as a fallback if `"URL"` does not resolve, do not rely on this behavior.
wellknown should be a url that can resolve the wellknown, but it should only be the base URL and not the full wellknown url.
Anything with a `?` in-front of its `:` are optional, though you must either include `"URL"` or `"URLs"`, but you may include both, though the client will most likely ignore `"URLs"` in favor of `"URL"`, though it may use `"URLs"` as a fallback if `"URL"` does not resolve, do not rely on this behavior.
`wellknown` should be a url that can resolve, but it should only be the base URL and not the full wellknown URL.
Some of these values may not be used right now, though they will likely be used in the future, so feel free to fill out what you like, though the more you fill out the more information we can give the users about your instance in the future.
language should be [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1_codes).
Country should be [ISO 8166-2 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
You can also add yourself to [this](https://github.com/spacebarchat/spacebarchat/tree/master/instances) list, and you should, though there are some disadvantages to only being in that list
`language` should be [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1_codes).
`country` should be [ISO 8166-2 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
You can also add yourself to [this](https://github.com/spacebarchat/spacebarchat/tree/master/instances) list, and you should, though there are **some disadvantages** to only being in that list such as not being on the Fermi Discovery list which shows Guilds more higher up on the Fermi client, etc.
# Questions
## Do I have to do this to let Jank Client connect to my server?
No, you may choose to not do this, this just makes it easier for people using Jank Client to find and use your instance as it's in the dropdown menu for instances, though the user may enter any instance they please.
## If my instance isn't spacebar is that allowed to be entered?
If it's spacebar compatable, yes it may be entered, though if there are too many incompatablities, it may not be included, or may need a warning of sorts.
## I'm hosting my own instance of spacebar and would like to change the defualt instance on my instance of Jank Client to my own instance.
## Do I have to do this to let Fermi Client connect to my server?
No, you may choose to not do this, this just makes it easier for people using Fermi Client to find and use your instance as it's in the dropdown menu for instances, though the user may enter any instance they please.
## If my instance isn't Spacebar is that allowed to be entered?
If it's Spacebar compatible then yes, it may be entered. Though if there are **too many incompatibilities** however, it may not be included, or may need a warning of sorts.
## I'm hosting my own instance of Spacebar and would like to change the default instance on my instance of Fermi Client to my own instance.
Just change the first entry in the list to your own, and it should connect without issue.
## Why would I put my instance in this list over the official spacebar list?
While putting your instance in the other list will get it to show up on jank client, this list does have more settings, and will show up earlier in the results, though either list will work to get in the dropdown menu
## Why would I put my instance in this list over the official Spacebar list?
While putting your instance in the other list will get it to show up on Fermi client, this list does have more settings, and will show up earlier in the results, though either list will work to get in the dropdown menu.
+4 -7
View File
@@ -5,7 +5,7 @@ Fermi is a [Spacebar](https://spacebar.chat) Client written in TS, HTML, and CSS
To build it, clone the repo and run `npm install`, then `npm run build`
To run it, use `npm start`
or do the equivalent with bun
or do the equivalent with bun.
Both [Bun](https://bun.sh) and [Node.js](https://nodejs.org) are supported, and should function as expected.
@@ -13,7 +13,7 @@ To access Fermi after starting, simply go to http://localhost:8080/login and eit
If there are any issues please report them either here, or to me dirrectly on spacebar
## Adding instances to the dropdown
Please see [this](https://github.com/MathMan05/Fermi/blob/main/InstanceInfo.md) for how to add an instance to the dropdown picker
Please see [this](https://github.com/MathMan05/Fermi/blob/main/InstanceInfo.md) for how to add an instance to the dropdown picker.
## How to statically host Fermi
[Click here](./howToStaticallyHost.md)
## RoadMap
@@ -21,12 +21,9 @@ You can view the current roadmap on https://github.com/users/MathMan05/projects/
## AI Code
AI code due to not being GPLv3 compatable is not allowed in this repo. I thought this didn't need to be said, but it does.
## Link
The official SpaceBar server for Fermi https://fermi.chat/invite/USgYJo?instance=https%3A%2F%2Fspacebar.chat
old invite for the official client https://dev.app.spacebar.chat/invite/USgYJo
The current hosted instance of Fermi https://fermi.chat/
The official Spacebar server for Fermi: https://fermi.chat/invite/USgYJo?instance=https%3A%2F%2Fspacebar.chat
The current hosted instance of Fermi: https://fermi.chat/
## Star History
+2 -2
View File
@@ -2,7 +2,7 @@
## Supported Versions
Currently, I only support the most up to date version of jank client, there are no stable releases, but this is planned for in the future
Currently, I only support the most up to date version of Fermi client, there are no stable releases, but this is planned for in the future
| Version | Supported |
| ------- | ------------------ |
@@ -11,4 +11,4 @@ Currently, I only support the most up to date version of jank client, there are
## Reporting a Vulnerability
If there's an issue please disclose it responsibly to me, or here on github privatly.
If there's an issue please disclose it responsibly to me, or here on Github privately.
+4 -4
View File
@@ -1,13 +1,13 @@
### How to statically host Fermi
Fermi due to its service worker, will technically work without any of this, but here's what you need to keep in mind for statically hosting it.
### I will assume the following
* 404.html will be used for 404 responses
* index.html will be used when in that directory
* `404.html` will be used for 404 responses
* `index.html` will be used when in that directory
* stuff like `/app` will just use the html file at `/app.html`
Here's the other thing you need to do:
Firstly you'll need to build Fermi like normal and host out the ./dist/webpage directory.
Firstly you'll need to build Fermi like normal and host out the `./dist/webpage` directory.
You need to make some rewrites, not redirects from these addresses:
* `/channels/*` -> `/app.html`
@@ -16,4 +16,4 @@ You need to make some rewrites, not redirects from these addresses:
Other than these three rewrites, everything else should work as expected!
(the reason why the service worker can fix this is due to it doing the rewrites on the client side)
*(the reason why the service worker can fix this is due to it doing the rewrites on the client side)*
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "jankclient",
"version": "0.2.0",
"description": "A SpaceBar Client written in TS HTML and CSS to run, clone the repo and do either `npm start` or `bun start` both bun and node are supported, and both should function as expected. To access Jank Client after init simply go to http://localhost:8080/login and login with your username and password.",
"description": "A Spacebar Client written in TS, HTML and CSS. to run, clone the repo and do either `npm start` or `bun start` both bun and node are supported, and both should function as expected. To access Fermi Client after init simply go to http://localhost:8080/login and login with your username and password.",
"main": ".dist/index.js",
"type": "module",
"scripts": {
+1 -1
View File
@@ -160,7 +160,7 @@ app.use("/", async (req: Request, res: Response) => {
const link = `${host}/services/oembed?url=${encodeURIComponent(ref)}`;
res.set(
"Link",
`<${link}>; rel="alternate"; type="application/json+oembed"; title="Jank Client oEmbed format"`,
`<${link}>; rel="alternate"; type="application/json+oembed"; title="Fermi Client oEmbed format"`,
);
}
+2 -2
View File
@@ -119,9 +119,9 @@ export async function inviteResponse(
res.json({
type: "link",
version: "1.0",
title: "Jank Client",
title: "Fermi Client",
thumbnail: "/logo.webp",
description: "A spacebar client that has DMs, replying and more",
description: "A Spacebar client that has DMs, replying and more.",
url: url.toString(),
});
}
+10 -10
View File
@@ -1,8 +1,8 @@
# Jank Audio format
This is a markdown file that will try to describe the jank client audio format in sufficient detail so people will know how this weird custom format works into the future.
This is a byte-aligned format, which uses the sequence jasf in asci as a magic number at the start.
# Fermi Audio format
This is a markdown file that will try to describe the Fermi client audio format in sufficient detail so people will know how this weird custom format works into the future.
This is a byte-aligned format, which uses the sequence jasf in ASCI as a magic number at the start.
the next 8 bits will decide how many voices this file has/will provide, if the value is 255 you'll instead have a 16 bit number that follows for how many voices there are, this *should* be unused, but I wouldn't be totally surprised if it did get used.
The next 8 bits will decide how many voices this file has/will provide, if the value is 255 you'll instead have a 16 bit number that follows for how many voices there are, this *should* be unused, but I wouldn't be totally surprised if it did get used.
then it'll parse for that many voices, which will be formatted like the following:
name:String8;
@@ -25,14 +25,14 @@ Given a non-zero length, this will parse the sounds as following:
| 011 | absolute power of the next expression |
| 012 | round the next expression |
| 013 | Math.cos() on the next expression |
> note:
>
> this is likely to expand in the future as more things are needed, but this is just how it is right now.
> [!NOTE]
> This is likely to expand in the future as more things are needed, but this is just how it is currently.
Once you've read all of the sounds in the file, you can move on to parsing the tracks.
This starts out by reading a u16 to find out how many tracks there are, then you'll go on to try and parse that many.
each track will then read a u16 to find out how long it is, then it'll read bytes as the following.
it'll first read the index(which is either a u8 or u16 depending on if the amount of voices was u8 or u16), which is the index of the voice 1-indexed, then if it's not 0 it'll parse two float32s in this order, the volume then the pitch of the sound, if it was 0 it'll instead read one 32f as a delay in the track. if it's a default sound it'll also read a third 32f for length
Each track will then read a u16 to find out how long it is, then it'll read bytes as the following.
It'll first read the index (which is either a u8 or u16 depending on if the amount of voices was u8 or u16), which is the index of the voice 1-indexed, then if it's not 0 it'll parse two float32s in this order, the volume then the pitch of the sound, if it was 0 it'll instead read one 32f as a delay in the track. If it's a default sound it'll also read a third 32f for length
then finally you'll parse the audios which are the complete tracks. you'll first parse a u16 to get how many audios there are, then for each audio you'll first parse a string8 for the name, then a u16 for the length then according to the length you'll go on to parse a u16 to get the track (1-indexed again) where if it's 0 you'll instead add a delay according to the next f32, how many ever times according to the length.
Then finally you'll parse the audios which are the complete tracks. You'll first parse a u16 to get how many audios there are, then for each audio you'll first parse a string8 for the name, then a u16 for the length then according to the length you'll go on to parse a u16 to get the track (1-indexed again) where if it's 0 you'll instead add a delay according to the next f32, how many ever times according to the length.
+6 -6
View File
@@ -3,9 +3,9 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Jank Audio</title>
<meta content="Jank Sound" property="og:title" />
<meta content="A sound editor for jank clients sound format .jasf" property="og:description" />
<title>Fermi Audio</title>
<meta content="Fermi Sound" property="og:title" />
<meta content="A sound editor for Fermi clients sound format .jasf" property="og:description" />
<meta content="/logo.webp" property="og:image" />
<meta content="#4b458c" name="theme-color" />
<link href="/style.css" rel="stylesheet" />
@@ -25,15 +25,15 @@
<body class="no-theme" style="overflow-y: scroll">
<h1>This will eventually be something</h1>
<p>
I want to let the sound system of jank not be so hard coded, but I still need to work on
I want to let the sound system of Fermi not be so hard coded, but I still need to work on
everything a bit before that can happen. Thanks for your patience.
</p>
<h3>why does this tool need to exist?</h3>
<p>
For size reasons jank does not use normal sound files, so I need to make this whole format to
For size reasons Fermi does not use normal sound files, so I need to make this whole format to
be more adaptable
</p>
<button id="download">Download the sounds</button>
<button id="download">Download all sounds</button>
</body>
<script src="/audio/page.js" type="module"></script>
</html>
+1 -1
View File
@@ -85,7 +85,7 @@
</p>
<br />
<a
href="https://translatewiki.net/wiki/Translating:JankClient"
href="https://translatewiki.net/wiki/Translating:Fermi"
class="TitleButtons"
id="translate"
i18n="htmlPages.trans"
+2 -2
View File
@@ -5,8 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Fermi</title>
<meta content="Invite" property="og:title" />
<meta content="Accept this invite for a spacebar guild" property="og:description" />
<meta name="description" content="You shouldn't see this, but this is an invite URL" />
<meta content="Accept this invite for a Spacebar guild" property="og:description" />
<meta name="description" content="Invite URL to a Spacebar Guild" />
<meta content="/logo.webp" property="og:image" />
<meta content="#4b458c" name="theme-color" />
<link href="/style.css" rel="stylesheet" />
+66 -1
View File
@@ -1,4 +1,69 @@
User-agent: *
# Block all known AI crawlers and assistants
# from using content for training AI models.
# Source: https://robotstxt.com/ai
User-Agent: GPTBot
User-Agent: ClaudeBot
User-Agent: Claude-User
User-Agent: Claude-SearchBot
User-Agent: CCBot
User-Agent: Google-Extended
User-Agent: Applebot-Extended
User-Agent: Facebookbot
User-Agent: Meta-ExternalAgent
User-Agent: Meta-ExternalFetcher
User-Agent: diffbot
User-Agent: PerplexityBot
User-Agent: PerplexityUser
User-Agent: Omgili
User-Agent: Omgilibot
User-Agent: webzio-extended
User-Agent: ImagesiftBot
User-Agent: Bytespider
User-Agent: TikTokSpider
User-Agent: Amazonbot
User-Agent: Youbot
User-Agent: SemrushBot-OCOB
User-Agent: Petalbot
User-Agent: VelenPublicWebCrawler
User-Agent: TurnitinBot
User-Agent: Timpibot
User-Agent: OAI-SearchBot
User-Agent: ICC-Crawler
User-Agent: AI2Bot
User-Agent: AI2Bot-Dolma
User-Agent: DataForSeoBot
User-Agent: AwarioBot
User-Agent: AwarioSmartBot
User-Agent: AwarioRssBot
User-Agent: Google-CloudVertexBot
User-Agent: PanguBot
User-Agent: Kangaroo Bot
User-Agent: Sentibot
User-Agent: img2dataset
User-Agent: Meltwater
User-Agent: Seekr
User-Agent: peer39_crawler
User-Agent: cohere-ai
User-Agent: cohere-training-data-crawler
User-Agent: DuckAssistBot
User-Agent: Scrapy
User-Agent: Cotoyogi
User-Agent: aiHitBot
User-Agent: Factset_spyderbot
User-Agent: FirecrawlAgent
Disallow: /
DisallowAITraining: /
# Block any non-specified AI crawlers (e.g., new
# or unknown bots) from using content for training
# AI models, while allowing the website to be
# indexed and accessed by bots. These directives
# are still experimental and may not be supported
# by all AI crawlers.
User-Agent: *
DisallowAITraining: /
Content-Usage: ai=n
Disallow: /channel/
Allow: /invite/
Allow: /oauth2/
+1 -1
View File
@@ -3781,7 +3781,7 @@ fieldset input[type="radio"] {
background: var(--primary-text-prominent);
}
/* Jank Mobile */
/* Fermi Mobile */
#maintoggle,
#maintoggleicon {
display: none;
+2 -2
View File
@@ -1,5 +1,5 @@
# Translations
the translations are stored in `/src/webpage/translations` in this format.
The translations are stored in `/src/webpage/translations` in this format below.
```json
{
"@metadata": {
@@ -13,7 +13,7 @@ the translations are stored in `/src/webpage/translations` in this format.
```
## I want to help translate this
Please go to [https://translatewiki.net/wiki/Translating:JankClient](https://translatewiki.net/wiki/Translating:JankClient) to help translate this project
Please go to [https://translatewiki.net/wiki/Translating:Fermi](https://translatewiki.net/wiki/Translating:Fermi) to help translate this project.
## What is the format?
It's the same format found [here](https://github.com/wikimedia/jquery.i18n#message-file-format), though we are not using jquery, and you might notice some of the strings use markdown, but most do not.