sylv / micro Goto Github PK
View Code? Open in Web Editor NEWA vanity image host with url shortening, 2fa, videos, and much more.
Home Page: https://micro.sylo.digital
License: GNU Affero General Public License v3.0
A vanity image host with url shortening, 2fa, videos, and much more.
Home Page: https://micro.sylo.digital
License: GNU Affero General Public License v3.0
Not sure they'll embed the image but they should pull a bit more info then just the favicon for it.
We strip exif data, it's probably that. Re-encoding everything on upload is probably going to be the most reasonable fix, it should be done anyway and we can fix rotation metadata when we do.
What should the db tables be i made a users table but when i make a column User.id then it just says it wasn't found so a db example would be nice
thanks
When attempting to upload a large file (video) and with the .microrc file changed to allow larger files + rebuilt, ShareX prompts an error about 15% into the upload. My guess is that the 50MB limit being changed in the .microrc isn't actually changing the limit within the app.
Error message:
Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.
Request URL:
https://my.url/api/sharex?input
Stack trace:
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Security._SslStream.StartWriting(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at ShareX.UploadersLib.Uploader.TransferData(Stream dataStream, Stream requestStream, Int64 dataPosition, Int64 dataLength)
at ShareX.UploadersLib.Uploader.SendRequestFile(String url, Stream data, String fileName, String fileFormName, Dictionary`2 args, NameValueCollection headers, CookieCollection cookies, HttpMethod method, String contentType, String relatedData)
Users should be able to setup their own link pages that lists whatever links they feel like, similar to linktree or littlelink. Users would be able to add whatever links they want and maybe a markdown description, then when users visit <user>.domain.com
(e.g, sylver.is-fucking.gay
) they would get dumped on a page with the links they set.
Whether or not the root subdomain is used or maybe domain.net/links
is definitely a decision. If it were the root, some kind of footer that links to an explanation on what that page is and that the domain itself is not affiliated with the user would make sense.
mailto:
/link/:id
. You would then be able to assign a domain to that link page, and going to the root of that domain would return the selected link page./link/2022Album
should be assignable, instead of just the ID. These would likely have to be limited to wildcard domains or domains assigned to the user.Specifically markdown and .txt files, they're annoying to read without word wrapping as they overflow the page.
A lot of people I have given micro access have been confused by the options on the dashboard where you select a domain, they think it persists automatically its just to customise the configuration. There are two ways forward, either split the configuration generator into a separate page that is clearly marked, or the harder but a lot nicer route of storing those domains server-side so you download the config once and customise it through the dashboard.
I'm not sure how this should work. Maybe we could rewrite authentication so each config sends a X-Micro-Config
header with a unique key that is saved in our database, and that key corresponds to things like the domain(s) to use for uploads unless X-Micro-Host
is present. Either way, I think we should continue to support X-Micro-Host
as a header on all endpoints.
It's confusing and annoying to maintain how it's currently setup.
It seems prisma doesn't want to play nice so the decision is between a ~700mb docker image with dev dependencies or ditch prisma. typed-knex
might be worth considering. For now the :latest
docker image is fine, :master
is built automatically and won't start because the prisma client isn't generated.
The current API is scuffed and unnecessary. GraphQL is slightly more fun and a lot better for client-side type info. The only downside with GraphQL is code duplication because prisma doesn't use classes for defining tables, but if we're ditching prisma that doesn't matter.
Should probably do it after #16
Files uploaded to sylv.example.com
should not be available on other-user.example.com
and vice versa.
There should be a "Download Torrent" option for files that lets you download files as a torrent. For popular files this would reduce server load and just be pretty cool tbh. It might make sense to only enable it for large (>100mb) files.
We could seed every file, but I think a better option would be to use web seed, which is basically a torrent with some http urls that are used as fallbacks if there are no peers. This is what the internet archive does for their torrents.
This blog covers some details on how it works, this lets you edit torrent files as JSON which will be useful for debugging. This link is a random internet archive entry with a torrent download that will be a useful example for a web seed torrent.
Instead of random letters, use words that can be typed in easily.
I'm running micro through podman. When I deploy it, I get the expected invite URL in the logs, but with a double slash after the domain:
[Nest] 2 - 08/28/2023, 11:42:26 AM LOG [InviteService] Go to https://url.example.com//invite/bunchoflettersandnumbers to create the first account.
But trying to visit either https://url.example.com//invite/bunchoflettersandnumbers
or https://url.example.com/invite/bunchoflettersandnumbers
results in the following log message:
Failed to proxy http://localhost:8080/v1/instance Error: connect ECONNREFUSED ::1:8080
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '::1',
port: 8080
}
and the website itself gives a 500 error.
I'm reverse proxying micro with Nginx. Here's the vhost file:
server {
server_name url.example.com;
gzip on;
client_max_body_size 200M;
location / {
proxy_pass http://localhost:1234;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/url.example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/url.example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}server {
if ($host = url.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name url.example.com;
listen 80;
return 404; # managed by Certbot
}
My .microrc.yaml
databaseUrl: postgresql://micro:secureToken@postgres/micro
secret: otherSecureToken
inquiries: [email protected]
storagePath: /data
restrictFilesToHost: true
hosts:
- url: https://url.example.com
- url: https://url.example.com
redirect: https://example.com
tags: ["admin"]
# conversions:
# - from: image/gif
# to: video/webm
# minSize: 1MB
My docker-compose.yml
:
version: "3"
services:
micro:
image: sylver/micro:main
container_name: micro
restart: unless-stopped
volumes:
- $PWD/.microrc.yaml:/usr/src/micro/.microrc.yaml
- $PWD/data:/data
# uncomment this if you dont care about https, then comment out the proxy service
ports:
- 1234:3000
postgres:
image: postgres:12-alpine
container_name: micro-db
restart: unless-stopped
environment:
# lleaving this as default should be fine as postgres will only ever be exposed to services
# in this docker-compose file, but you might still want to consider changing it to something more secure.
- POSTGRES_PASSWORD=secureToken
- POSTGRES_USER=micro
- POSTGRES_DB=micro
volumes:
- $PWD/.pg-data:/var/lib/postgresql/data
# comment this out if you dont care about https, then uncomment the above ports
# proxy:
# image: caddy:2-alpine
# restart: unless-stopped
# ports:
# - 80:80
# - 443:443
# volumes:
# - $PWD/.caddy-data:/data
# - $PWD/.caddy-config:/config
# - $PWD/Caddyfile:/etc/caddy/Caddyfile
I've tried allowing port 8080 through my firewall (ipv4 and ipv6) just in case, but that didn't solve it. My guess is something is using port 8080 that shouldn't be, but I'm not sure if that's on the host system or one of the containers.
See https://micro.sylo.digital/f/SrAc8X
If you have enough media to load another page, it tries to load but can't unless you scroll down slightly. In certain circumstances, you can't scroll down unless you zoom the page to 110%.
Yes I regenerated my token :)
It would be cool if you could add an option to "shorten" URLs (are they really short tho?). This would be useful for videos and other large files, so that they can be uploaded to YouTube or Google Drive and redirected to from Micro, instead of being uploaded directly to Micro.
A property in the postgres users table that allows admins to suspend a user, preventing them from logging in. This could say something like "Your account has been suspended, please contact {{ insert the inquiries address here }} for more information."
Discord embeds aren't working for me
personally, not running my own instance. concerned about old file bloat.
When clicking on an uploaded file or going back to the dashboard from a file, the page loads infinitely. Refreshing the page makes it load correctly.
Video demonstration: https://micro.sylo.digital/v/8SkSvi
From my experience, when uploading media files with japanese symbols, the page won't load when trying to view them (can't tell the error code due to uploads throwing HTTP 500 right now).
When uploading the same files without Japanese, the page loads, and the upload is accessible.
This is most likely not limited to only Japanese, however i did not test Chinese or Korean symbols.
Unlike the upload dialog on the website, the menu to select the domain to use when using the paste and shorten pages do not substitute {{username}} for the name of the currently logged in user.
When using invalid credentials, no error message or indication is shown to the user.
Tested on both mobile and desktop Firefox as well as desktop Chrome.
# fall-through list of limits, shorter ages = higher priority
limits:
- age: 7d # limit for files that expire after 7 days
limit: 1GB
- age: 30d # limit for files that expire after 30 days
limit: 500MB
- limit: 100MB # default for all files
{{username}}.is-fucking.gay
)I will be logged in at the webpage I'm redirected to, able to delete the uploaded file.
I am redirected to my file at the selected domain, where I'm not logged in, and am given no button to delete my file.
Change the domain in the URL to micro.sylo.digital
/api/f/:id/.json instead of /f/:id/.json
When logging in, if your account has 2FA setup, it will prompt you to enter the 2FA and without waiting for input, redirect you to the dashboard, which throws an "Unauthorized" response
yep
This is one of the best projects i saw this week.
why? Because the other projects with same scope have either too many features or are too bare bones.
But now to the issue: readme says it's not important now, but having deploy instructions would make it easier for collaborators join your project, making it progress faster.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.