소스 검색

Add a software architecture documentation page

Miraty 2 년 전
부모
커밋
2ecc520dae
1개의 변경된 파일40개의 추가작업 그리고 0개의 파일을 삭제
  1. 40 0
      DOCS/architecture.md

+ 40 - 0
DOCS/architecture.md

@@ -0,0 +1,40 @@
+# Software architecture
+
+## Program flow
+
+`router.php`
+: Receives every external HTTP request from the web server, executes actions required in any case, executes matching code in `pg-act` if appropriate, and calls `view.php` either way.
+
+`pg-act/`
+: Executed when a form is submitted: checks that every parameter is valid and secure, then executes the feature of the page according to the parameters.
+
+`view.php`
+: Displays global HTML and includes matching file from `pg-view`.
+
+`pg-view/`
+: Displays the main page content (notably HTML forms), may sometimes display form output passed through the `$data` array.
+
+The `output` function is used to return success or error messages and stop processing of the request.
+
+## Other components
+
+`fn/`
+: Functions, grouped by concerned service
+
+`sftpgo-auth.php`
+: When someone tries to log in over SFTP, SFTPGo sends username and password to this script, which queries the database and replies whether authentication succeeded or not.
+
+`check.php`
+: This file is not part of the normal program execution, it is meant to be run by developers to test that the current setup is working.
+
+`DOCS/`
+: Documentation (some important or standard files may be directly in the root)
+
+`css/`
+: Each `.css` file in this directory is declared in every page.
+
+`db/`
+: SQlite database, the only directory writable by the program
+
+`locales/`
+: Gettext translations, see [translation.md](translation.md)