Giter Site home page Giter Site logo

clickbait / cpomf Goto Github PK

View Code? Open in Web Editor NEW
36.0 8.0 4.0 3.14 MB

Pomf API compatible file host written in Crystal - The software behind nya.is.

Home Page: https://nya.is

License: MIT License

Shell 0.16% Python 0.67% Crystal 73.54% CSS 18.45% JavaScript 7.17%
pomf crystal postgres file-upload file-sharing hosting sharex sharex-support pomf-api

cpomf's Introduction

cpomf

pomf backend written in crystal for pomf.is

Installation

Prerequisites

  • Postgres
  • Mschematool
  • Crystal 0.20.4

Setup

Set your environment variables:

  • POMF_PORT - The port that cpomf listens to.
  • POMF_DEBUG - Whether or not cpomf is in debug mode true|false
  • POMF_DATABASE_URL - The postgres URL for your database, eg; postgres://localhost/pomf_database
  • POMF_SECRET_KEY - Your secret key; preferably something that's long and randomly generated.
  • POMF_ADMINS - A comma seperated list of admin usernames; keeping in mind that usernames are lowercase and alphanumeric only.
  • POMF_BLACKLISTED_NAMES - A comma seperated list of banned usernames; it's usually good to blacklist names like admin or anything else you don't want users to use.
  • POMF_UPLOAD_DIR - Relative path to your pomf upload directory.
  • POMF_URL - the root URL of your site; eg. https://pomf.is/
  • POMF_UPLOAD_URL - The upload URL for your site; eg. https://u.pomf.is/

Run shards install to install dependencies.

Run mschematool default init_db and then mschematool default sync

Compile the project with crystal build --release pomf.cr

Usage

Run cpomf like you would run any other binary file ./pomf

Use a nginx reverse proxy to cpomf; and use nginx to handle static files, including those in /src/pomf/public; google tutorials if you need to.

Please make sure that you modify the default templates and styles before you host your own clone; I've left nya.is' designs in as a reference, but being unique is king in a sea of clones.

Make sure you create your account before you release your site.

Contributing

  1. Fork it ( https://github.com/neko/cpomf/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • neko neko - creator, maintainer
  • RX14 RX14 - contributor

cpomf's People

Contributors

indrakaw avatar neko avatar rx14 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cpomf's Issues

Download non-whitlisted files via dl manager supports.

I just wondering the way I can download .zip, .rar, and .exe via uGet/Wget and FDM. I have to bypass CAPTCHA and it's IMPOSSIBLE.

Here the idea: "Cookie: allow-download=1"
That the way I able to download file directly via web browser, wget and download manager on Volafile.

I hope this feature implemented.

componentizing

I feel that several features of the site could be broken into their own shards. This would mean that the shards could be maintained separately, plugged into different projects, and could offer a larger amount of customization.

use multipart shard

would be easier to use the multipart shard instead of having to use our own crystal version

Integrations

There are a couple of utilities that I'd like to have a go at creating for Nya.is.

  • Chrome Extension
  • WordPress Plugin

deprecate old repo

probably best to keep everything to this one now, to keep things cleaner and less confusing

"remember me" option.

This is useful because I don't have to retype email and password to login every time I closed my browser or end the session.

Edit:
I don't see logout option, the only way to logout is: close the browser. If it is it, then no problem.

whitelisting

asshats keep uploading viruses and getting pomf/nya blacklisting, i think the best option is to move from generic file hosting to media hosting (as that is what pomf & nya are mainly used for).

i'll be doing extensive research into what filetypes should be safe and which filetypes are getting uploaded to pomf & nya.

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.