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

Proposal: http/https server and custom domain for everyone! #105

Open
8 of 12 tasks
mayli opened this issue Jul 16, 2019 · 10 comments
Open
8 of 12 tasks

Proposal: http/https server and custom domain for everyone! #105

mayli opened this issue Jul 16, 2019 · 10 comments

Comments

@mayli
Copy link
Contributor

mayli commented Jul 16, 2019

So, let's improve the nginx on shell server to next level!

Currently shell-server has a basic nginx service is nearly hard to use for new users.

So the plan is:

  • having a global nginx server listening on port 80 and 443

    • use Let's Encrypt to obtain https certificates and auto-renew
  • default etc/skel to provide

    • serve http://<user>.<server>.hashbang.sh from ~user/.nginx.sock
    • systemd --user service and nginx config to start nginx serving Public done
  • optional etc/skel to provide https service

    • serve https://<user>.<server>.hashbang.sh from ~user/.nginx.https.sock
    • systemd --user service and nginx config to start nginx serving Public
  • custom domains

    • forward custom domains to
      • /var/run/nginx/<domain>.http.sock
      • /var/run/nginx/<domain>.https.sock

The global nginx server config looks like this (the ssl part)

stream {    
    server {
        listen      443;
        proxy_protocol on;
        proxy_pass  unix:/var/run/nginx/$ssl_preread_server_name.https.sock;
        ssl_preread on;
    }
}
@benharri
Copy link
Member

admin-tools#154 will be helpful for this as well as nginx/main.yml

@mayli mayli changed the title Http/https server and domain for everyone! Proposal: Http/https server and domain for everyone! Jul 18, 2019
@mayli
Copy link
Contributor Author

mayli commented Jul 18, 2019

admin-tools#154 will be helpful for this as well as nginx/main.yml

Yep, I contributed to the original nginx service, but it turns to be not very useful to most users. This issue is to track the improvements.

@RyanSquared
Copy link
Member

This seems like a decent roadmap but I do think we should stick with Public instead of public_html (as it is currently); as-is, people don't serve just HTML.

We already do have a systemd unit that users can enable, [email protected], but that only runs HTTP and on ports >1024. Ideally, onboarding for this would be transparent as I think we already advertise that it should just work out of the box.

@benharri
Copy link
Member

but it turns to be not very useful to most users

dns records for *..hashbang.sh haven't been deployed yet which is the main blocker

I opened a PR for shellserver wildcard records

@Arnie97
Copy link

Arnie97 commented Sep 9, 2019

The [email protected]does not seem to work now.

arnie97@sf1:~/Public$ systemctl start SimpleHTTPServer@8080
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start '[email protected]'.
Authenticating as: root
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
==== AUTHENTICATION FAILED ===
Failed to start [email protected]: Access denied
See system logs and 'systemctl status [email protected]' for details.

arnie97@sf1:~/Public$ journalctl -q
polkit-agent-helper-1[25990]: pam_unix(polkit-1:auth): auth could not identify password for [root]

@MineRobber9000
Copy link

@Arnie97 try:

systemctl --user start SimpleHTTPServer@8080

@RyanSquared
Copy link
Member

Also, it's likely that port 8080 is taken. All users as of right now (and probably in the future as well) will be sharing the same address space, so it would be wise to pick one that likely isn't already used.

@mayli mayli changed the title Proposal: Http/https server and domain for everyone! Proposal: http/https server and custom domain for everyone! Sep 17, 2020
@RyanSquared
Copy link
Member

As of right now, HTTPS is working. I do not see a valid solution for other peoples' domains at this point other than having some kind of domain-based challenge system.

@retronav
Copy link

Did anything progress regarding custom domains? 🙂

@RyanSquared
Copy link
Member

We currently do not have any system set up for custom domains. At this point, I believe it would require some advanced proxy logic (dynamically looking up CNAMEs for incoming records to see which user they should go to) that's more complicated than the current setup and I don't have the time to write it.

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

No branches or pull requests

6 participants