New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
osticket: add module #148959
base: master
Are you sure you want to change the base?
osticket: add module #148959
Conversation
not sure how to fix the manual build :-( |
6869775
to
af7b955
Compare
echo ${version} | ||
''; | ||
|
||
pkg = pkgs.stdenv.mkDerivation rec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason you're not adding this derivation to the package set and instead putting it directly in the module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the derivation needs the database user etc. Without it, it won't work, and it doesn't make much sense as a stand-alone package.
That's why I thought it would be better together in the module.
I saw the same for mediawiki
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact mediawiki
does have a package. What you linked to was a bit of a wrapper around the package. You should definitely create a separate derivation file in the pkgs/
tree... how else will our bots automatically update your software?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments... More than I intended to, I guess. I hope they are of value to you. If you need a hand with anything feel free to ping.
# Patch the location of the config file and the version | ||
sed -i -e "s|INCLUDE_DIR.'ost-config.php'|'${stateDir}/ost-config.php'|" -e "s|define('GIT_VERSION', '\\$git')|define('GIT_VERSION', '${version}')|" bootstrap.php | ||
sed -i "s|../include|${stateDir}|" setup/install.php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nicer approach here is to leave the application looking at include/ost-config.php
, but then create your own version of the file that consists of this:
<?php
return require(getenv('OST_CONFIG'));
?>
Take a look at the mediawiki package.
# Pre-populate the database settings for setup. | ||
# The password is not used but required. | ||
sed -i "s|'dbhost'=>'localhost'|'dbhost'=>'localhost','dbuser'=>'${user}','dbpass'=>'${user}','dbname'=>'${user}'|" setup/inc/install.inc.php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this imply that the user has to click through a web form to complete installation of this software?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes indeed, there are a bunch of settings to configure and I think automating that ok to keep out of scope for an initial module?
# Add script header for cron | ||
sed -i '1i\#!/usr/bin/env php' api/cron.php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upstream doesn't intend for this script to be executable. See below suggestion in definition of systemd.services."${user}-cron"
.
{ | ||
root = mkForce "${pkg}/public"; | ||
|
||
locations = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a link to the documentation on how you got all these locations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alas no, they were extracted by eyeball from the apache configuration files
chmod a+x $out/public/manage.php $out/public/api/cron.php $out/public/api/pipe.php | ||
mkdir -p $out/bin | ||
ln -s ../public/manage.php $out/bin/osticket_manage | ||
ln -s ../public/api/cron.php $out/bin/osticket_cron |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer required if you accept my suggestion about the cron job.
description = "Issue tracking system"; | ||
platforms = platforms.linux; | ||
maintainers = [ maintainers.wmertens ]; | ||
license = licenses.gpl2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gpl2Only
or gpl2Plus
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks to be gpl2Only? https://github.com/osTicket/osTicket/blob/develop/LICENSE.txt
# TODO extensions function on plugin definition | ||
# that then gets mapped and joined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
}; | ||
|
||
# TODO make this nicer wrt getting the plugins, perhaps ship all plugins by default + allow extra | ||
plugins = mkOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible this would be better as an argument to the derivation (when you move that to a separate file) than an option to the module... 🤔 Maybe pkgs.osticket.withPackages (p: with p; [ slack ])
? 😅
Co-authored-by: Aaron Andersen <aaron@fosslib.net>
Co-authored-by: Aaron Andersen <aaron@fosslib.net>
@aanderse thank you for your thorough review and hints, I distilled them into todos and will address them... this year? 😅 |
The year is soon ending! Can I help you to get this merged? It can be merged the next year if needed :P. |
Motivation for this change
Add osTicket, a nice support ticketing system with email support, as a module.
Things done
./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notesTo Do
pkgs.osticket.withPackages (p: with p; [ slack ])