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

Apps should be able to register custom domain #27473

Closed
cm-t opened this issue Jun 11, 2021 · 3 comments
Closed

Apps should be able to register custom domain #27473

cm-t opened this issue Jun 11, 2021 · 3 comments
Labels
enhancement wontfix This will not be worked on

Comments

@cm-t
Copy link

cm-t commented Jun 11, 2021

How to use GitHub

  • Please use the 👍 reaction to show that you are interested into the same feature.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Is your feature request related to a problem? Please describe.

When i I use PicoCMS, I want to add a custom url (CNAME for eg) for a site using automatic configuration, means i must technically know what config in what file i must edit and i have to know if it affect any automatic (Nextcloud image based on ubuntu core/snap) updates. I feels i can't be 'just' a user, but a sysadmin.
Moreover you currently have to add the CNAME in the trusted hostname of Nextcloud while i'm sure we could dodge this.


Describe the solution you'd like

Provide for apps (in my case PicoCMS for Nextcloud) a way to add sub route of the node to be join-able by another (sub/parent)domain name; and it won't break with any update or anything unsecure would happend (it's better if it is done by upstream rather anyone do something manualy).

I didn't find another apps that need this, but i guess we could see new apps appearing such as:

  • an app that allow to share a public file under another domain name such as share.my.dn/fileID
  • an app that allow building shortUrl / redirecUrl under another domain name such as linkto.my.dn/CustomUrl
  • an app that allow users to share a basic public profil under antoher domain name such asme.my.dn/username
  • sky is the limit ?
    Basicly the custom CNAME would be an alias to index.php/apps/app_name/optionnal_subfolder. The optionnal_subfolder is important for the PicoCMS app for Nextcloud.

And an app could register many CNAME (especialy in the PicoCMS case, see 'additional context'), not just one, so it's not just a manifest file in the build of the app file I think, but a callable thing.

Describe alternatives you've considered

I don't have alternative, except a suggestion like it doesn't need to be working on all kind of Nextcloud installation (at least, in the beginning). for example, it could support at first, the snap/ubuntu core image since all the settings are known in the Nextcloud context.
I think apps should not themself modify the settings, but apps could ask Nextcloud to do so. Nextcloud could say no if the setting are not on its control (for eg: a custom install environment) or because it is in conflict (this app or another already registered a path with this domain).

Edit: an alternative would be (could be temporary or not) having a documentation section about how to do this manually. The snippets that can be found on this topic for nextcloud are often partial, not working, not suggesting to backup the original/current and working config file, and impacts of doing it; and moreover they do not even name the files themselves and their path. I guess having a howTo for nextcloud on snap/ubuntu core image would be a great start ?

Additional context

  • PicoCMS for Nextcloud road to 1.1 is mentionning this feature but it seems it might need something from the server itself to allow this.
  • There is an issue from PicoCMS explaining the need here: #83 (some apache/nginx snippet are posted or linked)
  • Here a basic use case context:
    • I have my nextcloud.my.dn
    • I have a picoCMS site i wish it was at the root: my.dn
    • and I have another site i wish it was at: blog.my.dn
    • In PicoCMS for Nextcloud apps config, i should be able to set the CNAME (that i have already registered on DNS) to this or that site (this is something to implemented from the PicoCMS for Nextcloud side, it could looks like the actual settings page with 1 more radio option followed by a text field for the CNAME, see this comment )
    • And pico will tells Nextcloud my wish, and Nextcloud will update its settings and it won't break with any update or anything unsecure would happend.
    • Something cool too would be that launching sudo nextcloud.enable-https lets-encrypt and typing nextcloud.my.dn my.dn blog.my.dn at the domain list prompt, will works. (I'm almost sure we could open a new issue feature request to have this callable from the admin panel, with hooks to apply it everytime a domain is added, or even safer, push a notification to make the admin confirm/adjust the list of domain before)

PS: Thank you for all the work that has been done from all the Nextcloud and apps contributors. Really.

edit: typos

@cm-t cm-t added 0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement labels Jun 11, 2021
@szaimen
Copy link
Contributor

szaimen commented Jul 27, 2021

Honestly, I don't think that this feature request is feasible.
But let's cc @nextcloud/server-triage for more opinions on this.

@skjnldsv
Copy link
Member

Yeah, that's out of scope

@skjnldsv skjnldsv added wontfix This will not be worked on and removed needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Jul 30, 2021
@goodretail
Copy link

Hi all,
I'm posting the link to my post in the thread 83
I have discovered a workaround is likely possible through the use of the vhosts file and mapping the domain to the PicoCMS website content directory.
I have checked with both my hosting provider and ChatGPT and done a thorough check after exhausting all possibilities through HTACCESS. Obviously that was all before discovering the discussion about it here.
Could anyone confirm if the solution of using the Vhosts file would please?

Also, I forgot to say that there is also a redirect required through the update of the htaccess setup in Nextcloud also.

The below is the HTACCESS update to the existing HTACCESS already available in the /nextcloud/ folder.
So i'm just at the point whether I should sign up to a VPS server to test this out.

Obviously if this solution works I am likely to take this route, but if not I might go for a headless CMS solution instead, and there are few I am testing out.
Headless CMS seems to be really taking the stage in a big way.

RewriteEngine On
# Force HTTPS for subdomain
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(www\.)?nextcloud\.parentdomain\.uk$ [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# Redirect jaega_digital_blog URL to uniquedomain.com
RewriteCond %{HTTP_HOST} ^(www\.)?nextcloud\.parentdomain\.uk$ [NC]
RewriteCond %{REQUEST_URI} ^/index.php/apps/cms_pico/pico/uniquedomain_blog(/.*)?$ [NC]
RewriteRule ^ https://jaegadigital.com [R=301,L]

# General rule to handle other requests
RewriteCond %{HTTP_HOST} ^(www\.)?nextcloud\.parentdomain\.uk$ [NC]
RewriteCond %{REQUEST_URI} !^/nextcloud/ [NC]
RewriteRule ^ /nextcloud/index.php [L]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants