Skip to content

Commit 2b56ede

Browse files
committed
Merge branch 'develop'
2 parents 2bfea87 + de737aa commit 2b56ede

File tree

125 files changed

+2536
-1877
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+2536
-1877
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Data folder for docker data
2-
/data
2+
/data*
33
/tmp.txt
4-
/tmp
4+
/tmp

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
### 3.0.0 - New major release
4+
5+
- Changed fs structure
6+
- Rewritten helper scripts
7+
- Reorganized examples
8+
- Added Site-to-site example
9+
- Removed `compression` from examples
10+
- Switched to bash wizards
11+
- Added auth-pass-verify example script
12+
313
### 2.0.6 - Fixed bugs, added additonal parameters
414

515
- Fixed bug in `ovpn` util.

CONTRIBUTING.md

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ Feel free to contribute to this project.
66

77
Sections:
88

9-
- [Example configs & hooks](root/defaults/example/README.md)
9+
- [Example configs & hooks](root/usr/local/share/docker-openvpn/README.md)
1010
- [Guides](docs/README.md)
1111
- [Helper Scripts](root/app/README.md)
12-
- [Modules](root/defaults/module/README.md)
1312

1413
## Syntax
1514

@@ -18,34 +17,41 @@ Sections:
1817

1918
## Directory structure of project
2019

21-
```
20+
``` text
2221
/config # Configuration dir (all config is here, generated on container start)
23-
backup # Folder where backups are generated
24-
example # Example configs (see root/defaults/example/README.md)
25-
module # Modules for openvpn
26-
openvpn # Openvpn configuration
27-
ccd # OpenVPN client-specific configuration directory (applied when client connects)
28-
client # Client configuration directory (for generation of .ovpn files)
29-
<clientconffile>.conf # Base for building client config (all files merged)
30-
config # Running config (server/client)
31-
<name>.conf # Config files (all files merged)
22+
backup # Generated backups
23+
client-configs # Generated client configs
24+
hooks
25+
finish # Deinit container
26+
init # Init container
27+
openvpn # OpenVPN directory
28+
ca.crt (*) # CA public key (when pki is setup)
29+
ccd # client-specific configuration directory (applied when client connects)
30+
crl.pem (**) # Certificate revocation list
31+
dh.pem (*) # Server crypto
32+
hook.sh # Hook script runner
3233
hooks # Put your custom scripts in one of subfolders
33-
auth # On authentication (needs to be enabled in config)
34-
client-connect # Client connected
35-
client-disconnect # Client disconnected
34+
auth # Server: On authentication (needs to be enabled in config)
35+
client-connect # Server: Client connected
36+
client-disconnect # Server: Client disconnected
3637
down # After interface is down
37-
finish # Deinit container
38-
init # Init container
39-
learn-address
38+
ipchange # Client: our remote IP initially authenticated or changes
39+
learn-address # Server: when IP, route, MAC added to OpenVPN internal routing table
4040
route-up # After routes are added
4141
route-pre-down # Before routes are removed
42+
start # Before service start
43+
stop # After service stop
4244
up # After interface is up
4345
tls-verify # Check certificate
44-
system.conf # System OpenVPN config file (do not edit, unless instructed)
45-
system-server.conf # System OpenCPN server specific file (do not edit, unless instructed)
46-
system-client.conf # System OpenCPN client specific file (do not edit, unless instructed)
47-
dynamic.conf # File that links all config files together (automatically generated)
48-
pki
46+
include.conf # Container specific settings (must be included)
47+
openvpn.conf or *.ovpn file # Main configuration file
48+
openvpn-template.conf # Template configuration for creating .ovpn and .pkg
49+
pid # OpenVPN PID (automatically written)
50+
server.crt (*) # Server public key
51+
server.key (*) # Server private key
52+
tmp # Temporary directory
53+
persistent-interface # Make used interface persistent
54+
pki (**) # Public key infrastructure directory (KEEP IT SAFE, specialy ca.key)
4955
ca.crt # CA certificate
5056
certs by serial # Certs by Serial ID
5157
<serial-id-cert>.pem
@@ -61,10 +67,10 @@ Sections:
6167
secret.key # Static key (if not using real PKI)
6268
serial # The current serial number
6369
ta.key # Secret for tls-auth, tls-crypt
64-
ssl
65-
safessl-easyrsa.cnf
66-
vars
67-
tmp # Temporary folder
70+
tmp # Temporary directory
71+
openssl-easyrsa.conf
72+
safessl-easyrsa.conf
73+
vars
6874
/defaults # Default configuration, which is copied into config on full setup
6975
...
7076
/etc # System config

Dockerfile

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# Base image
33
# @see https://github.com/SloCompTech/docker-baseimage
44
#
5-
FROM slocomptech/baseimage:alpine
5+
ARG FROM_SUFFIX
6+
FROM slocomptech/bi-python:3.8.0${FROM_SUFFIX}
67

78
# Build arguments
89
ARG BUILD_DATE
@@ -13,57 +14,46 @@ ARG VERSION
1314
#
1415
# Image labels
1516
# @see https://github.com/opencontainers/image-spec/blob/master/annotations.md
16-
# @see http://label-schema.org/rc1/
1717
# @see https://semver.org/
1818
#
1919
LABEL org.opencontainers.image.title="OpenVPN Server" \
20-
org.label-schema.name="OpenVPN Server" \
2120
org.opencontainers.image.description="Docker image with OpenVPN server" \
22-
org.label-schema.description="Docker image with OpenVPN server" \
2321
org.opencontainers.image.url="https://github.com/SloCompTech/docker-openvpn" \
24-
org.label-schema.url="https://github.com/SloCompTech/docker-openvpn" \
2522
org.opencontainers.image.authors="Martin Dagarin <martin.dagarin@gmail.com>" \
2623
org.opencontainers.image.version=$VERSION \
27-
org.label-schema.version=$VERSION \
2824
org.opencontainers.image.revision=$VCS_REF \
29-
org.label-schema.vcs-ref=$VCS_REF \
3025
org.opencontainers.image.source=$VCS_SRC \
31-
org.label-schema.vcs-url=$VCS_SRC \
32-
org.opencontainers.image.created=$BUILD_DATE \
33-
org.label-schema.build-date=$BUILD_DATE \
34-
org.label-schema.schema-version="1.0"
35-
26+
org.opencontainers.image.created=$BUILD_DATE
3627

3728
#
3829
# Environment variables
3930
# @see https://github.com/OpenVPN/easy-rsa/blob/master/doc/EasyRSA-Advanced.md
4031
#
41-
ENV EASYRSA=/usr/share/easy-rsa \
32+
ENV BACKUP_DIR=/config/backup \
33+
EASYRSA=/usr/share/easy-rsa \
34+
EASYRSA_EXT_DIR=/config/x509-types \
4235
EASYRSA_PKI=/config/pki \
43-
EASYRSA_VARS_FILE=/config/ssl/vars \
44-
#EASYRSA_SSL_CONF=/config/ssl/openssl-easyrsa.cnf \
45-
EASYRSA_SAFE_CONF=/config/ssl/safessl-easyrsa.cnf \
46-
EASYRSA_TEMP_FILE=/config/tmp/temp \
47-
TUNNEL_INTERFACE="tun0"
36+
EASYRSA_SSL_CONF=/config/openssl-easyrsa.cnf \
37+
EASYRSA_SAFE_CONF=/config/safessl-easyrsa.cnf \
38+
EASYRSA_VARS_FILE=/config/vars \
39+
OPENVPN_DIR=/config/openvpn
4840

4941
# Install packages
5042
RUN apk add --no-cache \
51-
# Core packages
52-
bash \
53-
easy-rsa \
54-
iptables \
55-
ip6tables \
56-
openvpn \
57-
python3 \
58-
sudo && \
43+
# Core packages
44+
bash \
45+
gettext \
46+
easy-rsa \
47+
iptables \
48+
ip6tables \
49+
nano \
50+
openvpn \
51+
openvpn-doc \
52+
sudo && \
5953
# Link easy-rsa in bin directory
6054
ln -s ${EASYRSA}/easyrsa /usr/local/bin && \
61-
# Link python3 also as python
62-
ln -s /usr/bin/pip3 /usr/bin/pip && \
63-
ln -s /usr/bin/python3 /usr/bin/python && \
64-
# Remove any temporary files created by apk
6555
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/* && \
66-
# Add permission for network management to user abc
56+
# Add permission for network management to container user
6757
echo "${CONTAINER_USER} ALL=(ALL) NOPASSWD: \
6858
/sbin/ip, \
6959
/sbin/ip6tables, \
@@ -83,7 +73,11 @@ RUN apk add --no-cache \
8373
/sbin/iptables-save, \
8474
/sbin/iptables-translate, \
8575
/sbin/route" \
86-
>> /etc/sudoers.d/${CONTAINER_USER}
76+
>> /etc/sudoers.d/${CONTAINER_USER} && \
77+
# Default configuration
78+
cp $EASYRSA/vars.example /defaults/vars && \
79+
cp $EASYRSA/openssl-easyrsa.cnf /defaults && \
80+
cp -r $EASYRSA/x509-types /defaults
8781

8882
# Add repo files to image
8983
COPY root/ /

Dockerfile.armhf

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)