Skip to main content

CHANGELOG.md

# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog][1], and this project adheres to [Semantic Versioning][2].

[1]: https://keepachangelog.com/en/1.0.0/
[2]: https://semver.org/spec/v2.0.0.html

## majic 1.2.0 - 2026-05-13

## Added

- Forked gen_magic.
- Pool: `Majic.Pool`, using [nimble_pool](https://hex.pm/packages/nimble_pool).
- Plug: `Majic.Plug`.
- Unified API: `Majic.perform/1,2,3`.
- Builds an up-to-date and patched magic database.
- `Majic.Server.reload/2,3`
- `Majic.Server.recycle/2,3`
- Woodpecker CI pipeline

## Changed

- Improved C port, now using erl_interface
- Builds on Musl and macOS (Homebrew)
- Better error and timeout handling
- Bytes support: `Majic.Server.perform(ref, {:bytes, <<>>})`
- Renamed `priv/apprentice` to `priv/libmagic_port` to be more obvious in `ps`
- Renamed `Majic.Helpers.perform_once` to `Majic.Once.perform`

## Fixed

- Use pkg-config to discover libmagic paths (fixes macOS Homebrew build)
- Remove `ei_init()` call that crashes on macOS with unlimited fd limit
- Redirect C port stderr to /dev/null unless MAJIC_DEBUG is set
- `Once.perform/3` now cleans up server process on error
- `Pool.terminate_worker/3` now stops server processes
- `Extension.fix/3` preserves directory paths in output
- `Extension.fix/3` handles uppercase extensions correctly
- `Extension.fix/3` no longer produces trailing dot with no candidates
- `Majic.Plug` rewritten with recursive transform for nested uploads
- `Majic.Plug` no longer raises on majic errors, falls back to original upload
- `Majic.perform/2` with `once: true` now passes `:timeout` option
- `Majic.Server` postpones reload/recycle calls in non-available states
- `Majic.Server` handles late port data in recycling state
- Fix `:eaccess` typo to `:eacces` in errno map
- Guard `terminate/3` against nil port

## majic [1.1.1]

- Fixed build artifact mistakenly included in the Hex.pm package

## majic [1.1.0]

- Updated dependencies
- `-Werror` removed from `Makefile`
- `Majic.Extension.fix/3` will append an extension when requested if none exist

## majic [1.0.0]

## gen_majic [1.0]

### Added

- Added support for process recycling (evadne).
- Added documentation (evadne).

### Changed

- Replaced GenServer with `:gen_statem` (evadne).
  - Changed API; added support for customisation.

- Refined tests and other aspects of the library (evadne).

## [0.20.83]

### Added

- Soak testing script (devstopfix)

### Changed

- Replaced Erlexec usage with Port (devstopfix)

## 0.0.1

### Added

- Initial Elixir wrapper with Erlexec (evadne)
- Intiial C program (evadne)

[unreleased]: https://github.com/evadne/gen_magic/compare/develop
[0.20.83]: https://github.com/devstopfix/gen_magic/commit/7e27fd094cb462d26ba54fde0205a5be313d12da