mirror of
1
Fork 0

[docs] Enable some new features (#2623)

* [docs] Enable a bunch of markdown extensions

* details makes admonitions collapsible and when started with ???
  instead of !!! they'll be collpased by default
* highlights are updated to include linenums by default but with a style
  that doesn't result in the linenums to be copy-pasted when selecting
  and pasting. This makes it possible to directly link to a specific
  line in the documentation instead of just the general page
* caret, mark and tilde make it possible to highlight text and have
  super/subscripts
* keys turns combos like `++ctrl+alt+del++` into HTML key elements
  showing a keyboard combination to press
* tabbed makes it possible to have tabs within a document. Right now we
  have different sections sometimes to show the config for nginx, apache
  and Caddy, which can be turned into tabs instead and which tab is
  picked will get remebered
* smartsymbols turns certain things, like `(c)` in the right symbol ©

* [docs] Upgrade all the python dependencies

* [docs] Explain how to update conda deps
This commit is contained in:
Daenney 2024-02-12 12:05:35 +01:00 committed by GitHub
parent 54ca2cfa6e
commit 4a4017b042
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 203 additions and 180 deletions

View File

@ -110,6 +110,8 @@ When adding a new page, you need to include it in the [`mkdocs.yml`](mkdocs.yml)
If you don't use Conda, you can read the `docs/environment.yml` to see which dependencies are required and `pip install` them manually. It's advisable to do this in a virtual environment, which you can create with something like `python3 -m venv /path-to/store-the-venv`. You can then call `/path-to/store-the-venv/bin/pip`, `/path-to/store-the-venv/bin/mkdocs` etc.
In order to upgrade dependencies, use `conda update --update-all` in the activated environment. You can then update the `environment.yml` with `conda env export --from-history -f ./docs/environment.yml`, though you'll need to fix the `channels`. Beware that `conda env export` will also drop the `pip` dependencies, so make sure to add those back.
## Development
### Golang forking quirks

View File

@ -19,7 +19,7 @@ Many implementations will regularly request the public key for a user in order t
## Configuration snippets
### nginx
=== "nginx"
For nginx, you'll need to start by configuring a cache zone. The cache zone must be created in the `http` section, not within `server` or `location`.

View File

@ -20,9 +20,7 @@ The filesystem location of `/assets` is defined by the [`web-asset-base-dir`](..
## Configuration
### Apache 2.4
This is intended to behave identical to the nginx section below.
=== "apache2"
The `Cache-Control` header is manually set to merge the values
from the configuration and the `expires` directive to avoid
@ -33,7 +31,7 @@ Assuming your GtS installation is rooted in `/opt/GtS` with a
`storage` subdirectory, and the webserver has been given access,
add the following section to the vhost:
```
```apacheconf
<Directory /opt/GtS/web/assets>
Options None
AllowOverride None
@ -58,7 +56,7 @@ add the following section to the vhost:
The trick here is that, in an Apache 2-based reverse proxy setup…
```
```apacheconf
RewriteEngine On
RewriteCond %{HTTP:Upgrade} websocket [NC]
@ -91,7 +89,7 @@ $ sudo a2enmod rewrite
Then (after a configtest), restart Apache.
### nginx
=== "nginx"
Here's an example of the three location blocks you'll need to add to your existing configuration in nginx:

View File

@ -3,12 +3,12 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python=3.11.3=h2755cc3_0_cpython
- pip=23.1.2=pyhd8ed1ab_0
- mkdocs=1.4.3=pyhd8ed1ab_0
- mkdocs-material=9.1.9=pyhd8ed1ab_0
- mkdocs-material-extensions=1.1.1=pyhd8ed1ab_0
- pillow=9.5.0=py311h573f0d3_0
- cairosvg=2.6.0=pyhd8ed1ab_0
- cairosvg==2.7.1
- mkdocs-material-extensions==1.3.1
- mkdocs-material==9.5.8
- mkdocs==1.5.3
- pillow==10.0.0
- pip==23.3.1
- python==3.11.3=h2755cc3_0_cpython
- pip:
- mkdocs-swagger-ui-tag==0.6.1
- mkdocs-swagger-ui-tag==0.6.8

View File

@ -64,6 +64,29 @@ In the above `sudoedit` command, replace `example.com` with the hostname of your
The file you're about to create should look a bit like this:
=== "2.4.47+"
```apache
MDomain example.com auto
MDCertificateAgreement accepted
<VirtualHost *:80 >
ServerName example.com
</VirtualHost>
<VirtualHost *:443>
ServerName example.com
SSLEngine On
ProxyPreserveHost On
# set to 127.0.0.1 instead of localhost to work around https://stackoverflow.com/a/52550758
ProxyPass / http://127.0.0.1:8080/ upgrade=websocket
ProxyPassReverse / http://127.0.0.1:8080/
RequestHeader set "X-Forwarded-Proto" expr=https
</VirtualHost>
```
=== "older versions"
```apache
MDomain example.com auto
MDCertificateAgreement accepted
@ -91,29 +114,6 @@ MDCertificateAgreement accepted
</VirtualHost>
```
or, if you have [Apache httpd 2.4.47+](https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#protoupgrade), you can get rid of both `mod_rewrite` and `mod_proxy_wstunnel` and simplify the whole config to:
```apache
MDomain example.com auto
MDCertificateAgreement accepted
<VirtualHost *:80 >
ServerName example.com
</VirtualHost>
<VirtualHost *:443>
ServerName example.com
SSLEngine On
ProxyPreserveHost On
# set to 127.0.0.1 instead of localhost to work around https://stackoverflow.com/a/52550758
ProxyPass / http://127.0.0.1:8080/ upgrade=websocket
ProxyPassReverse / http://127.0.0.1:8080/
RequestHeader set "X-Forwarded-Proto" expr=https
</VirtualHost>
```
Again, replace occurrences of `example.com` in the above config file with the hostname of your GtS server. If your domain name is `gotosocial.example.com`, then `gotosocial.example.com` would be the correct value.
You should also change `http://127.0.0.1:8080` to the correct address and port (if it's not on `127.0.0.1:8080`) of your GtS server. For example, if you're running GoToSocial on another machine with the local ip of `192.168.178.69` and on port `8080` then `http://192.168.178.69:8080/` would be the correct value.
@ -182,6 +182,19 @@ In the above `sudoedit` command, replace `example.com` with the hostname of your
The file you're about to create should look initially for both 80 (required) and 443 ports (optional) a bit like this:
=== "2.4.47+"
```apache
<VirtualHost *:80>
ServerName example.com
ProxyPreserveHost On
# set to 127.0.0.1 instead of localhost to work around https://stackoverflow.com/a/52550758
ProxyPass / http://127.0.0.1:8080/ upgrade=websocket
ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>
```
=== "older versions"
```apache
<VirtualHost *:80>
ServerName example.com

View File

@ -25,9 +25,9 @@ plugins:
lang: en
- social:
cards: true
cards_color:
fill: "#fd6a00"
text: "#fafaff"
cards_layout_options:
background_color: "#fd6a00"
color: "#fafaff"
- swagger-ui-tag:
supportedSubmitMethods: []
syntaxHighlightTheme: obsidian
@ -37,13 +37,23 @@ extra_css:
markdown_extensions:
- admonition
- pymdownx.details
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
linenums_style: pymdownx-inline
pygments_lang_class: true
linenums: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- pymdownx.smartsymbols
- pymdownx.caret
- pymdownx.keys
- pymdownx.mark
- pymdownx.tilde
- pymdownx.tabbed:
alternate_style: true
nav:
- "Home": "index.md"