Spreed: Add `occ` commands

Created on 7 Jun 2018  路  11Comments  路  Source: nextcloud/spreed

It should be possible to configure the installation and settings with the occ command. For example:

STUN servers: your.domain.org:<yourChosenPortNumber>
TURN server: your.domain.org:<yourChosenPortNumber>
TURN secret: <yourChosen/GeneratedSecret>
UDP and TCP

Would help a lot in https://github.com/nextcloud/vm/pull/561

2. developing enhancement settings 鈿欙笍 good first issue

Most helpful comment

Any thought about these?

php occ talk:stun:list
php occ talk:stun:add "stun.nextcloud.com:443"
php occ talk:stun:delete "stun.nextcloud.com:443"

php occ talk:turn:list
php occ talk:turn:add --server="turn.example.com" --secret="secret" --protocols="udp,tcp"
php occ talk:turn:add --server="turn.example.com" --generate-secret --protocols="udp,tcp"
php occ talk:turn:delete --server="turn.example.com" --protocols="udp,tcp"

php occ talk:signaling:list
php occ talk:signaling:add "wws://signaling.example.com" --validate-ssh-certificate
php occ talk:signaling:delete "wws://signaling.example.com"

All 11 comments

In theory you already can:
occ config:app:set spreed stun_servers <json encoded array list>

Already done here, but would be "nice-to-have" with specific commands.

@enoch85 would the following syntax be useful?
php occ spreed:stunservers "stun.nextcloud.com:443" "stun2.nextcloud.com:443"

looks good to me, but two suggestions:

  1. I would use talk: instead of spreed:
  2. I wonder if it makes sense to have dedicated commands to list/add/delete servers, instead of requiring to always set all of them in one go?

btw @denismosolov feel free to poke me after the talks today :sunglasses:

Any thought about these?

php occ talk:stun:list
php occ talk:stun:add "stun.nextcloud.com:443"
php occ talk:stun:delete "stun.nextcloud.com:443"

php occ talk:turn:list
php occ talk:turn:add --server="turn.example.com" --secret="secret" --protocols="udp,tcp"
php occ talk:turn:add --server="turn.example.com" --generate-secret --protocols="udp,tcp"
php occ talk:turn:delete --server="turn.example.com" --protocols="udp,tcp"

php occ talk:signaling:list
php occ talk:signaling:add "wws://signaling.example.com" --validate-ssh-certificate
php occ talk:signaling:delete "wws://signaling.example.com"

@denismosolov Great, thank you! :+1:

I rethought some parts of the above, submitted PR and I think we can start the review:

php occ talk:stun:list --output="plain"

output must be plain(default), json or json_pretty

php occ talk:stun:add "stun.nextcloud.com:443"

server must be hostname:port otherwise it prints an error message

php occ talk:stun:delete "stun.nextcloud.com:443"

doesnt validate server, always prints success message even if nothing was deleted
adds a default stun.nextcloud.com:443 if all servers were removed and prints a note about it

php occ talk:turn:list --output="plain"

output must be plain(default), json or json_pretty

php occ talk:turn:add "turn.example.com" "udp,tcp" --secret="secret"

server must be a non empty string
protocols must be tcp, udp or udp,tcp
secret must be a non empty string

php occ talk:turn:add "turn.example.com" "udp,tcp" --generate-secret

--secret and --generate-secret are not allowed together

php occ talk:turn:delete "turn.example.com" "udp,tcp"

doesnt validate server, always prints success message even if nothing was deleted

php occ talk:signaling:list --output="plain"

output must be plain(default), json or json_pretty
it prints list of signaling servers and shared secret

php occ talk:signaling:add "wws://signaling.example.com" "secret" --validate-ssh-certificate

server must be a non empty string
secret must be a non empty string
--validate-ssh-certificate is optional

php occ talk:signaling:delete "wws://signaling.example.com"

doesnt validate server, always prints success message even if nothing was deleted
--validate-ssh-certificate is optional

Added <info>There is nothing to delete.</info> message if user tries to delete a server which is not in the list

Hi @nickvergessen
Do you think this is a suitable place for occ talk documentation? https://docs.nextcloud.com/server/14/admin_manual/configuration_server/occ_command.html

For now I would put it into a .md file in the docs/ folder of this repo.

Was this page helpful?
0 / 5 - 0 ratings