Browse Source

Correct minor bugs in deployment

Léo Viallon-Galinier 11 months ago
parent
commit
48e1e9c246
5 changed files with 6 additions and 3 deletions
  1. 1 1
      app.py
  2. 1 1
      belote.py
  3. 0 0
      settings.example.cfg
  4. 2 0
      settings.example.py
  5. 2 1
      templates/game_join.html

+ 1 - 1
app.py

@@ -7,5 +7,5 @@ sys.path.insert(0,here)
7 7
 
8 8
 import settings
9 9
 from belote import app, socketio
10
-socketio.run(app, debug=False, host=settings.PUBLIC_URL, port=8080)
10
+socketio.run(app, debug=False, host=settings.LISTEN_URL, port=8080)
11 11
 

+ 1 - 1
belote.py

@@ -417,5 +417,5 @@ def delete_game(user=None, game=None):
417 417
 
418 418
 
419 419
 if __name__ == '__main__':
420
-    socketio.run(app, debug=True, host='0.0.0.0', port=8080 )
420
+    socketio.run(app, debug=True, host='127.0.0.1', port=8080 )
421 421
 

settings.exemple.cfg → settings.example.cfg


+ 2 - 0
settings.example.py

@@ -1,3 +1,5 @@
1 1
 # The public url for preventing 
2 2
 # Cross_origin bugs
3 3
 PUBLIC_URL='127.0.0.1'
4
+# Listen url
5
+LISTEN_URL = '127.0.0.1'

+ 2 - 1
templates/game_join.html

@@ -118,11 +118,12 @@ socket.on('leave', function(data){
118 118
         $('#gostart').hide();
119 119
         $('#add_player').show();
120 120
     {% else %}
121
-    if (username == {{ user.login }}){
121
+    if (username == '{{ user.login }}'){
122 122
         console.log("Vous avez été banni");
123 123
         $('#listpart').prepend(`
124 124
           <div class="alert" id="alert0">
125 125
           <button type="button" class="close" onclick="javascript:hidealert('alert0')">&times;</button>
126
+          Vous avez été banni !
126 127
         </div>
127 128
             `);
128 129
     }