You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+24-19Lines changed: 24 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,26 @@ When submitting pull requests, the pull request should be made to the version yo
8
8
9
9
## Conventions
10
10
11
-
This code base is currently using PHP version 7.4. All files are required to be linted with PSR-12 standard. This repository will automatically check PRs for linting compliance.
11
+
This code base is currently using PHP version 8.3. All files are required to be linted with PSR-12 standard. This repository will automatically check PRs for linting compliance.
12
+
13
+
### handling HTTP headers
14
+
15
+
* the web page header `LOC_HEADER` should be included before handling HTTP headers
16
+
* all expected headers should be fetched using `UnitySite::array_get_or_bad_request`
17
+
* all headers which are expected to be one of a set of hard coded values should use a switch case where the default case is `UnitySite::bad_request("invalid <header-name>")`
18
+
19
+
### admin access control
20
+
21
+
All pages under `admin/` should check `$USER->isAdmin()` and do `UnitySite::forbidden($USER, $SQL)` if not admin. This should be redundant since the web server should also be doing this on `admin/` as a whole.
22
+
23
+
### error messages
24
+
25
+
Use `UnitySite::alert` to make a popup. Be sure to break out of whatever logic branch you're in.
26
+
27
+
### die()
28
+
29
+
Don't use `die()`. Throw an exception.
30
+
12
31
13
32
## Development Environment
14
33
@@ -29,26 +48,12 @@ While the environment is running, the following is accessible:
29
48
30
49
### Test Users
31
50
32
-
The test environment ships with a number of users that can be used for testing. When accessing locked down portions of the portal, you will be asked for a username and password. The password is always `password`.
33
-
34
51
The following users are available for testing:
35
52
36
-
*`[email protected]` - admin user who is a member of pi_user1_domain_edu
*`[email protected]` - portal administrator, also has PI group `pi_web_admin_unityhpc_test`
54
+
55
+
The test environment ships with a randomly generated (with hard coded seed) set of organizations, PI groups, and user accounts. See `tools/docker-dev/generate-user-bootstrap-files-.py`. Use PHPLDAPAdmin to view them. The UIDs are of the form `user0001_org01_test`, `user0002_org02_test`, ... . The lowest user numbers are deliberatly left out, so that you can test the creation of new users. To log in as a user, you can clear your cookies and do HTTP basic auth with their `mail` attribute and password "password", or you can log in as `web_admin` and switch to their account from the user management page.
51
56
52
57
### Changes to Dev Environment
53
58
54
-
Should the default schema of the web portal change, the `ldap/bootstrap.ldif` and `sql/bootstrap.sql` must be updated for the LDAP server and the MySQL server, respectively.
59
+
Should the default schema of the web portal change, `tools/generate_htpasswd_bootstrap-ldif.py` and `sql/bootstrap.sql` must be updated for the LDAP server and the MySQL server, respectively.
1. configure the files in `deployment/` according to their respective `README.md` files
35
+
1. make sure redis cache is populated: `cd workers && php ./update-ldap-cache.php`
36
+
1. Point your web server's document root to `webroot` in this repo
36
37
37
38
The scope of this project ends at being responsible for the LDAP user database. We recommend production deployments to set up scripts which detect changes in LDAP and then perform further actions. For example, a script can be used to create Slurm scheduler accounting roles based on the LDAP information created by this website.
38
39
@@ -46,7 +47,7 @@ The update process is similar to the installation process:
46
47
47
48
1. Clone the release and follow installation instructions 1 and 2 from above.
48
49
2. Copy the following folders from the old installation to the new one:
49
-
1.`config`
50
+
1.`deployment`
50
51
2.`webroot/assets/footer_logos`
51
52
52
53
We recommend a deployment where each version of the portal is its own clone, then just change a symlink to point to the new version. This way a rollback is much easier.
0 commit comments