aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README14
-rw-r--r--server.py6
-rw-r--r--siteconfig.py2
3 files changed, 11 insertions, 11 deletions
diff --git a/README b/README
index d723a5c..5ebe3c9 100644
--- a/README
+++ b/README
@@ -44,7 +44,7 @@ zip), change into the directory, then:
`python server.py`
-Your server will (by default) be hosted on http://localhost:8000
+Your server will (by default) be hosted on http://127.0.0.1:5000
## Adding Pages
@@ -165,14 +165,16 @@ You can disable it by deleting the code under `send_file_from_site` or
You should NOT run this server as in the quick start, but instead deploy it in
an appropriate container. Refer to https://flask.palletsprojects.com/en/2.0.x/deploying/
-for options, but an easy option I like is to use uswgi. On a Debian-like distro
+for options, but an easy option I like is to use uwsgi since it's well
+documented.
-`sudo apt install uwsgi`
`python -m venv env`
-`uwsgi -s /tmp/yourapplication.sock --manage-script-name --mount /yourapplication=server:app`
+`pip install uwsgi`
+`doas -u www uwsgi -s /var/path/to/your-flask.sock --manage-script-name --mount /=server:app --virtualenv ./env`
Then point your main http daemon (niginx, apache, httpd) to the socket you
-made. See nginx as an example here, more in the same doc:
+made. There are examples for a nginx configuration in the uWSGI and Flask docs:
-https://uwsgi-docs.readthedocs.io/en/latest/Nginx.html
+- https://uwsgi-docs.readthedocs.io/en/latest/Nginx.html
+- https://flask.palletsprojects.com/en/2.0.x/deploying/uwsgi/
diff --git a/server.py b/server.py
index 8614fe3..21ecb2f 100644
--- a/server.py
+++ b/server.py
@@ -192,7 +192,7 @@ def setup():
app.config.update({'DOMAIN': siteconfig.DOMAIN})
app.config.update({'HOME_TITLE': siteconfig.HOME_TITLE})
-
+# Need to come first to be compatible with wsgi
+setup()
if __name__ == '__main__':
- setup()
- app.run(host=siteconfig.HOST, port=siteconfig.PORT)
+ app.run()
diff --git a/siteconfig.py b/siteconfig.py
index 28c3cbd..8dbe006 100644
--- a/siteconfig.py
+++ b/siteconfig.py
@@ -4,8 +4,6 @@ class siteconfig:
HOME_TITLE = "WELCOME" # "HELLO WORLD!"
LINKS_FILE = ".links" # ".lnx"
DESC_FILE = ".description" # ".desc`"
- HOST = "127.0.0.1" # "192.168.1.1" "1.2.3.4"
- PORT = 8000 # 8080, 8001, 8002
DEFAULT_MIMETYPE = "application/octet-stream" # "text/plain"
MIMETYPES = {}