#!/bin/sh
set -e
cd "$(dirname "$(realpath "$0")")"


rm -fr ./venv
rm -fr acme-onem2m
python -m venv ./venv
source ./venv/bin/activate
git clone https://github.com/ankraft/ACME-oneM2M-CSE.git acme-onem2m
python -m pip install --requirement=./acme-onem2m/requirements.txt
python -m pip install --requirement=./requirements.txt

echo "
[basic.config]
cseType=IN
cseID=id-in
cseName=cse-in
adminID=CAdmin
dataDirectory=\${baseDirectory}
networkInterface=0.0.0.0
cseHost=10.75.69.114
httpPort=8080
logLevel=debug
databaseInMemory=True
consoleTheme=dark

[cse.registration]
; Edit this to add more allowed originators.
allowedCSROriginators=id-in,id-mn,id-asn

[textui]
startWithTUI=false

[cse.operation.requests]
enable=true

[http]
enableUpperTesterEndpoint=true
enableStructureEndpoint=true
" > acme-onem2m/acme.ini
