File tree Expand file tree Collapse file tree 5 files changed +39
-13
lines changed Expand file tree Collapse file tree 5 files changed +39
-13
lines changed Original file line number Diff line number Diff line change @@ -21,17 +21,23 @@ apt-get install -y libnetconf2-experimental python3-netconf2-experimental
2121SCRIPT
2222
2323$setup = <<SCRIPT
24- wget https://github.com/CESNET/Netopeer2GUI/releases/download/0.1 /ncgui.tgz
24+ wget https://github.com/CESNET/Netopeer2GUI/releases/download/0.2 /ncgui.tgz
2525tar -xzf ncgui.tgz
2626cp /home/vagrant/shared/ncgui.conf /etc/apache2/sites-available/
2727a2enmod rewrite
28+ a2enmod proxy_http
2829a2dissite 000-default.conf
2930a2ensite ncgui.conf
3031ln -s /home/vagrant/ncgui /var/www/html/ncgui
32+ mkdir /var/www/html/ncgui/data
3133cd /var/www/html/ncgui/backend
3234/home/vagrant/shared/setvenv.sh
3335cp /home/vagrant/shared/lgui-config.ini /var/www/html/ncgui/backend/config.ini
3436cp /home/vagrant/shared/netopeer-config.ini /var/www/html/ncgui/backend/liberouterapi/modules/netopeer/config.ini
37+ cp /home/vagrant/shared/run.sh /var/www/html/ncgui/backend/run.sh
38+ cp /home/vagrant/shared/ncgui.service /etc/systemd/system/ncgui.service
39+ systemctl enable ncgui.service
40+ service ncgui start
3541service apache2 restart
3642SCRIPT
3743
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ port = 27017
6060database = liberouter
6161
6262[sqlite]
63- file = ncgui-users.sq3
63+ file = /var/www/html/ncgui/data/ ncgui-users.sq3
6464
6565[ssl]
6666; key =
Original file line number Diff line number Diff line change 55 ErrorLog ${APACHE_LOG_DIR}/error.log
66 CustomLog ${APACHE_LOG_DIR}/access.log combined
77
8- WSGIDaemonProcess libapi threads=5 user=vagrant group=vagrant
9- WSGIScriptAlias "/libapi" "/var/www/html/ncgui/backend/wsgi.py"
10- WSGIPassAuthorization on
8+ RewriteEngine on
9+ RewriteRule ^/libapi(.*) http://[::1]:5555$1 [P]
10+
11+ RewriteCond %{QUERY_STRING} transport=polling [NC]
12+ RewriteRule /(.*) http://[::1]:5555/$1 [P]
13+
14+ RewriteCond %{HTTP:Upgrade} websocket [NC]
15+ RewriteRule /(.*) ws://[::1]:5555/$1 [P]
1116
1217 <directory "/var/www/html/ncgui">
1318 AllowOverride All
14- </directory>
19+ Options -Indexes
1520
16- <directory "/var/www/html/ncgui/backend">
17- WSGIProcessGroup libapi
18- WSGIApplicationGroup %{GLOBAL}
19- WSGIScriptReloading On
20-
21- AllowOverride All
22- Require all granted
21+ RewriteCond %{REQUEST_FILENAME} -f [OR]
22+ RewriteCond %{REQUEST_FILENAME} -l [OR]
23+ RewriteCond %{REQUEST_FILENAME} -d
24+ RewriteRule ^.*$ - [L]
25+ RewriteRule ^.* /index.html [L]
2326 </directory>
2427</VirtualHost>
Original file line number Diff line number Diff line change 1+ [Unit]
2+ Description =Netopeer2GUI backend
3+
4+ [Service]
5+ Type =oneshot
6+ ExecStart =/var/www/html/ncgui/backend/run.sh
7+ RemainAfterExit =true
8+ StandardOutput =syslog
9+ StandardError =syslog
10+
11+ [Install]
12+ WantedBy =multi-user.target
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ source /var/www/html/ncgui/backend/venv/bin/activate
3+ python3 /var/www/html/ncgui/backend/ &
4+ deactivate
5+
You can’t perform that action at this time.
0 commit comments