|
1 |
| -# Meh... |
| 1 | +# Meh... another comment system |
2 | 2 |
|
| 3 | +## Features |
3 | 4 |
|
4 |
| -A simple comment system for your static (or non-static) site. |
| 5 | +## Overview |
5 | 6 |
|
| 7 | +## Devel Quick Start |
6 | 8 |
|
7 |
| -## Quick Start |
| 9 | +You can use this to get a development environment up and running quickly. This is not suitable for production use. But should answer all your questions about how Meh works. |
8 | 10 |
|
9 | 11 | cd backend
|
10 | 12 | composer install
|
11 | 13 | cd ../frontend
|
12 | 14 | npm install
|
13 | 15 | npm run build
|
14 | 16 | cd ..
|
| 17 | + cp .env.example .env |
| 18 | + $EDITOR .env |
15 | 19 | ./meh migrate
|
16 |
| - ./meh config site_url https://myblog.example.com |
17 |
| - ./meh config admin_password supersecret |
| 20 | + php -s localhost:8000 -t public |
18 | 21 |
|
19 |
| -Point your Apache to the `public` directory and you're good to go. |
| 22 | +You can then use `http://localhost:8000/` as the base URL for all components. |
20 | 23 |
|
21 |
| -## Command Line Tool |
| 24 | +## Server |
22 | 25 |
|
23 |
| -Meh comes with a command line tool that helps you manage your comment system. The `meh` command provides utilities for database management, configuration, and importing comments from other platforms. |
24 | 26 |
|
25 |
| -To see available commands: |
| 27 | +* [Command Line Tool](doc/cli.md) |
| 28 | +* [Database Setup and Upgrade](doc/migrate.md) |
| 29 | +* [Configuration](doc/config.md) |
| 30 | +* [Mastodon Integration](doc/mastodon.md) |
26 | 31 |
|
27 |
| - ./meh |
28 | 32 |
|
29 |
| -All commands support the `--site` (or `-s`) parameter to specify which site to operate on. This is useful if you're managing multiple sites with the same Meh installation. |
30 |
| - |
31 |
| - ./meh --site myblog config |
32 |
| - |
33 |
| -If not specified, the default site name "meh" will be used. Site names have to be lowercase and can only contain letters, numbers, and underscores. Each site corresponds to a separate SQLite database. |
34 |
| - |
35 |
| -## Database Migration |
36 |
| - |
37 |
| -The `migrate` command is essential for setting up and maintaining your Meh installation: |
38 |
| - |
39 |
| -``` |
40 |
| -./meh migrate |
41 |
| -``` |
42 |
| - |
43 |
| -This command: |
44 |
| - |
45 |
| -1. Creates a new SQLite database for your site if it doesn't exist yet |
46 |
| -2. Applies any pending database schema migrations to keep your database structure up-to-date |
47 |
| -3. Generates a secure JWT secret if one doesn't exist |
48 |
| - |
49 |
| -You should run this command: |
50 |
| -- When first setting up Meh |
51 |
| -- After updating to a new version of Meh |
52 |
| -- When creating a new site in a multi-site setup (with the `--site` parameter) |
53 |
| - |
54 |
| -For multi-site setups, specify the site name: |
55 |
| - |
56 |
| -``` |
57 |
| -./meh --site blog2 migrate |
58 |
| -``` |
59 |
| - |
60 |
| -It is important to run this command for each of your sites when upgrading to a new version of Meh. |
61 |
| - |
62 |
| -## Configuration |
63 |
| - |
64 |
| -Meh uses a layered configuration system that allows for flexible setup across multiple sites: |
65 |
| - |
66 |
| -1. **Default Values**: Every configuration option has a sensible default value. |
67 |
| - |
68 |
| -2. **Environment Variables**: Defaults can be overridden by environment variables prefixed with `MEH_` (e.g., the `site_url` config can be set via the `MEH_SITE_URL` env var). |
69 |
| - |
70 |
| -3. **`.env` File**: For convenience, you can place environment variables in a `.env` file in the project root. The project contains a `.env.example` file that you can copy and modify. |
71 |
| - |
72 |
| -4. **Database Storage**: Site-specific configurations can stored in each site's database and take precedence over environment variables. |
73 |
| - |
74 |
| -### Configuration Hierarchy |
75 |
| - |
76 |
| -When Meh looks for a configuration value, it checks these sources in order: |
77 |
| - |
78 |
| -1. Default values (lowest priority) |
79 |
| -2. Environment variables / `.env` file |
80 |
| -3. Database values (highest priority) |
81 |
| - |
82 |
| -### Managing Configuration |
83 |
| - |
84 |
| -Use the `meh config` command to view or modify database configuration values: |
85 |
| - |
86 |
| -``` |
87 |
| -# View all configuration values and their sources |
88 |
| -./meh config |
89 |
| -
|
90 |
| -# View a specific configuration value |
91 |
| -./meh config site_url |
92 |
| -
|
93 |
| -# Set a configuration value in the database |
94 |
| -./meh config site_url https://example.com |
95 |
| -
|
96 |
| -# Remove a database configuration (revert to environment or default) |
97 |
| -./meh config site_url "" |
98 |
| -``` |
99 |
| - |
100 |
| -For multi-site setups, use the `--site` parameter: |
101 |
| - |
102 |
| -``` |
103 |
| -./meh --site blog1 config site_url https://blog1.example.com |
104 |
| -./meh --site blog2 config site_url https://blog2.example.com |
105 |
| -``` |
106 |
| - |
107 |
| -Configs set up via Environment always apply to all sites, while configs set up via the database are site-specific. |
108 |
| - |
109 |
| -## Mastodon Integration |
110 |
| - |
111 |
| -Meh includes built-in support for integrating with Mastodon, allowing you to import replies to your Mastodon posts as comments on your site. |
112 |
| - |
113 |
| -### Configuration |
114 |
| - |
115 |
| -To set up Mastodon integration: |
116 |
| - |
117 |
| -1. Configure your Mastodon account in your site settings: |
118 |
| - |
119 |
| -``` |
120 |
| -./meh config mastodon_account "@yourusername@instance.social" |
121 |
| -``` |
122 |
| - |
123 |
| -2. If you're using GoToSocial, even read access requires an API token. The easiest way to get one is to use the [Access Token Generator for Mastodon API](https://takahashim.github.io/mastodon-access-token/). You only need the `read` scope. |
124 |
| - |
125 |
| -``` |
126 |
| -./meh config mastodon_token "your-api-token" |
127 |
| -``` |
128 |
| - |
129 |
| -3. Set up a cron job to periodically fetch new posts and replies: |
130 |
| - |
131 |
| -``` |
132 |
| -# Run every hour to check for new Mastodon posts and replies |
133 |
| -0 * * * * /path/to/meh mastodon |
134 |
| -``` |
135 |
| - |
136 |
| -For multi-site setups you need to set up a `mastodon_account` config and cron job for each site. But you can have all sites use the same account. |
137 |
| - |
138 |
| -### How It Works |
139 |
| - |
140 |
| -The Mastodon integration: |
141 |
| - |
142 |
| -1. Fetches posts from your configured Mastodon account |
143 |
| -2. Identifies posts that link to your site |
144 |
| -3. Tracks these posts in the database |
145 |
| -4. Periodically checks for replies to these posts |
146 |
| -5. Imports replies as comments on the corresponding blog post |
147 |
| - |
148 |
| -This creates a seamless bridge between discussions on your blog and on the Fediverse. |
149 |
| - |
150 |
| -### Manual Import |
151 |
| - |
152 |
| -You can manually trigger the Mastodon import process at any time: |
153 |
| - |
154 |
| -``` |
155 |
| -./meh mastodon |
156 |
| -``` |
157 |
| - |
158 |
| -This is useful for testing or for an initial import of existing conversations. |
159 |
| - |
160 |
| -## Components |
| 33 | +## Client (your blog) |
161 | 34 |
|
162 | 35 | * [meh-form](./frontend/src/components/meh-form/readme.md)
|
163 | 36 | * [meh-comments](./frontend/src/components/meh-comments/readme.md)
|
|
0 commit comments