Federated video streaming platform using ActivityPub and P2P in the web browser with Angular. https://joinpeertube.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
832 B

  1. import { program } from 'commander'
  2. import { assignToken, buildServer } from './cli'
  3. program
  4. .option('-u, --url <url>', 'Server url')
  5. .option('-n, --username <username>', 'Username')
  6. .option('-p, --password <token>', 'Password')
  7. .parse(process.argv)
  8. const options = program.opts()
  9. if (
  10. !options.url ||
  11. !options.username ||
  12. !options.password
  13. ) {
  14. if (!options.url) console.error('--url field is required.')
  15. if (!options.username) console.error('--username field is required.')
  16. if (!options.password) console.error('--password field is required.')
  17. process.exit(-1)
  18. }
  19. const server = buildServer(options.url)
  20. assignToken(server, options.username, options.password)
  21. .then(() => {
  22. console.log(server.accessToken)
  23. process.exit(0)
  24. })
  25. .catch(err => {
  26. console.error(err)
  27. process.exit(-1)
  28. })