~tsileo/microblog.pub-devel

Document running from subpath v1 APPLIED

Alexey Shpakovsky: 1
 Document running from subpath

 1 files changed, 39 insertions(+), 0 deletions(-)
git send-email is still not my strong side, sorry, a note was lost:

As of writing, you can find rendered preview of changes at:
<http://microblogpubdocs.shpakovsky.ru/installing.html#(advanced)-running-from-subpath>

Note that _recommended_ way of configuring this might change in the
future, so
this is more an "invitation to discuss" (like, how and where to document it),
rather than "proposed change" :)
Hey,

Thank you, I agree, since this it works right now, your edits in the documentation look correct (and I appreciate the "Advanced" notice), I just applied the patch.

Thanks!
Thanks!

Feel free to change wording, if you feel like - I'm not an expert in
English :)

I also would like to add documentation for not-so-documented features like
favicon, image_url, overriding individual blocks in templates/utils.html
(with a link to jinja docs), and maybe stream customization from
https://git.sr.ht/~tsileo/microblog.pub/commit/2cc4eda14320bfccd55deceac9535ac18e1c2fa3
(with warnings that it's advanced and may change).

What do you think about it? And if yes, is it better to do it as separate
patches, separate commits in one patch, or one (big) commit with all
changes?
So, favicon, imgae_url and overriding individual blocks sounds ok to add in the doc.
A single patch for the 3 above should be good.

But I would wait about the stream customization, as I will change the API, I would like to wait until it's stable before it gets documented.

Thank you!
Ok, thanks! Will do - during the weekend or close.

BTW, I like the idea of giving users an option to write some Python
functions to customize microblog.pub even more. Looks like third step of
customize-ability:

1) edit CSS
2) edit HTML (templates)
3) write Python (small functions)
4) mess with Python code of microblog.pub itself

A bit of nostalgia: The first PHP code I wrote was for "php script plugin"
in Miranda messenger 15 years ago. So I might be a bit biased here :)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~tsileo/microblog.pub-devel/patches/37176/mbox | git am -3
Learn more about email & git

[PATCH] Document running from subpath Export this patch

---
 docs/install.md | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/docs/install.md b/docs/install.md
index 4e8d444..bb73b1b 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -191,6 +191,45 @@ http {
}
```

## (Advanced) Running from subpath

It is possible to configure microblogpub to run from subpath.
To achieve this, do the following configuration _between_ config and start steps.
i.e. _after_ you run `make config` or `poetry run inv configuration-wizard`,
but _before_ you run `docker compose up` or `poetry run supervisord`.
Changing this settings on an instance which has some posts or was seen by other instances will likely break links to these posts or federation (i.e. links to your instance, posts and profile from other instances).

The following steps will explain how to configure instance to be available at `https://example.com/subdir`.
Change them to your actual domain and subdir.

* Edit `data/profile.toml` file, add this line:

		id = "https://example.com/subdir"

* Edit `misc/*-supervisord.conf` file which is relevant to you (it depends on how you start microblogpub - if in doubt, do the same change in all of them) - in `[program:uvicorn]` section, in the line which starts with `command`, add this argument at the very end: ` --root-path /subdir`

Above two steps are enough to configure microblogpub.
Next, you also need to configure reverse proxy.
It might slightly differ if you plan to have other services running on the same domain, but for [NGINX config shown above](#reverse-proxy), the following changes are enough:

* Add subdir to location, so location block starts like this:

		location /subdir {

* Add `/` at the end of `proxy_pass` directive, like this:

		proxy_pass http://localhost:8000/;

These two changes will instruct NGINX that requests sent to `https://example.com/subdir/...` should be forwarded to `http://localhost:8000/...`.

* Inside `server` block, add redirects for well-known URLs (add these lines after `client_max_body_size`, remember to replace `subdir` with your actual subdir!):

		location /.well-known/webfinger { return 301 /subdir$request_uri; }
		location /.well-known/nodeinfo  { return 301 /subdir$request_uri; }
		location /.well-known/oauth-authorization-server  { return 301 /subdir$request_uri; }

* Optionally, [check robots.txt from a running microblogpub instance](https://microblog.pub/robots.txt) and integrate it into robots.txt file in the root of your server - remember to prepend `subdir` to URLs, so for example `Disallow: /admin` becomes `Disallow: /subdir/admin`.

## YunoHost edition

[YunoHost](https://yunohost.org/) support is available (although it is not an official package for now): <https://git.sr.ht/~tsileo/microblog.pub_ynh>.
-- 
1.9.1
git send-email is still not my strong side, sorry, a note was lost:

As of writing, you can find rendered preview of changes at:
<http://microblogpubdocs.shpakovsky.ru/installing.html#(advanced)-running-from-subpath>

Note that _recommended_ way of configuring this might change in the
future, so
this is more an "invitation to discuss" (like, how and where to document it),
rather than "proposed change" :)