-
Notifications
You must be signed in to change notification settings - Fork 32
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
add custom domain #635
add custom domain #635
Conversation
) | ||
|
||
|
||
class CustomDomain(models.Model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should just call it 'Domain' and then create a Domain entry for e.g. http://projecta.kartoza.com which is the default domain that all new projects get added to that do not have an explicitly set domain. Then add a foreign key reference to Domain from both the organisation and project models.
@@ -20,6 +20,7 @@ server { | |||
# the domain name it will serve for | |||
server_name staging.projecta.kartoza.com changelog.linfiniti.com changelog.kartoza.com changelog.qgis.org changelog.inasafe.org staging.changelog.qgis.org; | |||
charset utf-8; | |||
include /home/web/media/server-name.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would imaging that since we will on a dedicated server using * for server name might be a simpler approach and then let projecta handle whether the hostname in the header of the request if valid or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(that we we do not need to use server-name.txt tricks)
|
||
class Meta: | ||
ordering = ['user'] | ||
unique_together = ['user', 'custom_domain'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the domain would need to be independently unique - otherwise what will happen if two users try to register the same domain?
) | ||
|
||
class Meta: | ||
ordering = ['user'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets order by the domain name
@Ann26 Referring back to my original ticket at #635 I think it makes more sense to make an atomic PR that adds an organisation model and associates each project with each organisation. By default we can associate projects with the 'global' organisation until the are assigned to a specific organisation. Then each organisation and project will get associated with a domain. |
@Ann26 can you also take a look at this PR from @meomancer and review whether the code will fit within the framework we are setting up here: |
ok @timlinux will do |
Hi @timlinux , looking at @meomancer 's PR (#361) I think the code can fit our framework with a bit of modification. I tried it in my local and using it we can assign additional administrators that can have permissions the same as the owner in the project, as shown below: (for staff users, they get all projects) The app also includes custom template tag that we can implement in template, e.g. Maybe the Project Collaborators can be the Managers of each app (e.g. changelog, sponsorship, certification) ? In conclusion,
|
Hi @timlinux , here is update:
Gifs: Or may click on Travis is still failing, I am still investigating it. |
Wow @Ann26 beautiful work! Please merge when you have travis passing and then deploy it to staging so I can play with it a bit. |
River, Site, SiteVisit importer
fix #570 and fix #603
[ WIP ]
This PR:
server-name.txt
which is included in nginx so the domain will be included in the allowed hosts.@timlinux and @cchristelis is this the right approach?
in the admin panel:
![screenshot from 2017-11-29 18-03-07](https://user-images.githubusercontent.com/26101337/33372341-405f8136-d530-11e7-8a6b-c219054e7841.png)
![screenshot from 2017-11-29 18-03-20](https://user-images.githubusercontent.com/26101337/33372345-41444f64-d530-11e7-9404-3a256b5571a1.png)