dmpop/buen
1
0
Fork
You've already forked buen
0
Simple micro photo sharing engine written in PHP
  • PHP 65.2%
  • CSS 33%
  • Dockerfile 1.8%
Dmitri Popov 5c33226a4b Add image resolution check before GD processing
Raise memory limit from 128M to 512M in custom.ini
2026年07月12日 20:42:31 +02:00
favicons Update favicon icons 2026年05月03日 17:42:41 +02:00
fonts Self-host fonts instead of loading from remote CDN 2026年05月03日 16:40:06 +02:00
lib Add image resolution check before GD processing 2026年07月12日 20:42:31 +02:00
.gitignore Replace session-based auth with token-based auth 2026年05月13日 14:40:05 +02:00
admin.php Add image resolution check before GD processing 2026年07月12日 20:42:31 +02:00
AGENTS.md Refactor shared HTML into lib/functions.php and remove inc/ directory 2026年07月12日 14:46:32 +02:00
config.php Replace file-based auth token with HMAC-based token 2026年05月23日 10:54:21 +02:00
custom.ini Add image resolution check before GD processing 2026年07月12日 20:42:31 +02:00
docker-compose.yaml Add Docker support with Dockerfile and compose configuration 2026年04月25日 13:38:09 +02:00
Dockerfile Refactor shared HTML into lib/functions.php and remove inc/ directory 2026年07月12日 14:46:32 +02:00
index.php Refactor shared HTML into lib/functions.php and remove inc/ directory 2026年07月12日 14:46:32 +02:00
LICENSE First commit 2026年04月25日 12:02:11 +02:00
post.php Refactor shared HTML into lib/functions.php and remove inc/ directory 2026年07月12日 14:46:32 +02:00
README.md Add sunshine like system 2026年07月11日 14:07:53 +02:00
rss.php Refactor post loading, move favicons/simian into includes, add CSRF 2026年07月12日 11:10:16 +02:00
SECURITY.md First commit 2026年04月25日 12:02:11 +02:00
style.css Refactor post loading, move favicons/simian into includes, add CSRF 2026年07月12日 11:10:16 +02:00
sunshine.php Refactor shared HTML into lib/functions.php and remove inc/ directory 2026年07月12日 14:46:32 +02:00
wall.php Refactor shared HTML into lib/functions.php and remove inc/ directory 2026年07月12日 14:46:32 +02:00

Buen

A simple self-hosted micro photo sharing engine written in PHP.

Example: jetstream

Features

  • Single-user photo sharing for personal use
  • Minimal dependencies - only requires PHP
  • Easy to deploy - no database (posts are saved as JSON files), no exotic dependencies
  • No learning curve - straightforward and simple
  • Wall page with all photos displayed as a thumbnail grid
  • Strips all EXIF metadata from uploaded photos
  • Sunshine: a simple like system — click the sun icon to show appreciation (cookie-based, one per post per visitor)
  • Microformats2 support
  • Works with simian

Requirements

  • PHP 7.4+ with GD extension
  • A web server or PHP built-in server

Installation

  1. Clone this repository:

    git clone https://github.com/dmpop/buen.git
    
  2. Generate a password hash:

    php -r "echo password_hash('YOUR_PASSWORD', PASSWORD_DEFAULT);"
    
  3. Open config.php and replace the default password hash with your generated hash:

    define("PASSWORD_HASH", '2ドルy12ドル$...');
    
  4. Update the site title, description, and URL in config.php as needed.

Running

Using PHP Built-in Server (Testing)

Start the built-in PHP server:

php -S 127.0.0.1:8080

Open http://127.0.0.1:8080 in your browser.

Using Docker

Build and start the container:

docker compose up -d

Open http://localhost:8080 in your browser.

Using a Web Server

Configure your web server (Apache, Nginx, etc.) to serve the application directory. Ensure the posts/, uploads/, and uploads/thumbs/ directories are writable by the web server.

Usage

  • View photos: Navigate to the site URL to browse uploaded photos
  • Upload photos: Access /admin.php to upload and manage photos
  • RSS feed: Access /rss.php for the RSS feed

Fix upload limit

Upload doesn't work? Most likely upload_max_filesize or post_max_size in your PHP config is too small and PHP is silently dropping the upload. Check your current limits:

php -i | grep -E 'upload_max_filesize|post_max_size|file_uploads'

If they're too low (default is often 2MB), either edit /etc/php/8.x/apache2/php.ini directly:

file_uploads = On
upload_max_filesize = 25M
post_max_size = 27M

Or drop a .htaccess file in your blog directory:

php_value upload_max_filesize 25M
php_value post_max_size 27M

Note that post_max_size must be larger than upload_max_filesize — it covers the entire POST body including the file plus form fields.

After editing php.ini, restart Apache:

sudo systemctl restart apache2

The .htaccess approach takes effect immediately without a restart, which is handy for testing. If neither helps, also check that the uploads/ and uploads/thumbs/ directories exist and are writable by the www-data user:

ls -la uploads/
sudo chown -R www-data:www-data uploads/ posts/

License

GPLv3 - see the LICENSE file for details.