Giter Site home page Giter Site logo

mondediefr / mondedie-chat Goto Github PK

View Code? Open in Web Editor NEW
41.0 8.0 10.0 693 KB

Node.js chat application using Express, Socket.io, Redis and Mithril

Home Page: https://chat.mondedie.fr

License: Apache License 2.0

JavaScript 73.91% CSS 16.16% HTML 9.93%
chat mondedie flarum mondediefr

mondedie-chat's People

Contributors

hardware avatar hydrog3n avatar magicalex avatar xataz 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mondedie-chat's Issues

Changer une phrase

Changer la phrase : Je n'utilise pas le mode AFK vu je peux être à plusieurs endroits en même temps

par : Je n'utilise pas le mode AFK puisque je suis doué d'ubiquité.

yarn

Mouais, ca tape dans les serveurs de fb...

Cas ou sur npm y'a aussi un lock avec la commande npm shrinkwrap.

Rendre les options persistante.

A chaque fois que l'on recharge la page les options sont perdu.
Il faudrait ajouter des cookies pour conserver les réglages.

[API] Séparation backend/frontend

Il serait bien de bien séparer le backend du front end afin de pouvoir faire différent clients et d'utiliser une API. Quand pensez vous ?

ErroError: ENOENT: no such

Hello,

Après l'installation, j'ai cette erreur sur la page web : une idée ?

Error: ENOENT: no such file or directory, open '/home/sites/chat.oreox.fr/mondedie-chat/views/includes/build/css.pug' at /home/sites/chat.oreox.fr/mondedie-chat/views/layout.pug line 13 at Object.fs.openSync (fs.js:667:18) at Object.fs.readFileSync (fs.js:572:33) at Function.read (/home/sites/chat.oreox.fr/mondedie-chat/node_modules/pug-load/index.js:69:13) at Object.read (/home/sites/chat.oreox.fr/mondedie-chat/node_modules/pug/lib/index.js:141:25) at /home/sites/chat.oreox.fr/mondedie-chat/node_modules/pug-load/index.js:24:25 at walkAST (/home/sites/chat.oreox.fr/mondedie-chat/node_modules/pug-walk/index.js:21:18) at /home/sites/chat.oreox.fr/mondedie-chat/node_modules/pug-walk/index.js:98:20 at Array.reduce (<anonymous>) at walkAndMergeNodes (/home/sites/chat.oreox.fr/mondedie-chat/node_modules/pug-walk/index.js:97:18) at walkAST (/home/sites/chat.oreox.fr/mondedie-chat/node_modules/pug-walk/index.js:35:19) at walkAST (/home/sites/chat.oreox.fr/mondedie-chat/node_modules/pug-walk/index.js:46:21) at /home/sites/chat.oreox.fr/mondedie-chat/node_modules/pug-walk/index.js:98:20 at Array.reduce (<anonymous>) at walkAndMergeNodes (/home/sites/chat.oreox.fr/mondedie-chat/node_modules/pug-walk/index.js:97:18) at walkAST (/home/sites/chat.oreox.fr/mondedie-chat/node_modules/pug-walk/index.js:35:19) at walkAST (/home/sites/chat.oreox.fr/mondedie-chat/node_modules/pug-walk/index.js:46:21) at /home/sites/chat.oreox.fr/mondedie-chat/node_modules/pug-walk/index.js:98:20 at Array.reduce (<anonymous>) at walkAndMergeNodes (/home/sites/chat.oreox.fr/mondedie-chat/node_modules/pug-walk/index.js:97:18) at walkAST (/home/sites/chat.oreox.fr/mondedie-chat/node_modules/pug-walk/index.js:35:19) at load (/home/sites/chat.oreox.fr/mondedie-chat/node_modules/pug-load/index.js:13:10) at Function.loadString [as string] (/home/sites/chat.oreox.fr/mondedie-chat/node_modules/pug-load/index.js:46:10)

http://s.en-prod.org/18062018-00:09:57.png

Dédoublement de la liste des utilisateurs connectés

Parfois la liste des utilisateurs connectés apparaît en double (voir plus). Je pense que ça vient du fait que le listener sur l'événement user_connected est enregistré une deuxième fois pour une raison que je ne maîtrise pas (problème réseau, déco/reco du chat suite à un push...etc).

socket.on('user_connected', function(user) {
    vm.list.push(new users.User(user));
    m.redraw();
});

Je viens d'en avoir un à l'instant :

screen
screen

2015-12-06T09:42:39 heroku router - - at=error code=H13 desc="Connection closed without response" method=GET path="/socket.io/?EIO=3&transport=websocket&sid=3bKAS4OKWTP1aYl5AABP" host=chat.mondedie.fr wd="88.xxx.xxx.xxx" dyno=web.1 connect=0ms service=1ms status=503 bytes=0

Moimeme semble avoir eu un petit soucis réseau, le socket semble avoir été ouvert 4 fois à la suite, peut-être que ça peut expliquer que l'event soit registered 4 fois aussi, je sais pas quoi en déduire. A méditer.

Rendre l'interface responsive

Voir :

http://v4-alpha.getbootstrap.com/layout/overview/
http://v4-alpha.getbootstrap.com/layout/responsive-utilities/
https://github.com/twbs/bootstrap/blob/v4-dev/scss/_variables.scss#L89-L100

  • Bug du textarea problème avec le height sur le breakpoint xs et sm.
  • logo mondedie dépasse sur login et chatroom (en breakpoint sm).
  • Trouver une solution pour que les users puissent se déconnecter sur les devices phones. (slideout.js)
  • Ajouter titre (hover) pour afficher les pseudos des images.

sh: 1: node: not found,npm WARN This failure might be due to the use of legacy binary "node"

Je n'arrive pas a installer le chat en suivant la procédure d'install manuelle décrite sur le github :

user@XXXX:~/chat/mondedie-chat# npm install -g bower gulp pm2
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN optional dep failed, continuing [email protected]
/usr/local/bin/gulp -> /usr/local/lib/node_modules/gulp/bin/gulp.js
npm WARN engine [email protected]: wanted: {"node":">=0.12"} (current: {"node":"0.10.25","npm":"1.4.21"})
/usr/local/bin/pm2 -> /usr/local/lib/node_modules/pm2/bin/pm2
/usr/local/bin/pm2-dev -> /usr/local/lib/node_modules/pm2/bin/pm2-dev
/usr/local/bin/bower -> /usr/local/lib/node_modules/bower/bin/bower
[email protected] /usr/local/lib/node_modules/gulp
âââ [email protected]
âââ [email protected]
âââ [email protected]
âââ [email protected]
âââ [email protected] ([email protected])
âââ [email protected]
âââ [email protected] ([email protected])
âââ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
âââ [email protected]
âââ [email protected] ([email protected], [email protected], [email protected])
âââ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
âââ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
âââ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

[email protected] /usr/local/lib/node_modules/pm2
âââ [email protected]
âââ [email protected]
âââ [email protected]
âââ [email protected]
âââ [email protected] ([email protected])
âââ [email protected] ([email protected])
âââ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
âââ [email protected]
âââ [email protected] ([email protected])
âââ [email protected] ([email protected], [email protected])
âââ [email protected] ([email protected], [email protected], [email protected], [email protected])
âââ [email protected] ([email protected])
âââ [email protected] ([email protected], [email protected])
âââ [email protected] ([email protected])
âââ [email protected] ([email protected])
âââ [email protected] ([email protected])
âââ [email protected] ([email protected])
âââ [email protected]
âââ [email protected]
âââ [email protected] ([email protected])
âââ [email protected] ([email protected], [email protected])
âââ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
âââ [email protected] ([email protected])
âââ [email protected]

[email protected] /usr/local/lib/node_modules/bower
user@XXXX:~/chat/mondedie-chat# npm install
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: Please use gulp-clean-css
npm WARN engine [email protected]: wanted: {"node":">=0.12.0"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=4"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.12.0"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.12.0"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.12"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN engine [email protected]: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.12"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN engine [email protected]: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.12"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.12"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.12"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.12"} (current: {"node":"0.10.25","npm":"1.4.21"})
npm WARN deprecated [email protected]: this package has been reintegrated into npm and is now out of date with respect to npm
\

[email protected] postinstall /root/chat/mondedie-chat/node_modules/gulp-sass/node_modules/node-sass/node_modules/cross-spawn/node_modules/spawn-sync
node postinstall

sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/root/chat/mondedie-chat/node_modules/gulp-sass/node_modules/node-sass/node_modules/sass-graph/node_modules/lodash'
npm ERR! error rolling back [email protected] { [Error: ENOTEMPTY, rmdir '/root/chat/mondedie-chat/node_modules/gulp-sass/node_modules/node-sass/node_modules/sass-graph/node_modules/lodash']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: '/root/chat/mondedie-chat/node_modules/gulp-sass/node_modules/node-sass/node_modules/sass-graph/node_modules/lodash' }
npm ERR! tar.unpack untar error /root/.npm/lodash/4.11.1/package.tgz
npm ERR! [email protected] postinstall: node postinstall
npm ERR! Exit status 127
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the spawn-sync package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node postinstall
npm ERR! You can get their info via:
npm ERR! npm owner ls spawn-sync
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 4.4.6-docker-6
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /root/chat/mondedie-chat
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR! tar.unpack untar error /root/.npm/node-gyp/3.3.1/package.tgz
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/chat/mondedie-chat/npm-debug.log
npm ERR! not ok code 0

Déconnexion préventive

Implémenter une déconnexion préventive du socket dans les cas suivants :

1 - L'utilisateur se connecte depuis un autre PC/mobile
2 - L'utilisateur n'est plus dans la liste des membres connectés
3 - L'utilisateur ne possède pas de profil dans Redis

Pour les points 2 et 3, la vérification peut se faire pendant le Heartbeat toutes les 50 secondes.

Pour les modérateurs :

  • Permettre de déconnecter tous les sockets actifs sur le chat (pratique avant un flush des sessions Redis).

Vagrant : Erreur 500 secret option required for sessions

Depuis ce commit df5d6cf vagrant ne fonctionne plus

Error: secret option required for sessions
    at session (/home/vagrant/mondedie-chat/node_modules/express-session/index.js:167:12)
    at Layer.handle [as handle_request] (/home/vagrant/mondedie-chat/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/vagrant/mondedie-chat/node_modules/express/lib/router/index.js:312:13)
    at /home/vagrant/mondedie-chat/node_modules/express/lib/router/index.js:280:7
    at Function.process_params (/home/vagrant/mondedie-chat/node_modules/express/lib/router/index.js:330:12)
    at next (/home/vagrant/mondedie-chat/node_modules/express/lib/router/index.js:271:10)
    at cookieParser (/home/vagrant/mondedie-chat/node_modules/cookie-parser/index.js:54:14)
    at Layer.handle [as handle_request] (/home/vagrant/mondedie-chat/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/vagrant/mondedie-chat/node_modules/express/lib/router/index.js:312:13)
    at /home/vagrant/mondedie-chat/node_modules/express/lib/router/index.js:280:7
    at Function.process_params (/home/vagrant/mondedie-chat/node_modules/express/lib/router/index.js:330:12)
    at next (/home/vagrant/mondedie-chat/node_modules/express/lib/router/index.js:271:10)
    at /home/vagrant/mondedie-chat/node_modules/express-validator/lib/express_validator.js:228:5
    at Layer.handle [as handle_request] (/home/vagrant/mondedie-chat/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/vagrant/mondedie-chat/node_modules/express/lib/router/index.js:312:13)
    at /home/vagrant/mondedie-chat/node_modules/express/lib/router/index.js:280:7
    at Function.process_params (/home/vagrant/mondedie-chat/node_modules/express/lib/router/index.js:330:12)
    at next (/home/vagrant/mondedie-chat/node_modules/express/lib/router/index.js:271:10)
    at urlencodedParser (/home/vagrant/mondedie-chat/node_modules/body-parser/lib/types/urlencoded.js:88:40)
    at Layer.handle [as handle_request] (/home/vagrant/mondedie-chat/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/vagrant/mondedie-chat/node_modules/express/lib/router/index.js:312:13)
    at /home/vagrant/mondedie-chat/node_modules/express/lib/router/index.js:280:7

Fichier .env non trouvé par le slug heroku

17 Nov 2015 07:51:20.534 app web.1 - - { [Error: ENOENT, no such file or directory '.env'] errno: -2, code: 'ENOENT', path: '.env', syscall: 'open' }

Le fichier .env est inutile sur heroku, il n'est utilisé qu'en environnement de développement par foreman ou vagrant, il faudra penser à spécifier le module dotenv en dépendance de dev et de mettre une condition avant le require dans app.js

Help with Install

I followed the build instructions.

location:
/var/www/flarum/chat

I created a .env file in /var/www/flarum/chat
I pasted the ENV as instructed on README
I create my own cookie and session unique password

When I try to login I get:

Erreur 500
secret option required for sessions

Error: secret option required for sessions
    at session (/var/www/keysndaggers/chat/node_modules/express-session/index.js:199:12)
    at Layer.handle [as handle_request] (/var/www/keysndaggers/chat/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/keysndaggers/chat/node_modules/express/lib/router/index.js:312:13)
    at /var/www/keysndaggers/chat/node_modules/express/lib/router/index.js:280:7
    at Function.process_params (/var/www/keysndaggers/chat/node_modules/express/lib/router/index.js:330:12)
    at next (/var/www/keysndaggers/chat/node_modules/express/lib/router/index.js:271:10)
    at cookieParser (/var/www/keysndaggers/chat/node_modules/cookie-parser/index.js:70:5)
    at Layer.handle [as handle_request] (/var/www/keysndaggers/chat/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/keysndaggers/chat/node_modules/express/lib/router/index.js:312:13)
    at /var/www/keysndaggers/chat/node_modules/express/lib/router/index.js:280:7
    at Function.process_params (/var/www/keysndaggers/chat/node_modules/express/lib/router/index.js:330:12)
    at next (/var/www/keysndaggers/chat/node_modules/express/lib/router/index.js:271:10)
    at /var/www/keysndaggers/chat/node_modules/express-validator/lib/express_validator.js:351:5
    at Layer.handle [as handle_request] (/var/www/keysndaggers/chat/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/keysndaggers/chat/node_modules/express/lib/router/index.js:312:13)
    at /var/www/keysndaggers/chat/node_modules/express/lib/router/index.js:280:7

This is my Nginx config:

server {
    listen 443;

    server_name chat.keys-daggers.org;

include snippets/snakeoil.conf;
    include snippets/ssl-params.conf;

    ssl on;
    add_header Strict-Transport-Security max-age=500;

    location / {
        proxy_pass http://127.0.0.1:5000; #private ip
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }

location ~* \.(eot|ttf|woff|woff2)$ {
    add_header Access-Control-Allow-Origin *;
}


    gzip on;
    gzip_http_version 1.1;
    gzip_vary on;
    gzip_comp_level 6;
    gzip_proxied any;
    gzip_types application/atom+xml
               application/javascript
               application/json
               application/vnd.ms-fontobject
               application/x-font-ttf
               application/x-web-app-manifest+json
               application/xhtml+xml
               application/xml
               font/opentype
               image/svg+xml
               image/x-icon
               text/css
               text/plain
               text/xml;
    gzip_buffers 16 8k;
    gzip_disable "MSIE [1-6]\.(?!.*SV1)";
}

This is my Nginx error:

 [error] 3927#3927: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.22.2, server: chat.keys-daggers.org, request: "GET /var/www/keysndaggers/chat/node_modules/express-session/index.js HTTP/2.0", upstream: "http://127.0.0.1:5000/var/www/keysndaggers/chat/node_modules/express-session/index.js", host: "chat.keys-daggers.org"

May you please help?

Piwik n'est pas activé

J'ai bien ajouté et configuré les variables PIWIK_ID et PIWIK_URL mais aucun tracking n'est activé. Je constate la même chose sur chat.mondedie.fr, mais je ne sais pas si c'est volontaire.

Command /me + Auto complétion

Note: Faire en sorte de cacher les commandes pour les utilisateurs

Liste des commandes à rajouter:

  • /kick @user seulement modérateur
  • /unban @user seulement modérateur
  • /ban list seulement modérateur
  • /unlock @user seulement modérateur
  • /me à tous

Problème en cas de loadbalancing

Certaine personne disparaisse de la liste des utilisateurs quand ils ont une connexion avec un loadbalancing. Il y a une solution pour corriger ça de notre coté ?

Ajouter google analytic

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})
(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'XXXX', 'YYYY');
ga('send', 'pageview');

il faudrait ajouter XXXX et YYYY dans le fichier env

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.