### Binary Installation and Execution Source: https://remark42.com/docs/getting-started/installation Steps to install Remark42 using pre-compiled binaries. This includes downloading an archive, unpacking it, and running the server with necessary parameters. ```bash remark42.linux-amd64 server --secret=12345 --url=http://127.0.0.1:8080 ``` -------------------------------- ### Docker Compose Installation Source: https://remark42.com/docs/getting-started/installation Instructions for setting up Remark42 using Docker Compose. It involves copying a configuration file, customizing it, and then pulling images and starting the service. ```bash docker compose pull && docker compose up -d ``` ```bash docker compose build && docker compose up -d ``` -------------------------------- ### Compiling from Source (Binary) Source: https://remark42.com/docs/getting-started/installation Instructions for compiling the Remark42 binary from source code, allowing customization of the target operating system and architecture. ```bash make OS=[linux|darwin|windows] ARCH=[amd64,386,arm64,arm] ``` -------------------------------- ### Remark42 Systemd Service Configuration Source: https://remark42.com/docs/getting-started/installation Guides the setup of Remark42 as a systemd service for persistent and managed operation. It includes creating an environment file for configuration and a service unit file. ```ini [Unit] Description=Remark42 Commenting Server After=syslog.target After=network.target [Service] Type=simple EnvironmentFile=/etc/remark42.env ExecStart=/usr/local/bin/remark42 server WorkingDirectory=/var/www/remark42 # directory where data files are stored and automatic backups will be created Restart=on-failure User=nobody # another good alternative is `www-data` Group=nogroup # another good alternative is `www-data` [Install] WantedBy=multi-user.target ``` ```ini SECRET=12345 REMARK_URL=http://127.0.0.1:8080 ``` ```bash sudo systemctl enable remark42.service sudo systemctl start remark42.service ``` ```bash sudo systemctl restart remark42.service ``` -------------------------------- ### Manual Testing Setup Source: https://remark42.com/docs/contributing/frontend Builds and runs the frontend using a development Docker Compose configuration, skipping frontend builds, and then starts the private backend. This setup is used for manual testing before submitting changes. ```shell docker compose -f compose-dev-frontend.yml build --build-arg SKIP_FRONTEND_BUILD=""; docker compose -f compose-private.yml up ``` -------------------------------- ### Start Remark42 Backend with Docker Compose Source: https://remark42.com/docs/contributing/frontend Builds and starts the Remark42 backend services using a private Docker Compose configuration. This is the initial step to get the backend running for development. ```shell docker compose -f compose-private.yml up --build ``` -------------------------------- ### Remark42 Binary Build Source: https://remark42.com/docs/getting-started/installation Command to build a single executable binary for Remark42. It requires specifying the target operating system (OS) and architecture (ARCH) to produce a platform-specific binary. ```bash make OS= ARCH= ``` -------------------------------- ### Remark42 Docker Build Source: https://remark42.com/docs/getting-started/installation Command to build the Remark42 Docker container. This command utilizes a Makefile to package the application into a Docker image, typically named `ghcr.io/umputun/remark42`. ```bash make docker ``` -------------------------------- ### Remark42 Docker Development Setup Source: https://remark42.com/docs/contributing/translations Commands to build and run Remark42 locally using Docker for development and testing purposes. This allows you to preview your translation changes in a live environment. ```shell docker compose -f compose-dev-frontend.yml build docker compose -f compose-dev-frontend.yml up ``` -------------------------------- ### Install Frontend Dependencies Source: https://remark42.com/docs/contributing/frontend Installs all necessary frontend dependencies using PNPM. This command also sets up pre-commit hooks for code formatting and linting before each commit. ```Shell pnpm i ``` -------------------------------- ### Start Frontend with Hot Reloading Source: https://remark42.com/docs/contributing/frontend Navigates to the frontend directory and starts the frontend development server using pnpm. This enables hot reloading for faster development cycles. ```shell cd frontend pnpm dev:app ``` -------------------------------- ### Backend Development (Without Docker) Source: https://remark42.com/docs/contributing/backend Instructions for setting up and running the Remark42 backend locally using the Go toolchain. This includes installing Go, copying frontend static files, and running the backend server with specific parameters. ```shell # frontend files docker pull ghcr.io/umputun/remark42:master docker create -ti --name remark42files ghcr.io/umputun/remark42:master sh docker cp remark42files:/srv/web/ ./backend/app/cmd/ docker rm -f remark42files # fix frontend files to point to the right URL ## Mac version find -E ./backend/app/cmd/web -regex '.*\.(html|js|mjs)$' -print -exec sed -i '' "s|{% REMARK_URL %}|http://127.0.0.1:8080|g" {} \; ## Linux version find ./backend/app/cmd/web -regex '.*\.\(html\|js\|mjs\)$' -print -exec sed -i "s|{% REMARK_URL %}|http://127.0.0.1:8080|g" {} \; ``` ```shell cd backend; go run app/main.go server --dbg --secret=12345 --url=http://127.0.0.1:8080 --admin-passwd=password --site=remark ``` ```shell HTTP http://admin:password@127.0.0.1:8080/api/v1/find?site=remark&sort=-active&format=tree&url=http://127.0.0.1:8080 ``` -------------------------------- ### Remark42 JavaScript Configuration Source: https://remark42.com/docs/getting-started/installation Defines the necessary JavaScript configuration object for Remark42, specifying the host URL and site ID. This object is used by the Remark42 embed script to connect to your Remark42 instance. ```javascript var remark_config = { host: "REMARK_URL", site_id: "YOUR_SITE_ID", } ``` ```javascript var remark_config = { host: "https://demo.remark42.com", site_id: "remark", } ``` -------------------------------- ### Local Backend Development Setup (Docker) Source: https://remark42.com/docs/contributing/backend Steps to set up a local Remark42 backend environment using Docker Compose for development and testing. It involves copying a configuration file, building, and running the services. ```shell cp compose-dev-backend.yml compose-private.yml # now, edit / debug `compose-private.yml` to your heart's content # build and run docker compose -f compose-private.yml up --build ``` -------------------------------- ### SendGrid SMTP Configuration Example Source: https://remark42.com/docs/configuration/email An example configuration for integrating Remark42 with SendGrid. It shows the necessary environment variables for connecting to SendGrid's SMTP server, including API key, host, port, and email sender details. ```shell - SMTP_HOST=smtp.sendgrid.net - SMTP_PORT=465 - SMTP_TLS=true - SMTP_USERNAME=apikey - SMTP_PASSWORD=key-123456789 - AUTH_EMAIL_FROM=notify@example.com - NOTIFY_EMAIL_FROM=notify@example.com ``` -------------------------------- ### Remark42 Translation File Structure Source: https://remark42.com/docs/contributing/translations Example structure of a Remark42 locale JSON file, showing key-value pairs for UI strings. These files are used to internationalize the Remark42 application. ```json { "anonymousLoginForm.length-limit": "Username must be at least 3 characters long", "anonymousLoginForm.log-in": "Log in", "anonymousLoginForm.symbol-limit": "Username must start from the letter and contain only Latin letters, numbers, underscores, and spaces", "<...>": "..." } ``` -------------------------------- ### Run Frontend with Hot Reloading Source: https://remark42.com/docs/contributing/frontend Starts the frontend development server using webpack-dev-server. It serves files on 127.0.0.1:9000 and enables hot reloading for a seamless development experience. ```Shell pnpm dev:app ``` -------------------------------- ### Remark42 Embed Script Source: https://remark42.com/docs/getting-started/installation The primary script to embed Remark42 comments on your website. It dynamically loads the necessary JavaScript components based on the `remark_config` object, typically targeting an HTML element with the ID 'remark42'. ```javascript !function(e,n){for(var o=0;o "Credentials". 3. Configure the "OAuth consent screen" (select "External", fill in App name, User support email, Application home page, Application privacy policy link, Authorized domains, Developer contact information). 4. Create "OAuth client ID" credentials. 5. Choose "Web application" as the application type. 6. Set "Authorized JavaScript Origins" and "Authorized redirect URIs" (e.g., `https://your-domain.com/auth/google/callback`). 7. Record the "Client ID" (AUTH_GOOGLE_CID) and "Client Secret" (AUTH_GOOGLE_CSEC). Refer to Google Cloud documentation for detailed steps. ``` -------------------------------- ### Yandex OAuth2 Setup Source: https://remark42.com/docs/configuration/authorization Configure Yandex OAuth2 for user authentication. This involves creating an OAuth App in the Yandex developer portal and specifying callback URIs and permissions. ```APIDOC Yandex OAuth2 Setup: 1. Create a new "OAuth App" via the Yandex developer portal. 2. Fill in the "App name". 3. Under "Platforms", select "Web services" and enter the "Callback URI #1" (e.g., `https://your-domain.com/auth/yandex/callback`). 4. Grant necessary permissions, typically from "Yandex.Passport API" (e.g., access to user avatar, username). 5. Record the "ID" (AUTH_YANDEX_CID) and "Password" (AUTH_YANDEX_CSEC). Refer to Yandex OAuth and Yandex.Passport API documentation for detailed steps. ``` -------------------------------- ### Docker Compose Configuration for Remark42 Source: https://remark42.com/docs/manuals/subdomain Example Docker Compose configuration for running Remark42. It specifies the image, container name, restart policy, environment variables for backend URL, site ID, secret, admin shared ID, and volume mounts for data persistence. ```yaml version: "2" services: remark42: image: ghcr.io/umputun/remark42:latest container_name: remark42 restart: always environment: - REMARK_URL=https://example.com/remark42/ - SITE= - SECRET= - ADMIN_SHARED_ID= volumes: - ./data:/srv/var logging: options: max-size: "10m" max-file: "1" ``` -------------------------------- ### Remark42 Comment Container Source: https://remark42.com/docs/getting-started/installation An HTML element that serves as the mounting point for the Remark42 comment widget. The embed script will render the comments within this designated div. ```html
``` -------------------------------- ### Configure Local Backend for Development Source: https://remark42.com/docs/contributing/frontend Sets up a local backend environment for frontend development by copying a default compose file. This allows for extensive testing with custom backend configurations, including authentication and notifications. ```Shell cp compose-dev-frontend.yml compose-private.yml # now, edit / debug `compose-private.yml` to your heart's content ``` -------------------------------- ### Remark42 Configuration Parameters Source: https://remark42.com/docs/configuration/parameters This section details all available configuration parameters for Remark42. It includes the command-line argument, the corresponding environment variable, the default value, and a description of its purpose and any constraints. Parameters marked as '*multi*' can accept multiple values. ```APIDOC Remark42 Configuration Parameters: - url (REMARK_URL): URL to Remark42 server, *required* - secret (SECRET): The shared secret key used to sign JWT, should be a random, long, hard-to-guess string, *required* - site (SITE): Site name(s), *multi* - store.type (STORE_TYPE): Type of storage, `bolt` or `rpc` (default: `bolt`) - store.bolt.path (STORE_BOLT_PATH): Parent directory for the bolt files (default: `./var`) - store.bolt.timeout (STORE_BOLT_TIMEOUT): Boltdb access timeout (default: `30s`) - store.rpc.api (STORE_RPC_API): RPC extension API URL - store.rpc.timeout (STORE_RPC_TIMEOUT): HTTP timeout (default: 5s) - store.rpc.auth_user (STORE_RPC_AUTH_USER): Basic auth user name - store.rpc.auth_passwd (STORE_RPC_AUTH_PASSWD): Basic auth user password - admin.type (ADMIN_TYPE): Type of admin store, `shared` or `rpc` (default: `shared`) - admin.rpc.api (ADMIN_RPC_API): RPC extension API URL - admin.rpc.timeout (ADMIN_RPC_TIMEOUT): HTTP timeout (default: 5s) - admin.rpc.auth_user (ADMIN_RPC_AUTH_USER): Basic auth user name - admin.rpc.auth_passwd (ADMIN_RPC_AUTH_PASSWD): Basic auth user password - admin.rpc.secret_per_site (ADMIN_RPC_SECRET_PER_SITE): Enable JWT secret retrieval per aud, which is site_id in this case - admin.shared.id ([admin.shared.id](http://admin.shared.id)) (ADMIN_SHARED_ID): Admin IDs (list of user IDs), *multi* - admin.shared.email (ADMIN_SHARED_EMAIL): Admin emails, *multi* (default: `admin@${REMARK_URL}`) - backup (BACKUP_PATH): Backups location (default: `./var/backup`) - max-back (MAX_BACKUP_FILES): Max backup files to keep (default: `10`) - cache.type (CACHE_TYPE): Type of cache, `redis_pub_sub`, `mem`, or `none` (default: `mem`) - cache.redis_addr (CACHE_REDIS_ADDR): Address of Redis PubSub instance, turn `redis_pub_sub` cache on for distributed cache (default: `127.0.0.1:6379`) - cache.max.items (CACHE_MAX_ITEMS): Max number of cached items, `0` - unlimited (default: `1000`) - cache.max.value (CACHE_MAX_VALUE): Max size of the cached value, `0` - unlimited (default: `65536`) - cache.max.size (CACHE_MAX_SIZE): Max size of all cached values, `0` - unlimited (default: `50000000`) - avatar.type (AVATAR_TYPE): Type of avatar storage, `fs`, `bolt`, or `uri` (default: `fs`) - avatar.fs.path (AVATAR_FS_PATH): Avatars location for `fs` store (default: `./var/avatars`) - avatar.bolt.file (AVATAR_BOLT_FILE): Avatars `bolt` file location (default: `./var/avatars.db`) - avatar.uri (AVATAR_URI): Avatars store URI (default: `./var/avatars`) - avatar.rsz-lmt (AVATAR_RESIZE): Max image size for resizing avatars on save (default: `0` (disabled)) - image.type (IMAGE_TYPE): Type of image storage, `fs`, `bolt` or `rpc` (default: `fs`) - image.fs.path (IMAGE_FS_PATH): Permanent location of images (default: `./var/pictures`) - image.fs.staging (IMAGE_FS_STAGING): Staging location of images (default: `./var/pictures.staging`) - image.fs.partitions (IMAGE_FS_PARTITIONS): Number of image partitions (default: `100`) - image.bolt.file (IMAGE_BOLT_FILE): Images bolt file location (default: `/var/pictures.db`) - image.rpc.api (IMAGE_RPC_API): RPC extension API URL - image.rpc.timeout (IMAGE_RPC_TIMEOUT): HTTP timeout (default: 5s) - image.rpc.auth_user (IMAGE_RPC_AUTH_USER): Basic auth user name - image.rpc.auth_passwd (IMAGE_RPC_AUTH_PASSWD): Basic auth user password - image.max-size (IMAGE_MAX_SIZE): Max size of image file (default: `5000000`) - image.resize-width (IMAGE_RESIZE_WIDTH): Width of a resized image (default: `2400`) - image.resize-height (IMAGE_RESIZE_HEIGHT): Height of a resized image (default: `900`) - auth.ttl.jwt (AUTH_TTL_JWT): JWT TTL (default: `5m`) - auth.ttl.cookie (AUTH_TTL_COOKIE): Cookie TTL (default: `200h`) - auth.send-jwt-header (AUTH_SEND_JWT_HEADER): Send JWT as a header instead of a server-set cookie; with this enabled, frontend stores the JWT in a client-side cookie. [See security considerations](#security-considerations-for-auth.send-jwt-header). (default: `false`) - auth.same-site (AUTH_SAME_SITE): Set same site policy for cookies (`default`, `none`, `lax` or `strict`) (default: `default`) - auth.apple.cid (AUTH_APPLE_CID): Apple client ID (App ID or Services ID) - auth.apple.tid (AUTH_APPLE_TID): Apple service ID - auth.apple.kid (AUTH_APPLE_KID): Apple Private key ID - auth.apple.private-key-filepath (AUTH_APPLE_PRIVATE_KEY_FILEPATH): Apple Private key file location (default: `/srv/var/apple.p8`) - auth.google.cid (AUTH_GOOGLE_CID): Google OAuth client ID - auth.google.csec (AUTH_GOOGLE_CSEC): Google OAuth client secret - auth.facebook.cid (AUTH_FACEBOOK_CID): Facebook OAuth client ID - auth.facebook.csec (AUTH_FACEBOOK_CSEC): Facebook OAuth client secret - auth.microsoft.cid (AUTH_MICROSOFT_CID): Microsoft OAuth client ID - auth.microsoft.csec (AUTH_MICROSOFT_CSEC): Microsoft OAuth client secret ``` -------------------------------- ### Caddy 2 Configuration for Remark42 Proxy Source: https://remark42.com/docs/manuals/subdomain Example Caddy 2 configuration to serve Remark42 on a specific path. It uses `handle_path` to proxy requests starting with `/remark42` to the `remark42` Docker service. ```conf example.com { root * /srv/www log { output file /logs/example.com.access.log } # remark42 handle_path /remark42* { reverse_proxy remark42:8080 } file_server } ``` -------------------------------- ### Build and Run Frontend Statically Source: https://remark42.com/docs/contributing/frontend Builds the Remark42 frontend into static files, mimicking the production build process. The resulting files are placed in a specific public directory. ```shell pnpm build ``` -------------------------------- ### Minimal docker-compose.yml for Remark42 Source: https://remark42.com/docs/configuration/parameters A basic docker-compose.yml file demonstrating how to run Remark42 with essential environment variables. It includes settings for the server URL, site ID, secret key, anonymous commenting, and GitHub OAuth. ```yaml version: "2" services: remark42: image: ghcr.io/umputun/remark42:latest restart: always container_name: "remark42" environment: - REMARK_URL=https://demo.remark42.com # URL pointing to your Remark42 server - SITE=YOUR_SITE_ID # site ID, same as used for `site_id`, see "Setup on your website" - SECRET=abcd-123456-xyz-$%^& # secret key - AUTH_ANON=true # enable anonymous commenting - AUTH_GITHUB_CID=12345667890 # OAuth2 client ID - AUTH_GITHUB_CSEC=abcdefg12345678 # OAuth2 client secret volumes: - ./var:/srv/var # persistent volume to store all Remark42 data ``` -------------------------------- ### Initialize and Manage Remark42 Instance in SPA Source: https://remark42.com/docs/configuration/frontend/spa Demonstrates how to initialize the Remark42 instance within a SPA framework. It includes logic to create a new instance, destroy the previous one if it exists, and handle the 'REMARK42::ready' event. ```javascript initRemark42() { if (window.REMARK42) { if (this.remark42Instance) { this.remark42Instance.destroy() } this.remark42Instance = window.REMARK42.createInstance({ node: this.$refs.remark42 as HTMLElement, ...remark42_config // See }) } } mounted() { if (window.REMARK42) { this.initRemark42() } else { window.addEventListener('REMARK42::ready', () => { this.initRemark42() }) } } ``` -------------------------------- ### SMTP StartTLS Enable Configuration Source: https://remark42.com/docs/configuration/parameters Enables the STARTTLS command to upgrade an unencrypted connection to an encrypted one. ```APIDOC smtp.starttls | SMTP_STARTTLS Description: enable StartTLS for SMTP Default: `false` ``` -------------------------------- ### Remark42 Command-Line Parameter Usage Source: https://remark42.com/docs/configuration/parameters Explains how to use command-line parameters for Remark42 configuration. It covers the long-form syntax and how to handle multiple values for certain parameters. ```bash # Command-line parameters are long-form --=value # Example: --site=https://demo.remark42.com # Multi parameters separated by ',' or repeated with command-line keys # Example: --site=s1 --site=s2 # Required parameters must be presented in the environment or provided in the command-line. ``` -------------------------------- ### Email Authentication Setup Variables Source: https://remark42.com/docs/configuration/email Environment variables that control email authentication functionality. Enabling these requires setting up SMTP variables and specifying sender addresses. ```env AUTH_EMAIL_ENABLE AUTH_EMAIL_FROM AUTH_EMAIL_SUBJ ("remark42 confirmation" by default) AUTH_EMAIL_CONTENT_TYPE ("text/html" by default) ``` -------------------------------- ### Remark42 Configuration Options Source: https://remark42.com/docs/configuration/parameters Lists common configuration parameters for Remark42, detailing their purpose, default values, and whether they are enabled or disabled. These can be set via command-line arguments or environment variables. ```APIDOC Configuration Options: - emoji: Enable emoji support. - simple-view: Enable minimized UI with basic info only. - proxy-cors: Disable internal CORS and delegate it to proxy. - allowed-hosts: Limit hosts/sources allowed to embed comments via CSP 'frame-ancestors'. - address: Web server listening address. - port: Web server port. - web-root: Web server root directory. - update-limit: Updates per second limit. - subscribers-only: Enable commenting only for Patreon subscribers. - disable-signature: Disable server signature in headers. - disable-fancy-text-formatting: Disable fancy comments text formatting (replacement of quotes, dashes, fractions, etc.). - admin-passwd: Password for `admin` basic auth. - dbg: Enable debug mode. ``` -------------------------------- ### Email Subscription API Source: https://remark42.com/docs/contributing/api Manages email subscriptions for comment notifications. Includes endpoints to get, subscribe, confirm, and unsubscribe user emails. Requires authentication for most operations. ```APIDOC GET /api/v1/email?site=site-id - Get user's email. - Authentication required. ``` ```APIDOC POST /api/v1/email/subscribe?site=site-id&address=user@example.org - Makes confirmation token and sends it to the user over email. - Authentication required. - Trying to subscribe to the same email a second time will return response code `409 Conflict` with explaining error message. ``` ```APIDOC POST /api/v1/email/confirm?site=site-id&tkn=token - Uses provided token parameter to set email for the user. - Authentication required. - Setting email subscribes user for all first-level replies to his messages. ``` ```APIDOC DELETE /api/v1/email?site=siteID - Removes user's email. - Authentication required. ``` -------------------------------- ### Run Frontend with Remote Backend Source: https://remark42.com/docs/contributing/frontend Attaches the frontend to a remote Remark42 backend, useful for visual adjustments or translations. It uses the REMARK_URL environment variable to specify the backend address. ```Shell npx cross-env REMARK_URL=http://127.0.0.1:8080 pnpm dev:custom ``` -------------------------------- ### Remark42 Initialization Script Source: https://remark42.com/docs/configuration/frontend The JavaScript snippet responsible for loading and initializing Remark42 components on the page. It dynamically creates script tags based on the `remark_config.components` array and the configured host. ```javascript !function(e,n){for(var o=0;o -s -f var/rules ``` -------------------------------- ### Remark42 Deprecated Parameters Source: https://remark42.com/docs/configuration/parameters Lists command-line options and their corresponding environment variables that are deprecated. It provides replacement options and the deprecation version for each. ```APIDOC Deprecated Parameters: | Command line | Replacement | Environment | Replacement | Default | Description | |---|---|---|---|---|---| | auth.email.template | none | AUTH_EMAIL_TEMPLATE | none | `email_confirmation_login.html.tmpl` | custom email message template file | | auth.email.host | smtp.host | AUTH_EMAIL_HOST | SMTP_HOST | | smtp host | | auth.email.port | smtp.port | AUTH_EMAIL_PORT | SMTP_PORT | | smtp port | | auth.email.user | smtp.username | AUTH_EMAIL_USER | SMTP_USERNAME | | smtp user name | | auth.email.passwd | smtp.password | AUTH_EMAIL_PASSWD | SMTP_PASSWORD | | smtp password | | auth.email.tls | smtp.tls | AUTH_EMAIL_TLS | SMTP_TLS | `false` | enable TLS | | auth.email.timeout | smtp.timeout | AUTH_EMAIL_TIMEOUT | SMTP_TIMEOUT | `10s` | smtp timeout | | img-proxy | image-proxy.http2https | IMG_PROXY | IMAGE_PROXY_HTTP2HTTPS | `false` | enable HTTP->HTTPS proxy for images | | notify.type | notify.admins, notify.users | NOTIFY_TYPE | NOTIFY_ADMINS, NOTIFY_USERS | | | | notify.email.notify_admin | notify.admins=email | NOTIFY_EMAIL_ADMIN | NOTIFY_ADMINS=email | | | | notify.telegram.token | telegram.token | NOTIFY_TELEGRAM_TOKEN | TELEGRAM_TOKEN | | Telegram token | | notify.telegram.timeout | telegram.timeout | NOTIFY_TELEGRAM_TIMEOUT | TELEGRAM_TIMEOUT | | Telegram timeout | | auth.twitter.cid | none | AUTH_TWITTER_CID | none | | Twitter Consumer API Key | | auth.twitter.csec | none | AUTH_TWITTER_CSEC | none | | Twitter Consumer API Secret key | ``` -------------------------------- ### Webhook Notification Template Configuration Source: https://remark42.com/docs/configuration/parameters Defines the template for webhook notification payloads. Supports Go templating for dynamic content. ```APIDOC notify.webhook.template | NOTIFY_WEBHOOK_TEMPLATE Description: Template for webhook notifications Default: `{"text": {{.Text | escapeJSONString}}}` ``` -------------------------------- ### Remark42 with Reproxy Docker Compose Configuration Source: https://remark42.com/docs/manuals/reproxy This Docker Compose configuration sets up Reproxy as a reverse proxy for the Remark42 service. It handles SSL termination using Let's Encrypt, gzip compression, and custom logging, while also configuring Remark42 with various parameters for authentication, email, and image handling. ```yaml version: "3.4" services: reproxy: image: umputun/reproxy:master restart: always hostname: reproxy container_name: reproxy logging: &default_logging driver: json-file options: max-size: "10m" max-file: "5" ports: - "80:8080" - "443:8443" environment: - TZ=America/Chicago - DOCKER_ENABLED=true - SSL_TYPE=auto - SSL_ACME_EMAIL=admin@example.com - SSL_ACME_FQDN=remark42.example.com - SSL_ACME_LOCATION=/srv/var/ssl - GZIP=true - LOGGER_ENABLED=true - LOGGER_FILE=/srv/var/logs/access.log - LOGGER_STDOUT=true - ASSETS_CACHE=30d,text/html:30s - HEADER=X-XSS-Protection:1;mode=block;,X-Content-Type-Options:nosniff volumes: - /var/run/docker.sock:/var/run/docker.sock:ro - ./var/ssl:/srv/var/ssl - ./var/logs:/srv/var/logs remark42: image: ghcr.io/umputun/remark42:master container_name: "remark42" hostname: "remark42" restart: always logging: *default_logging environment: - MHOST - SECRET=some-secret-thing - USER=app - REMARK_URL=https://remark42.example.com - CACHE_MAX_VALUE=10000000 - IMAGE_PROXY_HTTP2HTTPS=true - AVATAR_RESIZE=48 - ADMIN_SHARED_ID=github_ef0f706a79cc24b112345 - ADMIN_SHARED_NAME=myname,anothername - ADMIN_SHARED_EMAIL=admin@example.com - AUTH_TWITTER_CID=12345678 - AUTH_TWITTER_CSEC=asdfghjkl - AUTH_ANON=true - AUTH_EMAIL_ENABLE=true - AUTH_EMAIL_FROM=confirmation@example.com - SMTP_HOST=smtp.mailgun.org - SMTP_PORT=465 - SMTP_TLS=true - SMTP_USERNAME=postmaster@mg.example.com - SMTP_PASSWORD=thepassword - IMAGE_MAX_SIZE=5000000 - EMOJI=true ports: - "8080" volumes: - ./var/remark42:/srv/var labels: reproxy.server: remark42.example.com reproxy.port: "8080" reproxy.route: "^/(.*)" reproxy.dest: "/$$1" reproxy.ping: "/ping" ``` -------------------------------- ### Image Proxy HTTP to HTTPS Configuration Source: https://remark42.com/docs/configuration/parameters Enables the image proxy to convert HTTP image URLs to HTTPS, improving security and compatibility. ```APIDOC image-proxy.http2https | IMAGE_PROXY_HTTP2HTTPS Description: enable HTTP->HTTPS proxy for images Default: `false` ``` -------------------------------- ### Let's Encrypt Certificates Directory Configuration Source: https://remark42.com/docs/configuration/parameters Specifies the directory where Let's Encrypt certificates will be stored when using automatic HTTPS configuration. ```APIDOC ssl.acme-location | SSL_ACME_LOCATION Description: dir where obtained le-certs will be stored Default: `./var/acme` ``` -------------------------------- ### Post Configuration Struct Source: https://remark42.com/docs/contributing/api Defines a configuration option for posts, specifically enabling commenting only for Patreon subscribers. ```Go type Post struct { SubscribersOnly bool `json:"subscribers_only"` // enable commenting only for Patreon subscribers } ``` -------------------------------- ### Manual Backup Command Source: https://remark42.com/docs/backup/backup Executes a manual backup of the Remark42 data store using the Docker command-line interface. Requires ADMIN_PASSWD to be enabled on the server. The backup file is named userbackup-{site ID}-{timestamp}.gz. ```bash docker exec -it remark42 backup -s {your site ID} ``` -------------------------------- ### Email Authentication From Address Configuration Source: https://remark42.com/docs/configuration/parameters Specifies the sender's email address for authentication-related emails. This can be a simple address or a formatted string like 'Name '. ```APIDOC auth.email.from | AUTH_EMAIL_FROM Description: email from (e.g. `john.doe@example.com` or `"John Doe"`) Default: Not specified ``` -------------------------------- ### Development Mode OAuth Configuration Source: https://remark42.com/docs/configuration/parameters Enables a local OAuth2 server for development purposes only. This setting should not be used in production environments. ```APIDOC auth.dev | AUTH_DEV Description: local OAuth2 server, development mode only Default: `false` ``` -------------------------------- ### Remark42 Admin User Configuration Source: https://remark42.com/docs/configuration/parameters Details how to define admin users for Remark42, typically within a `docker-compose.yml` file or via command-line arguments. It explains how to obtain user IDs. ```yaml environment: - ADMIN_SHARED_ID=github_ef0f706a79cc24b17bbbb374cd234a691a034128,github_dae9983158e9e5e127ef2b87a411ef13c891e9e5 # To get a user ID, log in and click on your username or any other user. # This will expand login info and show the full user ID. ``` -------------------------------- ### VSCode ESLint Configuration Source: https://remark42.com/docs/contributing/frontend Configuration snippet for VSCode to correctly recognize and lint code within subdirectories, specifically for the frontend application. ```json { "eslint.workingDirectories": ["frontend/apps/remark42"] } ``` -------------------------------- ### SSL/TLS Type Configuration Source: https://remark42.com/docs/configuration/parameters Determines the SSL/TLS configuration for the server. Options include 'none' for HTTP, 'static' for HTTPS with provided certificates, and 'auto' for HTTPS with Let's Encrypt integration. ```APIDOC ssl.type | SSL_TYPE Description: `none`-HTTP, `static`-HTTPS, `auto`-HTTPS + le Default: `none` ``` -------------------------------- ### SSL Key File Path Configuration Source: https://remark42.com/docs/configuration/parameters The file path to the SSL private key (key.pem) when using static HTTPS configuration. ```APIDOC ssl.key | SSL_KEY Description: path to the key.pem file Default: Not specified ``` -------------------------------- ### Email Authentication Enable Configuration Source: https://remark42.com/docs/configuration/parameters Enables authentication via email, allowing users to log in or verify their identity using email addresses. ```APIDOC auth.email.enable | AUTH_EMAIL_ENABLE Description: enable auth via email Default: `false` ```