Skip to content

Commit c0fccb1

Browse files
authored
Merge pull request #6 from biolds/master
add chromium image
2 parents 5291119 + 3d7c953 commit c0fccb1

File tree

6 files changed

+308
-0
lines changed

6 files changed

+308
-0
lines changed

chromium/Dockerfile

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
FROM debian:buster
2+
env DEBIAN_FRONTEND noninteractive
3+
env FILEBEAT_DEB_URL https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.5.2-amd64.deb
4+
env FILEBEAT_RPM_URL https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.5.2-x86_64.rpm
5+
env METRICBEAT_DEB_URL https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-5.5.2-amd64.deb
6+
env METRICBEAT_RPM_URL https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-5.5.2-x86_64.rpm
7+
8+
run echo 'APT::Default-Release "buster";' > /etc/apt/apt.conf.d/00apt_default_release
9+
add sources.list /etc/apt/sources.list
10+
11+
run apt-get update -qy
12+
run apt-get install -y supervisor git sudo ssh \
13+
rabbitmq-server easy-rsa sshpass rsync suricata wget jq curl nginx \
14+
tigervnc-standalone-server x11-apps xterm postgresql-11 postgresql-client libpq-dev \
15+
build-essential python3-dev libffi-dev libldap2-dev libsasl2-dev libssl-dev virtualenv python3-virtualenv \
16+
python2-dev chromium chromium-driver
17+
18+
run mkdir /data /var/run/sshd
19+
run useradd -m -d /home/admin -p sa1aY64JOY94w admin
20+
run adduser admin sudo
21+
run adduser admin www-data
22+
user admin
23+
run cat /dev/zero | ssh-keygen -q -N ""
24+
add config /home/admin/.ssh/config
25+
26+
user root
27+
# Set VNC password to admin123
28+
run mkdir -p /root/.vnc && echo 'ZrO3AaiJtEI=' | base64 -d > /root/.vnc/passwd && chmod 600 /root/.vnc/passwd
29+
30+
run sed -Ei 's/^(\%sudo.*)ALL/\1NOPASSWD:ALL/' /etc/sudoers
31+
32+
run mkdir -p /var/log/celery/ && chown admin:admin /var/log/celery/
33+
34+
user admin
35+
run touch /var/log/celery/ansible.log /var/log/celery/beat.log /var/log/celery/django-auth.log /var/log/celery/django-error.log /var/log/celery/django-security.log /var/log/celery/django-sql.log /var/log/celery/django.log
36+
run touch /home/admin/django-debug.log
37+
run mkdir -p /home/admin/ansible /home/admin/git-sources /home/admin/backups /home/admin/django \
38+
/home/admin/packages/deb /home/admin/packages/rpm /home/admin/upgrade /home/admin/coverage /home/admin/generated
39+
40+
# Add packages for log shipping
41+
user admin
42+
run cd /home/admin/packages/deb && wget "$FILEBEAT_DEB_URL"
43+
run cd /home/admin/packages/rpm && wget "$FILEBEAT_RPM_URL"
44+
run cd /home/admin/packages/deb && wget "$METRICBEAT_DEB_URL"
45+
run cd /home/admin/packages/rpm && wget "$METRICBEAT_RPM_URL"
46+
47+
# Install Scirius packages
48+
run virtualenv -p python3 /home/admin/venv
49+
add requirements.txt /home/admin/requirements.txt
50+
run /home/admin/venv/bin/pip install -r /home/admin/requirements.txt --upgrade
51+
run /home/admin/venv/bin/pip install coverage pylint pylint-django
52+
53+
# Robotframework
54+
user root
55+
add requirements-rf.txt /root/requirements-rf.txt
56+
run virtualenv -p python3 /root/rf/
57+
run /root/rf/bin/pip install -r /root/requirements-rf.txt --upgrade
58+
59+
# vnc2flv installation requires python2
60+
run virtualenv -p python2 /root/vnc2flv/
61+
run /root/vnc2flv/bin/pip install vnc2flv
62+
63+
run mkdir /root/.ssh
64+
run mkdir -p /etc/ansible
65+
66+
# Postgresql installation
67+
run mkdir -p /var/run/postgresql/11-main.pg_stat_tmp/ && chown postgres:postgres /var/run/postgresql -R
68+
user postgres
69+
run /etc/init.d/postgresql start && \
70+
psql --command "CREATE USER docker WITH SUPERUSER PASSWORD 'scient';" && \
71+
createdb -O docker scient && \
72+
/etc/init.d/postgresql stop
73+
user root
74+
run echo "host all all 127.0.0.0/8 md5" >> /etc/postgresql/11/main/pg_hba.conf
75+
run sed -e "s/^log_line_prefix .*/log_line_prefix = '%t [%p]: [%l-1] '/" -i /etc/postgresql/11/main/postgresql.conf
76+
run (echo 'log_min_duration_statement = 0' && \
77+
echo 'log_checkpoints = on' && \
78+
echo 'log_connections = on' && \
79+
echo 'log_disconnections = on' && \
80+
echo 'log_lock_waits = on' && \
81+
echo 'log_temp_files = 0' && \
82+
echo 'log_autovacuum_min_duration = 0' && \
83+
echo 'log_error_verbosity = default') >> /etc/postgresql/11/main/postgresql.conf
84+
85+
# Install pgbadger
86+
env PGBADGER_VER 11.2
87+
run cd /root && wget https://github.com/darold/pgbadger/archive/v${PGBADGER_VER}.tar.gz
88+
run cd /root && tar xzf v${PGBADGER_VER}.tar.gz && mv pgbadger-${PGBADGER_VER} pgbadger && rm v${PGBADGER_VER}.tar.gz
89+
90+
# nginx configuration
91+
add nginx.conf /etc/nginx/sites-enabled/default
92+
run touch /var/log/gunicorn-error.log /var/log/gunicorn-access.log && \
93+
chown admin:admin /var/log/gunicorn-error.log /var/log/gunicorn-access.log
94+
95+
run make-cadir /etc/nginx/ca && \
96+
cd /etc/nginx/ca && bash -c "./easyrsa init-pki && \
97+
echo | ./easyrsa build-ca nopass && \
98+
./easyrsa build-server-full stamus nopass"
99+
run mkdir -p /etc/nginx/ssl/ && cp /etc/nginx/ca/pki/issued/stamus.crt /etc/nginx/ssl/manager.crt && \
100+
cp /etc/nginx/ca/pki/private/stamus.key /etc/nginx/ssl/manager.key

chromium/config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Host *
2+
ProtocolKeepAlives 10
3+
ServerAliveInterval 10
4+
ServerAliveCountMax 1

chromium/nginx.conf

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
##
2+
# You should look at the following URL's in order to grasp a solid understanding
3+
# of Nginx configuration files in order to fully unleash the power of Nginx.
4+
# http://wiki.nginx.org/Pitfalls
5+
# http://wiki.nginx.org/QuickStart
6+
# http://wiki.nginx.org/Configuration
7+
#
8+
# Generally, you will want to move this file somewhere, and start with a clean
9+
# file but keep this around for reference. Or just disable in sites-enabled.
10+
#
11+
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
12+
##
13+
14+
# Default server configuration
15+
#
16+
server {
17+
listen 443 default_server;
18+
19+
ssl on;
20+
ssl_certificate /etc/nginx/ssl/manager.crt;
21+
ssl_certificate_key /etc/nginx/ssl/manager.key;
22+
23+
# SSL configuration
24+
#
25+
# listen 443 ssl default_server;
26+
# listen [::]:443 ssl default_server;
27+
#
28+
# Self signed certs generated by the ssl-cert package
29+
# Don't use them in a production server!
30+
#
31+
# include snippets/snakeoil.conf;
32+
33+
root /var/www/html;
34+
35+
# Add index.php to the list if you are using PHP
36+
index index.html index.htm index.nginx-debian.html;
37+
38+
server_name _;
39+
40+
#location / {
41+
# # First attempt to serve request as file, then
42+
# # as directory, then fall back to displaying a 404.
43+
# try_files $uri $uri/ =404;
44+
#}
45+
46+
location /static/ { # STATIC_URL
47+
alias /var/www/html/static/;
48+
}
49+
50+
location /media/ { # MEDIA_URL
51+
alias /var/www/html/static/;
52+
}
53+
54+
location / {
55+
proxy_pass http://127.0.0.1:8080;
56+
proxy_read_timeout 600;
57+
58+
# Header to identify
59+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
60+
61+
# Headers used by django-rest-framework to build urls
62+
proxy_set_header X-Forwarded-Host $http_host;
63+
proxy_set_header X-Forwarded-Proto https;
64+
65+
client_max_body_size 450M;
66+
}
67+
68+
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
69+
#
70+
#location ~ \.php$ {
71+
# include snippets/fastcgi-php.conf;
72+
#
73+
# # With php5-cgi alone:
74+
# fastcgi_pass 127.0.0.1:9000;
75+
# # With php5-fpm:
76+
# fastcgi_pass unix:/var/run/php5-fpm.sock;
77+
#}
78+
79+
# deny access to .htaccess files, if Apache's document root
80+
# concurs with nginx's one
81+
#
82+
#location ~ /\.ht {
83+
# deny all;
84+
#}
85+
}
86+
87+
88+
# Virtual Host configuration for example.com
89+
#
90+
# You can move that to a different file under sites-available/ and symlink that
91+
# to sites-enabled/ to enable it.
92+
#
93+
#server {
94+
# listen 80;
95+
# listen [::]:80;
96+
#
97+
# server_name example.com;
98+
#
99+
# root /var/www/example.com;
100+
# index index.html;
101+
#
102+
# location / {
103+
# try_files $uri $uri/ =404;
104+
# }
105+
#}

chromium/requirements-rf.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
bcrypt==3.1.7
2+
cffi==1.14.0
3+
cryptography==2.9.2
4+
paramiko==2.7.1
5+
pkg-resources==0.0.0
6+
pycparser==2.20
7+
PyNaCl==1.4.0
8+
robotframework==3.2.1
9+
robotframework-selenium2library==3.0.0
10+
robotframework-seleniumlibrary==4.4.0
11+
robotframework-sshlibrary==3.4.0
12+
scp==0.13.2
13+
selenium==3.141.0
14+
six==1.15.0
15+
urllib3==1.25.9

chromium/requirements.txt

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
amqp==2.6.0
2+
ansible==2.9.10
3+
anyjson==0.3.3
4+
arrow==0.15.7
5+
async==0.6.2
6+
bcrypt==3.1.7
7+
billiard==3.6.3.0
8+
celery==4.4.6
9+
certifi==2020.6.20
10+
cffi==1.14.0
11+
chardet==3.0.4
12+
cheroot==8.3.0
13+
click==7.1.2
14+
cryptography==2.9.2
15+
Django==2.2.13
16+
django-auth-ldap==2.2.0
17+
django-bootstrap3==14.0.0
18+
django-celery-results==1.2.1
19+
django-chunked-upload==1.1.3
20+
django-cprofile-middleware==1.0.5
21+
django-dbbackup==2.5.0
22+
django-filter==2.3.0
23+
django-ipware==2.1.0
24+
django-mass-edit==3.2.0
25+
django-revproxy==0.10.0
26+
django-tables2==2.3.1
27+
django-webpack-loader==0.7.0
28+
djangorestframework==3.7.7
29+
ecdsa==0.15
30+
elasticsearch==6.8.1
31+
elasticsearch-curator==3.5.1
32+
enum34==1.1.10
33+
flup==1.0.3
34+
future==0.18.2
35+
gevent==20.6.2
36+
gitdb==4.0.5
37+
GitPython==3.1.3
38+
greenlet==0.4.16
39+
gunicorn==20.0.4
40+
httplib2==0.18.1
41+
idna==2.9
42+
idstools==0.6.3
43+
importlib-metadata==1.6.1
44+
influxdb==5.3.0
45+
IPy==1.0
46+
jaraco.functools==3.0.1
47+
Jinja2==2.11.2
48+
kombu==4.6.11
49+
Markdown==3.2.2
50+
MarkupSafe==1.1.1
51+
medusa==0.5.4
52+
more-itertools==8.4.0
53+
msgpack==0.6.1
54+
paramiko==2.7.1
55+
pkg-resources==0.0.0
56+
psutil==5.7.0
57+
psycopg2==2.8.5
58+
psycopg2-binary==2.8.5
59+
pyasn1==0.4.8
60+
pyasn1-modules==0.2.8
61+
pycparser==2.20
62+
pycrypto==2.6.1
63+
Pygments==2.6.1
64+
PyNaCl==1.4.0
65+
python-dateutil==2.8.1
66+
python-gnupg==0.4.6
67+
python-ldap==3.3.0
68+
pytz==2020.1
69+
PyYAML==5.3.1
70+
requests==2.24.0
71+
six==1.15.0
72+
smmap==3.0.4
73+
sqlparse==0.3.1
74+
subprocess32==3.5.4
75+
tornado==6.0.4
76+
urllib3==1.17
77+
vine==1.3.0
78+
web.py==0.51
79+
zipp==3.1.0
80+
zope.event==4.4
81+
zope.interface==5.1.0

chromium/sources.list

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
deb http://deb.debian.org/debian buster main contrib non-free
2+
deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free
3+
deb http://deb.debian.org/debian buster-updates main contrib non-free

0 commit comments

Comments
 (0)