Skip to content

fedigram/fedigram-server

 
 

Repository files navigation

License

fedigram-server

fedigram-server is a fork of nebula-chat/chatengine (later renamed to teamgram)

fedigram-server's main repo: https://github.com/fedigram/fedigram-server

fedigram-server's project status: Unknown; working on this. Currently making the code build and run from https://github.com/fedigram/fedigram-server repo.

fedigram-server's chats:

  • irc.ilita.i2p #fedigram-dev (see also: https://i2pd.website/ https://geti2p.net/ )
  • irc.libera.chat #fedigram-dev
  • не хотите телегу с опенсорсным сервером поделать федеративную как федиверс? #fedigram-dev

Quick start with Docker

  1. Install docker and docker-compose
  2. Edit docker-compose.yml: replace CHATENGINE_HOST to "127.0.0.1".
  3. ? Edit scripts/config/config.json and specify /data2/dc_options{ip_address,port}. ?
  4. Run make -j$(nproc) command in your shell at the git repo folder.
  5. Now, fedigram server is listening on TCP port 12345.

Websites (aren't currently working)

Build

  • Get the source code 

    mkdir -pv $GOPATH/src/github.com/fedigram
    cd $GOPATH/src/github.com/fedigram
    #then, if you have ssh key on github
    eval `ssh-agent`
    ssh-add your-github-ssh-key
    git clone git@github.com:fedigram/fedigram-server.git
    #or, if you don't have ssh key on github
    git clone https://github.com/fedigram/fedigram-server.git
  • Build

    source $GOPATH/src/github.com/fedigram/fedigram-server/scripts/config/build.sh
  • Init

    • OS tested: Ubuntu 20.04.6 Linux 5.15.0-92-generic #102~20.04.1-Ubuntu SMP Mon Jan 15 13:09:14 UTC 2024 x86_64
    • mysql tested: mysql-server-8.0 (8.0.36-0ubuntu0.20.04.1)
    • install mysql somewhere
    • then,
    cd $GOPATH/src/github.com/fedigram/fedigram-server/scripts/
    mysql -u root -p
    # at mysql: 
        CREATE DATABASE PluralityServer;
        use PluralityServer;
        source PluralityServer.sql
        source merge_20181129_201906.sql
        exit;
  • Configure:

    • Run
       cd $GOPATH/src/github.com/fedigram/fedigram-server/scripts/config && source ./createconfig.sh
    • Edit *.toml *.json files there:
      • auth_session service: auth_session.toml // includes redis & mysql parameters
      • document service: document.toml // includes redis & mysql parameters
      • sync service: sync.toml
      • upload service: upload.toml
      • biz_server service:
        • config.json lang_pack_en.toml lang_pack_cn.toml
        • biz_server.toml // includes redis & mysql parameters
      • auth_key service: server_pkcs1.key auth_key.toml
      • session service: session.toml
      • frontend service: frontend.toml
    • When completed, run
       source ./installconfig.sh
  • Run

    cd $GOPATH/src/github.com/fedigram/fedigram-server/service/auth_session
    ./auth_session
    
    cd $GOPATH/src/github.com/fedigram/fedigram-server/service/document
    ./document
    
    cd $GOPATH/src/github.com/fedigram/fedigram-server/messenger/sync
    ./sync
    
    cd $GOPATH/src/github.com/fedigram/fedigram-server/messenger/upload
    ./upload
    
    cd $GOPATH/src/github.com/fedigram/fedigram-server/messenger/biz_server
    ./biz_server
    
    cd $GOPATH/src/github.com/fedigram/fedigram-server/access/auth_key
    ./auth_key
    
    cd $GOPATH/src/github.com/fedigram/fedigram-server/access/session
    ./session
    
    cd $GOPATH/src/github.com/fedigram/fedigram-server/access/frontend
    ./frontend

OBSOLETE/OLD INFO BELOW

Introduction

An open source mtproto server implemented in go language with compatible old (layer 86) Telegram clients.

Quick start

  1. Run sudo apt install docker docker-compose in your shell;
  2. git clone --recursive git@github.com:fedigram/fedigram-server.git && cd fedigram-server
  3. Edit ./docker-compose.yml: replace timezone with your own. There were reports that having a wrong timezone makes chatengine fail.
  4. Run sudo make -j$(nproc) command in your shell;
  5. Now, chatengine is running on your host's TCP port 12345;
  6. Use fedigram clients to connect to fedigram server;
  7. Enjoy!

The rest of this README is for developers

Architecture

Architecture

Documents

Diffie–Hellman key exchange

Creating an Authorization Key

Mobile Protocol: Detailed Description (v.1.0, DEPRECATED)

Encrypted CDNs for Speed and Security Translate By @steedfly

Windows-Build By @robinfoxnan

Manual Build and Install

Note: You will probably need a VM for this as the code often uses root at MySQL and root for filesystem write access.

git clone https://github.com/fedigram/fedigram-server
cd fedigram-server
# replace 192.168.1.100 to you own host IP.
# sed -i "" 's/CHATENGINE_HOST=127.0.0.1/CHATENGINE_HOST=192.168.1.100/g' docker-compose.yml # macOS
sed -i 's/CHATENGINE_HOST=127.0.0.1/CHATENGINE_HOST=192.168.1.100/g' docker-compose.yml # linux
make -j$(nproc)

Dependencies

  • redis
  • mysql
  • etcd

More

Build document

Build script

Prerequisite script

SQL

You need all scripts/*.sql.

Compatible clients

Important: default signIn and signOut verify code is 12345

Android client for NebulaChat

FOSS client for NebulaChat

iOS client for NebulaChat

tdesktop for NebulaChat

Original Nebula Chat author's notes

Chatengine is not a commercial project, only supports mtproto API layer 86, and only supports private chats and small groups.

If need enterprise edition, please PM the author or download clients from nebula.chat (default verify code is: 12345).

Packages

No packages published

Languages

  • Go 98.7%
  • Smarty 0.8%
  • Shell 0.3%
  • C++ 0.1%
  • Python 0.1%
  • Dockerfile 0.0%