Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
44a3f51
Create Async version of updateCoursesContent
emanuelGitCodes Feb 4, 2025
d5eb23b
Removed Disabled Locks on Menu Tabs
SavvyDolphin77 Mar 13, 2025
5e26e86
Adds Aysnc Calls From API
SavvyDolphin77 Mar 25, 2025
eb26161
Add Async Downloading Files & Scanning
SavvyDolphin77 Mar 25, 2025
9d30133
Removed Update for New Items To Creation
SavvyDolphin77 Mar 26, 2025
06ba0e1
Adds Local Scanner & Print Output
SavvyDolphin77 Apr 1, 2025
5d2a6bc
Temp Work on Concurrent Scanning
SavvyDolphin77 Apr 2, 2025
6dc3f65
Removes AuthToken Passing & Ignores Scanner Files
SavvyDolphin77 Apr 3, 2025
0ad4efb
Add FullRescanMessage and FullRescanHandler for asynchronous processi…
emanuelGitCodes Apr 7, 2025
52328e7
Enhance Docker setup with Supervisor for PHP-FPM and add messenger wo…
emanuelGitCodes Apr 9, 2025
313a391
Add Supervisor Configurations for Messenger
SavvyDolphin77 Apr 14, 2025
588e77d
Adds Messenger System
SavvyDolphin77 Apr 14, 2025
258bbac
local scan fix
evannaderi Apr 14, 2025
a995bae
Fixes Logging Disappearing Issue
SavvyDolphin77 Apr 17, 2025
54de3ec
local scan levels
evannaderi Apr 17, 2025
2058614
Implement Scanning Function for Messenger
SavvyDolphin77 Apr 17, 2025
f61bfb0
fix default lvl
evannaderi Apr 21, 2025
e7c310c
Adds Wait For All Scans to Complete
SavvyDolphin77 Apr 22, 2025
8b03a75
Printing to terminal back on
emanuelGitCodes Apr 23, 2025
1f290a3
Merge branch 'async-equal-access' into async-equal-access-evan-changes
SavvyDolphin77 Apr 24, 2025
30fc9ec
Separate Scan Function and Enhancements
SavvyDolphin77 Apr 24, 2025
f67a49e
Merge pull request #1 from SavvyDolphin77/async-equal-access-evan-cha…
SavvyDolphin77 Apr 24, 2025
33c0013
Fixes Issues with Async
SavvyDolphin77 Apr 29, 2025
dc70049
Ignore equal-access-server directory from branch
emanuelGitCodes Apr 30, 2025
ee0ad8d
Removed Equal Access Server To help Merge
SavvyDolphin77 Apr 30, 2025
da4b63c
Focus on making updateCourseContent() faster. Currently applying a su…
emanuelGitCodes May 7, 2025
7888128
Merge branch 'async-process-upgrade' into equal-access
emanuelGitCodes May 8, 2025
5caf183
Merge pull request #1025 from emanuelGitCodes/equal-access
emanuelGitCodes May 8, 2025
dc197f7
Merge remote-tracking branch 'conner-fork/async-equal-access' into as…
emanuelGitCodes May 15, 2025
7532023
Implement FullRescanMessage and its handler; refactor SyncController …
emanuelGitCodes May 19, 2025
8f06694
Refactor supervisor configurations and enhance message handling for c…
emanuelGitCodes May 19, 2025
22b30d4
Create env variable so the number of workers running is the same as n…
emanuelGitCodes May 20, 2025
17afc0f
Add SCAN_POOL_SIZE variable for equal access local configuration
emanuelGitCodes May 20, 2025
fc52f3a
Enhance rate limit handling for when running out of tokens and error …
emanuelGitCodes Jun 2, 2025
f09ab07
Add FinishRescanMessage and handler; enhance ScanContentItem for batc…
emanuelGitCodes Jun 2, 2025
c10a164
Update FullRescanMessage transport to high priority; clean up unused …
emanuelGitCodes Jun 3, 2025
5d18662
Add Redis integration for batch processing; implement BatchCounterSer…
emanuelGitCodes Jun 3, 2025
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
8 changes: 7 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ VERSION_NUMBER="3.5.0"
# Available options: "phpally", "equalaccess_local", "equalaccess_lambda"
ACCESSIBILITY_CHECKER="equalaccess_lambda"

# NOTE: When using a lambda function with equal access,
# NOTE: When using a lambda function with equal access,
# you need to define the following in a separate .env.local:
# EQUALACCESS_AWS_ACCESS_KEY_ID=<access_key_id>
# EQUALACCESS_AWS_SECRET_ACCESS_KEY=<secret_access_key>
Expand Down Expand Up @@ -189,3 +189,9 @@ YOUTUBE_API_KEY=""
###> jwk base url ###
JWK_BASE_URL="https://canvas.instructure.com/"
###> jwk base url ###

###> Equal Access Local Num Browsers ###
SCAN_POOL_SIZE=6

###> Redis
REDIS_URL=redis://udoit3-redis:6379
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
RUN wget https://get.symfony.com/cli/installer -O - | bash && \
mv /root/.symfony/bin/symfony /usr/local/bin/symfony

# ensures supervisor config is in place and supervisor is running
COPY supervisor.conf /etc/supervisor/conf.d/messenger-worker.conf
RUN service supervisor start

#Copy over files
COPY --chown=ssm-user:www-data . /var/www/html/

Expand All @@ -52,4 +56,5 @@ WORKDIR /var/www/html
RUN chmod +x deploy/udoit-ng.sh
RUN deploy/udoit-ng.sh

CMD php-fpm
#CMD php-fpm # runs supervisor which starts main application and messanger workers
CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]
28 changes: 14 additions & 14 deletions assets/js/Components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,62 +18,62 @@ export default function Header({ t, navigation, handleNavigation }) {
<ul>
<li
className={`flex-row ${navigation === 'summary' ? ' active-link' : ''}`}
onClick={()=>handleNavigation('summary')}
onClick={() => handleNavigation('summary')}
onKeyPress={(e) => {
if(e.key === 'Enter' || e.key === ' ') {
if (e.key === 'Enter' || e.key === ' ') {
handleNavigation('summary')
}
}}
tabindex='0'>
<div className='flex-column justify-content-center'>
<HomeIcon className='icon-md pr-1'/>
<HomeIcon className='icon-md pr-1' />
</div>
<div className='flex-column justify-content-center'>
{t('menu.summary')}
</div></li>
<li
<li
className={`flex-row ${navigation === 'fixIssues' ? ' active-link' : ''}`}
onClick={()=>handleNavigation('fixIssues')}
onClick={() => handleNavigation('fixIssues')}
onKeyPress={(e) => {
if(e.key === 'Enter' || e.key === ' ') {
if (e.key === 'Enter' || e.key === ' ') {
handleNavigation('fixIssues')
}
}}
tabindex='0'>
<div className='flex-column justify-content-center'>
<UFIXITIcon className='icon-md pr-1'/>
<UFIXITIcon className='icon-md pr-1' />
</div>
<div className='flex-column justify-content-center'>
{t('menu.fix_issues')}
</div>
</li>
<li
className={`flex-row ${navigation === 'reports' ? ' active-link' : ''}`}
onClick={()=>handleNavigation('reports')}
onClick={() => handleNavigation('reports')}
onKeyPress={(e) => {
if(e.key === 'Enter' || e.key === ' ') {
if (e.key === 'Enter' || e.key === ' ') {
handleNavigation('reports')
}
}}
tabindex='0'>
<div className='flex-column justify-content-center'>
<ReportIcon className='icon-md pr-1'/>
<ReportIcon className='icon-md pr-1' />
</div>
<div className='flex-column justify-content-center'>
{t('menu.reports')}
</div>
</li>
<li
className={`flex-row ${navigation === 'settings' ? ' active-link' : ''}`}
onClick={()=>handleNavigation('settings')}
onClick={() => handleNavigation('settings')}
onKeyPress={(e) => {
if(e.key === 'Enter' || e.key === ' ') {
if (e.key === 'Enter' || e.key === ' ') {
handleNavigation('settings')
}
}}
tabindex='0'>
<div className='flex-column justify-content-center'>
<SettingsIcon className='icon-md pr-1'/>
<SettingsIcon className='icon-md pr-1' />
</div>
<div className='flex-column justify-content-center'>
{t('menu.settings')}
Expand All @@ -84,4 +84,4 @@ export default function Header({ t, navigation, handleNavigation }) {
</nav>
</header>
)
}
}
31 changes: 28 additions & 3 deletions build/nginx/Dockerfile.php.pdo.mysql
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
FROM php:8.4.2-fpm

# PHP extensions
RUN apt-get update && apt-get install -y libpng-dev zlib1g-dev git unzip
RUN docker-php-ext-install gd pdo pdo_mysql
# Install necessary packages and PHP extensions
RUN apt-get update && apt-get install -y \
supervisor \
libpng-dev \
zlib1g-dev \
git \
unzip

RUN docker-php-ext-install pdo pdo_mysql gd

# Create log directories expected by Supervisor and your apps
RUN mkdir -p /var/www/html/var/log/supervisor \
&& mkdir -p /var/log/supervisor

# Copy your code
COPY . /var/www/html
WORKDIR /var/www/html

# Copy Supervisor configs into the image
COPY build/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
COPY build/supervisor/php-fpm.conf /etc/supervisor/conf.d/php-fpm.conf
COPY build/supervisor/ /etc/supervisor/conf.d/

# Expose port if necessary (e.g., for Nginx, but with PHP-FPM you typically let Nginx handle this)
EXPOSE 9000

# Start Supervisor as the main process
CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]
12 changes: 12 additions & 0 deletions build/supervisor/messenger-concurrent.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[program:messenger-concurrent]
directory = /var/www/html
# command = php /var/www/html/bin/console messenger:consume async_concurrent --sleep=100000 -vv
command = php /var/www/html/bin/console messenger:consume async_concurrent -vv
numprocs = %(ENV_SCAN_POOL_SIZE)s
process_name = %(program_name)s_%(process_num)02d
autostart = true
autorestart = true
stdout_logfile = /dev/fd/1
stdout_logfile_maxbytes = 0
stderr_logfile_maxbytes = 0
stderr_logfile = /dev/fd/2
11 changes: 11 additions & 0 deletions build/supervisor/messenger-high.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[program:messenger-high]
directory = /var/www/html
command = php bin/console messenger:consume async_priority_high -vv
numprocs = 2 # maybe fewer, but always running
process_name = %(program_name)s_%(process_num)02d
autostart = true
autorestart = true
stdout_logfile = /dev/fd/1
stdout_logfile_maxbytes = 0
stderr_logfile_maxbytes = 0
stderr_logfile = /dev/fd/2
11 changes: 11 additions & 0 deletions build/supervisor/messenger-low.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[program:messenger-low]
directory = /var/www/html
command = php bin/console messenger:consume async_priority_low -vv
numprocs = 4
process_name = %(program_name)s_%(process_num)02d
autostart = true
autorestart = true
stdout_logfile = /dev/fd/1
stdout_logfile_maxbytes = 0
stderr_logfile_maxbytes = 0
stderr_logfile = /dev/fd/2
13 changes: 13 additions & 0 deletions build/supervisor/php-fpm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[program:php-fpm]
command=/usr/local/sbin/php-fpm --nodaemonize
autostart=true
autorestart=true
startsecs=5
priority=10

# stdout_logfile=/var/www/html/var/log/supervisor/php-fpm.out.log
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0

stderr_logfile=/dev/fd/2
stderr_logfile_maxbytes=0
19 changes: 19 additions & 0 deletions build/supervisor/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[supervisord]
nodaemon=true
user=root
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid
childlogdir=/var/log/supervisor

[unix_http_server]
file=/var/run/supervisor.sock #; path to the UNIX socket file
chmod=0700

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock

[include]
files = /etc/supervisor/conf.d/*.conf
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"oro/doctrine-extensions": "^2.0",
"phpdocumentor/reflection-docblock": "^5.2",
"phpstan/phpdoc-parser": "^0.5.3",
"predis/predis": "^3.0",
"sensio/framework-extra-bundle": "^6.2",
"sunra/php-simple-html-dom-parser": "1.5.2",
"symfony/apache-pack": "^1.0",
Expand Down
71 changes: 67 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions config/packages/framework.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
framework:

messenger:
reset_on_message: true

secret: '%env(APP_SECRET)%'
#csrf_protection: true
#http_method_override: true
Expand Down
20 changes: 15 additions & 5 deletions config/packages/messenger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@ framework:

transports:
# https://symfony.com/doc/current/messenger.html#transport-configuration
async_priority_high:
async_priority_high:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
options:
options:
table_name: 'queue'
queue_name: 'priority_high'
async_priority_low:
async_priority_low:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
options:
options:
table_name: 'queue'
queue_name: 'priority_low'
queue_name: 'priority_low'

async_concurrent:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
options:
table_name: 'queue'
queue_name: 'concurrent'

failed: 'doctrine://default?queue_name=failed'
sync: 'sync://'

Expand All @@ -25,3 +32,6 @@ framework:
#'App\Message\BackgroundQueueItem': async_priority_low
'App\Message\PriorityQueueItem': sync
'App\Message\BackgroundQueueItem': sync
'App\Message\ScanContentItem': async_concurrent
'App\Message\FullRescanMessage': async_priority_high
'App\Message\FinishRescanMessage': async_priority_high
7 changes: 6 additions & 1 deletion config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ services:
resource: '../src/Controller'
tags: ['controller.service_arguments']


Predis\Client:
class: Predis\Client # autowiring id == class name
arguments:
- '%env(REDIS_URL)%'

# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones

Loading