### Install and Start Fake S3 Server Source: https://github.com/nextcloud/server/wiki/How-to-test-S3-primary-storage Install the fake-s3 gem and start the server. This command installs the necessary tool and then launches it, creating a directory for storage and listening on port 4567. ```bash sudo gem install fakes3 mkdir /tmp/s3 fakes3 -r /tmp/s3 -p 4567 ``` -------------------------------- ### Start LDAP Server with Docker Source: https://github.com/nextcloud/server/wiki/How-to-test-LDAP? Clone the administration repository and run the start script to initialize the LDAP server. ```bash git clone https://github.com/owncloud/administration administration/ldap-testing/start.sh ``` -------------------------------- ### GPL-3.0+ Interactive Mode Notice Source: https://github.com/nextcloud/server/blob/master/LICENSES/GPL-3.0-or-later.txt This snippet provides an example of a short notice to display when a program, licensed under GPL-3.0-or-later, starts in interactive mode. It informs the user about the lack of warranty and how to view license details. ```text Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. ``` -------------------------------- ### Generic License Header Example Source: https://github.com/nextcloud/server/blob/master/contribute/HowToApplyALicense.md An example of a generic license header where adding yourself to AUTHORS.md is preferred. ```text /** * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ ``` -------------------------------- ### Standard GPL-2.0-only Notice Source: https://github.com/nextcloud/server/blob/master/LICENSES/GPL-2.0-only.txt Include this notice at the start of each source file to convey the exclusion of warranty and terms of redistribution. ```text one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail. ``` -------------------------------- ### Example Test Execution Output Source: https://github.com/nextcloud/server/blob/master/apps/user_ldap/tests/Integration/readme.md This output demonstrates a successful test run, including container status, LDAP server information, created users/groups, and test results. ```bash $ sudo ./run-test.sh lib/IntegrationTestAccessGroupsMatchFilter.php 71cbe88a4993e67066714d71c1cecc5ef26a54911a208103cb6294f90459e574 c74dc0155db4efa7a0515d419528a8727bbc7596601cf25b0df05e348bd74895 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES c74dc0155db4 osixia/phpldapadmin:0.5.1 "/sbin/my_init" 1 seconds ago Up Less than a second 80/tcp, 0.0.0.0:8443->443/tcp docker-phpldapadmin 71cbe88a4993 nickstenning/slapd:latest "/sbin/my_init" 1 seconds ago Up Less than a second 127.0.0.1:7770->389/tcp docker-slapd LDAP server now available under 127.0.0.1:7770 (internal IP is 172.17.0.78) phpldapadmin now available under https://127.0.0.1:8443 created user : Alice Ealic created group : RedGroup created group : BlueGroup created group : GreenGroup created group : PurpleGroup running case1 running case2 Tests succeeded Stopping and resetting containers docker-slapd docker-phpldapadmin docker-slapd docker-phpldapadmin ``` -------------------------------- ### Interactive Program Notice (GPL-2.0-only) Source: https://github.com/nextcloud/server/blob/master/LICENSES/GPL-2.0-only.txt Use this notice for interactive programs when they start, providing basic information and instructions on how to view license details. ```text Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. ``` -------------------------------- ### Example Conventional Commit Message Source: https://github.com/nextcloud/server/blob/master/AGENTS.md An example demonstrating the structure of a conventional commit message, including the type, scope, short description, and the required 'Assisted-by' trailer. ```git feat(files_sharing): allow sharing with contacts Assisted-by: ClaudeCode:claude-sonnet-4-6 ``` -------------------------------- ### Configure Git GPG Program (GPG4Win v2) Source: https://github.com/nextcloud/server/wiki/How-to-sign-your-commits-using-PGP Configure Git to use the gpg2 executable from GPG4Win version 2. Ensure the path is correct for your installation. ```bash git config --global gpg.program "c:/Program Files (x86)/GNU/GnuPG/gpg2.exe" ``` -------------------------------- ### Run Tests for WebDAV Backend with SQLite Source: https://github.com/nextcloud/server/blob/master/apps/files_external/tests/README.md Execute unit tests for the WebDAV backend against an ownCloud instance, using SQLite as the database. This command starts the necessary environment, runs tests, and attempts cleanup. ```bash ./autotest-external.sh sqlite webdav-ownCloud ``` -------------------------------- ### Manually Run Unit Tests for Debugging Source: https://github.com/nextcloud/server/blob/master/apps/files_external/tests/README.md Execute unit tests multiple times for debugging purposes after manually starting the external storage provider. This command is run from the `apps/files_external/tests` directory. ```bash phpunit --configuration ../../../tests/phpunit-autotest-external.xml backends/BACKEND.php ``` -------------------------------- ### SPDX License Header for PHP Files Source: https://github.com/nextcloud/server/blob/master/AGENTS.md All new files must include the correct SPDX license header. This example shows the AGPL-3.0-or-later format for PHP files. ```php /** * SPDX-FileCopyrightText: * SPDX-License-Identifier: AGPL-3.0-or-later */ ``` -------------------------------- ### Applying GPL-3.0+ to a New Program Source: https://github.com/nextcloud/server/blob/master/LICENSES/GPL-3.0-or-later.txt This snippet shows the recommended header to include at the beginning of each source file when distributing software under the GPL-3.0-or-later license. It includes copyright information and a pointer to the full license text. ```text Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ``` -------------------------------- ### Nextcloud Configuration for Single-Bucket S3 Storage Source: https://github.com/nextcloud/server/wiki/How-to-test-S3-primary-storage Configure Nextcloud to use the fake S3 server with a single-bucket setup. This is the standard configuration for using S3 as object storage. ```php 'objectstore' => [ 'class' => 'OC\\Files\\ObjectStore\\S3', 'arguments' => [ 'bucket' => 'abc', 'key' => '123', 'secret' => 'abc', 'hostname' => 'localhost', 'port' => '4567', 'use_ssl' => false, 'use_path_style' => 'true', ], ], ``` -------------------------------- ### Configure and Populate LDAP with Users in Groups Source: https://github.com/nextcloud/server/wiki/How-to-test-LDAP? Edit the configuration file and then run the PHP script to create users within specified groups. ```bash cd administration/ldap-testing/ gedit config.php php batchCreateUsersInGroups.php ``` -------------------------------- ### Populate LDAP with Users Source: https://github.com/nextcloud/server/wiki/How-to-test-LDAP? Execute the PHP script to create a batch of users in the LDAP instance. ```bash cd administration/ldap-testing/ php batchCreateUsers.php ``` -------------------------------- ### Nextcloud Configuration for Multi-Bucket S3 Storage Source: https://github.com/nextcloud/server/wiki/How-to-test-S3-primary-storage Configure Nextcloud to use the fake S3 server with a multi-bucket setup. This is useful for testing scenarios involving multiple distinct storage buckets. ```php 'objectstore_multibucket' => [ 'class' => 'OC\\Files\\ObjectStore\\S3', 'arguments' => [ 'bucket' => 'abc', 'num_buckets' => 64, 'key' => '123', 'secret' => 'abc', 'hostname' => 'localhost', 'port' => '4567', 'use_ssl' => false, 'use_path_style' => 'true', ], ], ``` -------------------------------- ### Import PGP Key Source: https://github.com/nextcloud/server/wiki/How-to-sign-your-commits-using-PGP If your key is not listed, import your combined private and public PGP key using this command, replacing the path with your actual key file location. ```bash gpg --import /path/to/yourkey.pub-sec.asc ``` -------------------------------- ### Configure Git GPG Program (GPG4Win v3) Source: https://github.com/nextcloud/server/wiki/How-to-sign-your-commits-using-PGP Configure Git to use the gpg executable from GPG4Win version 3. Use this command if the previous one does not apply to your GPG4Win version. ```bash git config --global gpg.program "c:/Program Files (x86)/GnuPG/bin/gpg.exe" ```