chore: added license and readme
c84e1fff
3 file(s) · +115 −0
| 15 | 15 | | [**OG**](apps/og) | Open Graph tag inspector | [](https://railway.com/deploy/OdXBt_?referralCode=JGcIp6) | |
|
| 16 | 16 | | [**Shrink**](apps/shrink) | Image compression and resizing | [](https://railway.com/deploy/enYUFb?referralCode=JGcIp6) | |
|
| 17 | 17 | | [**Cellar**](apps/cellar) | Minimal wine collection tracker | [](https://railway.com/deploy/MNprVh?referralCode=JGcIp6) | |
|
| 18 | + | | [**Posts**](apps/posts) | Minimal CMS blog with admin interface | | |
|
| 18 | 19 | ||
| 19 | 20 | ## Shared Crates |
|
| 20 | 21 |
| 1 | + | MIT License |
|
| 2 | + | ||
| 3 | + | Copyright (c) 2026 Steve Simkins |
|
| 4 | + | ||
| 5 | + | Permission is hereby granted, free of charge, to any person obtaining a copy |
|
| 6 | + | of this software and associated documentation files (the "Software"), to deal |
|
| 7 | + | in the Software without restriction, including without limitation the rights |
|
| 8 | + | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
| 9 | + | copies of the Software, and to permit persons to whom the Software is |
|
| 10 | + | furnished to do so, subject to the following conditions: |
|
| 11 | + | ||
| 12 | + | The above copyright notice and this permission notice shall be included in all |
|
| 13 | + | copies or substantial portions of the Software. |
|
| 14 | + | ||
| 15 | + | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
| 16 | + | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
| 17 | + | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
| 18 | + | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
| 19 | + | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
| 20 | + | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
|
| 21 | + | SOFTWARE. |
|
| 22 | + |
| 1 | + | # Posts |
|
| 2 | + | ||
| 3 | + | A minimal CMS blog with admin interface |
|
| 4 | + | ||
| 5 | + | ## Quickstart |
|
| 6 | + | ||
| 7 | + | ```bash |
|
| 8 | + | cd apps/posts |
|
| 9 | + | cp .env.example .env |
|
| 10 | + | # Edit .env with your password |
|
| 11 | + | cargo build --release |
|
| 12 | + | ./target/release/posts |
|
| 13 | + | ``` |
|
| 14 | + | ||
| 15 | + | ### Environment Variables |
|
| 16 | + | ||
| 17 | + | | Variable | Description | Default | |
|
| 18 | + | |---|---|---| |
|
| 19 | + | | `POSTS_PASSWORD` | Password for admin login | `changeme` | |
|
| 20 | + | | `POSTS_DB_PATH` | SQLite database file path | `posts.sqlite` | |
|
| 21 | + | | `UPLOADS_DIR` | Directory for uploaded files | `uploads` | |
|
| 22 | + | | `SITE_URL` | Public URL for RSS feed and links | `http://localhost:3000` | |
|
| 23 | + | | `HOST` | Server bind address | `127.0.0.1` | |
|
| 24 | + | | `PORT` | Server port | `3000` | |
|
| 25 | + | | `COOKIE_SECURE` | Enable HTTPS-only cookies | `false` | |
|
| 26 | + | ||
| 27 | + | ## Overview |
|
| 28 | + | ||
| 29 | + | A self-hosted blog CMS built with Rust. Here's a few highlights: |
|
| 30 | + | - Single Rust binary with embedded assets |
|
| 31 | + | - Password authentication with session cookies |
|
| 32 | + | - Create, edit, publish, and delete blog posts with markdown |
|
| 33 | + | - Static pages with custom navigation links |
|
| 34 | + | - File uploads with admin management |
|
| 35 | + | - Custom CSS support from the admin panel |
|
| 36 | + | - RSS feed at `/feed.xml` |
|
| 37 | + | - Dark themed UI with Commit Mono font |
|
| 38 | + | - SQLite for persistent storage |
|
| 39 | + | ||
| 40 | + | ## Structure |
|
| 41 | + | ||
| 42 | + | ``` |
|
| 43 | + | posts/ |
|
| 44 | + | ├── src/ |
|
| 45 | + | │ ├── main.rs # App entrypoint, env vars, starts server |
|
| 46 | + | │ ├── server.rs # Axum router, HTTP handlers, and templates |
|
| 47 | + | │ ├── auth.rs # Password verification and session management |
|
| 48 | + | │ └── db.rs # SQLite database layer (posts, pages, files, settings, sessions) |
|
| 49 | + | ├── templates/ # Askama HTML templates |
|
| 50 | + | │ ├── base.html # Public base layout |
|
| 51 | + | │ ├── index.html # Blog home page |
|
| 52 | + | │ ├── post.html # Single post view |
|
| 53 | + | │ ├── posts.html # Post listing |
|
| 54 | + | │ ├── page.html # Static page view |
|
| 55 | + | │ ├── login.html # Login page |
|
| 56 | + | │ ├── admin_base.html # Admin layout |
|
| 57 | + | │ ├── admin_index.html # Admin dashboard |
|
| 58 | + | │ ├── admin_post_form.html # Create/edit post form |
|
| 59 | + | │ ├── admin_pages.html # Admin page listing |
|
| 60 | + | │ ├── admin_page_form.html # Create/edit page form |
|
| 61 | + | │ ├── admin_files.html # File upload management |
|
| 62 | + | │ └── admin_settings.html # Blog settings |
|
| 63 | + | ├── static/ # Favicons, fonts, and styles |
|
| 64 | + | ├── uploads/ # Uploaded files directory |
|
| 65 | + | ├── Dockerfile |
|
| 66 | + | └── docker-compose.yml |
|
| 67 | + | ``` |
|
| 68 | + | ||
| 69 | + | ## Deployment |
|
| 70 | + | ||
| 71 | + | ### Docker (recommended) |
|
| 72 | + | ||
| 73 | + | ```bash |
|
| 74 | + | cd apps/posts |
|
| 75 | + | cp .env.example .env |
|
| 76 | + | # Edit .env with your password |
|
| 77 | + | docker compose up -d |
|
| 78 | + | ``` |
|
| 79 | + | ||
| 80 | + | This will start Posts on port `3000` with a persistent volume for the SQLite database and uploads. |
|
| 81 | + | ||
| 82 | + | ### Binary |
|
| 83 | + | ||
| 84 | + | ```bash |
|
| 85 | + | cargo build --release |
|
| 86 | + | ``` |
|
| 87 | + | ||
| 88 | + | The resulting binary at `./target/release/posts` is self-contained with all assets embedded. Copy it to your server with a configured `.env` file and run it directly. |
|
| 89 | + | ||
| 90 | + | ## License |
|
| 91 | + | ||
| 92 | + | [MIT](LICENSE) |