diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..91d96a66 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,6 @@ +# Documentation and FAQ + +- [How to configure remark42 with nginx reverse proxy](nginx-proxy.md) +- [How to configure remark42 without a subdomain](subdomain.md) +- [Telegram notifications](telegram.md) + diff --git a/docs/nginx-proxy.md b/docs/nginx-proxy.md new file mode 100644 index 00000000..385c15ed --- /dev/null +++ b/docs/nginx-proxy.md @@ -0,0 +1,50 @@ +## How to configure remark42 with nginx reverse proxy + +Example of nginx configuration (reverse proxy) running remark42 service on remark42.example.com + +``` +server { + listen 443; + server_name remark42.example.com; + ssl on; + ssl_certificate /etc/nginx/ssl/remark42.example.com.crt; + ssl_certificate_key /etc/nginx/ssl/remark42.example.com.key; + + gzip on; + gzip_types text/plain application/json text/css application/javascript application/x-javascript text/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml; + gzip_min_length 1000; + gzip_proxied any; + + + location ~ /\.git { + deny all; + } + + location /index.html { + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_pass http://remark42:8080/web/index.html; + } + + location / { + proxy_redirect off; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_pass http://remark42:8080/; + } + + access_log /var/log/nginx/remark42.log; + +} + +server { + listen 80; + server_name remark42.example.com; + return 301 https://remark42.example.com$request_uri; +} +``` + +note: `proxy_pass` points to internal DNS name `remark42` and expected to run from the same compose. If nginx runs outside of compose the real IP (or docker's bridge IP) should be used \ No newline at end of file diff --git a/docs/subdomain.md b/docs/subdomain.md new file mode 100644 index 00000000..cb63a404 --- /dev/null +++ b/docs/subdomain.md @@ -0,0 +1,25 @@ +## How to configure remark42 without a subdomain + +All README examples show configurations with remark42 on its own subdomain, i.e. `https://remark42.example.com`. However, it is possible and sometimes desirable to run remark42 without a subdomain, but just under some path, i.e. `https://example.com/remark42`. + +- The nginx.conf would then look something like: +``` + location /remark42/ { + rewrite /remark42/(.*) /$1 break; + proxy_pass http://remark42:8080/; // use internal docker name of remark42 container for proxy + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } +``` + +- The frontend URL looks like this: `s.src = 'https://example.com/remark42/web/embed.js;` + +- The backend `REMARK_URL` parameter will be `https://example.com/remark42` + +- And you also need to slightly modify the callback URL for the social media login API's: + - Facebook Valid OAuth Redirect URIs: `https://example.com/remark42/auth/facebook/callback` + - Google Authorized redirect URIs: `https://example.com/remark42/auth/google/callback` + - Github Authorised callback URL: `https://example.com/remark42/auth/github/callback` + \ No newline at end of file diff --git a/docs/telegram.md b/docs/telegram.md new file mode 100644 index 00000000..42aaf347 --- /dev/null +++ b/docs/telegram.md @@ -0,0 +1,32 @@ +## Telegram notifications + +In order to integrate notifications from remark42 with the [telegram](https://telegram.org), you should make [a channel](https://telegram.org/faq_channels) and obtain a token. This token should be used as `NOTIFY_TELEGRAM_TOKEN`. You also need to set `NOTIFY_TYPE=telegram` and set `NOTIFY_TELEGRAM_CHAN` to your channel. + +In order to get token "just talk to [BotFather](https://core.telegram.org/bots#6-botfather)". All you need is to send `/newbot` command, choose bot name and the name for your bot (it must end in `bot`). This is it, you got a token. + +_Example of such a "talk":_ + +``` +Umputun: +/newbot + +BotFather: +Alright, a new bot. How are we going to call it? Please choose a name for your bot. + +Umputun: +example_comments + +BotFather: +Good. Now let's choose a username for your bot. It must end in `bot`. Like this, for example: TetrisBot or tetris_bot. + +Umputun: +example_comments_bot + +BotFather: +Done! Congratulations on your new bot. You will find it at t.me/example_comments_bot. You can now add a description, about section and profile picture for your bot, see /help for a list of commands. By the way, when you've finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure the bot is fully operational before you do this. + +Use this token to access the HTTP API: +12345678:xy778Iltzsdr45tg + +For a description of the Bot API, see this page: https://core.telegram.org/bots/api +```