CLC DOCUMENT REPOSITORY v1.0.0

INSTALL
1. Extract this package to any folder on the Windows Server.
2. Run INSTALL.bat as Administrator.
3. It installs to C:\CLC Document Repository.
4. Backend defaults to http://127.0.0.1:8811.
5. Point your IIS site at C:\CLC Document Repository\IIS.
6. Use Win-ACME against the IIS site as normal.

DEFAULT ADMIN PASSWORD
ChangeMe123!
Change it immediately in Admin > Settings.

FEATURES
- Public browsing and downloading with no login.
- Admin-only uploads, metadata, categories and settings.
- Notes and comma-separated keywords.
- Multiple versions grouped under one file entry.
- Latest version always appears first.
- Older versions remain downloadable and can be promoted back to Latest.
- PDF files open inline in the browser.
- Configurable bulk storage folder.
- Configurable backend port; default 8811.
- Optional public download throttling in KB/s; 0 = unlimited.
- 50 GB application upload request ceiling for large ISO/files.
- Responsive light interface.
- Windows service installed automatically.

IIS
The included IIS\web.config uses reverse proxying.
IIS URL Rewrite and Application Request Routing (ARR) must be installed, with ARR proxy enabled.
The installer does NOT restart IIS or Windows.

PORT CHANGES
Changing the port in Admin > Settings rewrites IIS\web.config.
Run RESTART_SERVICE.bat after changing the port.

STORAGE
Default: C:\CLC Document Repository\storage
You can change this to another local server folder or UNC path.
For UNC paths, the Windows service account must have read/write rights to the share.

UPDATES
UPDATE.bat preserves .venv, data, storage and logs. It only replaces application files and restarts this app service.


V1.0.1 INSTALLER FIX
- INSTALL.bat can now be run from C:\CLC Document Repository itself.
- Robocopy success codes 0-7 are accepted.
- Copy failures now display the real Robocopy code and log.


V1.0.2 INSTALLATION BEHAVIOUR
- The ZIP is an installer/update source package.
- Extract it to any folder OUTSIDE C:\CLC Document Repository.
- Run INSTALL.bat from that separate folder.
- INSTALL.bat always copies the application into:
  C:\CLC Document Repository
- The installer refuses to run from the final install directory.
- The installer also refuses to run from a subfolder inside the install directory.
- Database, logs, private Python environment and bulk storage are preserved on reinstall/update.


V1.0.3 COPY FIX
- Fixed Robocopy parsing when the installer source path contains spaces.
- The copy command now uses normalized source/destination paths with no trailing slash.
- The Robocopy command is now a single line to avoid CMD continuation parsing problems.


V1.0.4 WEBSITE/STARTUP REPAIR
- Replaced the previous pywin32 service wrapper with a compiled .NET Framework Windows Service host.
- Installer verifies /health before reporting success.
- Added CHECK_SERVER.bat to show service state, listening port and HTTP health.
- Fixed template number formatting that could trigger HTTP 500 on repository pages.
- IIS web.config includes IIS maximum request-filtering content size.


V1.0.5 SAFE UPDATE SYSTEM
- Startup uses a dedicated Windows Task Scheduler task.
- INSTALL.bat prints the exact failed stage.
- After the first successful install, use UPDATE_ONLY.bat for every update.
- UPDATE_ONLY.bat excludes data, storage, logs, backups and .venv from file copying.
- Before each update it backs up repository.db plus the current application code.
- If the update or health check fails, it automatically restores the prior code and repository.db.
- BACKUP_DATA.bat creates a manual database/config backup.


V1.0.6 BACKEND START FIX
- Removed the cmd.exe /c scheduled-task action that failed on paths containing spaces.
- Startup task now launches the private Python executable directly.
- Explicit working directory: C:\CLC Document Repository
- task_runner.py captures startup, stdout and stderr logs.
- INSTALL.bat creates a safety copy of repository.db if one already exists.
- UPDATE_ONLY.bat remains the supported safe updater after the first successful installation.
- UPDATE_ONLY.bat excludes data, storage, logs, backups and .venv and makes a timestamped rollback backup.


V1.1.0 REPOSITORY LIBRARY UPDATE
- Added RESET_ADMIN_PASSWORD.bat. Run it locally on the server if the saved admin password is unknown. It changes only the password hash in repository.db.
- Session secret is now persistent in data\session_secret.txt so admin sessions are not invalidated just because the backend restarts.
- Categories are displayed in a left-hand repository sidebar with file counts.
- Uploads are chunked in 8 MB pieces, allowing large ISO/software files to pass through IIS without one huge upload request.
- Selecting a file uploads it once for inspection, extracts metadata, and pre-fills display name, logical name, version, keywords and notes when that information exists.
- Extracted metadata is saved per file version and shown on the file details page.
- Metadata support includes PDF, Microsoft Office Open XML, image/EXIF, common audio/video tags, Windows PE executable metadata, ZIP metadata and ISO volume metadata.
- Added Windows, macOS and Linux compatibility options plus a version/requirement field for each platform on every uploaded version.
- Added custom PNG/JPG/WEBP/GIF/ICO image/icon per file group.
- Custom icons are stored safely under data\icons and are not overwritten by UPDATE_ONLY.bat.
- UPDATE_ONLY.bat continues to preserve data, storage, logs, backups, .venv and configured settings and creates a rollback backup before updating.


V1.2.0 MULTI-DOWNLOAD / BACKGROUND METADATA
- One upload session can contain multiple files for the same file group.
- Each download has its own version label, Windows/macOS/Linux compatibility and multiple categories.
- Categories are many-to-many at download/version level rather than one category per file group.
- Existing single categories are safely migrated onto existing download versions.
- Files save immediately with lightweight filename/size/type information.
- Detailed metadata is queued after save and processed by a separate metadata worker process.
- Each metadata extraction runs in its own child process with a timeout so a damaged parser/file cannot take down the web server.
- Metadata status is visible as Queued, Processing, Complete or Failed, with an admin Recheck Metadata action.
- UPDATE_ONLY.bat remains data-safe and preserves database, storage, settings, logs, icons and backups.
