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

Current restrictions due to hardcoded url in database #28

Closed
2 tasks
juliushaertl opened this issue Nov 15, 2018 · 1 comment
Closed
2 tasks

Current restrictions due to hardcoded url in database #28

juliushaertl opened this issue Nov 15, 2018 · 1 comment
Labels
bug Something isn't working technical debt
Milestone

Comments

@juliushaertl
Copy link
Member

  • Creating the account is using overwrite.cli.url, we probably should just use the domain the user is currently using when browsing the social app for the first time
  • The app requires the webserver to be configured to work without index.php. Those should be set dynamically depending on the configuration

@daita Don't we have any possibility to just keep the domain out of the database and add the domain prefix for the activity pub urls dynamically on each request?

E.g. we have cloud1.example.com and cloud2.example.com which are both trusted domains of the same Nextcloud instance.

Request https://cloud1.example.com/index.php/apps/social/@admin would return

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1"
  ],
  "id": "https://cloud1.example.com/index.php/apps/social/@admin",
  "type": "Person",
  "url": "https://cloud1.example.com/index.php/apps/social/@admin",
  "aliases": [
    "@admin",
    "users/admin"
  ],
  "preferredUsername": "admin",
  "name": "",
  "inbox": "https://cloud1.example.com/index.php/apps/social/@admin/inbox",
  "outbox": "https://cloud1.example.com/index.php/apps/social/@admin/outbox",
  "account": "",
  "following": "https://cloud1.example.com/index.php/apps/social/@admin/following",
  "followers": "https://cloud1.example.com/index.php/apps/social/@admin/followers",
  "endpoints": {
    "sharedInbox": "https://cloud1.example.com/index.php/apps/social/inbox"
  },
  "publicKey": {
    "id": "https://cloud1.example.com/index.php/apps/social/@admin#main-key",
    "owner": "https://cloud1.example.com/index.php/apps/social/@admin",
    "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0vtHX723CgzuL1MmSr/0\nso5seUsbfUQn8t7OZiOdxCD3o9uX08P3YlkNKirf/C0nruXTgxXLXPc7j5zTy9U7\nhl3apLMOZ83YPqxVVD+3lJwHRuTVEkwdcPYaYIlC3QlgrUC4i+WLy7G0E4jERc+L\n4Rhdv1pQ0xQcRQh36w9lAkmkX5/AaTcdRKK/93ZqCcdq6ZQcawYKRe091aNKyjZe\nkVGjKB90Q8ra+WCaQTnKWafh+lZ5gRHbkKZr0BoN2BxqkaxysS/IvR7esMuDLHwI\nzdgVj8EUf7eghG9ibdXWb6icedR2u6+9akIEpsnADko5MDLSI2JRZh6lQyXnWEgs\nKwIDAQAB\n-----END PUBLIC KEY-----\n"
  }
}

Request https://cloud2.example.com/index.php/apps/social/@admin would return

{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1"
  ],
  "id": "https://cloud2.example.com/index.php/apps/social/@admin",
  "type": "Person",
  "url": "https://cloud2.example.com/index.php/apps/social/@admin",
  "aliases": [
    "@admin",
    "users/admin"
  ],
  "preferredUsername": "admin",
  "name": "",
  "inbox": "https://cloud2.example.com/index.php/apps/social/@admin/inbox",
  "outbox": "https://cloud2.example.com/index.php/apps/social/@admin/outbox",
  "account": "",
  "following": "https://cloud2.example.com/index.php/apps/social/@admin/following",
  "followers": "https://cloud2.example.com/index.php/apps/social/@admin/followers",
  "endpoints": {
    "sharedInbox": "https://cloud2.example.com/index.php/apps/social/inbox"
  },
  "publicKey": {
    "id": "https://cloud2.example.com/index.php/apps/social/@admin#main-key",
    "owner": "https://cloud2.example.com/index.php/apps/social/@admin",
    "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0vtHX723CgzuL1MmSr/0\nso5seUsbfUQn8t7OZiOdxCD3o9uX08P3YlkNKirf/C0nruXTgxXLXPc7j5zTy9U7\nhl3apLMOZ83YPqxVVD+3lJwHRuTVEkwdcPYaYIlC3QlgrUC4i+WLy7G0E4jERc+L\n4Rhdv1pQ0xQcRQh36w9lAkmkX5/AaTcdRKK/93ZqCcdq6ZQcawYKRe091aNKyjZe\nkVGjKB90Q8ra+WCaQTnKWafh+lZ5gRHbkKZr0BoN2BxqkaxysS/IvR7esMuDLHwI\nzdgVj8EUf7eghG9ibdXWb6icedR2u6+9akIEpsnADko5MDLSI2JRZh6lQyXnWEgs\nKwIDAQAB\n-----END PUBLIC KEY-----\n"
  }
}
@ArtificialOwl
Copy link
Member

we're not using overwrite.cli.url anymore, host must be set in the admin settings page, and should not be changed once used.

Theoretically, changing the address for the social app would require to drop all data from database.
Now, if someone wants to change all ids in all table, this might be a working solution, but will still bring issues.

@jancborchardt jancborchardt added this to the 0.1 🥚 milestone Dec 2, 2018
@jancborchardt jancborchardt added technical debt bug Something isn't working labels Dec 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working technical debt
Projects
None yet
Development

No branches or pull requests

3 participants