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

feat: add NEF #133

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ DOCKER_IMAGE_NAME = 'base'
DOCKER_IMAGE_TAG = 'latest'

.PHONY: base
all: base amf ausf nrf nssf pcf smf udm udr n3iwf upf chf tngf webconsole
all: base amf ausf nrf nssf pcf smf udm udr n3iwf upf chf tngf nef webconsole

base:
docker build -t ${DOCKER_IMAGE_OWNER}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} ./base
Expand Down Expand Up @@ -33,6 +33,8 @@ chf: base
docker build --build-arg F5GC_MODULE=chf -t ${DOCKER_IMAGE_OWNER}/chf-base:${DOCKER_IMAGE_TAG} -f ./base/Dockerfile.nf ./base
tngf: base
docker build --build-arg F5GC_MODULE=tngf -t ${DOCKER_IMAGE_OWNER}/tngf-base:${DOCKER_IMAGE_TAG} -f ./base/Dockerfile.nf ./base
nef: base
docker build --build-arg F5GC_MODULE=nef -t ${DOCKER_IMAGE_OWNER}/nef-base:${DOCKER_IMAGE_TAG} -f ./base/Dockerfile.nf ./base

webconsole: base
docker build -t ${DOCKER_IMAGE_OWNER}/webconsole-base:${DOCKER_IMAGE_TAG} -f ./base/Dockerfile.nf.webconsole ./base
27 changes: 27 additions & 0 deletions cert/nef.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAqXpvTc1WpUqw6NI6+VcjBDf4tE2Zg/ebZx7Dr3th9P7GAI66
kVyooV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mK6OcHhiYKyJBMVCsg5wB
ywzOyjVwbeR0ie7DF1JWYbK4rNLhydikmGbLMbL2cSTOlmhMaKsCJtsXN/i/sMlX
2AP/2C4OqAkny64ii7axXQKBgAbOCC9y3OPuIBILWcicKpQSdTzlBVO71ayOgzUP
8JHZouMMjjaV3WNofru8Ze8Cpz2w8CHgYMJPutWYOk7QMMVLGcxjOfi0fDtXFLMO
+2E0PadJTQ6Ryfe3QovvNOJ6peebSvIVy9MPaHni42hIXPjhihbnbjPE6mCz45/l
9yOZAoGANrcL3qNMD6PDIvknr3Y7rhMStZsEdkFEGBTUSP4pZbwHnNIKX5iQluw7
Aawx2ZidYh89X8LFkPsup5OGTrAUP/TPCgXA+aZlO0yjVMCFlA7D+MTiNOeSOe//
0dAVhuRAFS510v0NfSPlLnSfA69jEcpuewf94ITMRj6MIiYLpxc=
-----END RSA PRIVATE KEY-----
20 changes: 20 additions & 0 deletions cert/nef.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDUzCCAjugAwIBAgIJANC4esPC102UMA0GCSqGSIb3DQEBCwUAMEAxCzAJBgNV
BAYTAlRXMRAwDgYDVQQIDAdIc2luY2h1MQ0wCwYDVQQHDARjaXR5MRAwDgYDVQQK
DAdmcmVlNUdDMB4XDTE5MDcxODA3NTkwOFoXDTI5MDcxNTA3NTkwOFowQDELMAkG
A1UEBhMCVFcxEDAOBgNVBAgMB0hzaW5jaHUxDTALBgNVBAcMBGNpdHkxEDAOBgNV
BAoMB2ZyZWU1R0MwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpem9N
zValSrDo0jr5VyMEN/i0TZmD95tnHsOve2H0/sYAjrqRXKihWbz1qy9khp2D7SRH
O4dHxwCiFoE6scZ1C212jHZPPXic2o60gxODjZiE7EW5L0wsvptH5PMuLo4SVP5J
kwUGwYZ01VRHdTSx/RWRuXOCKluIqcmoNCh4f/hEd5yWvAgGqytsqBVKw2EQ9BYJ
oSsUedmd9Hjz9QdVj72UWVCwFyBfUgz2VH8SC50FlZgEjHTBNjL5OriRHv4a0nGV
+YRZPdsAIja5jUP27XOm+N/dzHDCTQrihPtYsir+idF4hPJNuhwe0yEaq8zqKvKH
zU+VoWGZB4EssThZAgMBAAGjUDBOMB0GA1UdDgQWBBTRNsNPYUMfmh6xMHsYpdhz
GAlUszAfBgNVHSMEGDAWgBTRNsNPYUMfmh6xMHsYpdhzGAlUszAMBgNVHRMEBTAD
AQH/MA0GCSqGSIb3DQEBCwUAA4IBAQANX8eve1eV6G8m6kcBeD664yI9v9ELVXPV
XJ06Vlrcx3xYzpyO2aIDlbA++zfS1Fdlczmn1bSh2jKyRi0JPq8Bc2bvpKUPU+jL
vYIcbLaUkT+YeknDOOMDLpwpZRyuTWw1dZg/LnlGkuSgjgpvyrNhXdx216TwgjGX
ao7hqQDzumH/CIX1/Bw19xjvy8y21fqgIjpgL4yB/1erC4i/I2Z+mZEb3DH459gz
sTmrUHUjO0mSVHmnLYKaYJbRYQGPUQTg5fIYasOAFG3K3C485MGRgMiSkrAC7A2M
ZHioUNtm3XF9tfE1srtLsPGfypiM/hiGWIlgYJHUh8NYjQIXF9Pb
-----END CERTIFICATE-----
23 changes: 23 additions & 0 deletions config/nefcfg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
info:
version: 1.0.1
description: NEF initial local configuration

configuration:
sbi:
scheme: http # The protocol for sbi (http or https)
registerIPv4: nef.free5gc.org # IP used to register to NRF
bindingIPv4: nef.free5gc.org # IP used to bind the service
port: 8000 # port used to bind the service
tls: # the local path of TLS key
pem: cert/nef.pem # NEF TLS Certificate
key: cert/nef.key # NEF TLS Private key
nrfUri: http://nrf.free5gc.org:8000 # A valid URI of NRF
nrfCertPem: cert/nrf.pem # NRF Certificate
serviceList: # the SBI services provided by this NEF
- serviceName: nnef-pfdmanagement # Nnef_PFDManagement Service
- serviceName: nnef-oam # OAM service

logger: # log output setting
enable: true # true or false
level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic
reportCaller: false # enable the caller report or not, value: true or false
22 changes: 22 additions & 0 deletions docker-compose-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,28 @@ services:
- free5gc-smf
- free5gc-upf

free5gc-nef:
container_name: nef
build:
context: ./nf_nef
args:
DEBUG_TOOLS: "false"
command: ./nef -c ./config/nefcfg.yaml
expose:
- "8000"
volumes:
- ./config/nefcfg.yaml:/free5gc/config/nefcfg.yaml
- ./cert:/free5gc/cert
environment:
GIN_MODE: release
networks:
privnet:
aliases:
- nef.free5gc.org
depends_on:
- db
- free5gc-nrf

free5gc-webui:
container_name: webui
build:
Expand Down
22 changes: 22 additions & 0 deletions docker-compose-ulcl-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,28 @@ services:
- free5gc-nrf
- free5gc-webui

free5gc-nef:
container_name: nef
build:
context: ./nf_nef
args:
DEBUG_TOOLS: "false"
command: ./nef -c ./config/nefcfg.yaml
expose:
- "8000"
volumes:
- ./config/nefcfg.yaml:/free5gc/config/nefcfg.yaml
- ./cert:/free5gc/cert
environment:
GIN_MODE: release
networks:
privnet:
aliases:
- nef.free5gc.org
depends_on:
- db
- free5gc-nrf

free5gc-webui:
container_name: webui
build:
Expand Down
19 changes: 19 additions & 0 deletions docker-compose-ulcl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,25 @@ services:
- db
- free5gc-nrf
- free5gc-webui

free5gc-nef:
container_name: nef
image: free5gc/nef:latest
command: ./nef -c ./config/nefcfg.yaml
expose:
- "8000"
volumes:
- ./config/nefcfg.yaml:/free5gc/config/nefcfg.yaml
- ./cert:/free5gc/cert
environment:
GIN_MODE: release
networks:
privnet:
aliases:
- nef.free5gc.org
depends_on:
- db
- free5gc-nrf

free5gc-webui:
container_name: webui
Expand Down
19 changes: 19 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,25 @@ services:
- free5gc-smf
- free5gc-upf

free5gc-nef:
container_name: nef
image: free5gc/nef:latest
command: ./nef -c ./config/nefcfg.yaml
expose:
- "8000"
volumes:
- ./config/nefcfg.yaml:/free5gc/config/nefcfg.yaml
- ./cert:/free5gc/cert
environment:
GIN_MODE: release
networks:
privnet:
aliases:
- nef.free5gc.org
depends_on:
- db
- free5gc-nrf

free5gc-webui:
container_name: webui
image: free5gc/webui:v3.4.3
Expand Down
29 changes: 29 additions & 0 deletions nf_nef/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM free5gc/nef-base:latest AS builder
FROM alpine:3.15

LABEL description="Free5GC open source 5G Core Network" \
version="Stage 3"

ENV F5GC_MODULE nef
ARG DEBUG_TOOLS

# Install debug tools ~ 100MB (if DEBUG_TOOLS is set to true)
RUN if [ "$DEBUG_TOOLS" = "true" ] ; then apk add -U vim strace net-tools curl netcat-openbsd ; fi

# Set working dir
WORKDIR /free5gc
RUN mkdir -p config/ log/ cert/

# Copy executable and default certs
COPY --from=builder /free5gc/${F5GC_MODULE} ./
COPY --from=builder /free5gc/cert/${F5GC_MODULE}.pem ./cert/
COPY --from=builder /free5gc/cert/${F5GC_MODULE}.key ./cert/

# Config files volume
VOLUME [ "/free5gc/config" ]

# Certificates (if not using default) volume
VOLUME [ "/free5gc/cert" ]

# Exposed ports
EXPOSE 8000