Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All of my changes #71

Open
wants to merge 70 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
e6285bf
also write tox_save in client mode (with -C)
Aug 19, 2020
ee6e937
Remove spurious debug output
Aug 19, 2020
15400c2
Avoid code repetition
Aug 19, 2020
c72d709
gitignore build products
Aug 19, 2020
de62d93
remove unused variable
Aug 20, 2020
5d1bce6
whitespace fixes
Aug 20, 2020
d2345a8
tokssh: persist client key if ~/.tuntox/persist/ exists
Aug 20, 2020
930eda7
improve parsing
Aug 20, 2020
8b340e2
ping mode: quit after pong (per documentation)
Aug 20, 2020
9217b34
remove unused variable
Aug 20, 2020
6ce9e56
avoid redundant comparison
Aug 20, 2020
ab4fa64
use tox_callback_friend_connection_status instead of polling
Aug 20, 2020
8569e6c
two new make targets: install-debs and debs
Aug 20, 2020
7712e55
gitignore gitversion.h
Aug 20, 2020
ed93588
add "-dirty" to gitversion.h when tree is dirty"
Aug 20, 2020
a45445e
Implement logging of the remote friend IP address
Aug 20, 2020
f70b248
skip tox bootstrap
Aug 20, 2020
f32dfb2
improve clarity
Aug 21, 2020
bd9ff5d
avoid unneeded conditionals
Aug 21, 2020
de2f3dc
fix indentation
Aug 21, 2020
1c8ef41
Move rule check to separate function
Aug 21, 2020
472f2f0
Allow wildcards in rules
Aug 21, 2020
22fd388
Change enum rules_policy to bool enforce_whitelist
Aug 21, 2020
127d2c2
Implement wildcard rules
Aug 21, 2020
f2153ae
represent program mode as a single enum
Aug 21, 2020
43f3a56
cleaning up the client state machine
Aug 21, 2020
8ee3c22
WIP
Aug 21, 2020
b947044
It's broken.
Aug 21, 2020
0a9ce77
It's fixed!
Aug 21, 2020
893fab6
whitespace
Aug 21, 2020
475d51f
set CONNECTED state in callback
Aug 21, 2020
2a7edb9
remove unused states
Aug 21, 2020
4dbabac
split large function in two, changing nothing
Aug 21, 2020
1c0e073
do not need to check program_mode here
Aug 21, 2020
7c03915
factorize usleep()-related code in main.c
Aug 22, 2020
3b65c8c
change log levels
Aug 22, 2020
afdfa84
fixup! factorize usleep()-related code in main.c
Aug 22, 2020
34867d1
error handling/reporting
Aug 22, 2020
38f74d3
fixup! change log levels
Aug 22, 2020
7b8fea7
use tox_timer for sleep on client
Aug 22, 2020
17c8cbf
logging improvements
Aug 24, 2020
702b610
tighter variable scope
Aug 24, 2020
e1d746e
steve
Aug 28, 2020
99a0520
Fix public key conflict
Aug 29, 2020
5961303
install tokssh
Aug 29, 2020
f32da4e
debian package will include service file; install target will enable …
Feb 24, 2021
88f3bbb
hard-code dependencies instead of using wildcard
Oct 7, 2021
41e73ea
fix whitespace
Oct 7, 2021
4f0d034
fix gitversion.h to rebuild only when changed
Oct 7, 2021
d965141
cleanup whitespace
Oct 7, 2021
ba7ed80
fixup! fix gitversion.h to rebuild only when changed
Oct 7, 2021
e3e7db9
enable warnings
Oct 7, 2021
dc362fa
silence warnings
Oct 7, 2021
0108aee
Makefile fixes
Oct 7, 2021
3898781
silence unused variable warnings
Oct 7, 2021
6d71058
whitespace
Oct 7, 2021
3347bab
enabling warnings found this real bug
Oct 7, 2021
1904354
clarify string manipulation code
Oct 7, 2021
90085ba
"make install" will use sudo
Oct 7, 2021
447ad05
Makefile: output consistency
Oct 7, 2021
eb4d601
tokssh can safely accept new ssh keys, since the tox ID is self-authe…
Oct 7, 2021
07f88c9
new command toxish
Oct 8, 2021
8b9302b
always rebuild debs for install-debs
Oct 8, 2021
e247b29
try to fix the fallthrough warning
Oct 10, 2021
6b71f5d
tokssh: major improvements
Oct 10, 2021
4f56fa7
toxish: fixes
Oct 10, 2021
630f77b
Revert "try to fix the fallthrough warning"
Feb 25, 2022
c65d4ea
fix tokssh
Mar 2, 2022
fe05915
gitignore *.deb
Mar 2, 2022
e7010e7
toxish: files in ~/.ssh/config.d/ must end in .conf
Oct 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@

# tuntox related, not needed in repo
tuntox
tuntox_nostatic
debian/debhelper-build-stamp
debian/files
debian/tuntox.substvars
gitversion.h
*.deb
73 changes: 51 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,51 +1,80 @@
SOURCES = $(wildcard *.c)
DEPS=toxcore
CC=gcc
CFLAGS=-g -Wall #-std=c99
SOURCES = client.c gitversion.c log.c mach.c main.c util.c
OBJECTS = $(SOURCES:.c=.o)
SCRIPTS = scripts/tokssh scripts/toxish
EXECUTABLES = tuntox tuntox_nostatic
DEB_VERSION = 0.0.9-1
DEB_ARCH = amd64
DEBS = ../tuntox_$(DEB_VERSION)_$(DEB_ARCH).deb ../tuntox-dbgsym_$(DEB_VERSION)_$(DEB_ARCH).deb
INCLUDES = client.h gitversion.h log.h mach.h main.h tox_bootstrap.h utarray.h uthash.h util.h utlist.h utstring.h
DEPS = toxcore
CC = gcc
CFLAGS = -g -W -Wall -O2 -fcompare-debug-second
CFLAGS += $(shell pkg-config --cflags $(DEPS))
LDFLAGS=-g -pthread -lm -static -lrt
LDFLAGS = -g -pthread -lm -static -lrt
LDFLAGS += $(shell pkg-config --static --libs $(DEPS))
DSO_LDFLAGS=-g -pthread -lm -lrt
DSO_LDFLAGS = -g -pthread -lm -lrt
DSO_LDFLAGS += $(shell pkg-config --libs $(DEPS))
OBJECTS=$(SOURCES:.c=.o)
INCLUDES = $(wildcard *.h)
PYTHON = /usr/bin/env python3
INSTALL = install -C
INSTALL_MKDIR = $(INSTALL) -d -m 755

prefix ?= /usr
bindir ?= $(prefix)/bin
prefix = /usr
bindir = $(prefix)/bin
etcdir = /etc

# Targets
all: tuntox tuntox_nostatic
.PHONY: all clean
all: $(EXECUTABLES)

gitversion.h: FORCE
@if [ -f .git/HEAD ] ; then echo " GEN $@"; echo "#define GITVERSION \"$(shell git rev-parse HEAD)\"" > $@; fi
gitversion != printf %s $$(git rev-parse HEAD) && (git diff --quiet || printf %s -dirty)
gitversion_on_disk != 2>/dev/null read _ _ v < gitversion.h && echo $$v || true
ifneq ("$(gitversion)", $(gitversion_on_disk))
.PHONY: gitversion.h
endif

FORCE:
gitversion.h:
@echo " GEN $@"
@echo '#define GITVERSION "$(gitversion)"' > $@

tox_bootstrap.h:
$(PYTHON) generate_tox_bootstrap.py
tox_bootstrap.h:
$(PYTHON) generate_tox_bootstrap.py

%.o: %.c $(INCLUDES) gitversion.h tox_bootstrap.h
@echo " CC $@"
@$(CC) -c $(CFLAGS) $< -o $@

tuntox: $(OBJECTS) $(INCLUDES)
$(CC) -o $@ $(OBJECTS) -lpthread $(LDFLAGS)
$(CC) -o $@ $(OBJECTS) -lpthread $(LDFLAGS)

tuntox_nostatic: $(OBJECTS) $(INCLUDES)
$(CC) -o $@ $(OBJECTS) -lpthread $(DSO_LDFLAGS)
$(CC) -o $@ $(OBJECTS) -lpthread $(DSO_LDFLAGS)

cscope.out:
@echo " GEN $@"
@cscope -bv ./*.[ch] &> /dev/null

clean:
rm -f *.o tuntox cscope.out gitversion.h tox_bootstrap.h
rm -f $(OBJECTS) $(EXECUTABLES) cscope.out gitversion.h

ifneq ($(shell id -u),0)
install:
sudo MAKEFLAGS=$(MAKEFLAGS) -- $(MAKE) install
else
install: tuntox_nostatic
$(INSTALL_MKDIR) -d $(DESTDIR)$(bindir)
cp tuntox_nostatic $(DESTDIR)$(bindir)/tuntox
install -d -m755 $(DESTDIR)$(bindir) $(DESTDIR)$(etcdir)
install -d -m700 $(DESTDIR)$(etcdir)/tuntox
install -D -T tuntox_nostatic $(DESTDIR)$(bindir)/tuntox
install -D -t $(DESTDIR)$(bindir) $(SCRIPTS)
install -m0644 -D -t $(DESTDIR)$(etcdir)/systemd/system scripts/tuntox.service
ifeq ($(SKIP_SYSTEMCTL),)
systemctl daemon-reload
systemctl restart tuntox
systemctl status tuntox
endif
endif

.PHONY: all clean tuntox
.PHONY: install-debs debs
install-debs: debs
$(shell [ "$$(id -u)" = 0 ] || echo sudo) dpkg -i $(DEBS)
$(DEBS) debs:
fakeroot -- sh -c 'SKIP_SYSTEMCTL=y ./debian/rules binary'
Loading