]> git.p6c8.net - jirafeau_project.git/blob - CONTRIBUTING.md
f7f21ed79399c5b92d03ca563031c924057059dc
[jirafeau_project.git] / CONTRIBUTING.md
1 # Contributing
2
3 Hi,
4
5 this document is made for newcomers in Jirafeau who are digging into the code.
6
7 If you have further questions, then just ask for help πŸ€“.
8
9 ## General principle
10
11 Jirafeau is made in the [KISS](http://en.wikipedia.org/wiki/KISS_principle) way (Keep It Simple, Stupid).
12
13 It is meant to be a simple filehosting service, simple to use, simple to install, simple to maintain.
14
15 This project won't evolve to a file manager and will focus to keep a very few dependencies.
16
17 So things like a markdown parser for the ToS or E-Mail tasks would be usefull for sure, but may be [rejected](https://gitlab.com/mojo42/Jirafeau/issues/37#note_1191566) since they would a lot of dependencies and makes the project more complex.
18
19 ## Structure
20
21 Here is a little explaination of Jirafeau's arboresence in a simplified
22 view only to show the most importants files and their role.
23
24 ```
25 .
26 β”œβ”€β”€ admin.php : administration interface to manage links and files
27 β”œβ”€β”€ f.php : permits to download files or show the download page
28 β”œβ”€β”€ index.php : provides a web interface to interact with API
29 β”œβ”€β”€ script.php : API interface (all file actions happen here - upload, deletion, etc)
30 β”œβ”€β”€ install.php : installation script
31 β”œβ”€β”€ tos.php : "Terms of Service" page
32 β”œβ”€β”€ lib
33 β”‚Β Β  β”œβ”€β”€ config.original.php : default parameters
34 β”‚Β Β  β”œβ”€β”€ config.local.php : the users parameters (auto generated, not versionized)
35 β”‚Β Β  β”œβ”€β”€ functions_*.js : JavaScript functions for index.php (AJAX etc)
36 β”‚Β Β  β”œβ”€β”€ functions.php : core functions and tools of Jirafeau
37 β”‚Β Β  β”œβ”€β”€ tos.original.txt : default text show on the ToS page
38 β”‚Β Β  β”œβ”€β”€ tos.local.txt : a users alternative text show on the ToS page (not versionized)
39 β”‚Β Β  β”œβ”€β”€ settings.php : core settings of Jirafeau, includes the configuration params automatically
40 β”‚Β Β  β”œβ”€β”€ locales : language folder, contains all language files
41 β”‚Β Β  └── template
42 β”‚Β Β  β”œβ”€β”€ footer.php : footer with links to source and ToS for all HTML views
43 β”‚Β Β  └── header.php : header with logo and title for all HTML views
44 β”œβ”€β”€ media : folder containing all skins
45 └── var-xxxxxxx : the users folder containing all data (auto generated, not versionized)
46 β”œβ”€β”€ async : chunks of uploaded files (not succressfull yet)
47 β”œβ”€β”€ files : all files that have been uploaded successfully
48 β”œβ”€β”€ [hashed file name] : the original file
49 β”œβ”€β”€ [hashed file name]_count : count many links to this file exist
50 └── links : all links, including meta-informations, pointing to files
51 β”œβ”€β”€ [link] : the link file, includes which original file should be used and some meta data like creation date, expiration time
52 ```
53
54 ## Translations
55
56 Translation may be add via [Jirafeau's Weblate](https://hosted.weblate.org/projects/jirafeau/master/).
57
58 ## Coding style
59
60 - This project follows the [PSR-2](http://www.php-fig.org/psr/psr-2/) Coding Style
61 - Files must be in UTF-8 without BOM and use Unix Line Endings (LF)
62
63 ## Branches
64
65 * ```master``` = latest release, e.g. 2.0.1
66 * ```next-release``` = development branch - all new features are merged into this branch until the next version is released. So use this branch as base while developing new features or bugfixes.
67 * ```test``` = sandbox branch to test new features or merge requests, or run integration tests. The content of this branch may change at any time.
68
69 ## Merge Requests
70
71 Please create one branch for each feature and send one merge request for each branch.
72
73 Dont squash several changes or commits into one merge request as this is hard to review.
74
75 Please use ```next-release``` as base branch and send your merge request to this branch (not ```master```).
76
77 Quick walktrough:
78
79 * Create ticket for new feature
80 * Fork the original repository, clone the own repository, add the original repository as upstream
81 * Checkout Β»next-releaseΒ« branch ```git checkout next-release```
82 * Create a new branch on top of that one, e.g. Β»some-featureΒ« ```git checkout -b some-feature```
83 * Commit changes β†’ push β†’ send merge request ```git add -A; git commit; git push``` MR via GitLab (link shown in console)
84 * Feature is reviewed
85 * MR accepted: Reviewer checks out Β»next-releaseΒ« branch and cherry-picks the commit ```git checkout next-release; git cherry-pick be4369641; git push```
86 * MR declined: Reviewer add some notes, Developer rebases his branch, adds neccessary changes, force pushes the branch, ask a reviewer to review the changes in the merge request ticket (as Gitlab recognizes them automatically) ```git checkout some-feature; git rebase upstream/next-release``` …[add changes]… ```git add -A, git commit --amend; git push -f```

patrick-canterino.de