micro/README.md

103 lines
4.2 KiB
Markdown
Raw Permalink Normal View History

2024-01-07 03:33:19 +00:00
<p align="center">
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="mr-2 text-primary">
<path d="M6.13 1L6 16a2 2 0 0 0 2 2h15"></path>
<path d="M1 6.13L16 6a2 2 0 0 1 2 2v15"></path>
</svg>
</p>
<p align="center">
2024-05-16 16:06:44 +00:00
<img src="https://skillicons.dev/icons?i=vite,tailwind,nest,typescript,docker,graphql" />
2024-01-07 03:33:19 +00:00
<br/>
2024-05-16 16:06:44 +00:00
<a href="https://discord.gg/VDMX6VQRZm"><kbd>🔵 discord</kbd></a> <a href="https://micro.sylo.digital"><kbd>🟣 hosted instance</kbd></a>
2024-01-07 03:33:19 +00:00
</p>
2020-08-27 15:09:27 +00:00
# micro
2024-01-07 03:33:19 +00:00
A vanity file sharing service with support for ShareX. You can see a preview at https://micro.sylo.digital
2021-04-17 13:51:40 +00:00
- [micro](#micro)
- [features](#features)
- [screenshots](#screenshots)
- [installation](#installation)
- [development](#development)
- [`web` package notes](#web-package-notes)
2021-04-17 13:51:40 +00:00
- [todo](#todo)
2024-01-07 03:33:19 +00:00
- [support](#support)
2021-04-17 13:51:40 +00:00
## features
- [x] ShareX Support
2022-06-18 19:29:02 +00:00
- [x] Video and image thumbnails
2021-04-17 13:51:40 +00:00
- [x] Config generation
- [x] Encrypted pastes
2021-04-17 13:51:40 +00:00
- [x] File name preservation
2022-05-05 03:48:59 +00:00
- [x] Video, image, text and markdown previews
2021-04-17 13:51:40 +00:00
- [x] Syntax highlighting for supported files
- [x] Deletion URLs
- [x] Dashboard
- [x] Permissions
- [x] Invite links
- [x] URL Shortening
- [x] Mobile support
- [x] EXIF metadata removal
2022-07-26 00:30:22 +00:00
- [x] Conversions (GIF>WebM, WebP>PNG, etc.)
2022-05-05 03:48:59 +00:00
- [x] Purging of old and/or large files (`config.purge`).
2022-10-07 11:48:07 +00:00
- [x] 2FA support
2024-05-16 16:06:44 +00:00
- [X] Decay files to S3 to save space
2021-04-17 13:51:40 +00:00
## screenshots
2020-12-04 15:02:55 +00:00
2021-02-15 17:55:24 +00:00
<table>
<tr>
2021-07-26 06:12:52 +00:00
<td><img src="https://i.imgur.com/YN5WXpz.png" title="Sign In Page" alt="Sign In Page"></td>
<td><img src="https://i.imgur.com/lw0FlYR.png" title="Dashboard" alt="Dashboard"></td>
2021-02-15 17:55:24 +00:00
</tr>
</tr>
<tr>
2021-07-26 06:12:52 +00:00
<td><img src="https://i.imgur.com/ybu4B8I.png" title="Upload Page" alt="Upload Page"></td>
<td><img src="https://i.imgur.com/Ij7PElj.png" title="Text Preview" alt="Text Preview"></td>
2021-02-15 17:55:24 +00:00
</tr>
</tr>
2022-05-16 13:15:32 +00:00
<tr>
<td><img src="https://i.imgur.com/1KUrtVf.png" title="Paste Page" alt="Paste Page"></td>
2022-10-07 11:48:07 +00:00
<td><img src="https://i.imgur.com/GYaEcKy.png" title="2FA setup" alt="2FA setup"></td>
2022-05-16 13:15:32 +00:00
</tr>
2021-02-15 17:55:24 +00:00
</table>
2021-02-04 08:06:13 +00:00
2021-04-02 04:57:37 +00:00
## installation
2024-05-16 16:06:44 +00:00
[See the `example` directory](./example) for how to setup micro.
2021-04-02 04:57:37 +00:00
## development
You can pull the repo and then `pnpm install`, after that everything should be good to go. You can start the `packages/api`/`packages/web` with `pnpm watch`.
### `web` package notes
> [!IMPORTANT]
> tl;dr, `web` is quirky and some packages that depend on react may break. if they do, try adding them to `noExternal` in vite.config.ts and they'll probably work.
The web package is a little weird. It uses [vike](https://vike.dev) in place of what might normally be nextjs, [preact](https://preactjs.com) in place of react and [vite](https://vitejs.dev) to build it all. Unlike nextjs, we have much more control over rendering, SSR, routing, etc. It's much faster, and much more fun. Of course, nothing is free - some hacky workarounds are required to get it working.
Preact is smaller, faster[,](https://tenor.com/view/26464591) and more fun than react. It's a drop-in replacement, but actually dropping it in is the hard part. The main problem is that in SSR mode, vite does not bundle dependencies, which means aliasing `react` to `preact` does not work because it's not transforming the packages to replace the react imports. You can force it to bundle dependencies, but then it chokes on some node dependencies like fastify. The only way I've found to get around this is to:
- Alias `react` to `preact` in node_modules using `.pnpmfile.cjs`
- Add some packages that still complain to `noExternal` in `vite.config.ts`, which forces them to be bundled and appears to resolve any remaining issues.
`tsup` is used as a final build step to bundle everything together. Vite breaks doing this, but not doing it results in much larger docker images.
2021-02-15 17:55:24 +00:00
## todo
2021-04-02 04:11:18 +00:00
- [ ] Ratelimiting
- [ ] Admin UI
2022-06-29 23:40:17 +00:00
- [ ] Deletion URLs for pastes/links
2022-06-29 06:26:10 +00:00
- [ ] Password recovery via emails
2022-07-01 00:10:32 +00:00
- [ ] SQLite support
2022-07-05 03:58:22 +00:00
- [ ] Private email aliases like firefox relay (might be difficult/expensive)
2021-04-17 13:51:40 +00:00
2024-01-07 03:33:19 +00:00
## support
2021-04-17 13:51:40 +00:00
<a href="https://discord.gg/VDMX6VQRZm" target="__blank">
<img src="https://discordapp.com/api/guilds/778444719553511425/widget.png?style=banner2" alt="sylo.digital"/>
</a>