GitGram — config.php — GitGram
Hobbes_OS2_Archive / main / v1.15 / config.php9,199 B↓ Raw
<?php
if (!defined('HOBBES')) { http_response_code(403); exit; }

// Paths
define('ROOT_DIR',      __DIR__);
define('DATA_DIR',      ROOT_DIR . '/data');
define('UPLOADS_DIR',   DATA_DIR . '/uploads');
define('POOL_DIR',      DATA_DIR . '/pool');
define('USERS_DIR',     DATA_DIR . '/users');
define('FILES_DIR',     DATA_DIR . '/files');
define('INDEX_DIR',     DATA_DIR . '/index');
define('SETTINGS_DIR',  DATA_DIR . '/settings');
define('INVITES_DIR',   DATA_DIR . '/invites');
define('CATS_FILE',     DATA_DIR . '/categories/categories.json');
define('SETTINGS_FILE', SETTINGS_DIR . '/settings.json');
define('SEARCH_FILE',   INDEX_DIR . '/search.json');
define('CATALOG_FILE',  INDEX_DIR . '/catalog.json');
define('DLLOG_FILE',    DATA_DIR  . '/index/dllog.json');

// Upload size limits
define('MAX_MEDIA_SIZE', 200 * 1024 * 1024); // 200 MB for media
define('MAX_FILE_SIZE',  200 * 1024 * 1024); // 200 MB for programs

// Allowed extensions
define('OS2_EXTENSIONS', [
    'zip','wpi','exe','cmd','bat','inf','rpm',
    'tar','gz','bz2','lzh','arj','7z','cab','img','iso',
]);
define('MEDIA_EXTENSIONS', [
    'jpg','jpeg','png','gif','bmp','ico',
    'wav','mp3','mid','midi','au','aiff',
    'avi','mov','mp4','mpeg','mpg',
]);
define('DOC_EXTENSIONS', [
    'txt','nfo','diz','doc','html','htm','pdf','rtf','me',
]);

// Role hierarchy (index = weight)
define('ROLES', ['guest', 'contributor', 'editor', 'admin']);

// OS/2 user-agent patterns
define('OS2_UA_PATTERNS', [
    'OS/2', 'Warp', 'WebExplorer', 'Warpzilla',
    'Lynx.*OS', 'SPRY', 'PMX',
]);

// Default site settings (active_preset tracks which named preset is active, '' = custom)
define('DEFAULT_SETTINGS', [
    'site_name'         => 'Hobbes OS/2 Archive',
    'site_tagline'      => 'The Premier OS/2 Software Repository',
    'open_registration'    => false,
    'show_splash'          => true,
    'guest_access'         => false,
    'contributor_category' => '',
    'landing_content'   =>
"# Welcome to the Hobbes OS/2 Archive

This archive is dedicated to OS/2 software, utilities, drivers, and media.
Browse our categories to find programs for Warp 3, Warp 4, eComStation, and ArcaOS.

## Getting Started

- **Guests** (OS/2 browsers): Full browse and download access
- **Contributors**: Upload and share your OS/2 software
- **Editors**: Approve submissions and manage categories

Use the navigation above to browse by category or search the archive.",
    'splash_content'    =>
"# Not Running OS/2?

This archive is designed for the OS/2 community. Guests browsing from non-OS/2 systems
need an account to access downloads.

**If you have an invite code**, use it to register for an account.
**If you are running OS/2**, please verify your browser sends the correct User-Agent string.

This restriction helps us serve the OS/2 community first.",
    'active_preset'     => '',
    'archiveorg' => [
        'key'        => '',
        'secret'     => '',
        'collection' => '',
        'item_id'    => '',   // single-item bulk upload identifier
    ],
    'two_spot' => [
        'enabled' => false,
        'bg'      => '#000080',
        'text'    => '#ffff00',
    ],
    'css' => [
        'bg_color'          => '#c0c0c0',
        'text_color'        => '#000000',
        'link_color'        => '#000080',
        'visited_color'     => '#800080',
        'header_bg'         => '#000080',
        'header_text'       => '#ffffff',
        'nav_bg'            => '#003399',
        'nav_text'          => '#ffffff',
        'nav_hover_bg'      => '#0055cc',
        'th_bg'             => '#000080',
        'th_text'           => '#ffffff',
        'tr_alt_bg'         => '#e8e8ff',
        'tr_hover_bg'       => '#c8c8e8',
        'border_color'      => '#808080',
        'btn_bg'            => '#c0c0c0',
        'btn_text'          => '#000000',
        'btn_border'        => '#808080',
        'panel_bg'          => '#ffffff',
        'panel_border'      => '#808080',
        'accent'            => '#000080',
        'footer_bg'         => '#000080',
        'footer_text'       => '#ffffff',
        'input_bg'          => '#000080',
        'input_text'        => '#ffff00',
        'input_border'      => '#808080',
        'error_bg'          => '#ffcccc',
        'success_bg'        => '#ccffcc',
        'info_bg'           => '#ccccff',
        'muted_color'       => '#444444',
    ],
]);

// Named theme presets — used by admin CSS page and user profile theme picker
define('THEME_PRESETS', [
    'os2_classic' => [
        'name' => 'OS/2 Classic (Blue/Gray)',
        'css'  => DEFAULT_SETTINGS['css'],
    ],
    'dark' => [
        'name' => 'Dark Mode',
        'css'  => [
            'bg_color'      => '#1a1a1a', 'text_color'    => '#cccccc',
            'link_color'    => '#6699ff', 'visited_color' => '#9966ff',
            'header_bg'     => '#000033', 'header_text'   => '#ffffff',
            'nav_bg'        => '#111133', 'nav_text'      => '#aaaacc',
            'nav_hover_bg'  => '#222266', 'th_bg'         => '#000033',
            'th_text'       => '#ffffff', 'tr_alt_bg'     => '#222222',
            'tr_hover_bg'   => '#1e1e3a',
            'border_color'  => '#444444', 'btn_bg'        => '#333333',
            'btn_text'      => '#cccccc', 'btn_border'    => '#555555',
            'panel_bg'      => '#222222', 'panel_border'  => '#444444',
            'accent'        => '#4466cc', 'footer_bg'     => '#000033',
            'footer_text'   => '#aaaacc', 'input_bg'      => '#333333',
            'input_text'    => '#cccccc', 'input_border'  => '#555555',
            'error_bg'      => '#330000', 'success_bg'    => '#003300',
            'info_bg'       => '#000033', 'muted_color'   => '#aaaaaa',
        ],
    ],
    'green_terminal' => [
        'name' => 'Green Terminal',
        'css'  => [
            'bg_color'      => '#001100', 'text_color'    => '#00cc00',
            'link_color'    => '#00ff00', 'visited_color' => '#009900',
            'header_bg'     => '#003300', 'header_text'   => '#00ff00',
            'nav_bg'        => '#002200', 'nav_text'      => '#00cc00',
            'nav_hover_bg'  => '#004400', 'th_bg'         => '#003300',
            'th_text'       => '#00ff00', 'tr_alt_bg'     => '#001a00',
            'tr_hover_bg'   => '#003300',
            'border_color'  => '#005500', 'btn_bg'        => '#002200',
            'btn_text'      => '#00cc00', 'btn_border'    => '#005500',
            'panel_bg'      => '#001500', 'panel_border'  => '#005500',
            'accent'        => '#00aa00', 'footer_bg'     => '#003300',
            'footer_text'   => '#00cc00', 'input_bg'      => '#000a00',
            'input_text'    => '#00cc00', 'input_border'  => '#005500',
            'error_bg'      => '#110000', 'success_bg'    => '#003300',
            'info_bg'       => '#001133', 'muted_color'   => '#009900',
        ],
    ],
    'hobbes_og' => [
        'name' => 'Hobbes OG',
        'css'  => [
            'bg_color'      => '#1F3F6F', 'text_color'    => '#EFDFCF',
            'link_color'    => '#EFEF7F', 'visited_color' => '#AFAF7F',
            'header_bg'     => '#0F2F5F', 'header_text'   => '#EFDFCF',
            'nav_bg'        => '#152d54', 'nav_text'      => '#EFEF7F',
            'nav_hover_bg'  => '#0F2F5F', 'th_bg'         => '#0F2F5F',
            'th_text'       => '#99CCCC', 'tr_alt_bg'     => '#1A3860',
            'tr_hover_bg'   => '#2a4878',
            'border_color'  => '#2A5090', 'btn_bg'        => '#0F2F5F',
            'btn_text'      => '#EFDFCF', 'btn_border'    => '#2A5090',
            'panel_bg'      => '#1A3860', 'panel_border'  => '#2A5090',
            'accent'        => '#99CCCC', 'footer_bg'     => '#0F2F5F',
            'footer_text'   => '#EFDFCF', 'input_bg'      => '#0F2F5F',
            'input_text'    => '#EFDFCF', 'input_border'  => '#2A5090',
            'error_bg'      => '#550000', 'success_bg'    => '#003322',
            'info_bg'       => '#0F2F5F', 'muted_color'   => '#b8b0a0',
        ],
    ],
    'amber' => [
        'name' => 'Amber',
        'css'  => [
            'bg_color'      => '#0d0900', 'text_color'    => '#ffb300',
            'link_color'    => '#ffd700', 'visited_color' => '#cc8800',
            'header_bg'     => '#1a0f00', 'header_text'   => '#ffb300',
            'nav_bg'        => '#0f0800', 'nav_text'      => '#ffb300',
            'nav_hover_bg'  => '#2a1800', 'th_bg'         => '#1a0f00',
            'th_text'       => '#ffd700', 'tr_alt_bg'     => '#150c00',
            'tr_hover_bg'   => '#2a1800',
            'border_color'  => '#664400', 'btn_bg'        => '#1a0f00',
            'btn_text'      => '#ffb300', 'btn_border'    => '#664400',
            'panel_bg'      => '#120a00', 'panel_border'  => '#664400',
            'accent'        => '#cc8800', 'footer_bg'     => '#1a0f00',
            'footer_text'   => '#ffb300', 'input_bg'      => '#0d0900',
            'input_text'    => '#ffb300', 'input_border'  => '#664400',
            'error_bg'      => '#2a0000', 'success_bg'    => '#002800',
            'info_bg'       => '#1a0f00', 'muted_color'   => '#cc8800',
        ],
    ],
]);
Ready
GitGram