ajoute DBG_INTRANET
This commit is contained in:
parent
ebeab8a0a0
commit
52c3795255
4 changed files with 12 additions and 16 deletions
|
@ -168,12 +168,9 @@ def generate(mail, params, lang=default_language, lang_fallback=default_language
|
|||
def validation_url(view_name, data='', debug=False):
|
||||
"""Enregistre une nouvelle url pour le module "validation" de l'intranet."""
|
||||
import requests
|
||||
if debug:
|
||||
CA = False
|
||||
ROOT = 'https://intranet-dev.crans.org'
|
||||
else:
|
||||
HOST = os.getenv('DBG_INTRANET', 'intranet2.crans.org')
|
||||
CA = '/etc/ssl/certs/cacert.org.pem'
|
||||
ROOT = 'https://intranet2.crans.org'
|
||||
ROOT = 'https://%s' % HOST
|
||||
url = ROOT + '/validation/register/%s/' % view_name
|
||||
payload = {
|
||||
'data': json.dumps(data),
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
Copyright (c) 2006, 2007, 2008, 2009 by Cr@ns (http://www.crans.org)
|
||||
"""
|
||||
import sys
|
||||
import os
|
||||
import requests
|
||||
if '/usr/scripts' not in sys.path:
|
||||
sys.path.append("/usr/scripts")
|
||||
|
@ -37,20 +38,14 @@ digicode_pass = secrets_new.get("digicode_pass")
|
|||
# #############################################################
|
||||
# CONSTANTES
|
||||
# #############################################################
|
||||
CODES_SERVERS = ["zamok", "asterisk", "vo"]
|
||||
CODES_DIR = "/usr/scripts/var/digicode/"
|
||||
CREATION_LINK = "https://intranet2.crans.org/digicode/create/"
|
||||
LIST_LINK = "https://intranet2.crans.org/digicode/list/"
|
||||
INTRANET = os.getenv('DBG_INTRANET', 'intranet2.crans.org')
|
||||
CREATION_LINK = "https://%s/digicode/create/" % INTRANET
|
||||
LIST_LINK = "https://%s/digicode/list/" % INTRANET
|
||||
CERTIFICATE = "/etc/ssl/certs/cacert.org.pem"
|
||||
|
||||
# #############################################################
|
||||
# FONCTIONS
|
||||
# #############################################################
|
||||
# test pour voir si on est bien sur la bonne machine
|
||||
import socket
|
||||
if socket.gethostname() not in CODES_SERVERS:
|
||||
raise EnvironmentError("La manipulation des codes pour le digicode n'est possible que sur %s" %
|
||||
', '.join(CODES_SERVERS))
|
||||
|
||||
class CommunicationError(Exception):
|
||||
pass
|
||||
|
|
|
@ -12,7 +12,8 @@ digicode_pass = gestion.secrets_new.get('digicode_pass')
|
|||
CODES = "/var/impression/codes"
|
||||
PIDFILE = "/var/run/digicode.pid"
|
||||
HOST, PORT = "zamok.adm.crans.org", 1200
|
||||
DIGICODE_LINK = "https://intranet2.crans.org/digicode/delete/"
|
||||
INTRANET = os.getenv('DBG_INTRANET', 'intranet2.crans.org')
|
||||
DIGICODE_LINK = "https://%s/digicode/delete/" % INTRANET
|
||||
CERTIFICATE = "/etc/ssl/certs/cacert.org.pem"
|
||||
|
||||
def log(message = "", logfile = "/var/log/crans/digicode.log"):
|
||||
|
|
|
@ -52,3 +52,6 @@ export DBG_SECRETS=/etc/crans/dbg_secrets/`whoami`/
|
|||
|
||||
# Pour la wifimap
|
||||
export DBG_WIFIMAP_DB=$CPATH/var/wifi_xml
|
||||
|
||||
# Addresse vers l'intranet (version 2)
|
||||
export DBG_INTRANET=intranet-dev.crans.org
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue