Giter Site home page Giter Site logo

mollersuite / monofile Goto Github PK

View Code? Open in Web Editor NEW
17.0 3.0 3.0 5.31 MB

File sharing over the Discord CDN

Home Page: https://fyle.uk

License: The Unlicense

HTML 2.13% TypeScript 41.40% JavaScript 15.98% CSS 1.75% SCSS 15.04% Svelte 23.71%
discord discord-cdn file-sharing file-upload

monofile's Introduction

monofile: 'File sharing over Discord', topped with the monofile logo. Blue gradient with an image of monofile 1.4.0-dev on the side.

The open-source, Discord-based file sharing service.
Flagship instance โ€” Live test instance


Setup

First, install monofile's prerequisites...

npm i

Then, add your bot token...

echo "TOKEN=INSERT-TOKEN.HERE" > .env

and, in addition, SMTP authentication...

echo "\[email protected]" > .env
echo "\nMAIL_PASS=password here" > .env

Invite your bot to a server, and create a new config.json in the project root:

// config.json
{
    "maxDiscordFiles": 20,
    "maxDiscordFileSize": 26214400,
    "targetGuild": "1024080490677936248",
    "targetChannel": "1024080525993971913",
    "requestTimeout":120000,
    "maxUploadIdLength":30,

    "accounts": {
        "registrationEnabled": true,
        "requiredForUpload": false
    },

    "webdrop": {
        "accountRequired": false
    },

    "mail": { // nodemailer transport options
        "host": "smtp.fastmail.com", // or your mail provider of choice
        "port": 465,
        "secure": true,
        "auth": {
            "user": "[email protected]",
            "pass": "REPLACE-WITH-YOUR-GENERATED-PASSWORD"
        }
    }
}

Then, compile:

tsc && sass src/style:out/style && rollup -c

and start.

npm start

monofile should now be running on either env.MONOFILE_PORT or port 3000.

Disclaimer

Although we believe monofile is not against Discord's developer terms of service, Etcetera is not liable if Discord takes action against you for running an instance.

License

Code written by Etcetera is currently licensed under Unlicense.

Icons under /assets/icons were created by Microsoft, and as such are licensed under different terms (MIT).

monofile's People

Contributors

imgbotapp avatar jack5079 avatar linkability avatar nbitzz avatar nbzschl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

monofile's Issues

Invites

allow admins to make invites when registration is disabled

Multi-bot / multi-webhook

Add multi-bot/multi-webhook support to pseudo-increase ratelimits (can webhooks read their own messages? I forgot)

Add config.json to .gitignore

config.json should be part of .gitignore, with an example provided in a separate file which can be copied over for easy setup

if we do this, we should also drop dotenv

Unified server and client build

Hono's official templates build the server using Vite. We should too.

Benefits include:

Homepage no longer loads on iOS

Should probably check if the notifications API is available before adding the button or anything, otherwise the page just Dies

Themes

Things to take into account:

  • How do we load themes? Just link to them with ? Or something else?
    • Maybe for the SPA, we can load them dynamically or something..?
  • How do we even format themes? Just plain old CSS files with variables? Some weird JSON config?
  • How do we organize themes? Do we create our own structure, or just follow Catppuccin's structure?
    • How do we generate the Catppuccin themes? Through SCSS, or manually?
  • Do we allow users to pick out custom accents for themes? I can only think of one being used in like, 2 places.
    • If we do allow custom accents, how do we set up the picker? I'd probably have to do it custom or something... but a big drop-down is a pain to browse, so if we have a lot of themes, we'd probably have to anyway
  • Do we allow users to create custom themes?
    • If we pick the JSON config approach, this is... pretty easy.
    • If we go with a CSS file, it's also probably pretty easy; make some basic script/UI to customize your theme with just colors, and add some advanced-mode thing to get a textbox
    • Do we allow multiple custom themes to be saved, or just some singular "custom" option?

@Jack5079

New client

New client (because v1.3's is terrible to work with.)

Plan is to, with this, solve:

  • #18 OAuth, sessions, and API keys can be configured in a new Access section under Account
  • #7 Implement progress bars
  • #63 #64 #28 New management panel, allowing admins to manage users, files, invites, etc...
  • #33 (really themes in general)
  • #39

I'll convert this to a PR once I publish the client-v2 branch.

A few ideas I want to implement:

  • Default palettes: Catppuccin Mocha and Latte. Theming will follow the structure of Catppuccin's palette
  • Sidebar instead of a topbar (by default.)
  • OAuth, sessions, and API keys all merged into one "Access" section.
  • Paginated file list(?)
  • FAQ, TOS, privacy policy, and abuse contact, merged into one "instance information" panel
  • Display total space used by files served
  • Aforementioned "management" panel
  • Disconnect the Logout button from Account and just place it directly in the topbar

Automated tests(?)

might be nice for checking if everything works properly. not now; but later, ofc

Display that.ufkcing are you sure dial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HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH

Implement file deletion job queue

Should help with Discord rate limits sucking; should mean if someone deletes like 1000 files at once it won't leave any messages up if you reboot in the middle of it

Password reentry should be required for actions listed under Account

Password reentry should be required for actions listed under the Account section of the account management menu. In addition, the "I forgot my password" should send an email containing a link to reset an account password, instead of just sending a link which logs the user in.

Light theme

For when you're outside trying to use monofile

ShareX config

just some direct download link (don't host on monofile DON'T HOST ON MONOFILE) in the footer to it

Large Files fail to upload

when i try to upload a large file (in my case 500MiB)
i get the following error

HeadersTimeoutError: Headers Timeout Error
    at Timeout.onParserTimeout [as _onTimeout] (/var/www/monofile/node_modules/undici/lib/client.js:902:28)
    at listOnTimeout (node:internal/timers:575:11)
    at process.processTimers (node:internal/timers:514:7) {
  code: 'UND_ERR_HEADERS_TIMEOUT'
}

Improve kbd navigation; accessibility

While tab-nav is actually surprisingly decent, 90% of all of the UI is not set up to display an outline when it is focused lol

also, we should probably figure out how to improve accessibility Mahiro Oyama smiling

Refactor API v0

While this isn't part of #12, we should definitely refactor v0 - the code is an absolute piece of shit right now and absolutely needs to be mostly rewritten. Should help if future issues arise from v0 in the future as well.

help

hey pls can u make a tutorial for RoControl? :(

Markofile

Svelte is turning to shit so we will need to find a new framework.
I propose Marko.

Advantages

  • It is trivial to combine a Marko Run and Hono server: npm run build src/server.ts, and in there something like
import * as Run from "@marko/run/router" // Run uses Request and Response
import { Hono } from "hono" // So does Hono
app.use("/", (c, next) => Run.fetch(c.req.raw) ?? next()) // i think? I had something before that worked I need to test more
  • Marko lets you stream pages. This means, for example, we can send the CSS of a preview page before we have the metadata
  • Marko's Tags API has reactivity like Svelte
  • Marko 5 (current) won't hydrate components that don't have JS
  • Marko 6 (future) is resumable - no hydration at all

Disadvantages

  • Data loading not clear when combining it with Hono (if we want to use idiomatic Marko Run) although we could simply do whatever we do in Svelte since we aren't using SvelteKit anyway
  • Less Marko developers
  • No transitions
  • No scoped CSS (although we aren't using that anyway)

Add progress bar to uploading

This is mainly for large files, like videos or big archives. As of right now, a user can't tell the upload progress of any file, adding a progress bar would help a user know how close to finished their file is (kinda obvious now that i write this but whatever lol). Not sure how'd implementation would work, but from what i know, checking when each chunk is done uploading, update the progress bar. Something like that lol

Consider swapping /:fileId for a blank page with an og:video/og:image tag and redirect

I'm pretty sure literally anyone can verify monofile on like google search console for themselves rn lmao
If we do #50, we can probably save ourselves from breaking anything by just checking the date at which a file was uploaded
People are kinda used to /:fileId being a direct link, however (or at least I am), so I'm not sure; but for the stuff most people use /:fileId for this is also kind of an improvement?

I'm not sure if we should do this or not so

An email server should not be a requirement

I did not know that monofile didn't work without one, but it seems like it; so we should probably work on removing this requirement.

This includes both client and server fixes to only initiate routes which use email when it is required, as well as hiding options related to email when it is disabled.

Self-management / automated setup

In the future, potentially:

  • have a monofile bot create its own server...
  • ...create its own channels to post in...
  • ...and create webhooks to send attachments from

so, basically: supply a bot token and monofile will do the rest.

Will add to the management panel:

  • the ability to generate webhooks to be used for uploads
  • the ability to generate an invite to join the server generated by monofile
  • the ability to manually add more bots

the bot specified by DISCORD_TOKEN should:

  • be assumed to already exist
  • be assumed to have all permissions
  • be used for server generation and management

new bots will automatically receive the delete messages permission

actions on messages under a webhook or bot that is no longer available should be distributed between all available bots

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.