Update to current Perl
This commit is contained in:
parent
ebd46d86d4
commit
3cc88f8150
57 changed files with 11638 additions and 665 deletions
41
distribution/docker-compose.yml
Normal file
41
distribution/docker-compose.yml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# This file is ideal for development and testing.
|
||||
# --- DO NOT USE FOR PRODUCTION ---
|
||||
# however, you can use it as a guide to create a proper production environment.
|
||||
services:
|
||||
db:
|
||||
image: mariadb
|
||||
container_name: db
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=123qwe
|
||||
- MYSQL_USER=webgui
|
||||
- MYSQL_PASSWORD=123qwe
|
||||
- MYSQL_DATABASE=www_example_com
|
||||
volumes:
|
||||
- ./share/create.sql:/docker-entrypoint-initdb.d/1.sql
|
||||
ports:
|
||||
- 3306
|
||||
|
||||
webgui:
|
||||
image: webgui
|
||||
container_name: webgui
|
||||
depends_on:
|
||||
- db
|
||||
volumes:
|
||||
- ../.:/data/WebGUI
|
||||
expose:
|
||||
- "80"
|
||||
|
||||
nginx-proxy:
|
||||
image: nginx:latest
|
||||
container_name: nginx_proxy
|
||||
depends_on:
|
||||
- webgui
|
||||
volumes:
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
ports:
|
||||
- "80:80"
|
||||
#TODO: add ssl later
|
||||
#- "443:443"
|
||||
# TODO: serve staatic files directly from nginx
|
||||
#- ./www:/var/www/html:ro
|
||||
|
||||
20
distribution/nginx/nginx.conf
Normal file
20
distribution/nginx/nginx.conf
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
worker_processes auto;
|
||||
events {}
|
||||
|
||||
http {
|
||||
upstream backend {
|
||||
server webgui:80;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
location / {
|
||||
proxy_pass http://backend;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
||||
}
|
||||
2543
distribution/share/create.sql
Normal file
2543
distribution/share/create.sql
Normal file
File diff suppressed because one or more lines are too long
43
distribution/webgui/entrypoint
Normal file
43
distribution/webgui/entrypoint
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#!/bin/bash
|
||||
|
||||
# script that runs when the docker container starts
|
||||
echo "Starting WebGUI entrypoint script..."
|
||||
for configfile in `perl -Ilib sbin/wgd for-each`;do
|
||||
|
||||
echo "Processing config file: $configfile"
|
||||
# wait for the db to come up and get our version so we know if we need to run upgrades
|
||||
connection_info=`perl -Ilib sbin/wgd db --config-file=$configfile --webgui-root=/data/WebGUI --print | sed "s/'//g" `
|
||||
while true; do
|
||||
db_version=`mysql --skip-column-names -e 'select webguiVersion from webguiVersion order by dateApplied desc limit 1;' $connection_info ` && break
|
||||
echo "waiting for the database to come up..."
|
||||
sleep 10
|
||||
done
|
||||
|
||||
code_version=`perl -Ilib -e 'use WebGUI; print $WebGUI::VERSION;'`
|
||||
|
||||
echo "code version $code_version"
|
||||
echo "database version $db_version for $configfile"
|
||||
|
||||
#this table shoud have a defult value. Shoud be in upgrade.pl to new version
|
||||
`mysql -e 'alter table userSession MODIFY COLUMN userId char(22) NOT NULL DEFAULT "0";' $connection_info ` && break
|
||||
`mysql -e 'alter table assetVersionTag MODIFY COLUMN name char(255) NOT NULL DEFAULT "default";' $connection_info ` && break
|
||||
if [ "$db_version" != "$code_version" ];then
|
||||
perl -Ilib sbin/wgd reset --upgrade --verbose --config-file=$configfile --webgui-root=/data/WebGUI/
|
||||
### alter table userSession MODIFY COLUMN userId char(22) NOT NULL DEFAULT '0';
|
||||
|
||||
## perl -Ilib sbin/wgd db --config-file=www.example.com --webgui-root=/data/WebGUI
|
||||
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
#perl -I/data/WebGUI/lib sbin/spectre.pl --daemon
|
||||
|
||||
service apache2 start
|
||||
|
||||
while true; do
|
||||
echo "Starting Apache web server..."
|
||||
sleep 60
|
||||
done
|
||||
|
||||
apachectl -DFOREGROUND
|
||||
6
distribution/webgui/modperl.pl
Normal file
6
distribution/webgui/modperl.pl
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#use Apache2::SizeLimit;
|
||||
#$Apache2::SizeLimit::MAX_PROCESS_SIZE = 600000;
|
||||
#$Apache2::SizeLimit::MAX_UNSHARED_SIZE = 600000;
|
||||
#$Apache2::SizeLimit::CHECK_EVERY_N_REQUESTS = 10;
|
||||
|
||||
1;
|
||||
4
distribution/webgui/webgui.conf
Normal file
4
distribution/webgui/webgui.conf
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
PerlSetVar WebguiRoot /data/WebGUI
|
||||
#PerlCleanupHandler Apache2::SizeLimit
|
||||
PerlRequire /data/WebGUI/sbin/preload.perl
|
||||
PerlRequire /etc/apache2/modperl.pl
|
||||
16
distribution/webgui/www.example.com.conf
Normal file
16
distribution/webgui/www.example.com.conf
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<VirtualHost 127.0.0.1:80>
|
||||
ServerName www.example.com
|
||||
ServerAlias localhost example.com unitedknowledge.vps2.unitedknowledge.net www.unitedknowledge.eu unitedknowledge.eu www.united-knowledge.eu united-knowledge.eu www.unitedknowledge.net unitedknowledge.net
|
||||
DocumentRoot /data/WebGUI/www
|
||||
SetEnvIf SSLPROXY "1" \
|
||||
SSLPROXY
|
||||
SetHandler perl-script
|
||||
PerlInitHandler WebGUI
|
||||
CustomLog /var/log/apache2/www.example.com.access.log combined
|
||||
ErrorLog /var/log/apache2/www.example.com.error.log
|
||||
PerlSetVar WebguiConfig www.example.com.conf
|
||||
|
||||
<Directory "/data/WebGUI/www">
|
||||
Require all granted
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
Loading…
Add table
Add a link
Reference in a new issue