Parcourir la source

Improve script template

Baptiste Jonglez il y a 10 ans
Parent
commit
8d7430b5c3
3 fichiers modifiés avec 6 ajouts et 3 suppressions
  1. 2 0
      config.py
  2. 2 1
      peerfinder.py
  3. 2 2
      templates/run.sh

+ 2 - 0
config.py

@@ -1,3 +1,5 @@
 DEBUG = True
 
 SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/test.db'
+
+PEERFINDER_DN42 = "http://172.23.184.112:8888"

+ 2 - 1
peerfinder.py

@@ -172,7 +172,8 @@ def create_participant():
         db.session.add(participant)
         db.session.commit()
         return render_template('participant.html', participant=participant,
-                               uuid=participant.uuid)
+                               uuid=participant.uuid,
+                               peerfinder=app.config["PEERFINDER_DN42"])
     else:
         return "Invalid arguments"
 

+ 2 - 2
templates/run.sh

@@ -1,8 +1,8 @@
 #!/bin/bash
 
 # Put your UUID here, and keep it secret!
-UUID="{{ uuid }}"
-PEERFINDER="http://172.23.184.112:8888"
+UUID="{{ uuid|default('00000000-0000-0000-0000-000000000000') }}"
+PEERFINDER="{{ peerfinder }}"
 NB_PINGS=5
 SLEEP=10