Giter Club home page Giter Club logo

micro's Issues

Database

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

Error uploading large files

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)

Personal link pages

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.

ideas

  • Users should be able to create multiple link pages
  • Ability to assign non-wildcard domains to users, that they can then assign to whichever pages they want
  • Some kind of NSFW toggle for links
  • Support linking to emails with mailto:
  • Have a database of icons and colours for each button, If a link has no preset icon and colour, scrape the URL for the favicon and let the user pick a colour (and/or average the favicon and invert it for the colour).
  • Link pages should not require a domain, and should be similar to pastes. I should be able to create a link page for eg a new album I'm writing. The personal page is then assigned an ID, and you can visit it by going to lets say /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.
  • Let users pick a custom link page ID, for example /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.

Obsidian not embedding uploads

Obsidian does not seem to embed micro urls, the upload itself works fine when visiting directly.

Tested with the following:

![](https://cyk.needs-a-hug.co/i/UJcbUb.png)

image

Split ShareX endpoint out and have settings stored server-side

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.

The docker image is broken.

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.

Switch to GraphQL

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

Support downloading files as torrents

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.

Error: connect ECONNREFUSED ::1:8080

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.

Add URL redirects

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.

suggestion: "Suspended" database property

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."

Uploads with japanese symbols don't load

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.

Allow for a higher temporary file limit

# 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

Can't delete files from non-default domain

Steps to reproduce

  1. Upload a file to a non-default domain (such as {{username}}.is-fucking.gay)
  2. Go to Files and click the uploaded file

Expected result

I will be logged in at the webpage I'm redirected to, able to delete the uploaded file.

What happens instead

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.

Workaround

Change the domain in the URL to micro.sylo.digital

Login page doesnt let you input 2FA

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

A congrat notice

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.