Coder Social home page Coder Social logo

stadsc / denizenpastingwebsite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from denizenscript/denizenpastingwebsite

0.0 0.0 0.0 519 KB

A pastebin webservice, primarily for Denizen scripts and logs.

License: MIT License

C# 75.89% HTML 12.95% PowerShell 0.06% Shell 0.12% CSS 7.38% JavaScript 3.60%

denizenpastingwebsite's Introduction

DenizenPastingWebsite

Paste website (like pastebin), primarily for Denizen scripts and server logs.

How To Install/Run

Designed for and tested on a Debian Linux server.

Usage on other Linux distros is likely very similar. Usage outside Linux may require independent research regarding how to install DotNet 6, and how to run a generic executable service perpetually.

  • Make sure you have screen and dotnet-6-sdk available
  • Add a user for the service (via adduser generally, then su to that user)
  • Clone the git repo (git clone https://github.com/DenizenScript/DenizenPastingWebsite) and enter the folder
  • Make a folder labeled config, inside it make a text file labeled config.fds, and fill it with the config sample below (and change values to fit your configuration needs).
  • Call ./update.sh
  • Will by default open on port 8096. To change this, edit start.sh
  • It is strongly recommended you run this webserver behind a reverse proxy like Apache2 or Nginx.

For testing on Windows, start.ps1 is also available to run via powershell.

Configuration

### GENERAL

# Maximum paste size (in number of characters). Pastes longer than this will be trimmed. Reference value is 5 million, or approximately 5 megabytes.
max-paste-size: 5000000
# Whether to test the "X-Forwarded-For" web header.
# Set to 'true' if running behind a reverse-proxy (like Apache2 or Nginx), 'false' if directly exposed.
trust-x-forwarded-for: true
# Set to the base URL for the paste service.
url-base: https://example.com
# How many pastes from a single origin can come through per minute (a simple flood protection tool). If set to 0, the paste website is effectively read-only. Set to '99999' if you want effectively unlimited pastes.
max-pastes-per-minute: 3
# Optionally specify a list of webhooks to run when new pastes are sent. Webhook content will be a simple JSON-formatted payload with key "content" set to simple displayable text (intended for use as a Discord webhook).
webhooks:
    new-paste:
    - https://example.com/webhook

### SPAM BLOCKING
# New pastes that match these tests will automatically be blocked.

# Optionally specify a list of (case-insensitive) text to check new pastes for to trigger automatic spam blocking.
spam-block-keyphrases:
- some naughty thing
# Optionally specify a list of (case-insensitive) text only short (less than 20 line) pastes for.
spam-block-short-keyphrases:
- some phrase
# Optionally specify a list of (case-insensitive) title text (in full) to auto-block if detected.
spam-block-titles:
- some bad title
# Optionally specify a list of (case-insensitive) title text to auto-block if detected contained in a paste title.
spam-block-partial-titles:
- some bad title

### OAUTH
# The paste service can optionally use Discord as a staff login tool, using Discord OAuth, and a role to mark staff in your Discord guild.

discord_oauth:
    # To use Discord OAuth2, you must register an application at https://discord.com/developers/applications
    # Change to 'true' if in use.
    enabled: false
    # Discord client ID. Generated on Discord's OAuth2 page.
    client-id: 123
    # Discord client secret Generated on Discord's OAuth2 page.
    client-secret: abc
    # Discord redirect URL. Must be added under "Redirects" on the OAuth2 page.
    # In most cases: The "/Auth/DiscordAuthConfirm" portion should be left as-is and the base URL should match 'url-base'.
    redirect-url: https://example.com/Auth/DiscordAuthConfirm
    # ID of the Discord guild relevant to this paste server, used for roles check.
    guild-id: 123
    # Guild role ID(s) that identity the user as an admin of the paste site.
    guild-roles-admin:
    - 123

### TERMS OF SERVICE
# This will show up at "/Info/Terms"

# Contact information. HTML allowed.
tos_contact: Ask on Discord @ <a href="https://discord.gg/Q6pZGSR">https://discord.gg/Q6pZGSR</a> or send an email to <code>[email protected]</code>.
# Text body of Terms of Service. HTML allowed.
tos_text: Legal stuff here, etc. Terms regarding takedown policy, etc. Probably include something like:<br>Pastes sent as spam or for advertising or "SEO" reasons will result in the uploader being blocked (if/when discovered).<br>Large numbers of pastes from a single user for any purpose may be ratelimited or blocked either automatically or manually.
# To customize any other part of the terms page, edit the file "Views/Info/Terms.cshtml"

Licensing pre-note:

This is an open source project, provided entirely freely, for everyone to use and contribute to.

If you make any changes that could benefit the community as a whole, please contribute upstream.

The short of the license is:

You can do basically whatever you want, except you may not hold any developer liable for what you do with the software.

The long version of the license follows:

The MIT License (MIT)

Copyright (c) 2021-2022 The Denizen Script Team

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

denizenpastingwebsite's People

Contributors

breadcrumbistaken avatar mcmonkey4eva avatar

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.