Giter Club home page Giter Club logo

avr-reileta's Introduction

Reil[ins]eta

Reileta is a system for the management for AtelierVR.

Table of Contents

How to install

  1. Clone the repository
git clone https://github.com/hactazoff/AVR-Reileta.git
cd AVR-Reileta/
  1. Install the dependencies
npm install
  1. Create a .env file and fill it with the .env.example file
cp .env.example .env
  1. Start the server
npm run dev

Environment Parameters

  • DATABASE_URL=string path - The database url
  • REILETA_ID=string - The id of the server
  • REILETA_ENABLE=boolean - If the server is enabled
  • REILETA_PORT=number - The port of the server
  • REILETA_PREFERED_ADDRESS=string - The prefered address of the server
  • REILETA_SECURE=boolean - If the server is secure
  • REILETA_AUTH_CAN_LOGIN=boolean - If you can login
  • REILETA_AUTH_CAN_REGISTER=boolean - If you can register
  • REILETA_AUTH_CAN_DELETE=boolean - If you can delete your account
  • REILETA_INTEGRITY_CAN_CREATE=boolean - If you can create integrity
  • REILETA_INTEGRITY_CAN_CHECK=boolean - If you can check integrity
  • REILETA_SOFT_HIDE_WORLDS=boolean - If you can view all worlds
  • REILETA_WORLD_CAN_MODIFY=boolean - If you can modify worlds
  • REILETA_WORLD_FALLBACK=string - The fallback world id
  • REILETA_TMP_FILE_EXPIRATION=number - The expiration of the temporary files
  • REILETA_DEFAULT_USER_TAGS=string - The default user tags (comma separated)
  • REILETA_CAN_EDIT_WORLD=boolean - If you can edit worlds
  • REILETA_SUPPORTED_WORLD_ASSET_ENGINE=string - The supported world asset engines (comma separated)
  • REILETA_SUPPORTED_WORLD_ASSET_PLATFORMS=string - The supported world asset platforms (comma separated)
  • REILETA_INTEGRITY_EXPIRATION=number - The expiration of the integrity
  • HIDE_IP=boolean - If you can hide the ip ' REILETA_CAN_UPLOAD_FILE=boolean - If you can upload files
  • REILETA_FILE_PATH=string - The file origin path

Eta (Registry Server)

The Eta is the main server of the system. It is the registry server for the users, services and worlds.

Reil (Security Server)

The Reil is the security server of the system. It is the security server for authentication, challenges and proxy. It can moderate the authorized servers and clients. On Request HTTP, it can add AVR-Gateway: {secure bool} {address string} header with the gateway address of the server.

Ins (Instance Servers)

The Ins are the instance servers of the system. They can be created by the users, services or decicated servers. They communicate with socket connections to the Reil and Eta servers. The others clients can connect to the Ins servers with the Reil server.

HTTP Requests

The system of Reileta is based on HTTP requests. The secure connection is mostly impotant and trustingly. The following table shows the available requests. All requests if you get a external server, you have to use the ?server query parameter.

A sample response looks like this:

{
    "request": REQUEST_URL,
    "data": DATA_OBJECT | undefined,
    "time": TIMESTAMP_IN_MILLISECONDS,
    "error": {
        "code": ERROR_CODE,
        "message": ERROR_MESSAGE
    } | undefined,
    "redirect": {
        "secure": REDIRECT_SECURE,
        "address": REDIRECT_ADDRESS
    } | undefined
}
  • REQUEST_URL is the url of the request.
  • DATA_OBJECT is the real response data of the request.
  • TIMESTAMP_IN_MILLISECONDS is the timestamp of the request.
  • ERROR_CODE is the error code of the request.
  • ERROR_MESSAGE is the error message of the request.
  • REDIRECT_SECURE is the secure of the redirect for the next request.
  • REDIRECT_ADDRESS is the address of the redirect for the next request.

Server

Authentication

The authentication is based on a token. You can Authenticate yourself with the following requests with the Authorization and User-Agent: AVR(User) headers, or with the ?authuser (deprecated) query parameter.

User

Tips: If you use @me as user :id, you can get the information about the current user. You can find a user by its ID or its name. The :server parameter is optional and only needed if you want to get the information of a user on a specific server. You can't not use ids with starting with @, because they are reserved for the system. For example @me is the current user, @root is the root user, and @admin is the main admin of the server.

Home

Thumbnail

Banner

Services

The services are addons the the mods client ans other services server. Is must be a unique id for alls services of the global system.

Worlds

Thumbnail

Assets

Asset File

Challenges

The server challenges are a way to get a token for a server. The token is used to authenticate the server to a other server. It can Authenticate itself with the following requests with the Authorization and User-Agent: AVR(Server) headers, or with the ?authserver query parameter.

Integrity

The integrity is a way to check the identity of a user on a other server, to access private data or access to a instance. It can Authenticate itself with the following requests with the Authorization and User-Agent: AVR(User) headers, or with the ?integrityuser query parameter.

Instances

The instances are the servers of the system.

WebSocket Connection

The utility of the WebSocket is to the communication with the proxy and the instance servers. The WebSocket is used to send and receive data from your server.

Requests

Sample request:

{
    "state"?: REQUEST_STATE,
    "command": REQUEST_EVENT,
    "data": DATA_OBJECT | undefined,
}
  • REQUEST_STATE is the state custom state of the request.
  • REQUEST_EVENT is the event of the request. Is represented by a path, for example avr/instance:join.
  • DATA_OBJECT is the data of the request.

Sample response:

{
    "state"?: RESPONSE_STATE,
    "command": RESPONSE_EVENT,
    "data": DATA_OBJECT | undefined,
    "error": {
        "code": ERROR_CODE,
        "message": ERROR_MESSAGE
    } | undefined
}
  • RESPONSE_STATE is the state custom state of the response.
  • RESPONSE_EVENT is the event of the response.
  • DATA_OBJECT is the data of the response.
  • ERROR_CODE is the error code of the response.
  • ERROR_MESSAGE is the error message of the response.

Request Events

In local eventName

  • avr/ping - Get the pong of the server

    {
        "i": number, // Initial timestamp by the client
    }
  • avr/authenticate - Authenticate to the server

    {
        "token"?: string, // The token of the user
        "integrity"?: string // The integrity token of the user
    }
  • avr/enter - Join a instance

    {
        "instance": string, // The instance id
    }
  • avr/quit - Leave a instance

    {
        "instance": string, // The instance id
    }

In <id_instance> eventName

  • avr/moderate - Moderate a user

    {
        "to_socket": string, // The socket id of the user
        "type": ModerationType // If the user is moderate
    }
  • avr/transform - Transform in the instance

    {
        "path": string, // The path of the transform, for a playere, it's `p:<@me|player_id>/<path>`
        "p": Transform.Position,
        "r": Transform.Rotation,
        "s": Transform.Scale,
        "v": Transform.Velocity,
        "a": Transform.Acceleration
    }

Response Events

In local eventName

  • avr/ping - Pong of the server

    The event is't send in logs.

    {
        "i": number, // Initial timestamp by the client
        "o": number // Timestamp by the server
    }
  • avr/authenticate - All authentication events

    {
        "internal": boolean, // If use token or not
        "user": {
            "id": string,
            "username": string,
            "display": string,
            "server": string
        }
    }
  • avr/enter - The current user entered a instance

    {
        "player": string, // The player id of the user
        "user": string, // The user id@server
    }
  • avr/quit - The current user left a instance

    {
        "player": string, // The player id of the user
        "code": Instance.QuitType // The code of the leave
    }

In <id_instance> eventName

  • avr/join - A user joined a instance

    {
        "player": string, // The player id of the user
        "user": string // The user id@server
    }
  • avr/left - A user left a instance

    {
        "player": string, // The player id of the user
        "type": QuitType // The code of the leave
    }
  • avr/moderate - Response of the moderation

    {
        "to_player": string, // The player id of the user
        "type": ModerationType // If the user is moderate
    }
  • avr/moderation - A user is moderate

    {
        "to_player": string, // The player id of the user
        "by_player": string, // The player id of the moderator
        "type": ModerationType // If the user is moderate
    }
  • avr/data - A user send data in the instance

    The event is't send in logs.

    {
        "player": string, // The player id of the user
        "data": any // The data of the user
    }
  • avr/transform - A user transform in the instance

    The event is't send in logs.

    {
        "player": string, // The player id of the user
        "path": string, // The path of the transform
        "p": Transform.Position,
        "r": Transform.Rotation,
        "s": Transform.Scale,
        "v": Transform.Velocity,
        "a": Transform.Acceleration
        "at": number // custom number to prevent rollback
    }

avr-reileta's People

Contributors

hactazoff avatar

Watchers

 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.