mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	need capture-wsgi as template to soft code port
This commit is contained in:
		
							parent
							
								
									c850b6d95a
								
							
						
					
					
						commit
						e848e0a559
					
				
					 2 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -23,8 +23,8 @@
 | 
			
		|||
    - { src: roles/captiveportal/templates/iiab-divert-to-nginx, mode: '0755', dest: /usr/sbin/ }
 | 
			
		||||
 | 
			
		||||
- name: Put put the python script that creates the server in place
 | 
			
		||||
  copy:
 | 
			
		||||
    src: roles/captiveportal/files/capture-wsgi.py 
 | 
			
		||||
  template:
 | 
			
		||||
    src: roles/captiveportal/templates/capture-wsgi.py 
 | 
			
		||||
    mode: '0755' 
 | 
			
		||||
    dest: /opt/iiab/captiveportal/ 
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -50,8 +50,8 @@ logger = logging.getLogger('/var/log/apache2/portal.log')
 | 
			
		|||
handler = RotatingFileHandler("/var/log/apache2/portal.log", maxBytes=100000, backupCount=2)
 | 
			
		||||
logger.addHandler(handler)
 | 
			
		||||
 | 
			
		||||
#PORT={{ captiveportal_port }}
 | 
			
		||||
PORT=9090
 | 
			
		||||
PORT={{ captiveportal_port }}
 | 
			
		||||
#PORT=9090
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Define globals
 | 
			
		||||
| 
						 | 
				
			
			@ -396,7 +396,7 @@ def application (environ, start_response):
 | 
			
		|||
      data = ['{}: {}\n'.format(key, value) for key, value in sorted(environ.items()) ]
 | 
			
		||||
      #logger.debug("need the correct ip:{}".format(data))
 | 
			
		||||
      ip = environ['REMOTE_ADDR'].strip()
 | 
			
		||||
   cmd="arp -an {}|gawk \'{{print $4}}\'".format(ip)
 | 
			
		||||
   cmd="arp -an %s|gawk \'{print $4}\'"%(ip)
 | 
			
		||||
   mac = subprocess.check_output(cmd, shell=True)
 | 
			
		||||
   data = []
 | 
			
		||||
   data.append("host: {}\n".format(environ['HTTP_HOST']))
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue