Free opensource chat that features video conference, p2p transferring files, screen sharing and more
2.1K
Pychat is an opensource absolutely free communcation tool targeted for a copmany use. It's created as alternative to Slack/Discord. See the table below to understand its key features.
| Pychat | Slack | Skype | Telegram | Viber | Discord | |
|---|---|---|---|---|---|---|
| Open Source | + | - | - | - | - | - |
| Free | + | +/- | +/- | + | +/- | +/- |
| Screen sharing | + | + | - | - | - | + |
| Stream drawing | + | - | - | - | - | - |
| Syntax highlight | + | - | - | - | - | + |
| Only company users | + | + | - | - | - | + |
| Audio/Video conference | + | + | + | + | - | + |
| Can run on your server | + | - | - | - | - | - |
| Audio/Video messages | + | - | - | + | + | - |
| P2P file sharing | + | - | - | - | - | - |
| P2P messaging | + | - | - | - | - | - |
| Message read status | + | - | + | + | + | - |
| Tagging user | + | + | - | + | + | + |
| Message threads | + | + | - | - | - | - |
| PWA (works w/o lan) | + | - | - | - | - | - |
| Desktop client | +/- | + | + | + | +/- | + |
| Mobile client | +/- | + | + | + | + | + |
| 3rd-party plugins | - | + | - | - | - | + |
I would personally use discord or slack as a company chat. They are built and maintained by thousands of people rather than a single person. BUT wait!!! There're some key factors of picking pychat over others:
Please don't use this build for production, as it uses debug ssl certificate, lacks a few features and all files are located inside of container, meaning you will lose all data on container destroy.
docker run -tp 443:443 deathangel908/pychat-test
Please run each step very carefully. Do not skip editing files, reading comments or any instructions. This may lead to bugs in the future.
server.key and certificate.crt. If you don't own a domain you can create self-signed certificates with command below, with self-signed certificate browser will warn users with broken ssl.openssl req -nodes -new -x509 -keyout server.key -out certificate.crt -days 3650
docker volume create pychat_data
containerid=`docker container create --name dummy -v pychat_data:/data hello-world`
docker cp settings.py dummy:/data/settings.py
docker cp production.json dummy:/data/production.json
docker cp turnserver.conf dummy:/data/turnserver.conf
docker cp certificate.crt dummy:/data/certificate.crt
docker cp server.key dummy:/data/server.key
docker rm dummy
If you need to edit files inside container you can use
docker run -i -t -v pychat_data:/tmp -it alpine /bin/sh
docker run -t -v pychat_data:/data -p 443:443 -p 3478:3478 deathangel908/pychat
If you don't or unable to run docker you can alway do the setup w/o it. You definitely spend more time, so I would recommend to use docker if possible. But if you're still sure, here's the setup for cent-os/archlinux based system:
/srv/http/pychat. If you want to close the project into a different directory, replace all absolute paths in config files. You can use download_content.sh rename_root_directory to do that.pacman -S postfix gcc jansson.alias yum="python2 $(which yum)" to /etc/bashrc if you use python3. And then install that packages yum install python34u, python34u-pip, redis, mysql-server, mysql-devel, postfix, mailxnginx_upload_module written in C) instead of python uploader (which is a lot slower) you should build nginx yourself. For archlinux setup requires pacman -S python-lxml gd make geoip. To build nginx with this module run from the root user: bash download_content.sh build_nginx 1.15.3 2.3.0. And create dir + user useradd nginx; install -d -m 0500 -o http -g http /var/cache/nginx/. If you don't, just install nginx with your package manager: e.g. pacman -S nginx or yum install nginx on centospychat.org, you want to replace all occurrences of pychat.org in rootfs directory for your domain. To simplify replacing use my script: ./download_content.sh rename_domain your.new.domain.com. Also check rootfs/etc/nginx/sites-enabled/pychat.conf if server_name section is correct after renaming.openssl req -nodes -new -x509 -keyout server.key -out certificate.crt -days 3650/etc/nginx/sites-enabled/pychat.conf and modify it by:server_name to one matching your domain/ip addressssl_certificate and ssl_certificate_key path to ones that you generatedupload_file module, remove locations api/upload_file and @upload_file, otherwise leave it as it is.sh download_content.sh copy_root_fs.mkdir backend/downloading_photos in the backend directory and give it access chmod 777 downloading_photos cDon't forget to change the owner of current (project) directory to http user: chown -R http:http. And reload systemd config systemctl daemon-reload. Also youinstall -d -m 0555 -o postfix -g postfix /etc/postfix/virtual; postmap /etc/postfix/virtual; newaliases; touch /etc/postfix/virtual-regexp; echo 'root postmaster' > /etc/aliasespackages=( mysqld redis tornado@8888 nginx postfix ) ; for package in "${packages[@]}" ; do systemctl enable $package; done;. Service mysqld could be named mysql on Ubuntu.packages=( redis-server nginx postfix mysqld tornado@8888) ; for package in "${packages[@]}" ; do service $package start; done;packages=( redis nginx postfix mysqld tornado) ; for package in "${packages[@]}" ; do systemctl start $package; done;chkconfig mysqld on; chkconfig on; chkconfig tornado on; chkconfig redis on; chkconfig postfix onpychat/backend/logs directory.sudo journalctl -u YOUR_SERVICE. Where YOUR_SERVICE could be: nginx, mysql, tornadohttp has access to you project directory, and all directories inside, especially to /photoscd frontend; nvm install; nvm use.yarn install --frozen-lockfilecp docker/pychat.org/production.json ./frontend/yarn run prod. This generates static files in frotnend/dist directory.Pychat uses websql and built the way so it renders everything possible w/o network. You have 3 options:
This is the simplest one. Just open settings page from you user and click "Add to home screen". Note that PWA is only available from chrome and chrome android. No support for IOS and other browsers. But PWA is the most stable from ones below.
Use nativifier to create a client (replace pychat.org for your server): npx run nativifier pychat.org
cd frontend; yarn run electronProd.You can use PWA as it's described in desktop app section which I recommend. Other way is cordova which is a lot harder. If you're not familiar with android SDK I would recommend doing the steps below from AndroidStudio:
"PUBLIC_PATH": "./", "BACKEND_ADDRESS": "pychat.org" build into dist, rm .gz. , copy to www. In index.html include <script src="cordova.js"></script>bash download_content.sh androidExample for mac:
~/Library/Android/sdk/tools/bin/sdkmanager --licensesbrew install gradlefrontend/platforms/android with androidStudioyarn run dev; bash download_content.sh androidDebug button should be available out of the box after openning a projectchrome://inspect/#devices in chromeThe flow is the following
This section depends on the OS you use. I tested full install on Windows/Ubuntu/CentOs/MacOS/Archlinux/Archlinux(rpi3 armv7). pychat.org currently runs on Archlinux Raspberry Pi 3.
PATH variable.pip to install them.PATH variable. Cygwin or git's will do find.(for example if you use only git PATH=C:\Program Files\Git\usr\bin;C:\Program Files\Git\bin).apt-get install python pip mysql-server libmysqlclient-dev (python should be 3.6-3.8) If pip is missing check python-pip. For old versions of Ubuntu you can use this ppa: sudo add-apt-repository ppa:deadsnakes/ppa; sudo apt-get update; sudo apt-get install python3.8 python3.8-dev python3.8-venv python3.8-apt; curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py; python3.8 get-pip.pyadd-apt-repository -y ppa:rwky/redis; apt-get install -y redis-serverpip install mysqlclient==1.3.13pacman -S unzip python python-pip redis yarn mariadb python-mysqlclient. nvm is located in aur so yay -S nvm (or use another aur package)mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql.brew install mysql redis python3brew services run mysql redispip install mysqlclientSince we're using self singed certificate your OS doesn't know about for development. We need to do some tricks for browser to make it work. If you have valid certificates for your domain you can skip this step.
frontend/certs directory. So you can skip this textcd frontend/certs
openssl genrsa -out private.key.pem 4096
openssl req -new -sha256 -out root.ca.pem -key private.key.pem -subj '/CN=localhost' -extensions EXT -config <( printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
openssl x509 -req -days 3650 -in root.ca.pem -signkey private.key.pem -out server.crt.pem -extfile ./v3.ext
Useful links:



--ignore-certificate-errors flag. E.g. on MacOS open -a Google\ Chrome --args --ignore-certificate-errors
Remember that Service Worker will work only if certificate is trusted. So flags like ignore-ceritifcate-errors won't work. But installing certifcate to root system will.excludeMAINfile to .gitignoreor create link to exclude. ln -rsf .excludeMAIN .git/info/excludebackend/chat/settings.py. Modify file according to the comments in it.cd backend). Create virtualEnv python3 -m venv --system-site-packages .venv. For ubuntu you can omit --system-site-packages . Activate it: source .venv/bin/activatepip install -r requirements.txt. (Remember you're still in backend dir)echo "create database pychat CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci; CREATE USER 'pychat'@'localhost' identified by 'pypass'; GRANT ALL ON pychat.* TO 'pychat'@'localhost';" | mysql -u root. You will need mysql running for that (e.g. systemctl start mysql on archlinux) If you also need remote access do the same with '192.168.1.0/255.255.255.0';bash ../download_content.sh create_django_tables. (Remember you're still in backend dir)Change to frontend directory cd frontend I would recommend to use node version specified in nvm, so nvm install; nvm use.
To get started install dependencies first: yarn install --frozen-lock # or use npm if you're old and cranky
Take a look at copy development.json. The description is at Frontend config
Webpack-dev-server is used for development purposes with hot reloading, every time you save the file it will automatically apply. This doesn't affect node running files, only watching files. So files like builder.js or development.json aren't affected. To run dev-server use yarn run devProxy. Backend should be running during that. Otherwise use yarn run dev. You can navigate to http://localhost:8080.
To build android use yarn run android -- 192.168.1.55 where 55 is your bridge ip address
To run electron use yarn run electronDev. This will start electron dev. and generate /tmp/electron.html and /tmp/electron.js
backend as root directory for pycharm.backendSettings: to chat/settings.pySettings -> Project backend -> Project Interpreter -> Cogs in right top -> 'Add' -> Virtual Environment -> Existing environment -> Interpereter = pychatdir/.venv/bin/python. Click ok. In previous menu on top 'Project interpreter` select the interpriter you just added.Settings -> Project backend -> Project structure.ideatemplates directory as Template FolderRun -> Edit configuration -> Django server -> Checkbox Custom run command start_tornado. Remove port value.cd frotnendCurrent linting supports:
<template>
<div>#[[$END$]]#</div>
</template>
<script lang="ts">
import {State} from '@/utils/store';
import {Component, Prop, Vue, Watch, Ref} from 'vue-property-decorator';
@Component
export default class ${COMPONENT_NAME} extends Vue {
}
</script>
<style lang
Content type
Image
Digest
sha256:0149f37e3…
Size
946.9 MB
Last updated
7 months ago
docker pull deathangel908/pychat