mirror of
https://github.com/open5gs/open5gs.git
synced 2025-10-24 16:43:44 +00:00
Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4989c7aa3 | ||
|
|
5365893c34 | ||
|
|
3c65414135 | ||
|
|
80bcfcf646 | ||
|
|
7e460fbcb4 | ||
|
|
62fe796d41 | ||
|
|
0104543f7d | ||
|
|
39c30cb908 | ||
|
|
c09b272e53 | ||
|
|
92d8bde84a | ||
|
|
e2bb5706fa | ||
|
|
d74afc5bc7 | ||
|
|
c8a65b6b18 | ||
|
|
f5582c97b5 | ||
|
|
b8cc130bf5 | ||
|
|
12d65e92d1 | ||
|
|
2904284405 | ||
|
|
f1b0cd5748 | ||
|
|
91c9586561 | ||
|
|
05cfcf4cc3 | ||
|
|
c827701824 | ||
|
|
5fcc7e2ee6 | ||
|
|
bd1dff2dc5 | ||
|
|
f1ad0b11ae | ||
|
|
9a86d4cb7c | ||
|
|
38cccb8a85 | ||
|
|
2d72eaa24d | ||
|
|
f915820f3a | ||
|
|
1009ac5e47 | ||
|
|
536138457e | ||
|
|
730053cef4 |
@@ -29,6 +29,7 @@ To get the latest Ubuntu version, please visit the official Ubuntu website: [htt
|
||||
The NextEPC package is available on the recent versions of Ubuntu.
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install software-properties-common
|
||||
sudo add-apt-repository ppa:acetcom/nextepc
|
||||
sudo apt-get update
|
||||
@@ -69,7 +70,7 @@ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
|
||||
curl -sL http://nextepc.org/static/webui/install | sudo -E bash -
|
||||
```
|
||||
|
||||
The service name is *nextepc-webui*. You must run it manually after installation. And then, the web server will be running on _http://localhost:3000_.
|
||||
The service name is *nextepc-webui*, and it will be running on _http://localhost:3000_.
|
||||
|
||||
```bash
|
||||
sudo systemctl start nextepc-webui
|
||||
|
||||
23
configure.ac
23
configure.ac
@@ -8,7 +8,7 @@ dnl This program is distributed in the hope that it will be useful, but
|
||||
dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
AC_INIT([NextEPC], [0.3.3], [acetcom@gmail.com])
|
||||
AC_INIT([NextEPC], [0.3.4], [acetcom@gmail.com])
|
||||
|
||||
AC_SUBST(LIBVERSION)
|
||||
LIBVERSION=1:0:0
|
||||
@@ -379,24 +379,15 @@ AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS(\
|
||||
atexit \
|
||||
gettimeofday \
|
||||
inet_ntop \
|
||||
inet_pton \
|
||||
inet_aton \
|
||||
memmove \
|
||||
sigaction \
|
||||
sigwait \
|
||||
sigsuspend \
|
||||
stpcpy \
|
||||
strcasecmp \
|
||||
strtoul \
|
||||
stricmp \
|
||||
strerror \
|
||||
inet_ntop inet_pton inet_aton \
|
||||
sigaction sigwait sigsuspend \
|
||||
stpcpy strcasecmp strtoul stricmp \
|
||||
writev \
|
||||
utime \
|
||||
utimes \
|
||||
sem_timedwait \
|
||||
pthread_yield \
|
||||
sched_yield \
|
||||
utime utimes sem_timedwait \
|
||||
pthread_yield sched_yield \
|
||||
getenv putenv setenv unsetenv \
|
||||
)
|
||||
|
||||
AC_SEARCH_LIBS(gethostbyname, nsl)
|
||||
|
||||
24
debian/changelog
vendored
24
debian/changelog
vendored
@@ -1,3 +1,27 @@
|
||||
nextepc (0.3.4-1~xenial) xenial; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Thu, 22 Feb 2018 02:16:08 +0000
|
||||
|
||||
nextepc (0.3.4-1~artful) artful; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Thu, 22 Feb 2018 02:14:43 +0000
|
||||
|
||||
nextepc (0.3.4~xenial) xenial; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Thu, 22 Feb 2018 02:09:23 +0000
|
||||
|
||||
nextepc (0.3.4~artful) artful; urgency=medium
|
||||
|
||||
* Bug Fixed
|
||||
|
||||
-- Sukchan Lee <acetcom@gmail.com> Thu, 22 Feb 2018 01:33:04 +0000
|
||||
|
||||
nextepc (0.3.3-3~artful) artful; urgency=medium
|
||||
|
||||
* Support Docker
|
||||
|
||||
@@ -114,6 +114,26 @@ CORE_DECLARE(void *) core_buffer_to_bcd(c_uint8_t *in, int in_len, void *out);
|
||||
*/
|
||||
CORE_DECLARE(char *)core_cpystrn(char *dst, const char *src, size_t dst_size);
|
||||
|
||||
/**
|
||||
* Get the value of an environment variable
|
||||
* @param value the returned value, allocated from @a pool
|
||||
* @param envvar the name of the environment variable
|
||||
*/
|
||||
CORE_DECLARE(char *) core_env_get(const char *envvar);
|
||||
|
||||
/**
|
||||
* Set the value of an environment variable
|
||||
* @param envvar the name of the environment variable
|
||||
* @param value the value to set
|
||||
*/
|
||||
CORE_DECLARE(status_t) core_env_set(const char *envvar, const char *value);
|
||||
|
||||
/**
|
||||
* Delete a variable from the environment
|
||||
* @param envvar the name of the environment variable
|
||||
*/
|
||||
CORE_DECLARE(status_t) core_env_delete(const char *envvar);
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -13,6 +13,8 @@ extern "C" {
|
||||
#define TLV_MAX_MORE 8
|
||||
#define TLV_1_OR_MORE(__v) __v[TLV_MAX_MORE]
|
||||
|
||||
#define TLV_MAX_CHILD_DESC 128
|
||||
|
||||
typedef enum {
|
||||
TLV_UINT8,
|
||||
TLV_UINT16,
|
||||
@@ -37,7 +39,7 @@ typedef struct _tlv_desc_t {
|
||||
c_uint16_t length;
|
||||
c_uint8_t instance;
|
||||
c_uint16_t vsize;
|
||||
void *child_descs[];
|
||||
void *child_descs[TLV_MAX_CHILD_DESC];
|
||||
} tlv_desc_t;
|
||||
|
||||
extern tlv_desc_t tlv_desc_more1;
|
||||
|
||||
@@ -143,3 +143,56 @@ char *core_cpystrn(char *dst, const char *src, size_t dst_size)
|
||||
|
||||
return (d);
|
||||
}
|
||||
|
||||
char *core_env_get(const char *envvar)
|
||||
{
|
||||
#ifdef HAVE_GETENV
|
||||
return getenv(envvar);
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
status_t core_env_set(const char *envvar, const char *value)
|
||||
{
|
||||
#if defined(HAVE_SETENV)
|
||||
|
||||
if (0 > setenv(envvar, value, 1))
|
||||
return CORE_ENOMEM;
|
||||
return CORE_OK;
|
||||
|
||||
#elif defined(HAVE_PUTENV)
|
||||
|
||||
char buf[HUGE_STRING_LEN];
|
||||
|
||||
if (snprintf(buf, HUGE_STRING_LEN, "%s=%s", envvar, value) < 0)
|
||||
return CORE_ENOMEM;
|
||||
if (0 > putenv(buf))
|
||||
return CORE_ENOMEM;
|
||||
return CORE_OK;
|
||||
|
||||
#else
|
||||
return CORE_ENOTIMPL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
status_t core_env_delete(const char *envvar)
|
||||
{
|
||||
#ifdef HAVE_UNSETENV
|
||||
|
||||
unsetenv(envvar);
|
||||
return CORE_OK;
|
||||
|
||||
#else
|
||||
/* hint: some platforms allow envvars to be unset via
|
||||
* putenv("varname")... that isn't Single Unix spec,
|
||||
* but if your platform doesn't have unsetenv() it is
|
||||
* worth investigating and potentially adding a
|
||||
* configure check to decide when to use that form of
|
||||
* putenv() here
|
||||
*/
|
||||
return CORE_ENOTIMPL;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -137,6 +137,54 @@ static void misc_test7(abts_case *tc, void *data)
|
||||
ABTS_TRUE(tc, strcmp("001010123456819", out) == 0);
|
||||
}
|
||||
|
||||
#define TEST_ENVVAR_NAME "core_test_envvar"
|
||||
#define TEST_ENVVAR2_NAME "core_test_envvar2"
|
||||
#define TEST_ENVVAR_VALUE "Just a value that we'll check"
|
||||
|
||||
static void misc_test8(abts_case *tc, void *data)
|
||||
{
|
||||
char *value;
|
||||
status_t rv;
|
||||
|
||||
rv = core_env_set(TEST_ENVVAR_NAME, TEST_ENVVAR_VALUE);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
value = core_env_get(TEST_ENVVAR_NAME);
|
||||
ABTS_PTR_NOTNULL(tc, value);
|
||||
ABTS_STR_EQUAL(tc, TEST_ENVVAR_VALUE, value);
|
||||
|
||||
rv = core_env_delete(TEST_ENVVAR_NAME);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
value = core_env_get(TEST_ENVVAR_NAME);
|
||||
ABTS_PTR_NULL(tc, value);
|
||||
|
||||
rv = core_env_set(TEST_ENVVAR_NAME, "");
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
value = core_env_get(TEST_ENVVAR_NAME);
|
||||
ABTS_PTR_NOTNULL(tc, value);
|
||||
ABTS_STR_EQUAL(tc, "", value);
|
||||
|
||||
rv = core_env_delete(TEST_ENVVAR_NAME);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
value = core_env_get(TEST_ENVVAR_NAME);
|
||||
ABTS_PTR_NULL(tc, value);
|
||||
|
||||
rv = core_env_set(TEST_ENVVAR2_NAME, TEST_ENVVAR_VALUE);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
value = core_env_get(TEST_ENVVAR2_NAME);
|
||||
ABTS_PTR_NOTNULL(tc, value);
|
||||
ABTS_STR_EQUAL(tc, TEST_ENVVAR_VALUE, value);
|
||||
value = core_env_get(TEST_ENVVAR_NAME);
|
||||
ABTS_PTR_NULL(tc, value);
|
||||
value = core_env_get(TEST_ENVVAR2_NAME);
|
||||
ABTS_PTR_NOTNULL(tc, value);
|
||||
ABTS_STR_EQUAL(tc, TEST_ENVVAR_VALUE, value);
|
||||
|
||||
rv = core_env_delete(TEST_ENVVAR2_NAME);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
value = core_env_get(TEST_ENVVAR2_NAME);
|
||||
ABTS_PTR_NULL(tc, value);
|
||||
}
|
||||
|
||||
abts_suite *testmisc(abts_suite *suite)
|
||||
{
|
||||
suite = ADD_SUITE(suite)
|
||||
@@ -148,6 +196,7 @@ abts_suite *testmisc(abts_suite *suite)
|
||||
abts_run_test(suite, misc_test5, NULL);
|
||||
abts_run_test(suite, misc_test6, NULL);
|
||||
abts_run_test(suite, misc_test7, NULL);
|
||||
abts_run_test(suite, misc_test8, NULL);
|
||||
|
||||
return suite;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "core_debug.h"
|
||||
#include "core_thread.h"
|
||||
#include "core_file.h"
|
||||
#include "core_lib.h"
|
||||
|
||||
#include "context.h"
|
||||
|
||||
@@ -48,6 +49,10 @@ status_t app_will_initialize(const char *config_path, const char *log_path)
|
||||
|
||||
if (context_self()->db_uri)
|
||||
{
|
||||
/* Override configuration if DB_URI environment variable is existed */
|
||||
if (core_env_get("DB_URI"))
|
||||
context_self()->db_uri = core_env_get("DB_URI");
|
||||
|
||||
rv = context_db_init(context_self()->db_uri);
|
||||
if (rv != CORE_OK) return rv;
|
||||
d_print(" MongoDB URI : '%s'\n", context_self()->db_uri);
|
||||
|
||||
@@ -396,8 +396,9 @@ static int s1ap_usrsctp_recv_handler(struct socket *sock,
|
||||
case SCTP_PEER_ADDR_CHANGE:
|
||||
break;
|
||||
case SCTP_SEND_FAILED :
|
||||
d_error("SCTP_SEND_FAILED"
|
||||
d_error("flags:0x%x - SCTP_SEND_FAILED"
|
||||
"(type:0x%x, flags:0x%x, error:0x%x)\n",
|
||||
flags,
|
||||
not->sn_send_failed_event.ssfe_type,
|
||||
not->sn_send_failed_event.ssfe_flags,
|
||||
not->sn_send_failed_event.ssfe_error);
|
||||
@@ -416,6 +417,16 @@ static int s1ap_usrsctp_recv_handler(struct socket *sock,
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SCTP_REMOTE_ERROR:
|
||||
{
|
||||
d_warn("flags:0x%x - SCTP_REMOTE_ERROR"
|
||||
"(type:0x%x, flags:0x%x, error:0x%x)\n",
|
||||
flags,
|
||||
not->sn_remote_error.sre_type,
|
||||
not->sn_remote_error.sre_flags,
|
||||
not->sn_remote_error.sre_error);
|
||||
break;
|
||||
}
|
||||
default :
|
||||
d_error("Discarding event with unknown "
|
||||
"flags = 0x%x, type 0x%x",
|
||||
|
||||
@@ -212,11 +212,10 @@ static int _gtpv1_u_recv_cb(sock_id sock, void *data)
|
||||
d_assert(bearer->sess->sgw_ue, pkbuf_free(pkbuf); return 0,
|
||||
"SGW_UE is NULL");
|
||||
|
||||
d_trace(3, "[SGW] S1U PATH deactivated : STATE[0x%x]\n",
|
||||
SGW_GET_UE_STATE(sgw_ue));
|
||||
|
||||
sgw_ue = bearer->sess->sgw_ue;
|
||||
|
||||
d_trace(3, "[SGW] S1U PATH deactivated : STATE[0x%x]\n",
|
||||
SGW_GET_UE_STATE(sgw_ue));
|
||||
if ((SGW_GET_UE_STATE(sgw_ue) & SGW_S1U_INACTIVE))
|
||||
{
|
||||
d_trace(5, " SGW-S1U Inactive\n");
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#
|
||||
# NextEPC Dockerfile
|
||||
#
|
||||
# https://github.com/acetcom/nextepc
|
||||
#
|
||||
|
||||
# Pull base image.
|
||||
FROM ubuntu:latest
|
||||
|
||||
# Install NextEPC.
|
||||
RUN \
|
||||
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv F26B05AF && \
|
||||
echo 'deb http://ppa.launchpad.net/acetcom/nextepc/ubuntu xenial main' > /etc/apt/sources.list.d/nextepc.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y nextepc
|
||||
|
||||
# Define working directory.
|
||||
WORKDIR /root
|
||||
@@ -1,48 +1,64 @@
|
||||
NextEPC docker
|
||||
Docker running example
|
||||
===========================================
|
||||
* Build Image
|
||||
$ docker-compose build
|
||||
|
||||
* docker build -t nextepc .
|
||||
* docker run --net=host --hostname nextepc -ti --name nextepc --privileged --cap-add=SYS_ADMIN -e "container=docker" -v /sys/fs/cgroup:/sys/fs/cgroup -v $PWD:/mnt nextepc /sbin/init
|
||||
* docker exec -it /bin/bash
|
||||
* sudo apt-get install curl sudo
|
||||
* curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
|
||||
* curl -sL http://nextepc.org/static/webui/install | sudo -E bash -
|
||||
* Development
|
||||
$ docker-compose run dev
|
||||
|
||||
* Runtime
|
||||
$ docker-compose \
|
||||
-f docker-compose.yml -f docker-compose.run.yml run run
|
||||
|
||||
* Test
|
||||
$ docker-compose \
|
||||
-f docker-compose.yml -f docker-compose.test.yml run test
|
||||
|
||||
* Test(ubuntu:artful)
|
||||
$ TAG=artful docker-compose build
|
||||
$ TAG=artful docker-compose \
|
||||
-f docker-compose.yml -f docker-compose.test.yml run test
|
||||
|
||||
* Development(fedora:latest)
|
||||
$ DIST=fedora docker-compose build
|
||||
$ DIST=fedora docker-compose run dev
|
||||
|
||||
* Runtime(debian:jessie)
|
||||
$ DIST=debian TAG=jessie docker-compose build
|
||||
$ DIST=debian TAG=jessie docker-compose
|
||||
-f docker-compose.yml -f docker-compose.run.yml run run
|
||||
|
||||
* All Test with All Environment
|
||||
$ ./check.sh
|
||||
|
||||
* Run WebUI
|
||||
$ docker-compose up -d
|
||||
|
||||
For Debian Package Release
|
||||
===========================================
|
||||
|
||||
* Ubuntu Docker Setup
|
||||
|
||||
$ docker run -p 4000:3000 --hostname build -ti --name build --privileged --cap-add=SYS_ADMIN -e "container=docker" -v /sys/fs/cgroup:/sys/fs/cgroup -v $PWD:/mnt ubuntu /sbin/init
|
||||
$ docker exec -it ubuntu /bin/login
|
||||
|
||||
* Access Source Repository
|
||||
$ sudo apt-get install sudo vim dpkg-dev git
|
||||
$ git clone https://github.com/acetcom/nextepc
|
||||
$ git checkout new_branch
|
||||
|
||||
* Check Pakcage
|
||||
$ dpkg-buildpackage
|
||||
$ sudo apt-get install ....
|
||||
$ dpkg-buildpackage
|
||||
* Run Docker
|
||||
$ docker-compose run dev
|
||||
|
||||
* Setup Debian Environment
|
||||
export DEBFULLNAME='Sukchan Lee'
|
||||
export DEBEMAIL='acetcom@gmail.com'
|
||||
|
||||
* Transfer GPG key
|
||||
$ gpg --export-secret-keys --armor --output private.asc'
|
||||
$ gpg --export-secret-keys --armor --output private.asc
|
||||
$ gpg --import private.asc
|
||||
$ gpg --export > public.asc'
|
||||
$ gpg --export > public.asc
|
||||
$ gpg --import public.asc
|
||||
|
||||
* Update debian/changelog
|
||||
$ sudo apt-get install devscripts
|
||||
$ dch -i
|
||||
|
||||
* Test OBS
|
||||
$ debuild -S
|
||||
- Upload *.dsc and *.tar.gz to https://build.opensuse.org/package/show/home:acetcom/nextepc
|
||||
|
||||
* Upload LaunchPad
|
||||
$ dch -i
|
||||
$ debuild -S
|
||||
$ dput ppa:acetcom/nextepc *.source.changes
|
||||
|
||||
* Build pckage
|
||||
$ dpkg-buildpackage
|
||||
|
||||
For Mac OS X (SCTP-patch)
|
||||
===========================================
|
||||
* /Applications/Docker.app/Contents/Resources/moby
|
||||
Update linuxkit-kernel, vmlinuz64
|
||||
|
||||
24
support/docker/build/Dockerfile
Normal file
24
support/docker/build/Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
ARG dist=ubuntu
|
||||
ARG tag=latest
|
||||
ARG username=acetcom
|
||||
FROM ${username}/${dist}-${tag}-base
|
||||
|
||||
MAINTAINER Sukchan Lee <acetcom@gmail.com>
|
||||
|
||||
WORKDIR /root
|
||||
COPY setup.sh /root
|
||||
|
||||
ARG USER=acetcom
|
||||
ARG REPO=nextepc
|
||||
ARG BRANCH=master
|
||||
RUN git clone https://github.com/$USER/$REPO
|
||||
ADD https://api.github.com/repos/$USER/$REPO/git/refs/heads/$BRANCH /root/nextepc-ver.json
|
||||
|
||||
RUN cd nextepc && \
|
||||
git fetch && git checkout -f -B master origin/master && \
|
||||
autoreconf -f -i && \
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
--localstatedir=/var && \
|
||||
make -j `nproc` install
|
||||
10
support/docker/build/setup.sh
Executable file
10
support/docker/build/setup.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! grep "pgwtun" /proc/net/dev > /dev/null; then
|
||||
ip tuntap add name pgwtun mode tun
|
||||
fi
|
||||
ip addr del 45.45.0.1/16 dev pgwtun 2> /dev/null
|
||||
ip addr add 45.45.0.1/16 dev pgwtun
|
||||
ip addr del cafe::1/64 dev pgwtun 2> /dev/null
|
||||
ip addr add cafe::1/64 dev pgwtun
|
||||
ip link set pgwtun up
|
||||
24
support/docker/centos/7/base/Dockerfile
Normal file
24
support/docker/centos/7/base/Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
ARG dist=centos
|
||||
ARG tag=latest
|
||||
FROM ${dist}:${tag}
|
||||
|
||||
MAINTAINER Sukchan Lee <acetcom@gmail.com>
|
||||
|
||||
RUN yum -y install \
|
||||
autoconf \
|
||||
libtool \
|
||||
gcc \
|
||||
flex \
|
||||
bison \
|
||||
git \
|
||||
lksctp-tools-devel \
|
||||
libidn-devel \
|
||||
gnutls-devel \
|
||||
libgcrypt-devel \
|
||||
openssl-devel \
|
||||
cyrus-sasl-devel \
|
||||
libyaml-devel \
|
||||
iproute
|
||||
|
||||
RUN yum -y install epel-release && \
|
||||
yum -y install mongo-c-driver-devel
|
||||
22
support/docker/centos/7/dev/Dockerfile
Normal file
22
support/docker/centos/7/dev/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
ARG dist=centos
|
||||
ARG tag=latest
|
||||
ARG username=acetcom
|
||||
FROM ${username}/${dist}-${tag}-base
|
||||
|
||||
MAINTAINER Sukchan Lee <acetcom@gmail.com>
|
||||
|
||||
RUN yum -y install \
|
||||
cscope \
|
||||
vim \
|
||||
sudo \
|
||||
iputils \
|
||||
net-tools
|
||||
|
||||
COPY setup.sh /root
|
||||
|
||||
ARG username=acetcom
|
||||
RUN useradd -m --uid=1000 ${username} && \
|
||||
echo "${username} ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/${username} && \
|
||||
chmod 0440 /etc/sudoers.d/${username}
|
||||
|
||||
WORKDIR /home/${username}
|
||||
10
support/docker/centos/7/dev/setup.sh
Executable file
10
support/docker/centos/7/dev/setup.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! grep "pgwtun" /proc/net/dev > /dev/null; then
|
||||
ip tuntap add name pgwtun mode tun
|
||||
fi
|
||||
ip addr del 45.45.0.1/16 dev pgwtun 2> /dev/null
|
||||
ip addr add 45.45.0.1/16 dev pgwtun
|
||||
ip addr del cafe::1/64 dev pgwtun 2> /dev/null
|
||||
ip addr add cafe::1/64 dev pgwtun
|
||||
ip link set pgwtun up
|
||||
1
support/docker/centos/latest
Symbolic link
1
support/docker/centos/latest
Symbolic link
@@ -0,0 +1 @@
|
||||
7
|
||||
18
support/docker/check.sh
Executable file
18
support/docker/check.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
docker-compose build
|
||||
docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
|
||||
|
||||
TAG=artful docker-compose build
|
||||
TAG=artful docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
|
||||
|
||||
DIST=fedora docker-compose build
|
||||
DIST=fedora docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
|
||||
|
||||
DIST=centos docker-compose build
|
||||
DIST=centos docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
|
||||
|
||||
DIST=debian TAG=jessie docker-compose build
|
||||
DIST=debian TAG=jessie docker-compose -f docker-compose.yml -f docker-compose.test.yml run --rm test
|
||||
|
||||
docker rm $(docker ps -qa --no-trunc --filter "status=exited")
|
||||
1
support/docker/debian
Symbolic link
1
support/docker/debian
Symbolic link
@@ -0,0 +1 @@
|
||||
ubuntu/
|
||||
22
support/docker/docker-compose.run.yml
Normal file
22
support/docker/docker-compose.run.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
run:
|
||||
network_mode: "host"
|
||||
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-build
|
||||
depends_on:
|
||||
- mongodb
|
||||
- build
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
devices:
|
||||
- "/dev/net/tun:/dev/net/tun"
|
||||
sysctls:
|
||||
- net.ipv6.conf.all.disable_ipv6=0
|
||||
volumes:
|
||||
- config:/etc/nextepc
|
||||
hostname: nextepc-run
|
||||
command: /bin/bash -c "/root/setup.sh; /usr/bin/nextepc-epcd"
|
||||
|
||||
volumes:
|
||||
config: {}
|
||||
18
support/docker/docker-compose.test.yml
Normal file
18
support/docker/docker-compose.test.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
test:
|
||||
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-build
|
||||
depends_on:
|
||||
- mongodb
|
||||
- build
|
||||
environment:
|
||||
DB_URI: mongodb://mongodb/nextepc
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
devices:
|
||||
- "/dev/net/tun:/dev/net/tun"
|
||||
sysctls:
|
||||
- net.ipv6.conf.all.disable_ipv6=0
|
||||
hostname: nextepc-test
|
||||
command: /bin/bash -c "/root/setup.sh; /usr/bin/testepc"
|
||||
73
support/docker/docker-compose.yml
Normal file
73
support/docker/docker-compose.yml
Normal file
@@ -0,0 +1,73 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
mongodb:
|
||||
image: mongo
|
||||
container_name: nextepc-mongodb
|
||||
ports:
|
||||
- "27017:27017"
|
||||
volumes:
|
||||
- mongodb:/data/db
|
||||
|
||||
webui:
|
||||
build: webui
|
||||
image: ${USER}/nextepc-webui
|
||||
container_name: nextepc-webui
|
||||
depends_on:
|
||||
- mongodb
|
||||
ports:
|
||||
- "3000:3000"
|
||||
depends_on:
|
||||
- mongodb
|
||||
environment:
|
||||
DB_URI: mongodb://mongodb/nextepc
|
||||
|
||||
base:
|
||||
build:
|
||||
context: ./${DIST-ubuntu}/${TAG-latest}/base
|
||||
args:
|
||||
dist: ${DIST-ubuntu}
|
||||
tag: ${TAG-latest}
|
||||
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-base
|
||||
command: /bin/bash -c "echo 'base' services"
|
||||
|
||||
build:
|
||||
build:
|
||||
context: ./build
|
||||
args:
|
||||
dist: ${DIST-ubuntu}
|
||||
tag: ${TAG-latest}
|
||||
username: ${USER}
|
||||
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-build
|
||||
depends_on:
|
||||
- base
|
||||
command: /bin/bash -c "echo 'build' services"
|
||||
|
||||
dev:
|
||||
build:
|
||||
context: ./${DIST-ubuntu}/${TAG-latest}/dev
|
||||
args:
|
||||
dist: ${DIST-ubuntu}
|
||||
tag: ${TAG-latest}
|
||||
username: ${USER}
|
||||
image: ${USER}/${DIST-ubuntu}-${TAG-latest}-dev
|
||||
depends_on:
|
||||
- mongodb
|
||||
- base
|
||||
environment:
|
||||
DB_URI: mongodb://mongodb/nextepc
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
devices:
|
||||
- "/dev/net/tun:/dev/net/tun"
|
||||
sysctls:
|
||||
- net.ipv6.conf.all.disable_ipv6=0
|
||||
volumes:
|
||||
- home:/home/${USER}
|
||||
- ${HOME}:/mnt
|
||||
hostname: nextepc-dev
|
||||
command: /bin/bash -c "chmod 666 /dev/net/tun; /root/setup.sh; su acetcom"
|
||||
|
||||
volumes:
|
||||
mongodb: {}
|
||||
home: {}
|
||||
23
support/docker/fedora/27/base/Dockerfile
Normal file
23
support/docker/fedora/27/base/Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
ARG dist=fedora
|
||||
ARG tag=latest
|
||||
FROM ${dist}:${tag}
|
||||
|
||||
MAINTAINER Sukchan Lee <acetcom@gmail.com>
|
||||
|
||||
RUN dnf -y install \
|
||||
autoconf \
|
||||
libtool \
|
||||
gcc \
|
||||
flex \
|
||||
bison \
|
||||
git \
|
||||
lksctp-tools-devel \
|
||||
libidn-devel \
|
||||
gnutls-devel \
|
||||
libgcrypt-devel \
|
||||
mongo-c-driver-devel \
|
||||
openssl-devel \
|
||||
cyrus-sasl-devel \
|
||||
snappy-devel \
|
||||
libyaml-devel \
|
||||
iproute
|
||||
22
support/docker/fedora/27/dev/Dockerfile
Normal file
22
support/docker/fedora/27/dev/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
ARG dist=fedora
|
||||
ARG tag=latest
|
||||
ARG username=acetcom
|
||||
FROM ${username}/${dist}-${tag}-base
|
||||
|
||||
MAINTAINER Sukchan Lee <acetcom@gmail.com>
|
||||
|
||||
RUN dnf -y install \
|
||||
cscope \
|
||||
vim \
|
||||
sudo \
|
||||
iputils \
|
||||
net-tools
|
||||
|
||||
COPY setup.sh /root
|
||||
|
||||
ARG username=acetcom
|
||||
RUN useradd -m --uid=1000 ${username} && \
|
||||
echo "${username} ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/${username} && \
|
||||
chmod 0440 /etc/sudoers.d/${username}
|
||||
|
||||
WORKDIR /home/${username}
|
||||
10
support/docker/fedora/27/dev/setup.sh
Executable file
10
support/docker/fedora/27/dev/setup.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! grep "pgwtun" /proc/net/dev > /dev/null; then
|
||||
ip tuntap add name pgwtun mode tun
|
||||
fi
|
||||
ip addr del 45.45.0.1/16 dev pgwtun 2> /dev/null
|
||||
ip addr add 45.45.0.1/16 dev pgwtun
|
||||
ip addr del cafe::1/64 dev pgwtun 2> /dev/null
|
||||
ip addr add cafe::1/64 dev pgwtun
|
||||
ip link set pgwtun up
|
||||
1
support/docker/fedora/latest
Symbolic link
1
support/docker/fedora/latest
Symbolic link
@@ -0,0 +1 @@
|
||||
27
|
||||
10
support/docker/package/Dockerfile
Normal file
10
support/docker/package/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
ARG tag=latest
|
||||
FROM ubuntu:${tag}
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get -y install software-properties-common && \
|
||||
add-apt-repository ppa:acetcom/nextepc && \
|
||||
apt-get update && \
|
||||
apt-get install -y nextepc
|
||||
|
||||
WORKDIR /root
|
||||
1
support/docker/ubuntu/artful
Symbolic link
1
support/docker/ubuntu/artful
Symbolic link
@@ -0,0 +1 @@
|
||||
xenial
|
||||
1
support/docker/ubuntu/jessie
Symbolic link
1
support/docker/ubuntu/jessie
Symbolic link
@@ -0,0 +1 @@
|
||||
trusty
|
||||
1
support/docker/ubuntu/latest
Symbolic link
1
support/docker/ubuntu/latest
Symbolic link
@@ -0,0 +1 @@
|
||||
xenial
|
||||
37
support/docker/ubuntu/trusty/base/Dockerfile
Normal file
37
support/docker/ubuntu/trusty/base/Dockerfile
Normal file
@@ -0,0 +1,37 @@
|
||||
ARG dist=ubuntu
|
||||
ARG tag=latest
|
||||
FROM ${dist}:${tag}
|
||||
|
||||
MAINTAINER Sukchan Lee <acetcom@gmail.com>
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get upgrade -y && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
autoconf \
|
||||
automake \
|
||||
libtool \
|
||||
gcc \
|
||||
flex \
|
||||
bison \
|
||||
git \
|
||||
libsctp-dev \
|
||||
libgnutls28-dev \
|
||||
libgcrypt-dev \
|
||||
libssl-dev \
|
||||
libidn11-dev \
|
||||
libyaml-dev \
|
||||
build-essential \
|
||||
iproute2 \
|
||||
ca-certificates \
|
||||
netbase \
|
||||
curl \
|
||||
pkg-config && \
|
||||
apt-get clean
|
||||
|
||||
WORKDIR /root
|
||||
RUN curl -SLO "https://github.com/mongodb/mongo-c-driver/releases/download/1.9.2/mongo-c-driver-1.9.2.tar.gz"; \
|
||||
tar xzf mongo-c-driver-1.9.2.tar.gz; \
|
||||
cd mongo-c-driver-1.9.2; \
|
||||
./configure --disable-automatic-init-and-cleanup; \
|
||||
make -j `nproc` install; \
|
||||
ldconfig;
|
||||
1
support/docker/ubuntu/trusty/dev
Symbolic link
1
support/docker/ubuntu/trusty/dev
Symbolic link
@@ -0,0 +1 @@
|
||||
../xenial/dev
|
||||
29
support/docker/ubuntu/xenial/base/Dockerfile
Normal file
29
support/docker/ubuntu/xenial/base/Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
||||
ARG dist=ubuntu
|
||||
ARG tag=latest
|
||||
FROM ${dist}:${tag}
|
||||
|
||||
MAINTAINER Sukchan Lee <acetcom@gmail.com>
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get upgrade -y && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
autoconf \
|
||||
automake \
|
||||
libtool \
|
||||
gcc \
|
||||
flex \
|
||||
bison \
|
||||
git \
|
||||
libsctp-dev \
|
||||
libgnutls28-dev \
|
||||
libgcrypt-dev \
|
||||
libssl-dev \
|
||||
libmongoc-dev \
|
||||
libbson-dev \
|
||||
libyaml-dev \
|
||||
build-essential \
|
||||
iproute2 \
|
||||
ca-certificates \
|
||||
netbase \
|
||||
pkg-config && \
|
||||
apt-get clean
|
||||
32
support/docker/ubuntu/xenial/dev/Dockerfile
Normal file
32
support/docker/ubuntu/xenial/dev/Dockerfile
Normal file
@@ -0,0 +1,32 @@
|
||||
ARG dist=ubuntu
|
||||
ARG tag=latest
|
||||
ARG username=acetcom
|
||||
FROM ${username}/${dist}-${tag}-base
|
||||
|
||||
MAINTAINER Sukchan Lee <acetcom@gmail.com>
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get upgrade -y && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
debhelper \
|
||||
devscripts \
|
||||
dput \
|
||||
dh-autoreconf \
|
||||
dh-systemd \
|
||||
manpages-dev \
|
||||
fakeroot \
|
||||
cscope \
|
||||
vim \
|
||||
sudo \
|
||||
iputils-ping \
|
||||
net-tools && \
|
||||
apt-get clean
|
||||
|
||||
COPY setup.sh /root
|
||||
|
||||
ARG username=acetcom
|
||||
RUN useradd -m --uid=1000 ${username} && \
|
||||
echo "${username} ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/${username} && \
|
||||
chmod 0440 /etc/sudoers.d/${username}
|
||||
|
||||
WORKDIR /home/${username}
|
||||
10
support/docker/ubuntu/xenial/dev/setup.sh
Executable file
10
support/docker/ubuntu/xenial/dev/setup.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! grep "pgwtun" /proc/net/dev > /dev/null; then
|
||||
ip tuntap add name pgwtun mode tun
|
||||
fi
|
||||
ip addr del 45.45.0.1/16 dev pgwtun 2> /dev/null
|
||||
ip addr add 45.45.0.1/16 dev pgwtun
|
||||
ip addr del cafe::1/64 dev pgwtun 2> /dev/null
|
||||
ip addr add cafe::1/64 dev pgwtun
|
||||
ip link set pgwtun up
|
||||
21
support/docker/webui/Dockerfile
Normal file
21
support/docker/webui/Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
FROM node:carbon
|
||||
|
||||
MAINTAINER Sukchan Lee <acetcom@gmail.com>
|
||||
|
||||
ARG PACKAGE=nextepc
|
||||
ARG VERSION=0.3.3
|
||||
|
||||
RUN set -e; \
|
||||
cd /usr/src; \
|
||||
rm -rf ./$PACKAGE; \
|
||||
curl -SLO "https://github.com/acetcom/$PACKAGE/archive/v$VERSION.tar.gz"; \
|
||||
tar -xvf v$VERSION.tar.gz; \
|
||||
mv ./$PACKAGE-$VERSION/ ./$PACKAGE;
|
||||
|
||||
WORKDIR /usr/src/nextepc/webui
|
||||
RUN npm install && \
|
||||
npm run build
|
||||
|
||||
CMD npm run start
|
||||
|
||||
EXPOSE 3000
|
||||
@@ -6,14 +6,25 @@ if [ "$SYSTEM" = "Linux" ]; then
|
||||
if ! grep "pgwtun" /proc/net/dev > /dev/null; then
|
||||
ip tuntap add name pgwtun mode tun
|
||||
fi
|
||||
if test "x`sysctl -n net.ipv6.conf.pgwtun.disable_ipv6`" = x1; then
|
||||
echo "net.ipv6.conf.pgwtun.disable_ipv6=0" > /etc/sysctl.d/30-nextepc.conf
|
||||
sysctl -p /etc/sysctl.d/30-nextepc.conf
|
||||
fi
|
||||
ip addr del 45.45.0.1/16 dev pgwtun 2> /dev/null
|
||||
ip addr add 45.45.0.1/16 dev pgwtun
|
||||
ip addr del cafe::1/64 dev pgwtun 2> /dev/null
|
||||
ip addr add cafe::1/64 dev pgwtun
|
||||
ip link set pgwtun up
|
||||
else
|
||||
sysctl -w net.inet.ip.forwarding=1
|
||||
ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255
|
||||
ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255
|
||||
ifconfig lo0 alias 127.0.0.4 netmask 255.255.255.255
|
||||
ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255
|
||||
if [ "$SYSTEM" = "Darwin" ]; then
|
||||
if ! test -f /etc/pf.anchors/org.nextepc; then
|
||||
sudo sh -c "echo 'nat on {en0} from 45.45.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.nextepc"
|
||||
fi
|
||||
pfctl -e -f /etc/pf.anchors/org.nextepc
|
||||
fi
|
||||
fi
|
||||
|
||||
2
webui/package-lock.json
generated
2
webui/package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nextepc",
|
||||
"version": "0.3.3",
|
||||
"version": "0.3.4",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nextepc",
|
||||
"version": "0.3.3",
|
||||
"version": "0.3.4",
|
||||
"description": "NextEPC",
|
||||
"main": "index.js",
|
||||
"repository": "https://github.com/acetcom/nextepc",
|
||||
|
||||
4316
webui/yarn.lock
4316
webui/yarn.lock
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user