cd /mnt/bigdisk/var/www/test.deepskylog.org/deepskylog
git pull
php artisan storage:link
composer update
npm update
npm run build
php artisan view:clear
php artisan migrate:fresh
# To add all the profile images
ln -s /var/www/www.deepskylog.be/common/observer_pics .
php artisan db:seed
chmod 777 storage/app/public/profile-photosphp artisan search:reindexWhen new strings were added, the translation files need to be updated. This can be done with the following command:
php artisan localize nl
php artisan localize fr
php artisan localize de
php artisan localize es
php artisan localize svOther languages can be added by changing the language code (nl) to the correct language code.
php artisan testDeepskyLog uses Laravel queued jobs for background processing (e.g. computing per-user metrics like Contrast Reserve).
Below are common commands and an example systemd service to run queue workers on the server.
- Configure your queue driver in
.env(examples):
# Use the database queue driver (simple, works without Redis)
QUEUE_CONNECTION=database- If using the database driver, create the queue tables and migrate:
cd /var/www/DeepskyLog/deepskylog
php artisan queue:table
php artisan queue:failed-table
php artisan migrate- Start a foreground worker (good for debugging):
cd /var/www/DeepskyLog/deepskylog
php artisan queue:work --tries=3 --sleep=3 --timeout=60- Restart workers after deploy or code change (graceful restart):
cd /var/www/DeepskyLog/deepskylog
php artisan queue:restart- Run a single job dispatching command (example: enqueue per-object CR computation):
# dispatch jobs (queued mode)
php artisan metrics:compute-cr USER_ID --instrument_id=INSTRUMENT_ID --location_id=LOCATION_ID --queued
# or run synchronously for a quick smoke test (small chunk):
php artisan metrics:compute-cr USER_ID --instrument_id=INSTRUMENT_ID --location_id=LOCATION_ID --chunk=10- Manage failed jobs:
php artisan queue:failed
php artisan queue:retry {id}
php artisan queue:retry all
php artisan queue:forget {id}
php artisan queue:flush- Example
systemdservice for a persistent worker (create/etc/systemd/system/deepskylog-worker.service):
[Unit]
Description=DeepskyLog queue worker
After=network.target
[Service]
User=www-data
Group=www-data
Restart=always
ExecStart=/usr/bin/php /var/www/DeepskyLog/deepskylog/artisan queue:work --sleep=3 --tries=3 --timeout=60
WorkingDirectory=/var/www/DeepskyLog/deepskylog
StandardOutput=syslog
StandardError=syslog
[Install]
WantedBy=multi-user.targetEnable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable deepskylog-worker.service
sudo systemctl start deepskylog-worker.service
sudo systemctl status deepskylog-worker.service- Useful debugging tips
- Tail the Laravel log for job errors:
tail -f /var/www/DeepskyLog/deepskylog/storage/logs/laravel.log- If jobs are not processed, check
QUEUE_CONNECTIONand ensure the worker is running under the same environment and user. - For high volume, use Redis + Laravel Horizon (optional).
- For all components, we use wireui. For the tables, we use livewire-powergrid
- TinyMCE is used for the rich text editing forms. An example on how to use this in the code can be found in resources/view/profile/update-profile-information-form.php
- There are two teams in DeepskyLog. Extra teams can be added later (for example moderators, social media team, ...):
| Team | Description |
|---|---|
| Observers | All observers and guest are part of this team |
| Administrators | Members of this team can do everything |
| Database Experts | Members of this team can do everything with the databases |
- Check if the user belongs to the correct team:
// If the current user's active group is the Administrators group
return $user->isAdministrator();
// If the current user's active group is the Database Expert group
return $user->isDatabaseExpert();
// If the current user's active group is the Observers group
return $user->isObserver();
// If the current user belongs to the Administrators group (does not need to be active)
return $user->hasAdministratorPrivileges();- Get the currently logged in user:
Auth::user()