Ravenserver Documentation

ravenserver is a NodeJS-based online repository/package manager for raven themes. You can write your own client or bot easily using the API if you want.The main instance runs on my website, and raven comes configured with that by default, but you can swap to your own easily.

REST API

  • POST /themes/report

    • This endpoint reports a theme for a specific reason. Required body fields:
      • name: The name of the theme you're reporting
      • reason: The reason the theme is being reported
      • info: Any additional information about the report
  • POST /themes/meta/:name

    • This endpoint updates the metadata of a specific theme. Required query fields:
      • token: A valid login token
      • typem: The metadata you're updating(either screen or description)
      • value: The value to update to
  • POST /themes/users/delete/:user

    • This endpoint permanently deletes a user's account and all owned themes. Required query fields:
      • token: A valid login token
      • pass: The user's password for verification
  • POST /themes/delete/:name

    • This endpoint permanently deletes a theme. Required query fields:
      • token: A valid login token
  • GET /themes/repo/:name

    • This endpoint returns a tarball of the named theme for downloading.
  • POST /themes/upload

    • This endpoint creates or updates a theme. Required query fields:
      • name: Theme name
      • token: A valid login token
    • It also requires a multipart tarball of the theme to be uploaded. The maximum size is 50mb.
  • POST /themes/user/create

    • This endpoint creates a new user. Required query fields:
      • name: The new user name. Must be unique
      • pass: The password to sign up with
  • GET /themes/user/login

    • This endpoint takes a name and password and, if authenticated correctly, returns a login token. Required query fields:
      • name: Username
      • pass: Password to authenticate with

Installation

To set up your own instance, it's pretty easy. First, grab the code:

git clone https://git.sr.ht/~nicohman/ravenserver

Create a file named config.json in the directory you cloned, containing these fields:

{
    "email":{
        // This is the email address that emails should be sent from
        "user": String,
        // This is the host that ravenserver wll use to send the emails
        "host": String,
        // This is the password to the email account
        "pass": String, 
    },
    // This controls whether or not to display a link to the downloads page. You should probably leave this off.
    "include_downloads": Boolean,
    // The page to redirect users to on clicking the download page link
    "downloads_page": String,
    // The secret to sign JWT tokens with
    secret: String
}

Then, you'll need to set up a MongoDB database on the server. It should be named themes, and ravenserver will handle the rest of the setup. Now, you're pretty much ready to go. Just start it up!

node app.js

I personally recommend using pm2 to manage it.

pm2 start app.js

Table of Contents

This commit

commit 9f9b0f280b298fd5cbf9dc8758b70ca71208fce1
Author: nicohman <nicohman@demenses.net>
Date:   2019-02-01T19:03:01

Add new fields to config docs
Clone this wiki
man@man.sr.ht:~nicohman/raven
https://man.sr.ht/~nicohman/raven