Skip to content
This repository was archived by the owner on Jun 24, 2020. It is now read-only.

Commit 1c586b6

Browse files
committed
it is now working.
1 parent 8d0e3ff commit 1c586b6

6 files changed

Lines changed: 167 additions & 2 deletions

File tree

Dockerfile

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,52 @@
33
# See https://github.com/phusion/baseimage-docker/blob/master/Changelog.md for
44
# a list of version numbers.
55
FROM phusion/baseimage:0.9.19
6+
MAINTAINER Eric Pfeiffer
7+
8+
ENV DEBIAN_FRONTEND="noninteractive" HOME="/root" TERM="xterm"
9+
ENV BASE_APTLIST="make pkg-config check g++ librsync-dev libz-dev libssl-dev uthash-dev libyajl-dev autoconf automake libtool git libncurses5 libacl1-dev"
10+
ENV APTLIST=""
11+
ENV BURP_VERSION="1.4.40"
12+
13+
ADD init/ /etc/my_init.d/
14+
ADD service/ /etc/service/
15+
RUN chmod -v +x /etc/service/*/run /etc/my_init.d/*.sh
16+
17+
RUN useradd -u 911 -U -d /config -s /bin/false abc && \
18+
usermod -G users abc && \
19+
mkdir -p /app/aptselect /config /defaults /data && \
20+
apt-get update && \
21+
apt-get install -qy python-pip && \
22+
pip install apt-select && \
23+
apt-get install -y python3-bs4 $BASE_APTLIST && \
24+
apt-get upgrade -y -o Dpkg::Options::="--force-confold"
625

726
# Use baseimage-docker's init system.
827
CMD ["/sbin/my_init"]
928

10-
# ...put your own build instructions here...
29+
# Install Burp Server
30+
RUN git clone --depth 1 --branch "$BURP_VERSION" https://github.com/grke/burp.git /tmp/burp && \
31+
cd /tmp/burp && \
32+
./configure --prefix=/app --sysconfdir=/defaults --localstatedir=/var && \
33+
make && \
34+
make install
35+
36+
ENV PATH=$PATH:/app/usr/sbin
37+
38+
RUN sed -i 's/^directory =.*/directory = \/data/g' /defaults/burp-server.conf && \
39+
sed -i 's/\/etc\/burp/\/config/g' /defaults/burp-server.conf && \
40+
sed -i 's/^stdout =.*/stdout = 1/g' /defaults/burp-server.conf && \
41+
sed -i 's/\/usr\/sbin/\/app\/usr\/sbin/g' /defaults/burp-server.conf && \
42+
sed -i 's/\/etc\/burp/\/config/g' /defaults/CA.cnf
43+
44+
RUN sed -i 's/^directory =.*/directory = \/data/g' /defaults/burp.conf && \
45+
sed -i 's/\/etc\/burp/\/config/g' /defaults/burp.conf && \
46+
sed -i 's/^stdout =.*/stdout = 1/g' /defaults/burp.conf && \
47+
sed -i 's/\/usr\/sbin/\/app\/usr\/sbin/g' /defaults/burp.conf && \
48+
sed -i 's/\/etc\/burp/\/config/g' /defaults/CA.cnf
1149

1250
# Clean up APT when done.
1351
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
52+
53+
VOLUME ["/config", "/data"]
54+
EXPOSE 4971 4972

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,46 @@
1-
# docker-burp-backup-server
1+
# computerfr33k/docker-burp-backup-server
2+
3+
(description)
4+
5+
## Usage
6+
7+
```
8+
docker create \
9+
--name="burp-server" \
10+
-v /path/to/config/data:/config \
11+
-v /path/to/backups:/data \
12+
-v /etc/localtime:/etc/localtime:ro \
13+
-p 4971:4971 -p 4972:4972 \
14+
computerfr33k/docker-burp-backup-server
15+
```
16+
17+
**Parameters**
18+
19+
* `-p 4971 -p 4972` - the port(s)
20+
* `-v /etc/localtime` for timesync - *optional*
21+
* `-v /config` - Configuration file location
22+
* `-v /data` - Location for backups
23+
* `-e PGID` for for GroupID - see below for explanation - *optional*
24+
* `-e PUID` for for UserID - see below for explanation - *optional*
25+
26+
It is based on phusion-baseimage with ssh removed, for shell access whilst the container is running do `docker exec -it burp-server /bin/bash`.
27+
28+
### User / Group Identifiers
29+
30+
**TL;DR** - The `PGID` and `PUID` values set the user / group you'd like your container to 'run as' to the host OS. This can be a user you've created or even root (not recommended).
31+
32+
Part of what makes our containers work so well is by allowing you to specify your own `PUID` and `PGID`. This avoids nasty permissions errors with relation to data volumes (`-v` flags). When an application is installed on the host OS it is normally added to the common group called users, Docker apps due to the nature of the technology can't be added to this group. So we added this feature to let you easily choose when running your containers.
33+
34+
## Setting up the application
35+
36+
37+
38+
## Updates
39+
40+
* To monitor the logs of the container in realtime `docker logs -f burp-server`.
41+
42+
43+
44+
## Version History
45+
46+
+ **07/12/2016:** Inital Release

init/10_add_user_adc.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
4+
5+
PUID=${PUID:-911}
6+
PGID=${PGID:-911}
7+
8+
if [ ! "$(id -u abc)" -eq "$PUID" ]; then usermod -o -u "$PUID" abc ; fi
9+
if [ ! "$(id -g abc)" -eq "$PGID" ]; then groupmod -o -g "$PGID" abc ; fi
10+
11+
echo "
12+
-------------------------------------
13+
_ _ _
14+
| |___| (_) ___
15+
| / __| | |/ _ \
16+
| \__ \ | | (_) |
17+
|_|___/ |_|\___/
18+
|_|
19+
Brought to you by linuxserver.io
20+
We do accept donations at:
21+
https://www.linuxserver.io/donations
22+
-------------------------------------
23+
GID/UID
24+
-------------------------------------
25+
User uid: $(id -u abc)
26+
User gid: $(id -g abc)
27+
-------------------------------------
28+
"
29+
chown abc:abc /app
30+
chown abc:abc /config
31+
chown abc:abc /defaults
32+
chown abc:abc /data

init/20_apt_update.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
# test if we need to run the update scripts
4+
[ "$ADVANCED_DISABLEUPDATES" ] && exit 0
5+
[ "$BASE_APTLIST" ] && APTLIST="$BASE_APTLIST ""$APTLIST"
6+
[ "$APTLIST" ] || exit 0
7+
8+
# run apt-select script to find fastest up to date mirror
9+
cd /defaults || exit
10+
echo "finding fastest mirror"
11+
apt-select -t 3 -m up-to-date && \
12+
cp /etc/apt/sources.list /etc/apt/sources.list.backup && \
13+
mv sources.list /etc/apt/
14+
15+
# check for and install any updates
16+
echo "We are now refreshing packages from apt repositories, this *may* take a while"
17+
apt-get update
18+
apt-get --only-upgrade install -yqq $APTLIST

init/30_check_config.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
# Copy config files if they don't exist
4+
function isDirEmpty {
5+
if [ ! "$(ls -A /config)" ]
6+
then
7+
cp -r /defaults/. /config/
8+
chown -R abc:abc /config
9+
fi
10+
}
11+
12+
function createIfMissing {
13+
if [ -f "/config/$1" ]
14+
then
15+
cp /defaults/$1 /config/$1
16+
chown -R abc:abc /config/$1
17+
fi
18+
}
19+
20+
isDirEmpty
21+
22+
createIfMissing burp-server.conf
23+
createIfMissing CA.cnf
24+
createIfMissing notify_script
25+
createIfMissing ssl_extra_checks_script
26+
createIfMissing summary_script
27+
createIfMissing timer_script

service/burp-server/run

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
exec /sbin/setuser abc /usr/sbin/burp -c /config/burp-server.conf -F

0 commit comments

Comments
 (0)