Skip to content

Commit

Permalink
Merge pull request #3 from sdslabs/wireguard
Browse files Browse the repository at this point in the history
Add Wireguard
  • Loading branch information
Bisht13 authored Aug 27, 2023
2 parents 34fb474 + 066e142 commit 7eabff2
Show file tree
Hide file tree
Showing 37 changed files with 1,398 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wireguard/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.git
.gitignore
.github
.gitattributes
READMETEMPLATE.md
README.md
20 changes: 20 additions & 0 deletions wireguard/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file is globally distributed to all container image projects from
# https://github.com/linuxserver/docker-jenkins-builder/blob/master/.editorconfig

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# trim_trailing_whitespace may cause unintended issues and should not be globally set true
trim_trailing_whitespace = false

[{Dockerfile*,**.yml}]
indent_style = space
indent_size = 2

[{**.sh,root/etc/s6-overlay/s6-rc.d/**,root/etc/cont-init.d/**,root/etc/services.d/**}]
indent_style = space
indent_size = 4
17 changes: 17 additions & 0 deletions wireguard/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
44 changes: 44 additions & 0 deletions wireguard/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# =========================
# Operating System Files
# =========================

# OSX
# =========================

.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
.jenkins-external
56 changes: 56 additions & 0 deletions wireguard/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# syntax=docker/dockerfile:1

FROM ghcr.io/linuxserver/baseimage-alpine:3.18

# set version label
ARG BUILD_DATE
ARG VERSION
ARG WIREGUARD_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thespad"

RUN \
echo "**** install dependencies ****" && \
apk add --no-cache --virtual=build-dependencies \
build-base \
elfutils-dev \
gcc \
git \
linux-headers && \
apk add --no-cache \
bc \
coredns \
gnupg \
grep \
iproute2 \
iptables \
ip6tables \
iputils \
libcap-utils \
libqrencode \
net-tools \
openresolv \
perl && \
echo "wireguard" >> /etc/modules && \
echo "**** install wireguard-tools ****" && \
if [ -z ${WIREGUARD_RELEASE+x} ]; then \
WIREGUARD_RELEASE=$(curl -sX GET "https://api.github.com/repos/WireGuard/wireguard-tools/tags" \
| jq -r .[0].name); \
fi && \
cd /app && \
git clone https://git.zx2c4.com/wireguard-tools && \
cd wireguard-tools && \
git checkout "${WIREGUARD_RELEASE}" && \
sed -i 's|\[\[ $proto == -4 \]\] && cmd sysctl -q net\.ipv4\.conf\.all\.src_valid_mark=1|[[ $proto == -4 ]] \&\& [[ $(sysctl -n net.ipv4.conf.all.src_valid_mark) != 1 ]] \&\& cmd sysctl -q net.ipv4.conf.all.src_valid_mark=1|' src/wg-quick/linux.bash && \
make -C src -j$(nproc) && \
make -C src install && \
echo "**** clean up ****" && \
apk del --no-network build-dependencies && \
rm -rf \
/tmp/*

# add local files
COPY /root /

# ports and volumes
EXPOSE 51820/udp
56 changes: 56 additions & 0 deletions wireguard/Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# syntax=docker/dockerfile:1

FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.18

# set version label
ARG BUILD_DATE
ARG VERSION
ARG WIREGUARD_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thespad"

RUN \
echo "**** install dependencies ****" && \
apk add --no-cache --virtual=build-dependencies \
build-base \
elfutils-dev \
gcc \
git \
linux-headers && \
apk add --no-cache \
bc \
coredns \
gnupg \
grep \
iproute2 \
iptables \
ip6tables \
iputils \
libcap-utils \
libqrencode \
net-tools \
openresolv \
perl && \
echo "wireguard" >> /etc/modules && \
echo "**** install wireguard-tools ****" && \
if [ -z ${WIREGUARD_RELEASE+x} ]; then \
WIREGUARD_RELEASE=$(curl -sX GET "https://api.github.com/repos/WireGuard/wireguard-tools/tags" \
| jq -r .[0].name); \
fi && \
cd /app && \
git clone https://git.zx2c4.com/wireguard-tools && \
cd wireguard-tools && \
git checkout "${WIREGUARD_RELEASE}" && \
sed -i 's|\[\[ $proto == -4 \]\] && cmd sysctl -q net\.ipv4\.conf\.all\.src_valid_mark=1|[[ $proto == -4 ]] \&\& [[ $(sysctl -n net.ipv4.conf.all.src_valid_mark) != 1 ]] \&\& cmd sysctl -q net.ipv4.conf.all.src_valid_mark=1|' src/wg-quick/linux.bash && \
make -C src -j$(nproc) && \
make -C src install && \
echo "**** clean up ****" && \
apk del --no-network build-dependencies && \
rm -rf \
/tmp/*

# add local files
COPY /root /

# ports and volumes
EXPOSE 51820/udp
Loading

0 comments on commit 7eabff2

Please sign in to comment.