Thanks for taking the time to contribute. Whether you are fixing a typo, translating a string, reporting a bug or building a feature, it is welcome.
By participating you agree to abide by the Code of Conduct.
- Ways to contribute
- Reporting a security vulnerability
- Development setup
- Running the checks
- Coding standards
- Branches and pull requests
- Commit messages
| 🐛 Report a bug | Open an issue with steps to reproduce and the diagnostic report from Admin → Bug icon (bottom left) |
| 💡 Suggest a feature | Open a feature request, or float the idea first in Discussions |
| 🌍 Translate | Join the POEditor project — no code required |
| 📖 Improve the docs | The documentation site lives in docs/ (docsify); edit the Markdown and open a PR |
| 💬 Help other users | Answer questions in Discussions |
| 💻 Write code | Read on |
New to open source? This guide walks through your first pull request.
Do not open a public issue for a security problem. Use GitHub Security Advisories — see SECURITY.md for the full policy.
Requirements: PHP 8.2+, MySQL 5.7+ / MariaDB 10.7+, Composer, and the extensions listed in the README.
git clone https://github.com/nilsteampassnet/TeamPass.git
cd TeamPass
composer installThe web root is public/; the application code lives in app/. Install through
/install/install.php.
composer.json sets vendor-dir to app/vendor, so Composer binaries live in app/vendor/bin/
— not vendor/bin/.
Install PHPUnit as a standalone phar. Do not use app/vendor/phpunit/phpunit/phpunit: it
resolves its classes through app/vendor/composer/, which is committed in its production
form and maps no dev package. The symptom is Class "PHPUnit\TextUI\Application" not found
with the package sitting right there, and composer dump-autoload does not fix it. The phar
carries its own dependencies and is immune — the same reason app/vendor/bin/phpstan works
(it is a phar too).
mkdir -p _tools
curl -sL -o _tools/phpunit.phar https://phar.phpunit.de/phpunit-10.5.66.phar
curl -sL -o /tmp/phpunit.phar.asc https://phar.phpunit.de/phpunit-10.5.66.phar.asc
gpg --keyserver hkps://keys.openpgp.org \
--recv-keys D8406D0D82947747293778314AA394086372C20A # Sebastian Bergmann
gpg --verify /tmp/phpunit.phar.asc _tools/phpunit.phar # expect: Good signature
chmod +x _tools/phpunit.phar_tools/ is gitignored, so the phar survives every checkout and merge. Keep its version in step
with .github/workflows/quality.yml, which resolves phpunit/phpunit: ^10.5 from the lock file.
The other dev tools still come from Composer, and they carry a trap. The dev dependencies are untracked, so any checkout or merge deletes them while leaving generated residue behind; because their directories still exist, Composer believes they are installed and skips them.
rm -rf app/vendor/phpstan/phpstan app/vendor/phpunit app/vendor/symfony/cache
composer install
git checkout -- app/vendor/composer/ # restores the production autoloaderThe rm -rf is not optional — without it composer install repairs nothing for those three
packages.
Always run
git checkout -- app/vendor/composer/before committing.composer installrewrites it into its dev form, and shipping that autoloader fatals every installation. TheCommitted autoloader is production-onlyCI job rejects a pull request that carries it.
php _tools/phpunit.phar # unit tests
php app/vendor/bin/phpstan analyse --memory-limit=2G # static analysis, level 4
php app/vendor/bin/composer-license-checker # dependency license complianceA full PHPStan run takes several minutes. All code must pass PHPStan level 4.
Encryption and permissions are easy to break in ways tests do not catch. Before opening a PR, exercise your change against:
- multiple user roles — administrator, manager, standard, read-only
- personal folders enabled and disabled
- the audit log (entries actually created?)
- LDAP / OAuth2, if you touched authentication
- the installer and the upgrade path, if you touched the schema
declare(strict_types=1)in every new file- Must pass PHPStan level 4
- Compatible with PHP 8.2
- Custom classes use the
TeampassClasses\*namespace (PSR-4) - Constants belong in
app/config/include.php - Always use parameterized queries — MeekroDB placeholders, never string concatenation:
DB::query('SELECT * FROM %l WHERE id=%i', 'teampass_items', $itemId); // GOOD DB::query("SELECT * FROM teampass_items WHERE id=" . $itemId); // NEVER
- Never use
exec()/shell_exec()/system()with user input - Use
hash_equals()for secret comparisons,realpath()to validate file paths - Never commit
includes/config/settings.phporTEAMPASS_SECRETS/SECUREFILE
Per .eslintrc: single quotes, no semicolons, 2-space indent, const over let, arrow
functions, ES6.
Add new source strings to app/includes/language/english.php; French translations
may accompany a feature. Other catalogs are maintained through the
POEditor project, whose next
synchronization overwrites direct edits. Keep placeholders such as #URL#,
#DATE# and #VIEWS# unchanged. Missing translations use the existing English
fallback until the POEditor update is available.
-
Every new
app/sources/*.queries.phpneeds a matching proxy shim inpublic/sources/. Without it the POST never reaches a real handler and is rejected with a misleading403 Access Forbidden by CSRFProtector. -
teampassclassespackages exist in two copies —app/includes/libraries/teampassclasses/andapp/vendor/teampassclasses/. Only thevendor/copy is autoloaded, so editing the other one alone produces a change with zero runtime effect. Edit both. Sentinel tests will fail otherwise.
Always go through the NestedTree class. Never update nleft / nright / nlevel manually.
master— stable, released codedevelop— integration branch, target your PRs here unless told otherwise- When working on a specific GitHub issue, name your branch
pr-XXXXwhereXXXXis the issue ID
Before opening a PR:
- PHPStan level 4 passes
- The test suite passes
- Every public function has a docblock
- Variable names and comments are in English
- No
var_dump()orconsole.log()left behind - Install and upgrade paths considered, if the schema changed
-
app/vendor/composer/restored to its production form
Keep changes minimal and in the existing style. Large refactors are unlikely to be merged — open a discussion first.
- Written in English
- Simple, concise sentences describing what the commit does
Fix folder counter after a personal item is moved to a shared folder
Questions? Ask in Discussions.