Help needed packaging InvoicePlane_ynh

Hi everyone,
I’m trying to package my very first application, InvoicePlane, i had it working using mywebapp_ynh but i want to have it as an yunohost app.
First time using Gihub too, i know the principles but first time i really use it.
I used exemple_ynh as the base for this project, updated app.src, nginx.conf, both READMEs, manifest and the license.
Then finally started the real work: the script. After some troubleshooting i manage to make it work up to “Configuring nginx web server” aaaaaand it crashes… Apparently service.nginx failed. "Job for nginx.service failed because the control process exited with error code.’
Here’s the debug:

Help would be greatly appreciated, maybe this app won’t be level 7 fully working before months with my competences ^^’ but y’know, this is how you learn… And i really want to.

1 Like

Hello Unipo

I see indeed that the problem is with nginx, the first thing is to have a look to the log of nginx /var/log/nginx/error.log which should probably tells you why it have failed.
I think that’s because of the second try_files instruction.

Welcome on board :slight_smile:

Hahaha :sweat_smile: Alright, shame on me… I’m more used to nginx -t or test config as it gives you what in which line there’s a problem.
Anyway i already found new issues, I’ll probably be back seeking help if I’m unable to find a solution by myself.
Thank you @Maniack_Crudelis !

So I finally managed to have a working script. Well most of it…
Now… Questions time!
_I wanted to remove the hashtags in front of to lines in the htaccess file during the installation. I did it with "ynh_replace_string “line1” “line1edited” “$final_path/htaccess” (maybe not the cleanest way to to it :sweat_smile: ). It did work for the first line but not for the second. Do you have an idea why?
_Once the yunohost app install completed when I go to https//domain.tld/invoiceplane I end up on the invoiceplane first launch/setup sort of page. How can i benefit of the SSO for this app (user, dbase,etc…)? I mean once logged in you user account and selected the invoiceplane tile i would like to arrive on the dashboard.
Thanks! :smiley:

Hum, first, a number sign, a hash or a pound sign, but not a “hashtag” please… Hashtags are a tweeter stuff…

Also, before answering your question, you have to know that nginx doesn’t read htaccess, so commented or not, the htaccess file won’t work anyway.

But, for your understanding of the process, looking at your second line, I think there’s too many special characters, ^(.*)$ $1 [R=301,L], that are going to be interpreted as regex.
So, first, try to limit your catching string to the minimum required, and also try the helper ynh_replace_special_string instead. This one is designed to not interpret special characters.

I end up on the invoiceplane first launch/setup sort of page.
That’s not an error, in your install script you copy the directory then configure everything around. But, the install process of invoiceplane implies to go the this page to finalize the install of the app.
Well, that’s usually not easy but the thing to do is to use curl to fill the fields. That way the script will filled the form and validate the finalize the installation.
The helper ynh_local_curl will help you to use curl for that purpose.

Oop’s I hit a nerve :sweat_smile: sorry about that, 'won’t happen again. (And I’m not even a twitter user :open_mouth:)

Oh alright, I didn’t know about the htaccess file, I just followed the directions form I’m gonna need to delete that.

I’ll take a look to ynh_local_curl, but for the record, I never considered this issue as an error, I was wondering how to avoid this.

Thank you so much for taking the time to explain everything and not just throwing raw answers to my questions. I understand of much time consuming it is, I appreciate it . :love_you_gesture:

Some work still need to be done but now I think I could get the hang of it!

Have a good one!

That’s not really an error, but for YunoHost packages we expect the app to be fully working at the end of the script, without any further steps to finalize the setup.
An user should be able to install an app without even knowing the app needs a database, nor what is it.

Do not hesitate to ask if you have any others questions.