Skip to content

Commit acc9cb8

Browse files
authored
Merge branch 'main' into patch-7
2 parents f407dc3 + e024a74 commit acc9cb8

File tree

14 files changed

+87
-250
lines changed

14 files changed

+87
-250
lines changed

Diff for: .github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Set up PHP
3030
uses: shivammathur/setup-php@v2
3131
with:
32-
php-version: "7.4"
32+
php-version: "8.3"
3333
coverage: none
3434
tools: phpcs
3535

Diff for: CONTRIBUTING.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ When submitting pull requests, the pull request should be made to the version yo
88

99
## Conventions
1010

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.
1212

1313
## Development Environment
1414

@@ -33,8 +33,6 @@ The test environment ships with a number of users that can be used for testing.
3333

3434
The following users are available for testing:
3535

36-
* `[email protected]` - admin user who is a member of pi_user1_domain_edu
37-
* `[email protected]` - admin user
3836
* `[email protected]` - user who is the owner of pi_user1_domain_edu
3937
* `[email protected]` - user who is the owner of pi_user2_domain_edu
4038
* `[email protected]` - user who is a member of pi_user1_domain_edu
@@ -51,4 +49,4 @@ The following users are available for testing:
5149

5250
### Changes to Dev Environment
5351

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.
52+
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.

Diff for: README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ Unity Web Portal is a PHP application built in top of MariaDB and LDAP which act
2222
1. Composer (`apt install composer` on Ubuntu)
2323
1. PHP Extensions
2424
1. `php-ldap`
25-
2. `php-curl`
26-
3. `php-redis`
27-
4. `php-cli`
28-
5. `php-mysql`
29-
6. `php-pdo`
30-
2. Composer packages
25+
1. `php-curl`
26+
1. `php-redis`
27+
1. `php-cli`
28+
1. `php-mysql`
29+
1. `php-pdo`
30+
1. Composer packages
3131
1. `cd` to this repository
32-
2. Install packages `composer update`
33-
3. Setup config file `config/config.ini` according to your site deployment
34-
4. Setup branding file `config/branding/config.ini` according to your site deployment
35-
5. Point your web server's document root to `webroot` in this repo
32+
1. Install packages `sudo composer update --no-plugins --no-scripts`
33+
1. Deployment:
34+
1. configure the files in `deployment/` according to their respective `README.md` files
35+
1. Point your web server's document root to `webroot` in this repo
3636

3737
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.
3838

@@ -46,7 +46,7 @@ The update process is similar to the installation process:
4646

4747
1. Clone the release and follow installation instructions 1 and 2 from above.
4848
2. Copy the following folders from the old installation to the new one:
49-
1. `config`
49+
1. `deployment`
5050
2. `webroot/assets/footer_logos`
5151

5252
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.

Diff for: defaults/config.ini.default

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ user_ou = "ou=users,dc=unityhpc,dc=test" ; User organizational unit
2121
group_ou = "ou=groups,dc=unityhpc,dc=test" ; Group organizational unit
2222
pigroup_ou = "ou=pi_groups,dc=unityhpc,dc=test" ; PI Group organizational unit
2323
orggroup_ou = "ou=org_groups,dc=unityhpc,dc=test" ; ORG group organizational unit
24-
admin_group = "cn=sudo,dc=unityhpc,dc=test" ; admin dn (members of this group are admins on the web portal)
24+
admin_group = "cn=web_admins,dc=unityhpc,dc=test" ; admin dn (members of this group are admins on the web portal)
2525
def_user_shell = "/bin/bash" ; Default shell for new users
2626

2727
[sql]

Diff for: resources/lib/UnityUser.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ public function getHomeDir($ignorecache = false)
555555
}
556556

557557
/**
558-
* Checks if the current account is an admin (in the sudo group)
558+
* Checks if the current account is an admin (in the web_admins group)
559559
*
560560
* @return boolean true if admin, false if not
561561
*/
@@ -572,7 +572,7 @@ public function isAdmin()
572572
*/
573573
public function isPI()
574574
{
575-
return $this->getPIGroup()->exists();
575+
return @$this->getPIGroup()->exists();
576576
}
577577

578578
public function getPIGroup()

Diff for: tools/docker-dev/build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
2-
2+
set -e
33
cd "$(dirname "$0")"
44

55
docker-compose down
66
docker-compose build --no-cache
7-
docker image prune
7+
docker image prune

Diff for: tools/docker-dev/identity/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:24.04
22

33
# OpenLDAP Server
44
ARG DEBIAN_FRONTEND=noninteractive
@@ -36,4 +36,4 @@ RUN echo "ServerName 127.0.0.1" >> /etc/apache2/apache2.conf
3636
EXPOSE 80
3737
EXPOSE 389
3838

39-
CMD apache2ctl -D FOREGROUND & slapd -h "ldap:/// ldapi:///" -u openldap -g openldap -d 0
39+
CMD apache2ctl -D FOREGROUND & slapd -h "ldap:/// ldapi:///" -u openldap -g openldap -d 0

Diff for: tools/docker-dev/identity/bootstrap.ldif

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ objectclass: top
1111
objectclass: simpleSecurityObject
1212
objectclass: organizationalRole
1313
userPassword: {SSHA}d6WBSm5wjlNpMwil1KQY+Uo4o/vc6PnR
14+
description: for LDAP server administration purposes, not a valid login to web portal
1415

15-
dn: cn=sudo,dc=unityhpc,dc=test
16-
cn: sudo
16+
dn: cn=web_admins,dc=unityhpc,dc=test
17+
cn: web_admins
1718
gidnumber: 500
1819
memberuid: user1_org1_test
1920
memberuid: user2_org1_test

Diff for: tools/docker-dev/run.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
2+
set -e
33
cd "$(dirname "$0")"
44

5-
docker-compose up
5+
docker-compose up

Diff for: tools/docker-dev/sql/Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:24.04
22

33
ARG DEBIAN_FRONTEND=noninteractive
44
RUN apt-get update && apt-get install -y \
55
mariadb-server \
66
mariadb-client \
77
apache2 \
8+
php8.3 \
89
phpmyadmin
910
RUN sed -i '/bind-address/c\bind-address = 0.0.0.0' /etc/mysql/mariadb.conf.d/50-server.cnf
1011
COPY bootstrap.sql /tmp/bootstrap.sql
1112

12-
RUN service mysql start; \
13+
RUN service mariadb start; \
1314
mariadb -e "CREATE DATABASE unity"; \
1415
mariadb -e "CREATE USER 'unity'@'%' IDENTIFIED BY 'password'"; \
1516
mariadb -e "GRANT ALL PRIVILEGES ON unity.* TO 'unity'@'%'"; \
@@ -28,4 +29,4 @@ RUN echo "ServerName 127.0.0.1" >> /etc/apache2/apache2.conf
2829
EXPOSE 80
2930
EXPOSE 3306
3031

31-
CMD apache2ctl -D FOREGROUND & mysqld
32+
CMD apache2ctl -D FOREGROUND & mysqld --user=root

0 commit comments

Comments
 (0)