Skip to content

developer documentation #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions developer_manual/branch-policies.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Branch policies
===============

Branchs
+++++++

Main
----

The main branch is the default branch for the repository. It is used for production-ready code and should always be stable. All changes to the main branch should be made through pull requests, which must be reviewed and approved by at least one other developer before merging.

Stables
-------

The stables branches are used for maintaining stable releases of the code.

Creating branch
+++++++++++++++

* 1. Folow the conevention of naming branches as ``feature/description`` or ``bugfix/description``.
133 changes: 133 additions & 0 deletions developer_manual/commits.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
Commits
=======

Conventional commits
++++++++++++++++++++

If you want to know more about `Convertional Commits <https://www.conventionalcommits.org/en/v1.0.0/>`__, you can read the documentation.

About the title of the commit, you should use the following format:

.. code-block:: bash

feat:my pull request <

About the description of the commit, you should use the following format:

.. code-block:: bash

Pull Request Description

Related Issue

Issue Number: #830

Pull Request Type

- Feature

Pull request checklist

- [X] Add button "Open file"
- [x] Add action to the button <


DCO
+++

If you want to know more about `DCO(Developer Certidicate of Origin) <https://developercertificate.org/>`__, you can read the documentation.


* Possible error envolve DCO

.. figure:: images/dco_error.png
:alt: DCO error screen.

If you see the error message "``You must sign off your commits with a DCO signoff``", it means that you need to add a signoff to your commit message. You can do this by adding the following line to your commit message:

There are two things to fix:

* 1. Sign off your commits (for DCO)
* 2. Use the [Conventional Commits](https://www.conventionalcommits.org) format for commit messages

Considering that you have 2 commits, at your terminal, run:

.. code-block:: bash

git rebase -i HEAD~2 <

The number 2 is about the quantity of commits ahead you will rebase.

You’ll see your commits listed like this:

.. code-block:: bash

pick e49199874 App metadata: Add donation link to appear on Nextcloud appstore <
pick 1ed4561ad doc: add donation links to Github Sponsors and Stripe <

Change both lines from `pick` to `edit`:

.. code-block:: bash

edit e49199874 App metadata: Add donation link to appear on Nextcloud appstore <
edit 1ed4561ad doc: add donation links to Github Sponsors and Stripe <

Save and close the editor.

Now you'll be editing the first commit. Run:

.. code-block:: bash

git commit --amend --signoff <

When your editor opens, change the first line of the commit message from:

.. code-block:: bash

App metadata: Add donation link to appear on Nextcloud appstore <

to:

.. code-block:: bash

docs: add donation link to appear on Nextcloud appstore <

Save and close.

Then:

.. code-block:: bash

git rebase --continue <

Now you're on the second commit. Run:

.. code-block:: bash

git commit --amend --signoff <

Change the first line from:

.. code-block:: bash

doc: add donation links to Github Sponsors and Stripe <

to:

.. code-block:: bash

docs: add donation links to GitHub Sponsors and Stripe <

Save and close.

Then:

.. code-block:: bash

git rebase --continue <

After this, you'll complete the rebase flow and be able to push your branch. Since this changes past commits, you’ll need to push with force:

.. code-block:: bash

git push --force-with-lease origin patch-2 <
Binary file added developer_manual/images/bug_report_form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added developer_manual/images/bug_report_form2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added developer_manual/images/bug_report_form3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added developer_manual/images/catch_issue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added developer_manual/images/choose_issue_screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added developer_manual/images/dco_error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added developer_manual/images/feature_request_form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added developer_manual/images/issue_screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added developer_manual/images/new_issue_screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added developer_manual/images/report_bug_screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 18 additions & 2 deletions developer_manual/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
.. _dev-index:

Developer
========================
=========

Welcome

We really appreciate everyone who would like to contribute to the LibreSign project! There are many ways to contribute, including writing code, filing issues on GitHub, helping people, assisting in triaging, reproducing, or fixing bugs that people have filed, and enhancing our documentation. Also giving a star to the project is a really good way to help and donate.

Before you get started, we encourage you to read our code of conduct, which describes our community norms:

* 1. `Our code of conduct <https://github.com/LibreSign/libresign/blob/main/CODE_OF_CONDUCT.md>`__, which explicitly stipulates that everyone must be gracious, respectful, and professional. This also documents our conflict resolution policy and encourages people to ask questions.


Here you will find the documentation for developers.

Expand All @@ -10,4 +19,11 @@ Here you will find the documentation for developers.
:maxdepth: 1

guide-api
api
api
translation
requesting-features
reporting-bugs
setup-environment
branch-policies
commits
pull-request
22 changes: 22 additions & 0 deletions developer_manual/pull-request.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Pull request
============

How to open
+++++++++++

Instructions about destination branch
-------------------------------------

* 1. Access `LibreSign <https://github.com/LibreSign/libresign>`__ repository on GitHub.

* 2. Clone the repository and create a new branch for your changes:
.. code-block:: bash

git clone

* 3. Create a new branch for your changes:
.. code-block:: bash

git checkout -b my-feature-branch

* 4. Access the `Pull Requests <https://github.com/LibreSign/libresign/pulls>`__ and create a new pull request.
51 changes: 51 additions & 0 deletions developer_manual/reporting-bugs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Reporting bugs
^^^^^^^^^^^^^^

Reporting bugs in LibreSign is essential for maintaining the quality and reliability of the application. If you encounter a bug, please follow these steps to report it effectively:

1 - Access the LibreSign repository at `LibreSign <https://github.com/LibreSign/libresign/>`__
2 - Go to the "Issues" tab.

.. figure:: images/issue_screen.png
:alt: Main screen.

* 1 - Issue tab
* 2 - Look and search for existing issues
* 3 - Create a new issue, here you can report a bug

3 - Click on the "New issue" button

.. figure:: images/report_bug_screen.png
:alt: New issue screen.

* 1 - New issue button
* 2 - Choose "Bug report" as the issue type

3.1 - Now you can fill in the details of your bug report

.. figure:: images/bug_report_form.png
:alt: Bug report form.

* 1 - Title of the bug report
* 2 - If you have some problem with the bug, you can add a label to the issue
* 3 - Description of the bug, including any relevant details or steps to reproduce
* 4 - Write want you expected to happen

3.1.1 - Continue to fill the form with the necessary information

.. figure:: images/bug_report_form2.png
:alt: Bug report form continued.

* 5 - Here you put screenshots or any other relevant files that can help in understanding the bug
* 6 - Here you give more details about environment where the bug was found, such as operating system, browser, etc.

3.1.2 - Continue to fill the form with the necessary information

.. figure:: images/bug_report_form3.png
:alt: Bug report form continued.

* 7 - Here you write the additional information about the bug.
* 8 - Add yourself as the author of the bug report.
* 9 - If need to choose a bug label, you can do it here.
* 10 - Here you choose the bug type.

51 changes: 51 additions & 0 deletions developer_manual/requesting-features.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Requesting features
^^^^^^^^^^^^^^^^^^^

To request a new feature in LibreSign, you can open an issue in the repository. Provide a clear description of the feature you would like to see, including any relevant details or use cases. This helps the development team understand the request and prioritize it accordingly.

When submitting a feature request, consider the following:
- Be specific about the feature you want.
- Explain why the feature is important or how it will benefit users.
- Provide examples or use cases if possible.
- Check if a similar feature request already exists to avoid duplicates.

Follow these steps to request a feature:

1 - Access the LibreSign repository at `LibreSign <https://github.com/LibreSign/libresign/issues>`__

2 - Go to the "Issues" tab.

.. figure:: images/issue_screen.png
:alt: Main screen.

* 1 - Issue tab
* 2 - Look and search for existing issues
* 3 - Create a new issue, here you can request a new feature

3 - Click on the "New issue" button.

.. figure:: images/new_issue_screen.png
:alt: New issue screen.

* 1 - New issue button
* 2 - Choose "feature request" as the issue type

3.1 - Now you can fill in the details of your feature request

.. figure:: images/feature_request_form.png
:alt: Feature request form.

* 1 - Title of the feature request
* 2 - If you have some problem with the feature, you can add a label to the issue
* 3 - Description of the feature request, including any relevant details or use cases

3.1.1 - Continue to fill the form with the necessary information

.. figure:: images/feature_request_form2.png
:alt: Feature request form continued.

* 4 - In this field, you can add a alternative description of the feature request.
* 5 - If you have any additional information, you can add it here.
* 6 - Here you add yourself as the author of the feature request.
* 7 - If need to choose a feature-resquest label, you can do it here.
* 8 - Here you choose the feature type.
71 changes: 71 additions & 0 deletions developer_manual/setup-environment.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
Setup environment
=================

Prerequirements
---------------

PHP version
+++++++++++

* 1. Version: 8.1
* 2. Docker image: php-fpm
* 3. We using the minimum version to acepted by relative Nextcloud version, so you can use the same version of Nextcloud that you are using in your production environment.

Node version
++++++++++++

* 1. Version: 20.0.0
* 2. Check package.json for more information.

LibreCode Nextcloud docker environment
++++++++++++++++++++++++++++++++++++++

* 1. Poppler-utils
* 2. Locale charmap as UTF-8 at operational system


Developing for LibreSign
------------------------

.. note::
If the project does not have an issue for what you want to do, create an issue first.

If you would prefer to write code, you may wish to start with our list of good first issues for LibreSign. See the respective sections below for further instructions.


Development environment
-----------------------

This project depends on the Nextcloud project, so to start writing code, you will need to set it up. We recommend using Docker for this, but feel free to use another method if you prefer. We suggest these two setups:

- `LibreCode Coop Setup <https://github.com/LibreCodeCoop/nextcloud-docker-development/ />`__
- `Julius Härtl Nextcloud Setup <https://github.com/juliusknorr/nextcloud-docker-dev />`__

.. note::
If you have any problems with these setups open an issue at corresponding to the project that you select to use.

After executing these Docker setups, wait until it's possible to access localhost. If access is not possible, go to your terminal, run the command docker ps, and then find the "nextcloud" image or "ghcr.io/juliushaertl/nextcloud-dev-php**". Access the address reported from the command output. (If you cannot find the image, you likely encountered a problem running the Docker setup; please return to the previous step.)

To get LibreSign executing go to the folder of the setup that you choose and find the folder called ``volumes/nextcloud/apps-extra`` and clone the LibreSign repository.

Open bash in Nextcloud container with ``docker compose exec -u www-data nextcloud bash``

Inside bash of Nextcloud go to the folder ``apps-extra/libresign`` and then run the commands:

.. code-block:: bash

# Download composer dependencies
composer install
# Download JS dependencies
npm ci
# Build and watch JS changes
npm run watch

To update API Documentation
---------------------------

After Configure the environment

After installing LibreSign, go to ``Administration Settings > LibreSign`` and:

- Click in the ``Download`` binaries button. When it show status ``successful`` to all items, except ``root certificate not configured``, is time to configure root certificate in the next section.
Loading