Improve the dynamic website hosting experience #131

Closed
opened 2022-04-28 21:42:14 +00:00 by a · 3 comments
Owner

Currently on exozyme it's very easy to host a static website, even easier than GitHub pages! Unfortunately hosting dynamic websites isn't as nice, and you can only host them on 10 ports total.

I think a solution with systemd user services and Unix sockets might work the best here. Of course, we have to be very careful about security with this.

Currently on exozyme it's very easy to host a static website, even easier than GitHub pages! Unfortunately hosting dynamic websites isn't as nice, and you can only host them on 10 ports total. I think a solution with systemd user services and Unix sockets might work the best here. Of course, we have to be very careful about security with this.
a added the
enhancement
help wanted
security
labels 2022-04-28 21:42:14 +00:00
a added this to the (deleted) project 2022-04-28 21:42:14 +00:00
Author
Owner

I added this to the wiki.

I added this to the wiki.
a closed this issue 2022-05-16 21:42:38 +00:00
Author
Owner

This was implemented in 72cfa07c1394375d4ecadc8ef4b3ce9144b60ba7.

This was implemented in [72cfa07c1394375d4ecadc8ef4b3ce9144b60ba7](https://git.exozy.me/exozyme/nginx/commit/72cfa07c1394375d4ecadc8ef4b3ce9144b60ba7).
Author
Owner

This is the (working) code that I used to test Unix socket proxying:

import socketserver
from http.server import BaseHTTPRequestHandler
import os

class UnixSocketHttpServer(socketserver.UnixStreamServer):
    def get_request(self):
        request, client_address = super(UnixSocketHttpServer, self).get_request()
        return (request, ["local", 0])


server = UnixSocketHttpServer('/srv/http/pages/test', BaseHTTPRequestHandler)
os.chmod('/srv/http/pages/test', 666)
server.serve_forever()
This is the (working) code that I used to test Unix socket proxying: ``` import socketserver from http.server import BaseHTTPRequestHandler import os class UnixSocketHttpServer(socketserver.UnixStreamServer): def get_request(self): request, client_address = super(UnixSocketHttpServer, self).get_request() return (request, ["local", 0]) server = UnixSocketHttpServer('/srv/http/pages/test', BaseHTTPRequestHandler) os.chmod('/srv/http/pages/test', 666) server.serve_forever() ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: exozyme/exozyme#131
No description provided.