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. 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 ## Development
### Golang forking quirks ### 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 ## 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`. 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 ## Configuration
### Apache 2.4 === "apache2"
This is intended to behave identical to the nginx section below.
The `Cache-Control` header is manually set to merge the values The `Cache-Control` header is manually set to merge the values
from the configuration and the `expires` directive to avoid 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, `storage` subdirectory, and the webserver has been given access,
add the following section to the vhost: add the following section to the vhost:
``` ```apacheconf
<Directory /opt/GtS/web/assets> <Directory /opt/GtS/web/assets>
Options None Options None
AllowOverride 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… The trick here is that, in an Apache 2-based reverse proxy setup…
``` ```apacheconf
RewriteEngine On RewriteEngine On
RewriteCond %{HTTP:Upgrade} websocket [NC] RewriteCond %{HTTP:Upgrade} websocket [NC]
@ -91,7 +89,7 @@ $ sudo a2enmod rewrite
Then (after a configtest), restart Apache. 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: 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 - conda-forge
- nodefaults - nodefaults
dependencies: dependencies:
- python=3.11.3=h2755cc3_0_cpython - cairosvg==2.7.1
- pip=23.1.2=pyhd8ed1ab_0 - mkdocs-material-extensions==1.3.1
- mkdocs=1.4.3=pyhd8ed1ab_0 - mkdocs-material==9.5.8
- mkdocs-material=9.1.9=pyhd8ed1ab_0 - mkdocs==1.5.3
- mkdocs-material-extensions=1.1.1=pyhd8ed1ab_0 - pillow==10.0.0
- pillow=9.5.0=py311h573f0d3_0 - pip==23.3.1
- cairosvg=2.6.0=pyhd8ed1ab_0 - python==3.11.3=h2755cc3_0_cpython
- pip: - 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: 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 ```apache
MDomain example.com auto MDomain example.com auto
MDCertificateAgreement accepted MDCertificateAgreement accepted
@ -91,29 +114,6 @@ MDCertificateAgreement accepted
</VirtualHost> </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. 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. 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: 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 ```apache
<VirtualHost *:80> <VirtualHost *:80>
ServerName example.com ServerName example.com

View File

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