ORGTAB — v1.0.49 — cPanel / LiteSpeed

UPLOAD LAYOUT
One universal ZIP supports fresh installations and in-place upgrades.
Everything is contained in one main folder. Upload the CONTENTS of the supplied
OrgTab folder to your desired document root or subfolder, e.g.
public_html/orgtab/. There is no separate public directory.

license.php           OrgTab Software License v1.0 (complete terms and public viewer)
index.php             Public homepage
admin.php             Administrator sign-in and control panel
setup.php             First-time administrator setup; automatically locks after use
assets/               Built-in artwork, CSS, JavaScript
custom/               Optional local branding (create yourself; never distributed)
config/.htaccess      Blocks all web access to config and its descendants
config/app.php        Private application code
config/render.php     Private homepage renderer
config/updates.php    Private software update checker
config/defaults/      Factory content and hosting-rule templates (distributed)
config/install.php    Private initialization and schema migration code
config/data/          Live private content, credentials, backups, logs and cache (created locally)
config/storage.php    Optional external private storage override (local only)
config/installation.json, installation-configured.json, installation.lock
                      Local initialization state and durable setup lock (not distributed)
config/manage-admin.php  Optional CLI account creation/recovery tool
config/check.php      Optional CLI tests for a disposable fresh installation
.htaccess             Created from config/defaults/root.htaccess if absent; existing file preserved

REQUIREMENTS
- cPanel with LiteSpeed Enterprise or Apache 2.4 and .htaccess authorization and
  rewrite rules enabled. This package targets cPanel's Apache-compatible LiteSpeed,
  not standalone OpenLiteSpeed configurations that ignore authorization directives.
- A patched, supported PHP 8.x version (minimum 8.2).
- JSON and PHP sessions enabled; HTTPS enabled for the domain.
- No database, Composer, external scripts, or Microsoft sign-in required.
- Optional update checks use outbound HTTPS via PHP cURL or OpenSSL TLS streams.
  Without either, OrgTab still works; the checker reports unavailable.

INSTALL WITH CPANEL FILE MANAGER (NO TERMINAL REQUIRED)
IMPORTANT: Before uploading/extracting OrgTab, restrict access to the target
folder using cPanel Directory Privacy (temporary HTTP authentication) or a
hosting-level IP restriction/private network. Do not expose a fresh installation
publicly until its administrator is created. Anyone able to reach an unconfigured
setup page can claim it; HTTPS, CSRF and rate limiting do not verify installer
ownership. No application setup credential or PHP file edit is needed for a
standard installation. Keep hosting restrictions active through sign-in checks.

1. Enable Show Hidden Files (dotfiles) in File Manager settings. Upload and extract
   the ZIP. Ensure config/.htaccess is present (it is included). The application
   creates a root .htaccess on its first request if none exists. If one already
   exists, preserve it and merge any missing application rules from
   config/defaults/root.htaccess, retaining cPanel PHP handlers and access rules.
   Use a dedicated subdomain or subfolder to avoid conflicts with another app.
   Keep the installation restricted during extraction and initial setup.

2. Choose the domain's PHP version in cPanel MultiPHP Manager or your host's
   Select PHP Version interface. Do not paste a guessed PHP handler into .htaccess;
   let cPanel manage its handler. Preserve any handler lines cPanel appends.
   Enable SSL/AutoSSL for the hostname. Enable Force HTTPS Redirect in cPanel where
   available; visit the application using https://.

3. PHP must run as your cPanel account and be able to create local files in
   config/ and write to the active data directory. On first use it also needs
   write access to the application root if .htaccess is absent. If necessary,
   copy config/defaults/root.htaccess to the root manually before visiting setup.
   Set private data directories to 700 and files to 600. On Unix, OrgTab verifies
   these modes and attempts to correct them; it refuses storage access if they
   cannot be secured. Do not use 777. For stronger protection, see PRIVATE STORAGE
   below before configuring an administrator.
   If saving fails, ask the host to correct ownership/PHP execution settings.
   Use cPanel MultiPHP INI Editor for display_errors=Off, log_errors=On, and
   post_max_size=2M or greater. The application limits content requests to 1 MB.

4. Open https://YOUR-HOST/orgtab/setup.php to initialize private storage.
   BEFORE submitting the account form, verify protection in your browser:
   https://YOUR-HOST/orgtab/config/protection-check.html
   https://YOUR-HOST/orgtab/config/data/content.json
   Both must return 403 Forbidden. A normal file-manager view inside cPanel is
   expected to work; this test is for a direct web request.
   If either returns file contents or a download, stop and ask the hosting provider
   to enable the included .htaccess rules. PHP itself cannot enforce rules for JSON
   or backup files served directly by the web server. A custom branded 403 page is
   fine. Check the HTTP status if your host uses custom error pages.

5. Visit https://YOUR-HOST/orgtab/setup.php. Follow the on-screen instructions:
   - Verify the private storage checks and confirm the installation is restricted.
   - Choose an administrator username and a new 14–72 byte password. Use 14–72
     ASCII characters for predictable length. Enter the password again to confirm.
   - Click Create administrator & finish setup.
   No separate setup credential, database or file editing is required.

6. The administrator is saved as a password hash, and a private setup-used.json
   marker permanently disables first-time setup for this installation's retained
   data directory. An existing administrator also independently blocks setup.
   The separate config/installation-configured.json marker also blocks setup
   if both account files are lost; never delete local installation markers.
   The lock is checked under an exclusive authentication lock during creation,
   so concurrent submissions cannot replace the first administrator. If account
   creation fails after the marker is saved, use CLI recovery; do not delete it.
   You may leave setup.php in place: subsequent visits return 403 Forbidden and
   show a locked notice with a sign-in link. Deleting setup.php is optional.

7. Open admin.php and sign in. Verify that setup.php is locked (or removed),
   and that the protection checks still return 403. Only then remove temporary
   hosting access restrictions if appropriate. The homepage at index.php requires
   no login. Retain hosting access controls if the portal should be employees-only.

PRIVATE STORAGE (RECOMMENDED FOR PUBLIC HOSTING)
By default, config/data is created inside the application and protected by
config/.htaccess and the root application rules. Their presence and private file permissions are checked locally;
PHP cannot guarantee the web server applies its rules to static files. Always
perform the browser protection checks in step 4 and after hosting changes.

For stronger isolation, before setup (or with all app traffic stopped and PHP
workers/caches restarted after editing the setting), first initialize the app
by visiting setup.php without submitting the form, then move the entire
config/data directory to
a dedicated directory outside ALL public document roots (e.g.
/home/YOUR-ACCOUNT/orgtab-private). Copy config/defaults/storage.example.php
to config/storage.php and edit it to return the absolute
path, e.g. return '/home/YOUR-ACCOUNT/orgtab-private'; . The directory must already
contain content.json and be writable by PHP. Do not point it at a shared home
directory or symlink. Remove the original public copy after verifying the move.
Set directory mode 700, files 600. OrgTab checks the resolved path against its
application and current document root during web requests. Other virtual hosts,
aliases and server mappings cannot be automatically detected; verify those with
your hosting provider. Keep both .htaccess files and check config/protection-check.html
returns 403 even with external storage. The old config/data URL should return
403 or 404 after moving. Never serve the external directory via an alias.

SECURITY LOG AND AUTHENTICATION
Admin > Security Log shows the newest 100 events, including successful/failed
credential checks, sign-out, account creation/recovery, password changes,
content publishing, backup restores and rate thresholds. UTC timestamps and
source IP addresses are retained locally. No passwords or session tokens
are logged. This is a bounded operational log, not a tamper-proof audit system;
logging failures are sent to PHP's error log. Consider applicable privacy rules.

Login and account-creation submissions use independent per-IP and global attempt windows. Each permits
10 attempts per IP and 30 across all sources in a fixed 15-minute window, with
30-second and 120-second account-wide cooldowns at 10 and 20 reserved attempts.
Successful sign-ins and account creation refund their own reservation. Blocked attempts do not extend
windows; a persistent attacker may still repeatedly cause temporary lockouts.
CLI account recovery clears login limits and invalidates prior sessions.
Authentication and content storage use separate locks. On password changes or
CLI recovery, stale sessions cannot perform subsequent content transactions.

If stored content is invalid, the homepage fails safely instead of rendering
unsafe data. Stop web traffic and restore a known-good content.json from the
private backups directory using File Manager; verify ownership and permissions.

APPEARANCE
- Navigation appears above the header; menus open on hover or tap.
- The sun/moon button at the top right switches the public homepage theme.
- Dark is the default. The choice is remembered using browser local storage,
  without a cookie. Clearing site data resets it. Private browsing may not retain it.
- Offline HTML includes the toggle; persistence depends on browser support for
  local file storage. If storage is blocked, switching still works for that visit.
- Built-in artwork is stored at assets/orgtab-default-logo.png and
  assets/orgtab-default-favicon.ico. Do not replace these distributed files.

CUSTOMIZATION AND OFFLINE COPIES
- Landing Page Cards: add, rename, reorder and delete the main cards and links.
- Dropdown menus: select a menu; edit its title, sections, links and order.
- Navigation shortcuts: Email, Phone List, Calendar and any additional direct links.
- Footer links and Site Settings: update text, site title, badge and header color.
- Site Settings > Regional settings: select the organization's time zone from
  the supported IANA time zones (default: America/New_York). It controls
  announcement expiration, displayed backup dates and the offline export date.
  Changing the zone reinterprets existing expiration dates in the new zone;
  review the expiration before saving. Stored backup timestamps remain UTC.
- Site Settings > Service status / header link: set the display text and URL
  for the header link, or disable it. Use an HTTP/HTTPS URL or the bundled
  demo destination. Both the live homepage and offline HTML use these settings.
  Save changes to publish the configuration.
- Drag the main landing page cards or dropdown menu titles in the order panels
  at the bottom of their admin pages. Individual links retain their existing order.
- Save changes publishes your draft. The previous version is retained automatically.
- Backups & transfer: export/import content JSON; retain up to 15 previous versions.
  Import loads a draft. Previous versions show backup creation timestamps,
  radio-button selection, and two confirmations before publishing a restore.
  Older backups beyond 15 are removed when listing backups or saving content.
- Download offline HTML exports the current SAVED page as a standalone file with
  embedded default logo, default favicon, styling and scripts. Save first if
  you have unsaved edits. Custom live artwork is not embedded in offline exports.
- Create custom/ in the application root, upload your own logo and favicon,
  and set Header logo image path and Favicon image path in Site Settings
  (e.g. custom/logo.png and custom/favicon.ico). Both accept local image
  paths only. Blank uses the built-in artwork, unless a customized legacy
  assets/logo.png or root favicon.ico is detected. Legacy files are not
  overwritten by this package. Reload the admin page after saving.
- Links accept http://, https://, mailto:single-address and tel: destinations.
  Existing destination-service authentication remains unchanged.

CACHING / PROXIES
The application sends Cache-Control: no-store, private and LiteSpeed's no-cache
header, and the root .htaccess disables LiteSpeed cache lookup. Exclude the entire
application path from any host/CDN forced page-cache rules. Never cache admin.php
or setup.php. If using Cloudflare, use Full (strict) with HTTPS to the origin.
The app does not trust arbitrary X-Forwarded-Proto headers; it requires HTTPS at
PHP's origin connection. No server-wide PHP or IIS configuration is included.

ACCOUNT RECOVERY / OPTIONAL TERMINAL SETUP
If cPanel Terminal/SSH is available, run these commands from the main app folder.
Check php -v first; use the host's PHP 8.x CLI path if its default is older.

  read -r -s -p 'New administrator password: ' orgtab_admin_password
  printf '\n'
  printf '%s\n' "$orgtab_admin_password" | php config/manage-admin.php admin
  unset orgtab_admin_password

This creates or replaces the single administrator and invalidates old sessions.
It sends the password via standard input, not a process argument or a file.
Without Terminal, ask the hosting administrator to run the recovery command.
Do not delete admin.json or setup-used.json to reopen setup on a live site.

BACKUP / FUTURE UPGRADES
Use the same OrgTab ZIP for fresh installations and updates. The archive never
contains the live config/data/ directory, local storage.php, installation state
or locks, custom/ directory, legacy logo/favicon filenames or root .htaccess.
Factory defaults are separate; they initialize new installations only.

1. Back up the entire installation and the active private data directory (which
   may be outside the web root). Include config/storage.php, local installation
   markers, custom artwork, and hosting rules. JSON content exports do not include
   credentials or the setup lock and are not a complete installation backup.
2. Stop/restrict application access during deployment so requests cannot execute
   a mixture of old and new application files. Extract the new OrgTab folder
   contents over the existing installation, replacing distributed files only.
   Do not delete or mirror/synchronize the destination directory to the archive.
3. The root .htaccess is preserved. config/.htaccess is a mandatory distributed
   deny-all protection file; if you added custom directives there, back them up
   and merge them without weakening the deny-all rule. Review root rule template
   changes and merge any necessary additions without replacing hosting settings.
4. Open the administrator control panel. Existing content is retained; supported
   schema migrations add new defaults only where absent, validate data and keep a
   private pre-migration copy in the active data directory's migration-backups/.
   The local installation state records the completed schema. Normal content
   backup retention remains 15; migration backups are separate. Never delete
   state or credentials to attempt recovery. Missing or corrupt content produces
   an error rather than being replaced by demo data. Restore from a known-good
   backup or follow CLI account recovery instructions as appropriate.
5. Verify the homepage, administrator sign-in, locked setup, custom branding,
   and private-directory protection, then reopen access. If upgrading fails,
   restore the complete pre-upgrade backup, including the application files and
   private installation state together.

Store ZIP archives outside the public web folder or delete them after extraction.
Keep config/.htaccess in place, including when restoring a backup.

LIMITS
One administrator account, no AD/SSO, no MFA, no role-based permissions, and a
bounded local security log (not a full audit trail). 30-minute idle timeout and
eight-hour maximum session. Per-IP and global rate limits as described above.
A reverse proxy can cause
users to share the same rate-limit bucket. Maximum 25 menus, 40 sections per
menu/homepage, 150 links per section/list, and 1 MB per save request.

REFERENCES
https://docs.cpanel.net/cpanel/software/multiphp-manager-for-cpanel/
https://docs.litespeedtech.com/lsws/security/
https://docs.litespeedtech.com/lsws/cp/cpanel/403-error/

FINAL FILE PERMISSIONS (PHP runs as the owning cPanel account)
Public directories and config/: 0755. Public files and both .htaccess files: 0644.
Optional local config/storage.php and local installation state/lock files: 0600.
config/data/, backups/ and migration-backups/: 0700.
All private data files, including lock files, setup marker, security log and
backup JSON files: 0600. The same modes apply to optional external storage.
Keep data writable by PHP. Do not use 0777. Check permissions after uploading.

SOFTWARE UPDATE CHECKS
The signed-in admin header shows the installed release and a status dot: green
when current, red when a newer release is reported, amber on failure or stale
success, gray before the first check, blue while checking. Click it for the
latest reported version, check timestamps, manual check and release download link.
The original About link remains at the bottom of the admin sidebar.

Automatic checks default to enabled. On an authenticated admin page load, a
background browser request performs a check only when due (every 24 hours after
success, or one hour after a failed attempt). No cron job, public page request,
or persistent background process is involved. The first check starts after the
admin interface loads. Manual checks are limited to one per minute across the
installation. A private cache and short reservation prevent concurrent checks.
Disable automatic checks in Site Settings > Software Updates and Save changes;
manual checks remain available. The setting is included in content backups and
imports, so review it after a restore/import if outbound access is restricted.

The only destination is https://www.orgtab.com/releases/version.txt (HTTPS with
certificate verification, no redirects). The response must be a plain numeric
major.minor.patch version and at most 128 bytes. The request has short timeouts,
uses a generic user-agent, and does not include the installed version, credentials,
organization name or content. The remote server sees the hosting server's IP.
The result is saved in the private data directory as update-check.json, using
update.lock, separate from content and audit history. A failed check does not
prevent portal use. The last successful version is retained and labeled as such.
No remote code is downloaded or executed and updates are never auto-installed.
Publish a new release ZIP before changing version.txt on orgtab.com. The file
should contain only the released version, optionally followed by a newline.

CURRENT ADMIN NAVIGATION
Landing Page Cards edits cards and links; Card Order rearranges cards.
Dropdown Menus edits sections/links; Menu Names adds/renames/deletes menus;
Menu Order rearranges menus. Site Settings includes Control panel title,
Regional settings, Service status / header link, custom logo and favicon paths,
and Software Updates.
Security Log displays recent security events and storage mode.
Save changes publishes the current draft.

INITIAL RELEASE / SAMPLE CONTENT
Fresh installation: no administrator account or password is included. The first
visit to setup.php guides account creation; restrict access before installation.
Demo links use demo.html#resource and can be saved unchanged in the control panel. Replace them with your real URLs when ready.
By default, the header service status link opens a labeled demo, not a live
monitoring service. Change its text and destination or disable it in Site Settings.
Offline HTML exports require demo.html beside the export for demo links to work; real absolute URLs work normally.
This universal package includes the OrgTab icon, matching favicon and sample content.
The sample content includes six landing page cards with three links each,
three dropdown menus with three sections and nine links each, three
navigation shortcuts, and two footer links. Some resources appear in both
the landing page cards and dropdown menus to demonstrate shared shortcuts.
Version 1.0.49 is the initial public release of OrgTab.

LICENSING
OrgTab is source-available software distributed under the OrgTab Software
License v1.0. Personal and commercial use, customization, and free
redistribution are permitted under its terms. Commercial resale, paid
software bundling, and paid hosted software access are prohibited. Genuine
installation, customization, hosting infrastructure, and support services
for a customer's own deployment may be charged for as described in the license.
Preserve license.php and the original notices when redistributing the software
or covered modified versions. The complete license controls over this summary.

To read the license, open license.php in the deployed application, inspect its
source in the package, use the View license link
in the homepage About window, or select the OrgTab version link below the
administrator sign-out button and open View license in the same About window.
Offline HTML exports include a copy of the license in their About window.
The self-contained public license.php page contains the complete license;
the existing direct text-file access restrictions remain enabled.
