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

🌏 Testing federation while there is no frontend yet #10686

Closed
nickvergessen opened this issue Oct 11, 2023 · 3 comments · Fixed by #11896
Closed

🌏 Testing federation while there is no frontend yet #10686

nickvergessen opened this issue Oct 11, 2023 · 3 comments · Fixed by #11896

Comments

@nickvergessen
Copy link
Member

nickvergessen commented Oct 11, 2023

Couple of manual steps are needed at the moment before being able to execute federation things locally.

  1. Enable federation on your instance
occ config:app:set spreed federation_enabled --value yes
  1. Allow federation with self-signed certificates and local remote servers
occ config:system:set sharing.federation.allowSelfSignedCertificates --value true --type bool
occ config:system:set allow_local_remote_servers --value true --type bool
  1. In case you do have a SSL cert set up on the instance you want to sent the federation invite to, make sure it's imported into your nextcloud and check it really worked (second command)
occ security:certificates:import /path/to/the/nextcloud.crt
occ security:certificates 

Lists something like the following for me:

+-----------------+-------------+--------------+--------------+-------------------------------------+
| File Name       | Common Name | Organization | Valid Until  | Issued By                           |
+-----------------+-------------+--------------+--------------+-------------------------------------+
| nextcloud28.crt | nextcloud28 | Nickv        | May 20, 2028 | Nickvergessen Certificate Authority |
+-----------------+-------------+--------------+--------------+-------------------------------------+
  1. Install the OCS viewer app https://github.com/nextcloud/ocs_api_viewer
  2. Navigate to the OCS > spreed > room > "Add a participant to a room"
  3. Fill in the auth (your current user name + password)
  4. Fill in the parameters: (see big screenshot below)
    • apiVersion: v4
    • token: token of the conversation you want to invite to
    • newParticipant: USERID@SERVERIP or when you use a domain to access nextcloud use that, e.g. [email protected]
    • sources: remotes
    • Confirm with Send API Request
  5. 🎉 The invited user should now have a notification informing them about the invite
    grafik

grafik

@Antreesy
Copy link
Contributor

Frontend shortcut: modify method

addableRemotes() {
if (this.searchResults !== []) {
return this.searchResults.filter((item) => item.source === 'remotes')
}

with following code:

addableRemotes() {
	if (this.searchResults !== []) {
		return this.searchResults.filter((item) => item.source === 'remotes')
			.concat(this.addableUsers.map(user => ({
				...user,
				id: user.id + '@' + window.location.host,
				label: user.label + '@' + window.location.host,
				source: 'remotes',
			})))
	}

That should allow to list local users as remote users:
image

@SystemKeeper
Copy link
Contributor

When using julius docker container (when using the nextcloud container, otherwise adjust the name):

./scripts/occ.sh nextcloud config:app:set spreed federation_enabled --value yes
./scripts/occ.sh nextcloud config:system:set sharing.federation.allowSelfSignedCertificates --value true --type bool
./scripts/occ.sh nextcloud config:system:set allow_local_remote_servers --value true --type bool

For SSL (adjust the filename):
docker compose cp data/ssl/nextcloud-mm.local.crt nextcloud:/tmp
./scripts/occ.sh nextcloud security:certificates:import /tmp/nextcloud-mm.local.crt
./scripts/occ.sh nextcloud security:certificates

@nickvergessen
Copy link
Member Author

Moving 2+3 into the readme, the rest is not needed anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants