Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
schors committed Apr 14, 2018
0 parents commit 15c086f
Show file tree
Hide file tree
Showing 15 changed files with 739 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*\~
*.swp
etc/
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Dockerized Dante socks5 proxy for telegram
==========================================

[РУССКАЯ Версия](README-RUS.md)

Features
--------
* Docker, Docker Compose
* Add/Del/Chpass user scripts
* Only telegram usage restrictions

Requirements
------------

* [Docker](https://www.docker.com/docker-community) for virtual containers
* [Docker Compose](https://docs.docker.com/compose/) - a tool for defining and running multi-container Docker applications
* [apg](http://www.adel.nursat.kz/apg/) - a package for generates several random passwords

Usage
-----

* Clone repository
* Edit dante/sockd.conf:
* external: The address to be used for outgoing connections. The address given may be either a IP address or an interface name.
* Uncoment some lines for IPv6 support
* Edit dante/Dockerfile:
* Edit `ENV WORKERS 50` for preforked workers
* Run `docker-compose up -d`
* Use scripts in `scripts` folder for adding and removing users, changing passwords

For nuts
--------

* PayPal https://www.paypal.me/schors
* Yandex.Money http://yasobe.ru/na/schors
* BTC:17V94QS4vaBwec1Qwqp2ow5b3tbrRGGcne

Links
-----

* [Telegram](https://telegram.org/) Messenger
* [Dante](https://www.inet.no/dante/index.html) A free SOCKS server

* [Restless Phil](https://2018.schors.spb.ru) Restless Phil :tm:
* [Roscomnadzor](http://rkn.gov.ru) The Federal Service for Supervision of Communications, Information Technology, and Mass Media


---
[![UNLICENSE](noc.png)](UNLICENSE)
24 changes: 24 additions & 0 deletions UNLICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>
51 changes: 51 additions & 0 deletions dante/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
FROM alpine:3.6

LABEL maintainer="<schors@gmail.com>"

ENV DANTE_VER 1.4.2
ENV DANTE_URL https://www.inet.no/dante/files/dante-$DANTE_VER.tar.gz
ENV DANTE_SHA baa25750633a7f9f37467ee43afdf7a95c80274394eddd7dcd4e1542aa75caad
ENV DANTE_FILE dante.tar.gz
ENV DANTE_TEMP dante
ENV DANTE_DEPS linux-pam-dev curl gcc g++ make
ENV CFGFILE "/etc/sockd.conf"
ENV WORKERS "10"

RUN set -x \
# Runtime dependencies
&& apk --no-cache add \
bash apg \
# Build dependencies
&& apk add --no-cache -t .build-deps $DANTE_DEPS \
&& mkdir -p $DANTE_TEMP \
&& cd $DANTE_TEMP \
&& curl -sSL $DANTE_URL -o $DANTE_FILE \
&& echo "$DANTE_SHA *$DANTE_FILE" | sha256sum -c \
&& tar xzf $DANTE_FILE --strip 1 \
&& ac_cv_func_sched_setscheduler=no ./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-client \
--disable-pidfile \
--without-libwrap \
--without-pam \
--without-bsdauth \
--without-gssapi \
--without-krb5 \
--without-upnp \
&& make && make install \

# Clean up
&& cd .. \
&& rm -rf $DANTE_TEMP \
&& apk del --purge .build-deps \
&& rm -rf /var/cache/apk/* /tmp/*

ADD files /
RUN ls -la /
ADD entrypoint.sh /entrypoint.sh

EXPOSE 1080

CMD /entrypoint.sh sockd -f ${CFGFILE} -N ${WORKERS}
11 changes: 11 additions & 0 deletions dante/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

set -e

for i in "passwd" "group" "shadow" "login.defs" "sockd.conf"; do
if [ ! -f "/etc/${i}" ]; then
cp "/conf/${i}" "/etc/${i}"
fi
done

exec "$@"
2 changes: 2 additions & 0 deletions dante/files/conf/group
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
root:x:0:
nogroup:x:65534:
Loading

0 comments on commit 15c086f

Please sign in to comment.