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

recommendation for hosting UI and backend on same host #342

Closed
brainchild0 opened this issue Dec 7, 2020 · 12 comments
Closed

recommendation for hosting UI and backend on same host #342

brainchild0 opened this issue Dec 7, 2020 · 12 comments
Labels
question Further information is requested

Comments

@brainchild0
Copy link

Unlike many similar applications, Shlink maintains a package-level separation between the web UI and the REST backend. However, simple deployments may seek to place the combined system on a single host. The distributions of both package have no overlapping names at the top level, so one might consider unpacking both into the same location. Is this course recommended?

Otherwise, what recommendation is offered?

(Another possibility would seem to be putting the backend on a subdomain and exposing the UI on the main domain...?)

@brainchild0 brainchild0 added the question Further information is requested label Dec 7, 2020
@acelaya
Copy link
Member

acelaya commented Dec 7, 2020

Hey @brainchild0

Another possibility would seem to be putting the backend on a subdomain and exposing the UI on the main domain...?

If you really want to host them both, I would recommend using a subdomain for one of them, yes, but probably the other way around.

The backend is also de one serving short domains, so you probably want to keep them as short as possible, while having the web client under something like admin.example.com shouldn't be a problem as very limited users will have access to it.

In any case, there's something else you can do. Just host shlink and access to it through https://app.shlink.io. It is an app running 100% in the browser, so you are not leaking any confidential information.

That way, you can forget about updating the client. One less thing to worry about.

@brainchild0
Copy link
Author

So the architecture is that the web client functions effectively as a standalone client application that happens to be served into the web browser?

This design choice is highly unusual. One issue is that the security rests on several assumptions whose correctness is unclear to the user, or administrator provisioning a deployment. A second, more direct, issue is that a typical use case is that a user might visit a web portal on a self-hosted site, enter login credentials, and then have access to the interface. Under the current model, access is only possible from clients that previously have been provisioned.

Overall, this design strikes me as less secure and more restrictive.

@acelaya
Copy link
Member

acelaya commented Dec 9, 2020

Yes, it's true. The reason to choose this approach was to simplify maintainability for me (I wish I had more time to work on the project), but it certainly has some disadvantages.

@brainchild0
Copy link
Author

Well, regardless, when I try to run, I get XSS complaints from the browser, which is not surprising. How does one normally circumvent this restriction?

@acelaya
Copy link
Member

acelaya commented Dec 9, 2020

Shlink sends the CORS headers automatically, so you probably have something in between dropping them (a reverse proxy or something in those lines)

@brainchild0
Copy link
Author

No, no proxy. I can't think of anything on my client that would have such an effect.

@acelaya
Copy link
Member

acelaya commented Dec 10, 2020

What browser are you using? Can you paste a screenshot of the error that is displayed in the browser's console?

Can you try accessing your Shlink instance from https://app.shlink.io or https://api-spec.shlink.io and see if it works?

@brainchild0
Copy link
Author

I revisited your previous comment, and realize that you suggested that a reverse proxy might cause the issue. It is true that the server runs a ngix reverse proxy in front of Apache. This configuration is rather typical of shared hosting solutions.

@acelaya
Copy link
Member

acelaya commented Dec 10, 2020

Yes, I know. I also use a reverse proxy on front of my own shlink instances.

What I mean is that it's probably misconfigured, as it's removing the headers that shlink generates.

@brainchild0
Copy link
Author

The configuration is handled by Plesk, which is an all-in-one package to help vendors selling shared hosting. Do you have experience with this solution?

@acelaya
Copy link
Member

acelaya commented Dec 10, 2020

I'm afraid I don't

@acelaya
Copy link
Member

acelaya commented Dec 12, 2020

As the original question has been answered, I'm closing this issue.

Feel free to open other tickets if needed.

@acelaya acelaya closed this as completed Dec 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants