# Help needed packaging InvoicePlane\_ynh

**URL:** <https://forum.yunohost.org/t/help-needed-packaging-invoiceplane-ynh/7453>\
**Category:** Apps packaging\
**Tags:** english\
**Created:** [March 24, 2019, 9:46am UTC](https://forum.yunohost.org/t/help-needed-packaging-invoiceplane-ynh/7453 "2019-03-24T09:46:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Unipo](https://forum.yunohost.org/user_avatar/forum.yunohost.org/unipo/32/3193_2.png) [@Unipo](https://forum.yunohost.org/u/Unipo)\
**Post date:** [March 24, 2019, 9:46am UTC](https://forum.yunohost.org/t/help-needed-packaging-invoiceplane-ynh/7453/1 "2019-03-24T09:46:25Z")

</div>

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 install.sh 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: [https://paste.yunohost.org/raw/icopamiqed](https://paste.yunohost.org/raw/icopamiqed)

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.  
Cheers,

---

<div class="post-metadata">

**Author:** ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)\
**Post date:** [March 24, 2019, 9:59am UTC](https://forum.yunohost.org/t/help-needed-packaging-invoiceplane-ynh/7453/2 "2019-03-24T09:59:53Z")

</div>

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](https://github.com/luneth/invoiceplane_ynh/blob/master/conf/nginx.conf#L19).

Welcome on board 🙂

---

<div class="post-metadata">

**Author:** ![Unipo](https://forum.yunohost.org/user_avatar/forum.yunohost.org/unipo/32/3193_2.png) [@Unipo](https://forum.yunohost.org/u/Unipo)\
**Post date:** [March 24, 2019, 10:26am UTC](https://forum.yunohost.org/t/help-needed-packaging-invoiceplane-ynh/7453/3 "2019-03-24T10:26:52Z")

</div>

Hahaha 😅 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 !

---

<div class="post-metadata">

**Author:** ![Unipo](https://forum.yunohost.org/user_avatar/forum.yunohost.org/unipo/32/3193_2.png) [@Unipo](https://forum.yunohost.org/u/Unipo)\
**Post date:** [March 24, 2019, 11:52am UTC](https://forum.yunohost.org/t/help-needed-packaging-invoiceplane-ynh/7453/4 "2019-03-24T11:52:55Z")

</div>

Alriiiiiiight…  
So I finally managed to have a working install.sh 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 😅 ). 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! 😃

---

<div class="post-metadata">

**Author:** ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)\
**Post date:** [March 24, 2019, 12:24pm UTC](https://forum.yunohost.org/t/help-needed-packaging-invoiceplane-ynh/7453/5 "2019-03-24T12:24:10Z")

</div>

> [@Unipo](#):
>
> I wanted to remove the hashtags in front of to lines in the htaccess file

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.

---

<div class="post-metadata">

**Author:** ![Unipo](https://forum.yunohost.org/user_avatar/forum.yunohost.org/unipo/32/3193_2.png) [@Unipo](https://forum.yunohost.org/u/Unipo)\
**Post date:** [March 24, 2019, 12:53pm UTC](https://forum.yunohost.org/t/help-needed-packaging-invoiceplane-ynh/7453/6 "2019-03-24T12:53:58Z")

</div>

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

Oh alright, I didn’t know about the htaccess file, I just followed the directions form [https://wiki.invoiceplane.com/en/1.0/getting-started/installation](https://wiki.invoiceplane.com/en/1.0/getting-started/installation). 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 . 🤟

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

Have a good one!

---

<div class="post-metadata">

**Author:** ![Maniack\_Crudelis](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maniack_crudelis/32/13_2.png) [@Maniack\_Crudelis](https://forum.yunohost.org/u/Maniack_Crudelis)\
**Post date:** [March 24, 2019, 3:03pm UTC](https://forum.yunohost.org/t/help-needed-packaging-invoiceplane-ynh/7453/7 "2019-03-24T15:03:57Z")

</div>

> [@Unipo](#):
>
> 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.

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.

> [@Unipo](#):
>
> Some work still need to be done but now I think I could get the hang of it!

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

---

<div class="post-metadata">

**Author:** ![Aleks](https://forum.yunohost.org/user_avatar/forum.yunohost.org/aleks/32/1704_2.png) [@Aleks](https://forum.yunohost.org/u/Aleks)\
**Post date:** [January 18, 2023, 8:23pm UTC](https://forum.yunohost.org/t/help-needed-packaging-invoiceplane-ynh/7453/8 "2023-01-18T20:23:04Z")

</div>

Closed on January 18, 2023, 8:23pm UTC


