', custom CSS might need adjustments. This example shows how to style the new element.
```css
.textarea {
white-space: pre;
}
```
--------------------------------
### Run Isso with Docker (Release Image)
Source: https://github.com/isso-comments/isso/blob/master/docs/docs/reference/installation.md
This command pulls the latest stable Docker image for Isso and runs it as a detached service. It maps host directories for configuration and database storage to the container and exposes the service on port 8080. Ensure the configuration file is adjusted for `dbpath` and `host`.
```console
$ docker pull ghcr.io/isso-comments/isso:release
$ mkdir -p config/ db/
$ cp contrib/isso.sample.cfg config/isso.cfg
# Set 'dbpath' to '/db/comments.db' and adjust 'host'
$ docker run -d --rm --name isso -p 127.0.0.1:8080:8080 \
-v /var/lib/isso:/config -v /var/lib/isso:/db \
ghcr.io/isso-comments/isso:release
```
--------------------------------
### Configure Hash Handling for Security (Python)
Source: https://github.com/isso-comments/isso/blob/master/CHANGES.rst
This section allows customization of hash handling for security-sensitive data. You can specify a salt, choose a hashing algorithm (like pbkdf2), and tune its parameters. This is crucial for securely storing user-related information.
```ini
[hash]
salt = Eech7co8Ohloopo9Ol6baimi
algorithm = pbkdf2
```
--------------------------------
### Get Latest Comments via REST API
Source: https://context7.com/isso-comments/isso/llms.txt
Fetches the most recent comments across all threads. Requires the 'latest-enabled' configuration to be true on the server. The 'limit' parameter controls the number of comments returned.
```shell
# Get latest 5 comments
curl 'https://comments.example.tld/latest?limit=5'
```
--------------------------------
### Configure SMTP From Header
Source: https://github.com/isso-comments/isso/blob/master/CHANGES.rst
Allows setting a full 'From' header for SMTP notifications. This is configured in the [smtp] section of the configuration file.
```ini
[smtp]
from = Foo Bar
```
--------------------------------
### Generate Docker Screenshots for Isso
Source: https://github.com/isso-comments/isso/blob/master/docs/docs/technical-docs/testing-client.md
These commands are used within the Isso project to manage visual regression testing through screenshots. The first command generates new screenshots, the second compares them against existing hash files, and the third updates the hash files if visual changes are intentional. It is recommended to use Docker for consistent results across different environments.
```console
$ make docker-generate-screenshots
```
```console
$ make docker-compare-screenshots
```
```console
$ make docker-update-screenshots
```
--------------------------------
### API: Count Endpoint Change (Python)
Source: https://github.com/isso-comments/isso/blob/master/docs/news.md
Removes the `/count` GET endpoint and mandates the use of the POST method instead. This change affects how comment counts are retrieved via the API.
```python
# Remove /count GET endpoint (use POST instead) ([#883](https://github.com/posativ/isso/pull/883), ix5)
```
--------------------------------
### Multiple Site Support
Source: https://github.com/isso-comments/isso/blob/master/CHANGES.rst
The project now supports multiple websites, a feature that is part of the broader effort related to issue #34.
```text
part of #34
```
--------------------------------
### Configure Isso Server Settings (INI)
Source: https://github.com/isso-comments/isso/blob/master/docs/news.md
Demonstrates how client-side settings can be overridden by server configurations. When these settings are present in the server configuration, the corresponding `data-isso-*` attributes on the client will be ignored.
```ini
[general]
reply-notifications
gravatar
[guard]
reply-to-self
require-author
require-email
```
--------------------------------
### Load Comments After AJAX Content Load
Source: https://context7.com/isso-comments/isso/llms.txt
An example of loading comments after article content is loaded via AJAX. It updates the thread ID and then fetches comments, suitable for dynamic content loading scenarios.
```javascript
// Example: Load comments after AJAX content load
function loadArticle(articlePath) {
fetch(`/api/articles${articlePath}`)
.then(response => response.json())
.then(article => {
document.getElementById('article-content').innerHTML = article.content;
document.getElementById('isso-thread').setAttribute('data-isso-id', articlePath);
window.Isso.fetchComments();
});
}
```
--------------------------------
### Configure Logging to File (Python)
Source: https://github.com/isso-comments/isso/blob/master/CHANGES.rst
This setting enables logging of application events to a specified file. By providing a file path to the 'log-file' option under the '[general]' section, Isso can persist logs for debugging and monitoring purposes. If left empty, logging behavior may default to console output.
```ini
[general]
log-file = /var/log/isso.log
```
--------------------------------
### Run Isso Development Server with Python Virtual Environment
Source: https://github.com/isso-comments/isso/blob/master/docs/docs/technical-docs/testing.md
This snippet demonstrates how to set up a Python virtual environment and run the Isso development server. It's useful for local development and debugging, providing a live instance of Isso at localhost:8080.
```bash
$ virtualenv --download .venv
$ source .venv/bin/activate
(.venv) $ isso -c contrib/isso-dev.cfg run
```
--------------------------------
### Nginx Configuration for Isso on Sub-URI
Source: https://github.com/isso-comments/isso/blob/master/docs/docs/reference/multi-site-sub-uri.md
This Nginx configuration demonstrates how to run Isso on a sub-URI (e.g., '/isso') on the same domain as the main website. This setup helps circumvent CORS issues and ensures compatibility with privacy-focused browser extensions.
```nginx
server {
listen [::]:80;
listen [::]:443 ssl;
server_name example.tld;
root /var/www/example.tld;
location /isso {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Script-Name /isso;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://localhost:8080;
}
}
```
--------------------------------
### Export Isso Comments to CSV using Bash
Source: https://github.com/isso-comments/isso/blob/master/docs/docs/guides/tips-and-tricks.md
This script exports all comments from an Isso SQLite database to a CSV file. It requires `sqlite3` to be installed and accessible. The output includes page URI, title, comment details, and author information.
```bash
dbpath='/path/to/your/isso.db'
data=$(sqlite3 ${dbpath} -csv 'SELECT threads.uri, threads.title, comments.id, comments.mode, datetime(comments.created, "unixepoch", "localtime"), datetime(comments.modified, "unixepoch", "localtime"), comments.author, comments.email, comments.website, comments.remote_addr, comments.likes, comments.dislikes, comments.voters,comments.text FROM comments INNER JOIN threads ON comments.tid=threads.id')
header='"page: URI","page: title","ID","mode","created on","modified on","author: name","author: email","author: website","author: IP","likes","dislikes","voters","text"'
echo -e "${header}
""${data}" > export.csv
```
--------------------------------
### POST /preview - Preview Comment
Source: https://context7.com/isso-comments/isso/llms.txt
Provides a preview of how Markdown text will be rendered as HTML.
```APIDOC
## POST /preview
### Description
Provides a preview of how Markdown text will be rendered as HTML.
### Method
POST
### Endpoint
`/preview`
### Request Body
- **text** (string) - Required - The raw Markdown text to preview.
### Request Example
```json
{
"text": "# Heading\n\nSome **bold** and *italic* text with `code`."
}
```
### Response
#### Success Response (200 OK)
- **text** (string) - The rendered HTML content.
#### Response Example
```json
{
"text": "Heading
\nSome bold and italic text with code.
"
}
```
```
--------------------------------
### Delete a Comment using Isso REST API
Source: https://context7.com/isso-comments/isso/llms.txt
This example shows how to delete a comment using a DELETE request to the /id/{comment_id} endpoint. Authentication with a cookie file is required. The response will be null if the deletion is successful and the comment has no replies, or it will return the comment object marked as deleted if it has replies.
```bash
# Delete comment with id 1
curl -X DELETE 'https://comments.example.tld/id/1' \
-H 'Content-Type: application/json' \
-b cookies.txt
# Response if no replies (200 OK):
null
# Response if comment has replies (200 OK) - comment marked as deleted but kept:
{
"id": 1,
"parent": null,
"text": "",
"author": null,
"website": null,
"mode": 4,
"created": 1464940838.254393,
"modified": 1464943500.123456,
"likes": 0,
"dislikes": 0
}
```
--------------------------------
### Isso Admin Interface Initialization
Source: https://github.com/isso-comments/isso/blob/master/CHANGES.rst
This change modifies the default behavior of the admin interface. It will not be enabled with a default password by default, enhancing security.
```python
# Don't enable admin interface with default password by default. #491
```
--------------------------------
### Nginx Reverse Proxy for Isso
Source: https://context7.com/isso-comments/isso/llms.txt
Nginx configurations for setting up a reverse proxy to Isso. It covers scenarios for running Isso on a subdomain and on a sub-path of a main website, including necessary header configurations.
```nginx
# Isso on subdomain (recommended)
server {
listen 443 ssl http2;
server_name comments.example.tld;
ssl_certificate /etc/ssl/certs/example.tld.crt;
ssl_certificate_key /etc/ssl/private/example.tld.key;
location / {
proxy_pass http://localhost:8080;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
# Isso on sub-path of main site
server {
listen 443 ssl http2;
server_name example.tld;
# Your main site configuration...
location /isso/ {
proxy_pass http://localhost:8080/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_set_header X-Script-Name /isso;
}
}
```
--------------------------------
### Override Isso Translation Strings (HTML)
Source: https://github.com/isso-comments/isso/blob/master/docs/docs/reference/client-config.md
This snippet illustrates how to override specific translation strings used by the Isso client. By appending `-text-[lang]` to a translation key and using it as a `data-isso-` attribute, you can customize the text displayed to users for a particular language. For example, overriding the 'postbox-notification' message for English is shown.
```html
data-isso-postbox-notification-text-en="Select to be notified of replies to your comment"
```
--------------------------------
### Configure apiDoc for Live API Testing
Source: https://github.com/isso-comments/isso/blob/master/docs/docs/reference/server-api.md
This JSON configuration snippet sets up apiDoc for live API testing. It defines the API name, version, and the sample URL for testing endpoints. The 'private' field can be set to 'true' to exclude private API endpoints from documentation.
```json
{
"name": "Isso API",
"version": "0.13.0",
"sampleUrl": "http://localhost:8080",
"private": "true"
}
```