Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
Signed-off-by: Ammar Faizi <[email protected]>
  • Loading branch information
ammarfaizi2 committed Jun 25, 2021
1 parent cd40e0a commit fe38d8b
Show file tree
Hide file tree
Showing 22 changed files with 2,367 additions and 1,425 deletions.
1 change: 1 addition & 0 deletions config/server.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ max_conn = 32
backlog = 10
ssl_cert = data/server/default_cert.pem
ssl_priv_key = data/server/default_key.pem
event_loop = io_uring

[iface]
dev = teavpn2-srv
Expand Down
28 changes: 28 additions & 0 deletions data/server/default_key.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC9zSX1fqMzZqeA
vlUcT/qy9x8qluVngayHcw0OyciEQCa9jIwA4rH1NRpEfYA5iLVMVwKb9YxRSquw
AhDAcmebPdkcyQ8t+OCyR2FbTgdohxqbWz/M5j6YKR30WB/rE9hciZqlh+IBDREo
x+FoqUH1K9/JtRxbWLrxL+pdphpHdcamWs0z/IaPuPjh/HqWJEud6ikIBwxALHD4
IiGpj4pGDeJMI3FmnjEua85TYKqzYquVfij/ryUWKjPRAyX8755nPimMrmUtfupV
KRvVQzmJTZCXtxCXD8JPbVzqBKPCE0GFtyGWYqL+v8LCAjlPJd2zyrMKRg3SBYL4
mBCUipabAgMBAAECggEAb/000YZYK0L9wHQNafgy9xfi1tFUKF+V+hHDeZ9L5eSo
Nx1PmlIoKIOdrR3T456rQpDwZC9dDLYfWWnOko6uXSYADgEAKOL5SZfedO40ZtOY
umP74B1Wf5d7Kio5Iw6BkhBLJDJqAq7AGizd7lA4L74kfDKVubxACYF5KqqQROrQ
F2w5S4lyeOppSCZKoEZ7XGuoni3BQ9dgtwTUn5MDnm6pvxUEj+BdamxebxzunZG8
9RrQqF0ocW9rpSi1KSZary+uq7v8ftnDJf2IwD/KiaZ+0pdMlipZXrZK8ZnjcsIF
8yOk52dhNyTbUvIGtn+lBA0XH5tj3rtfqe47h6Qq8QKBgQDfHfcrckzAJIplaCPn
Of5tzW1Wtpp6PajiYZTE/LrUyiu22U2zP3PjR3y0OlHC2cRIdS8rQK/PglyO1XnE
33dLdJ+ivTufSqw0uPoVH8gLWeKj12v/+Qe7Y/L2uTOYgbhqoxZ4z8PFkDlkJIY7
YSo6m72sviCkFh2T3qYaI3HWUwKBgQDZxjUWIuF8nQAZr3W+KAhDT4tHrwM+xoy3
PZySOVXxPFcObvvFp4vg+te2oab5vBplHrU8jTUZVCuDVZwnAoCN261xbI6EYRwr
DI8AlHgEb0vwT/IzF7uKDdwJmZqIO0fT7nlVn+xPx9Gh8C7Eu8QEQV4OSJS+R+q5
okVXmGqlmQKBgQCczUhqBjgeSQ/iWJ/y3vUKYfbXnBlQk4jfIEkXb6414ad7J5jN
wmhFcHYZi2ruj3C8o2507U8hfLJjx29+hrYmF14hVvBR8H65xs4qjl1ebNs03i6O
hIuEjKex8VJrea8LcnZWjV0+uS88S9byYET3T4CrqCr0Zn5+71i4wfQ89QKBgGJv
VBmQZKnF8YCqrabpQ2rhboxVUDs01fARuk7h+bXT12nfwpAB/pkP6SdVBDuHycqB
Sdx321N6lzyDGtULLX5xmIFXV0gA+RGAWLcjZOhkQkf6avirNordXuM7+fywBvSF
q3SHl/Ir2NbA0PL+CEkAHvqH1iv4J+IGth809qepAoGAA3SL5a0D65heoK83wTSQ
r1DxRfIyDtG3zcLGOs2kU3sYMCTfCtGJJd2oUJxAsFTVWJu9DShWpie3CpqC9ZWk
J3tPDaotLRpLaZ+ZheSNaek1MtwxIhV9hWjSnWW1vrGxjz3q+X1gsoSDl8xe5CQA
auXMyrcwpDzvBDl7bkEo1wc=
-----END PRIVATE KEY-----
18 changes: 18 additions & 0 deletions data/server/defaut_cert.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-----BEGIN CERTIFICATE-----
MIIC1jCCAb6gAwIBAgIUML90D8ANcVgG5orNE7j9roGLXVQwDQYJKoZIhvcNAQEL
BQAwEzERMA8GA1UEAwwIaW50ZWdyYWwwHhcNMjEwMjA3MDcwMjAxWhcNMzEwMjA1
MDcwMjAxWjATMREwDwYDVQQDDAhpbnRlZ3JhbDCCASIwDQYJKoZIhvcNAQEBBQAD
ggEPADCCAQoCggEBAL3NJfV+ozNmp4C+VRxP+rL3HyqW5WeBrIdzDQ7JyIRAJr2M
jADisfU1GkR9gDmItUxXApv1jFFKq7ACEMByZ5s92RzJDy344LJHYVtOB2iHGptb
P8zmPpgpHfRYH+sT2FyJmqWH4gENESjH4WipQfUr38m1HFtYuvEv6l2mGkd1xqZa
zTP8ho+4+OH8epYkS53qKQgHDEAscPgiIamPikYN4kwjcWaeMS5rzlNgqrNiq5V+
KP+vJRYqM9EDJfzvnmc+KYyuZS1+6lUpG9VDOYlNkJe3EJcPwk9tXOoEo8ITQYW3
IZZiov6/wsICOU8l3bPKswpGDdIFgviYEJSKlpsCAwEAAaMiMCAwCQYDVR0TBAIw
ADATBgNVHREEDDAKgghpbnRlZ3JhbDANBgkqhkiG9w0BAQsFAAOCAQEAOkguqIyf
LfU2y/y7qgMSWuwcRN2X5/gVEptb3mgLL1iAJK9jMscvTBZkgSlTDBcIhdVKr8Ka
F++KVk2ShcG40KjnrQh6bw0/5E3d9/X0b5hCqQ4REa1e4O2c9j0TNz0vLYMT36kS
Jz7z5FGL8GsC6wKmqLiwG8HjtT935ysUWAeY7rajbDaNdvP8kEEATyFOUNEBp5QF
m7ybs+zXhRA+tjkb8Enhx3uN/Ekx7OfDUoaLk2Ue6UOFokkm31Y3hHE3vGkuHie3
SawSUIpLU2QZIahsdWjUc6AjaQB1yOK7Htraqd8Zz44u5v1ccir47DQFG+NxP3Pi
fSHdf2b7Fe1q9g==
-----END CERTIFICATE-----
9 changes: 9 additions & 0 deletions data/server/users/ammarfaizi2.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

[auth]
username = ammarfaizi2
password = mypassword123

[iface]
ipv4 = 10.8.8.2
ipv4_netmask = 255.255.255.0
mtu = 1500
1 change: 1 addition & 0 deletions src/teavpn2/include/teavpn2/server/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ struct srv_sock_cfg {
int backlog;
char *ssl_cert;
char *ssl_priv_key;
char *event_loop;
};


Expand Down
2 changes: 2 additions & 0 deletions src/teavpn2/server/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ static bool parse_section_socket(struct srv_sock_cfg *sock, const char *name,
sock->ssl_cert = ar_strndup(value, 512);
} else if (!strcmp(name, "ssl_priv_key")) {
sock->ssl_priv_key = ar_strndup(value, 512);
} else if (!strcmp(name, "event_loop")) {
sock->event_loop = ar_strndup(value, 32);
} else {
return INVALID_NAME;
}
Expand Down
37 changes: 37 additions & 0 deletions src/teavpn2/server/linux.old/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#
# SPDX-License-Identifier: GPL-2.0
#
# @author Ammar Faizi <[email protected]> https://www.facebook.com/ammarfaizi2
# @license GNU GPL-2.0
#
# Copyright (C) 2021 Ammar Faizi
#

DEP_DIRS += $(BASE_DEP_DIR)/src/teavpn2/server/linux


OBJ_TMP_CC := \
$(BASE_DIR)/src/teavpn2/server/linux/tcp.o \
$(BASE_DIR)/src/teavpn2/server/linux/tcp_epoll.o



OBJ_JUST_RM += $(BASE_DIR)/src/teavpn2/server/linux/tcp_io_uring.o
ifdef IO_URING_SUPPORT
ifneq ($(IO_URING_SUPPORT),0)
CFLAGS += -DIO_URING_SUPPORT=1
OBJ_TMP_CC += $(BASE_DIR)/src/teavpn2/server/linux/tcp_io_uring.o
endif
endif



OBJ_PRE_CC += $(OBJ_TMP_CC)


$(OBJ_TMP_CC):
$(CC_PRINT)
$(Q)$(CC) $(PIC_FLAGS) $(DEPFLAGS) $(CFLAGS) -c $(O_TO_C) -o $(@)


$(BASE_DIR)/src/teavpn2/server/linux/tcp_io_uring.o: $(LIBURING_OBJ)
Loading

0 comments on commit fe38d8b

Please sign in to comment.