diff options
-rw-r--r-- | .travis.yml | 33 | ||||
-rw-r--r-- | other/bootstrap_daemon/docker/Dockerfile | 65 | ||||
-rw-r--r-- | other/bootstrap_daemon/src/Makefile.inc | 1 | ||||
-rw-r--r-- | other/bootstrap_daemon/src/log.c | 4 | ||||
-rw-r--r-- | toxcore/Makefile.inc | 3 | ||||
-rw-r--r-- | toxencryptsave/Makefile.inc | 3 |
6 files changed, 68 insertions, 41 deletions
diff --git a/.travis.yml b/.travis.yml index a4dbc7a0..1fda1449 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -6,20 +6,41 @@ compiler: | |||
6 | - clang | 6 | - clang |
7 | 7 | ||
8 | before_script: | 8 | before_script: |
9 | - sudo add-apt-repository ppa:avsm/ocaml42+opam12 -y | ||
9 | - sudo apt-get update -qq | 10 | - sudo apt-get update -qq |
11 | - sudo apt-get install ocaml opam astyle -qq | ||
10 | - sudo apt-get install libconfig-dev libvpx-dev libopus-dev check -qq | 12 | - sudo apt-get install libconfig-dev libvpx-dev libopus-dev check -qq |
13 | # build apidsl | ||
14 | - git clone https://github.com/iphydf/apidsl | ||
15 | - cd apidsl | ||
16 | - export OPAMYES=1 | ||
17 | - opam init | ||
18 | - opam install ocamlfind ppx_deriving menhir | ||
19 | - eval `opam config env` | ||
20 | - make -j3 | ||
21 | - cd .. | ||
11 | # install sodium, as it's not in Ubuntu Trusty | 22 | # install sodium, as it's not in Ubuntu Trusty |
12 | - git clone git://github.com/jedisct1/libsodium.git > /dev/null | 23 | - git clone git://github.com/jedisct1/libsodium.git |
13 | - cd libsodium | 24 | - cd libsodium |
14 | - git checkout tags/1.0.8 > /dev/null | 25 | - git checkout tags/1.0.8 |
15 | - ./autogen.sh > /dev/null | 26 | - ./autogen.sh |
16 | - ./configure > /dev/null | 27 | - ./configure |
17 | - make -j3 >/dev/null | 28 | - make -j3 |
18 | - sudo make install >/dev/null | 29 | - sudo make install |
19 | - cd .. | 30 | - cd .. |
20 | - sudo ldconfig | 31 | - sudo ldconfig |
21 | 32 | ||
22 | script: | 33 | script: |
34 | # check if toxcore.h and toxav.h match apidsl tox.in.h and toxav.in.h | ||
35 | # tox.h | ||
36 | - ./apidsl/_build/apigen.native ./other/apidsl/tox.in.h > tox.h | ||
37 | - astyle --options=./other/astyle/astylerc tox.h | ||
38 | - diff -u tox.h ./toxcore/tox.h | ||
39 | # toxav.h | ||
40 | - ./apidsl/_build/apigen.native ./other/apidsl/toxav.in.h > toxav.h | ||
41 | - astyle --options=./other/astyle/astylerc toxav.h | ||
42 | - diff -u toxav.h ./toxav/toxav.h | ||
43 | # build toxcore and run tests | ||
23 | - ./autogen.sh | 44 | - ./autogen.sh |
24 | - CFLAGS="-Ofast -Wall -Wextra" ./configure --enable-daemon --enable-ntox | 45 | - CFLAGS="-Ofast -Wall -Wextra" ./configure --enable-daemon --enable-ntox |
25 | - make | 46 | - make |
diff --git a/other/bootstrap_daemon/docker/Dockerfile b/other/bootstrap_daemon/docker/Dockerfile index ef9d525c..d4d611b5 100644 --- a/other/bootstrap_daemon/docker/Dockerfile +++ b/other/bootstrap_daemon/docker/Dockerfile | |||
@@ -1,7 +1,8 @@ | |||
1 | FROM debian:jessie | 1 | FROM debian:jessie |
2 | 2 | ||
3 | # get all deps | 3 | WORKDIR /tmp/tox |
4 | RUN apt-get update && apt-get install -y \ | 4 | |
5 | RUN export BUILD_PACKAGES="\ | ||
5 | build-essential \ | 6 | build-essential \ |
6 | libtool \ | 7 | libtool \ |
7 | autotools-dev \ | 8 | autotools-dev \ |
@@ -12,41 +13,40 @@ RUN apt-get update && apt-get install -y \ | |||
12 | yasm \ | 13 | yasm \ |
13 | libsodium-dev \ | 14 | libsodium-dev \ |
14 | libconfig-dev \ | 15 | libconfig-dev \ |
15 | python3 \ | 16 | python3" && \ |
16 | && apt-get clean \ | 17 | export RUNTIME_PACKAGES="\ |
17 | && rm -rf /var/lib/apt/lists/* | 18 | libconfig9 \ |
18 | 19 | libsodium13" && \ | |
20 | # get all deps | ||
21 | apt-get update && apt-get install -y $BUILD_PACKAGES $RUNTIME_PACKAGES && \ | ||
19 | # install toxcore and daemon | 22 | # install toxcore and daemon |
20 | WORKDIR /root/ | 23 | git clone https://github.com/irungentoo/toxcore && \ |
21 | RUN git clone https://github.com/irungentoo/toxcore | 24 | cd toxcore && \ |
22 | WORKDIR /root/toxcore/ | 25 | ./autogen.sh && \ |
23 | RUN ./autogen.sh | 26 | ./configure --enable-daemon && \ |
24 | RUN ./configure --enable-daemon | 27 | make -j`nproc` && \ |
25 | RUN make -j`nproc` | 28 | make install -j`nproc` && \ |
26 | RUN make install -j`nproc` | 29 | ldconfig && \ |
27 | RUN ldconfig | ||
28 | |||
29 | WORKDIR /root/toxcore/other/bootstrap_daemon/ | ||
30 | |||
31 | # add new user | 30 | # add new user |
32 | RUN useradd --home-dir /var/lib/tox-bootstrapd --create-home \ | 31 | useradd --home-dir /var/lib/tox-bootstrapd --create-home \ |
33 | --system --shell /sbin/nologin \ | 32 | --system --shell /sbin/nologin \ |
34 | --comment "Account to run Tox's DHT bootstrap daemon" \ | 33 | --comment "Account to run Tox's DHT bootstrap daemon" \ |
35 | --user-group tox-bootstrapd | 34 | --user-group tox-bootstrapd && \ |
36 | RUN chmod 700 /var/lib/tox-bootstrapd | 35 | chmod 700 /var/lib/tox-bootstrapd && \ |
37 | 36 | cp other/bootstrap_daemon/tox-bootstrapd.conf /etc/tox-bootstrapd.conf && \ | |
38 | RUN cp tox-bootstrapd.conf /etc/tox-bootstrapd.conf | ||
39 | |||
40 | # remove all the example bootstrap nodes from the config file | 37 | # remove all the example bootstrap nodes from the config file |
41 | RUN N=-1 && \ | 38 | sed -i '/^bootstrap_nodes = /,$d' /etc/tox-bootstrapd.conf && \ |
42 | while grep -q "bootstrap_nodes =" /etc/tox-bootstrapd.conf; \ | ||
43 | do \ | ||
44 | head -n $N tox-bootstrapd.conf > /etc/tox-bootstrapd.conf; \ | ||
45 | N=$((N-1)); \ | ||
46 | done | ||
47 | |||
48 | # add bootstrap nodes from https://nodes.tox.chat/ | 39 | # add bootstrap nodes from https://nodes.tox.chat/ |
49 | RUN python3 docker/get-nodes.py >> /etc/tox-bootstrapd.conf | 40 | python3 other/bootstrap_daemon/docker/get-nodes.py >> /etc/tox-bootstrapd.conf && \ |
41 | # perform cleanup | ||
42 | export AUTO_ADDED_PACKAGES="$(apt-mark showauto)" && \ | ||
43 | apt-get remove --purge -y $BUILD_PACKAGES $AUTO_ADDED_PACKAGES && \ | ||
44 | apt-get clean && \ | ||
45 | rm -rf /var/lib/apt/lists/* && \ | ||
46 | cd / && \ | ||
47 | rm -rf /tmp/* | ||
48 | |||
49 | WORKDIR /var/lib/tox-bootstrapd | ||
50 | 50 | ||
51 | USER tox-bootstrapd | 51 | USER tox-bootstrapd |
52 | 52 | ||
@@ -55,5 +55,4 @@ ENTRYPOINT /usr/local/bin/tox-bootstrapd \ | |||
55 | --log-backend stdout \ | 55 | --log-backend stdout \ |
56 | --foreground | 56 | --foreground |
57 | 57 | ||
58 | EXPOSE 443 3389 33445 | 58 | EXPOSE 443/tcp 3389/tcp 33445/tcp 33445/udp |
59 | EXPOSE 33445/udp | ||
diff --git a/other/bootstrap_daemon/src/Makefile.inc b/other/bootstrap_daemon/src/Makefile.inc index a0d75fa0..29b2822e 100644 --- a/other/bootstrap_daemon/src/Makefile.inc +++ b/other/bootstrap_daemon/src/Makefile.inc | |||
@@ -11,6 +11,7 @@ tox_bootstrapd_SOURCES = \ | |||
11 | ../other/bootstrap_daemon/src/log.c \ | 11 | ../other/bootstrap_daemon/src/log.c \ |
12 | ../other/bootstrap_daemon/src/log.h \ | 12 | ../other/bootstrap_daemon/src/log.h \ |
13 | ../other/bootstrap_daemon/src/tox-bootstrapd.c \ | 13 | ../other/bootstrap_daemon/src/tox-bootstrapd.c \ |
14 | ../other/bootstrap_daemon/src/global.h \ | ||
14 | ../other/bootstrap_node_packets.c \ | 15 | ../other/bootstrap_node_packets.c \ |
15 | ../other/bootstrap_node_packets.h | 16 | ../other/bootstrap_node_packets.h |
16 | 17 | ||
diff --git a/other/bootstrap_daemon/src/log.c b/other/bootstrap_daemon/src/log.c index a0ac20d9..ee3a1421 100644 --- a/other/bootstrap_daemon/src/log.c +++ b/other/bootstrap_daemon/src/log.c | |||
@@ -75,6 +75,8 @@ int level_syslog(LOG_LEVEL level) | |||
75 | case LOG_LEVEL_ERROR: | 75 | case LOG_LEVEL_ERROR: |
76 | return LOG_ERR; | 76 | return LOG_ERR; |
77 | } | 77 | } |
78 | |||
79 | return LOG_INFO; | ||
78 | } | 80 | } |
79 | 81 | ||
80 | void log_syslog(LOG_LEVEL level, const char *format, va_list args) | 82 | void log_syslog(LOG_LEVEL level, const char *format, va_list args) |
@@ -92,6 +94,8 @@ FILE *level_stdout(LOG_LEVEL level) | |||
92 | case LOG_LEVEL_ERROR: | 94 | case LOG_LEVEL_ERROR: |
93 | return stderr; | 95 | return stderr; |
94 | } | 96 | } |
97 | |||
98 | return stdout; | ||
95 | } | 99 | } |
96 | 100 | ||
97 | void log_stdout(LOG_LEVEL level, const char *format, va_list args) | 101 | void log_stdout(LOG_LEVEL level, const char *format, va_list args) |
diff --git a/toxcore/Makefile.inc b/toxcore/Makefile.inc index 9fb910fc..d6b67eb2 100644 --- a/toxcore/Makefile.inc +++ b/toxcore/Makefile.inc | |||
@@ -50,7 +50,8 @@ libtoxcore_la_SOURCES = ../toxcore/DHT.h \ | |||
50 | ../toxcore/TCP_connection.c \ | 50 | ../toxcore/TCP_connection.c \ |
51 | ../toxcore/list.c \ | 51 | ../toxcore/list.c \ |
52 | ../toxcore/list.h \ | 52 | ../toxcore/list.h \ |
53 | ../toxcore/misc_tools.h | 53 | ../toxcore/misc_tools.h \ |
54 | ../toxcore/tox_old_code.h | ||
54 | 55 | ||
55 | libtoxcore_la_CFLAGS = -I$(top_srcdir) \ | 56 | libtoxcore_la_CFLAGS = -I$(top_srcdir) \ |
56 | -I$(top_srcdir)/toxcore \ | 57 | -I$(top_srcdir)/toxcore \ |
diff --git a/toxencryptsave/Makefile.inc b/toxencryptsave/Makefile.inc index 20c8b1b3..56bc101d 100644 --- a/toxencryptsave/Makefile.inc +++ b/toxencryptsave/Makefile.inc | |||
@@ -6,7 +6,8 @@ libtoxencryptsave_la_include_HEADERS = \ | |||
6 | libtoxencryptsave_la_includedir = $(includedir)/tox | 6 | libtoxencryptsave_la_includedir = $(includedir)/tox |
7 | 7 | ||
8 | libtoxencryptsave_la_SOURCES = ../toxencryptsave/toxencryptsave.h \ | 8 | libtoxencryptsave_la_SOURCES = ../toxencryptsave/toxencryptsave.h \ |
9 | ../toxencryptsave/toxencryptsave.c | 9 | ../toxencryptsave/toxencryptsave.c \ |
10 | ../toxencryptsave/defines.h | ||
10 | 11 | ||
11 | 12 | ||
12 | if WITH_NACL | 13 | if WITH_NACL |