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
							
								
									1b5f20f633
								
							
						
					
					
						commit
						851c91e19d
					
				
					 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/ }
 | 
					    - { 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
 | 
					- name: Put put the python script that creates the server in place
 | 
				
			||||||
  copy:
 | 
					  template:
 | 
				
			||||||
    src: roles/captiveportal/files/capture-wsgi.py 
 | 
					    src: roles/captiveportal/templates/capture-wsgi.py 
 | 
				
			||||||
    mode: '0755' 
 | 
					    mode: '0755' 
 | 
				
			||||||
    dest: /opt/iiab/captiveportal/ 
 | 
					    dest: /opt/iiab/captiveportal/ 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -51,8 +51,8 @@ logger = logging.getLogger('/var/log/apache2/portal.log')
 | 
				
			||||||
handler = RotatingFileHandler("/var/log/apache2/portal.log", maxBytes=100000, backupCount=2)
 | 
					handler = RotatingFileHandler("/var/log/apache2/portal.log", maxBytes=100000, backupCount=2)
 | 
				
			||||||
logger.addHandler(handler)
 | 
					logger.addHandler(handler)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#PORT={{ captiveportal_port }}
 | 
					PORT={{ captiveportal_port }}
 | 
				
			||||||
PORT=9090
 | 
					#PORT=9090
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Define globals
 | 
					# Define globals
 | 
				
			||||||
| 
						 | 
					@ -394,7 +394,7 @@ def application (environ, start_response):
 | 
				
			||||||
      data = ['{}: {}\n'.format(key, value) for key, value in sorted(environ.items()) ]
 | 
					      data = ['{}: {}\n'.format(key, value) for key, value in sorted(environ.items()) ]
 | 
				
			||||||
      #logger.debug("need the correct ip:{}".format(data))
 | 
					      #logger.debug("need the correct ip:{}".format(data))
 | 
				
			||||||
      ip = environ['REMOTE_ADDR'].strip()
 | 
					      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)
 | 
					   mac = subprocess.check_output(cmd, shell=True)
 | 
				
			||||||
   data = []
 | 
					   data = []
 | 
				
			||||||
   data.append("host: {}\n".format(environ['HTTP_HOST']))
 | 
					   data.append("host: {}\n".format(environ['HTTP_HOST']))
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue