Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

The Things Network commands starting server local lorawan

You need to have a console open in the folder where your docker-compose is then start with :
docker-compose pull

Next, you need to initialize the database of the Identity Server:
docker-compose run --rm stack is-db init

Next, an initial admin user has to be created. Make sure to give it a good password :
docker-compose run --rm stack is-db create-admin-user 
  --id admin 
  --email your@email.com

Then the command-line interface needs to be registered as an OAuth client:
docker-compose run --rm stack is-db create-oauth-client 
  --id cli 
  --name "Command Line Interface" 
  --owner admin 
  --no-secret 
  --redirect-uri "local-callback" 
  --redirect-uri "code"
  
For --secret, make sure to enter the same value as you set for console.oauth.client-secret 
in the ttn-lw-stack-docker.yml file in the Configuration step:
copy the 1st line and change the secret
copy the 2nd line and input your local ip adress
CONSOLE_SECRET="your-console-secret"  
SERVER_ADDRESS="your-server-address" 
docker-compose run --rm stack is-db create-oauth-client  
  --id console 
  --name "Console" 
  --owner admin 
  --secret "${CONSOLE_SECRET}" 
  --redirect-uri "${SERVER_ADDRESS}/console/oauth/callback" 
  --redirect-uri "/console/oauth/callback" 
  --logout-redirect-uri "${SERVER_ADDRESS}/console" 
  --logout-redirect-uri "/console"

Start The Things Stack with:
docker-compose up
 
PREVIOUS NEXT
Tagged: #The #Things #Network #commands #starting #server #local #lorawan
ADD COMMENT
Topic
Name
7+8 =