Skip to content

Commit

Permalink
Merge tag 'Release45'
Browse files Browse the repository at this point in the history
  • Loading branch information
martincz committed Mar 29, 2024
2 parents 9612b39 + 9ee27e7 commit deae227
Show file tree
Hide file tree
Showing 150 changed files with 18,087 additions and 3,704 deletions.
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Checks: >
-bugprone-suspicious-memory-comparison,
-bugprone-not-null-terminated-result,
-bugprone-signal-handler,
-bugprone-assignment-in-if-condition,
-concurrency-mt-unsafe,
-modernize-macro-to-enum,
-misc-unused-parameters,
-misc-misplaced-widening-cast,
-misc-no-recursion,
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Docker Image

on:
workflow_dispatch:
inputs:
version:
description: 'new image tag(e.g. v1.1.0)'
required: true
default: 'latest'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{vars.DOCKERHUB_REPO}}:${{ github.event.inputs.version }}
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LABEL maintainer="Martincz Gao <[email protected]>"
ENV TZ=Asia/Shanghai

# prepare builder
ARG OPENSSL_VER=1.1.1f
ARG OPENSSL_VER=3.0.10
RUN apt update && \
apt install -y perl curl make musl-tools musl-dev && \
ln -s /usr/include/linux /usr/include/$(uname -m)-linux-musl && \
Expand All @@ -31,7 +31,7 @@ COPY . /build/smartdns/
RUN cd /build/smartdns && \
export CC=musl-gcc && \
export CFLAGS="-I /opt/build/include" && \
export LDFLAGS="-L /opt/build/lib" && \
export LDFLAGS="-L /opt/build/lib -L /opt/build/lib64" && \
sh ./package/build-pkg.sh --platform linux --arch `dpkg --print-architecture` --static && \
\
( cd package && tar -xvf *.tar.gz && chmod a+x smartdns/etc/init.d/smartdns ) && \
Expand All @@ -43,10 +43,10 @@ RUN cd /build/smartdns && \
cp package/smartdns/etc/smartdns /release/opt/ -a && \
cd / && rm -rf /build

FROM busybox:latest
FROM busybox:stable-musl
COPY --from=smartdns-builder /release/ /
EXPOSE 53/tcp
EXPOSE 53/udp
VOLUME "/etc/smartdns/"
VOLUME ["/etc/smartdns/"]

CMD ["/usr/sbin/smartdns", "-f", "-x"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2018-2023 Ruilin Peng (Nick) <[email protected]>.
# Copyright (C) 2018-2024 Ruilin Peng (Nick) <[email protected]>.
#
# smartdns is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 2 additions & 2 deletions etc/init.d/smartdns
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (C) 2018-2023 Ruilin Peng (Nick) <[email protected]>.
# Copyright (C) 2018-2024 Ruilin Peng (Nick) <[email protected]>.
#
# smartdns is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -37,7 +37,7 @@ test -x $SMARTDNS || exit 5

case $1 in
start)
$SMARTDNS "$SMART_DNS_OPTS"
$SMARTDNS "$SMART_DNS_OPTS" -R
while true; do
if [ -e "$PIDFILE" ]; then
break;
Expand Down
Loading

0 comments on commit deae227

Please sign in to comment.