I did get a step further with the hardcoded version; it breaks now at there being no composer.phar, which I read about in Aleks’ post, but which is not available/created in the upstream source of the app (as far as I can see on manual install).
Wohoo, a few iterations later, it finished the installation script succesfully!
Turned out to be a case of “Operation successful, patient died” though. Using the default template for nginx and hoping for the best, I get a bad gateway when visiting the app-URL.
php artisan serve will serve the app to localhost:8000
There is an attempt at a systemd service file to make artisan actually do that in the background, but I also started it manually without a port-in-use error so it needs more looking into.
Either way, I have to point the nginx configuration at port 8000 one way or another.
Would one of the helper scripts find a free port for me, since the next artisan app will use 8000 as well, or does artisan do some proxying by itself?
I’m a bit surprised though that it wants to listen on port 8000, typically PHP apps will use PHP-FPM which works differently than the “daemon listening on port” scheme … x_X
Anyway ideally your app shouldn’t need to use one specific port but use a port chosen ~randomly (possibly with a default value) and making sure that no other app or process uses that port. In packaging v2+ it is done using the “port” resource : App resources | Yunohost Documentation (typically just having [resource.ports] with no option/property should be fine and will create a variable $port / __PORT__ to be used in configurations etc
While searching for a solution, “learning” kicked in. I should indeed use PHP-FPM, with artisan preferably only for quick proof-of-concept uses while developing.
I’ll do some more studying and triyng before posting back here!
I installed the app on a new Yunohost to see whether all dependencies are pulled in correctly. They do, more or less, but the result is not quite what I expcted. Something’s off in the permissions, eg, CSS is 404.
I can’t quite figure out what the problem is. After comparing permissions on two working installations (one Yunohost where I created the package, one Yunohost without package but upstream Github install with redirect instead), I can’t find why my new installation (via the package) does not function.
Thanks for looking into the package and for your suggestions!
I think they are specific to Laravel, with Lychee also built on that framework. Laravel wants to write to appdir/storage, if it can’t, the app won’t run.
Is there a better way to ensure that access is permissive enough?
The dev gives install instructions to run with Artisan, no nginx suggestions
I tried very permissive access, even that did not work. Reviewing nginx conf for the app, I added a rewrite earlier on to have index.php ‘working’,
# try redirecting stuff to index.php
rewrite ^(.*)$ /index.php$1 last;
That actually tried to put every file in index.php, also .css
The correct way seems to be
try_files $uri $uri/ /index.php?$query_string;
but when using that, I get redirected to /usr/share/nginx/htmlindex.php , ie, there must be a relative path instead of an absolute path somewhere, and a / goes missing. The result is 404 of course.
In that situation, things tend to work more or less when explicitly/manually requesting index.php in the URL in the browser. That’s a no-go of course, because the portal won’t use a link to index.php.
Would you have an idea as to why try_files without the rewrite don’t work?
Edit: the reason I opened the topic, $composer_version, was solved by your reply last week. I’ll open a new ticket to address further packaging woes!