Git Product home page Git Product logo

homeserver's Introduction

Ruma – Your home in Matrix.

A set of Rust crates (libraries) for interacting with the Matrix chat network.

websitechatdocumentation (unstable)

Getting started

If you want to build a Matrix client or bot, have a look at matrix-rust-sdk. It builds on Ruma and includes handling of state storage, end-to-end encryption and many other useful things.

For homeservers, bridges and harder-to-categorize software that works with Matrix, you're at the right place. To get started, add ruma to your dependencies:

# crates.io release
ruma = { version = "0.10.0", features = ["..."] }
# git dependency
ruma = { git = "https://github.com/ruma/ruma", branch = "main", features = ["..."] }

ruma re-exports all of the other crates, so you don't have to worry about them as a user. Check out the documentation on docs.rs (or on docs.ruma.dev if you use use the git dependency).

Status

Ruma 0.10.0 supports all events and REST endpoints of Matrix 1.10.

Various changes from in-progress or finished MSCs are also implemented, gated behind the unstable-mscXXXX (where XXXX is the MSC number) Cargo features.

A few less formalized things are gated behind the unstable-unspecified Cargo feature.

Contributing

See CONTRIBUTING.md.

Minimum Rust version

Ruma currently requires Rust 1.75. In general, we will never require beta or nightly for crates.io releases of our crates, and we will try to avoid releasing crates that depend on features that were only just stabilized.

ruma-signatures is an exception: It uses cryptographic libraries that often use relatively new features and that we don't want to use outdated versions of. It is guaranteed to work with whatever is the latest stable version though.

License

MIT

homeserver's People

Contributors

jplatte 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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homeserver's Issues

API: POST /createRoom

Parameters:

  • invite
    • create m.room.member events for each invitation
  • name
  • visibility
  • invite_3pid
  • topic
  • preset
    • set default value of m.room.history_visibility event
    • set default value of m.room.join_rules event
    • increase power levels for all users invited to trusted private chats
  • creation_content
  • initial_state
    • always create m.room.power_levels
    • always create m.room.join_rules
    • always create m.room.history_visibility
    • validate and create additional state events
  • room_alias_name
    • create alias
    • create m.room.aliases event
    • create m.room.canonical_alias event if one isn't provided in initial_state

Global behavior:

  • create m.room.member for the user creating the room

API: PUT /rooms/:room_id/send/:event_type/:transaction_id

  • Create new events from input.
  • Verify the room exists.
  • Verify the sender has permission to create the event.
  • Ensure requests are idempotent using transaction IDs.
  • Protect against ToCToU errors with permissions.
  • Add tests.
    • Text message
    • Custom message type
    • Message for non-existent room
    • Message for room where the sender doesn't have permission

API: GET /sync

Spec

https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-sync

Parameters

  • since
  • full_state
  • filter
  • timeout
  • set_presence

State

  • next_batch
  • presence
    • events
  • rooms
    • join
      • unread_notifications
      • timeline
        • limited
        • prev_batch
        • events (basic)
      • state
        • events
      • account_data
        • events
      • ephemeral
        • events
    • leave
      • timeline
        • limited
        • prev_batch
        • events
      • state
        • events
    • invite
      • invite_state
        • events

Details

  • Support partial timeline.events, timeline.limited
  • No support for timeline.prev_batch
  • Support following in timeline.events (m.room.member, m.room.message, m.room.history_visibility)
  • Support timeline limiting by filter
  • Support partial since, full_state
  • Remove empty rooms rooms.join, rooms.leave, rooms.invite
  • Parse all parameters since, filter, full_state, set_presence, timeout
  • No support for parameter: set_presence, timeout
  • Basic invalidation for parameters
  • Basic macro for TryInto e.g. impl MessageEvent for Event
  • Support presence in sync with since
  • Support sync set_presence

Macaroon not 32 bytes

I wrote the following go code to generate a 32 byte crypographically secure random number and base64 encode it, but I continually recieve Failed to load configuration file: macaroon_secret_key must be 32 bytes.

Output examples:

  • vqjwJXXjPci9+6o6Le9BZQ576l5xo7C+MTdRCju9
  • 4B6W17W6l4eJT7TxHp7oVnG4r6Mjus7hDjATDSp2
  • bq30jK/m0EaLPJYlK6YWMr2wdZVGxu1uDPzCR1Gh
package main

import (
    "bytes"
    "crypto/rand"
    "encoding/base64"
    "fmt"
    "log"
)

func main() {
    b := make([]byte, 32)
    _, err := rand.Read(b)
    if err != nil {
        log.Fatal(err)
    }
    buf := bytes.Buffer{}
    base64.NewEncoder(base64.StdEncoding, &buf).Write(b)
    fmt.Println(string(buf.Bytes()))
}

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.