Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Use new helpers, add backup/restore and uwsgi #6

Merged
merged 26 commits into from
Dec 5, 2018
Merged

Use new helpers, add backup/restore and uwsgi #6

merged 26 commits into from
Dec 5, 2018

Conversation

Jibec
Copy link

@Jibec Jibec commented Oct 30, 2017

Hi, I wanted to add backup and restore, and I finally rewrote this package.

Some part I did not understood where removed (like swap) or I didn't like the easy_install ran as root.

Using gunicorn looked like to require a port, I decided to use uwsgi to have a socket instead.

I'm unsure it works, package_check gives weird results (upgrade doesn't work with package_check, but works fine on my VM). Please have a looks and play with it :)

Do not install this in production if you are not ready to loose your data.

@Jibec
Copy link
Author

Jibec commented Nov 16, 2017

this work is now ready for testing, please come and try, but use it carefully, everything is in your database, to be safe, just dump it!

@rigelk
Copy link
Member

rigelk commented Dec 29, 2017

Since I don't use YunoHost anymore in production, I can't test it fully right now. Look very nice though! I will be testing it and doing a proper review in the upcoming days if I manage to free some time for a proper test.

@Jibec
Copy link
Author

Jibec commented Jan 18, 2018

I see time is hard to find!
Do you mind transfering this application to me?

@Jibec
Copy link
Author

Jibec commented Jan 29, 2018

@maniackcrudelis I can't figure out the reason why upgrade from fd63504 and 267ccc2 fails as it works fine in my VM... I would appreciate it you may have a look.

@rigelk it also includes a maintainer change, (btw, beudbeud was written)

@Josue-T
Copy link

Josue-T commented Jun 28, 2018

Hello,
Thanks @Jibec for your work.
I think it could be good to go forward with this PR because I have the same issue #7 and it might affect many user. This PR should really improve the package. I allow myself to just review a little bit the code.

conf/nginx.conf Outdated
uwsgi_read_timeout 3600;
uwsgi_param SCRIPT_NAME __PATH__;
uwsgi_modifier1 30;
uwsgi_pass unix:///tmp/__NAME__.socket;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you store a socket in /tmp, is it not better in something like /run/uwsgi/app/searx as same as in searx ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true, I'll improve that someday

manifest.json Outdated
@@ -1,25 +1,25 @@
{
"name": "Firefox Sync Server",
"id": "ffsync",
"url": "https://github.com/abeudin/ffsync_ynh",
"version": "1.6.0",
Copy link

@Josue-T Josue-T Jun 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, could you use the new syntax for versioning (1.6.0~ynh1) ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, fixed.

# usage: ynh_setup_source dest_dir [source_id]
# | arg: dest_dir - Directory where to setup sources
# | arg: source_id - Name of the app, if the package contains more than one app
ynh_setup_source_local () {
Copy link

@Josue-T Josue-T Jun 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this helper is in the core so, we don't really need it here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, let's fix this

"packaging_format": 1,
"description": {
"en": "Mozilla’s Sync-Server to host your Firefox account data",
"fr": "Le serveur de synchronisation de Mozilla, pour héberger vos données Firefox"
},
"maintainer": {
"name": "beudbeud",
"email": "beudbeud@beudibox.fr",
"url": "https://github.com/balu-/FSyncMS"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mybe you could add the previous_maintainers key.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

scripts/install Outdated
# Use 'FSyncMS' as database name and user
db_user=ffsync
# Check destination directory
final_path="/var/www/$app"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use /var/www as final_path for an app which use python and wsgi. I think most the common for that is /opt/yunohost/$app

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unless this changed recently, this looks wrong: https://github.com/YunoHost/example_ynh/blob/master/scripts/install#L45

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and no,

Many app (by example searx, or synapse) which use python use /opt/yunohost/$app.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, ok, I won't change it if there it isn't mandatory.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I don't really understand why you change that because before it was on the right place (see here). So why do you change that ?

I really think that /var/www/$app is more for php / web apps but not for uwsgi / python app and many app apply this concept.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the discussion here, I think that it could be good to change that. I could also do it if you don't have time to do it.

scripts/install Outdated

# TODO: fix this css patch
# ynh_replace_string "media\/img@$path_url\/media\/img@g" $final_path/syncserver/page/sync_files/firefox_sync-bundle.css
# ynh_replace_string "media\/img@$path_url\/media\/img@g" $final_path/syncserver/page/sync_files/responsive-bundle.css
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is it ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no idea, I did not understood either

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

me neither.

#=================================================

# Backup the current version of the app
ynh_backup_before_upgrade
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we really able to do a backup if we upgrade the old installation style ?

@Jibec
Copy link
Author

Jibec commented Jun 28, 2018 via email

@rigelk
Copy link
Member

rigelk commented Jun 28, 2018

@Jibec I can approve and merge the request when you deem it ready.

@Jibec
Copy link
Author

Jibec commented Jun 28, 2018 via email

@Jibec
Copy link
Author

Jibec commented Jul 5, 2018

It now looks like to works fine from old install and every basic scenario.

Please test upgrade: yunohost app install https://github.com/YunoHost-Apps/ffsync_ynh/ && yunohost app upgrade ffsync -u https://github.com/jibec/ffsync_ynh/

@rigelk
Copy link
Member

rigelk commented Jul 5, 2018

Works for me!

@Jibec
Copy link
Author

Jibec commented Jul 6, 2018 via email

@Jibec Jibec closed this Aug 4, 2018
@licryle
Copy link

licryle commented Aug 8, 2018

Well, f6b79fe will certainly help with one of the 3 issues I've raised, but not the 2 other ones.

Reminder:

@licryle
Copy link

licryle commented Aug 8, 2018

I see this topic is closed, but I don't think it's working, are you tracking (1) and (3) independently?
Happy to help as mentioned before.

@Josue-T Josue-T reopened this Aug 22, 2018
@Josue-T
Copy link

Josue-T commented Aug 22, 2018

Hello,

I have pushed some fix, so it might be better now.

I have also tested the migration from the old package with my prod instance (on ARM) and it was good.

I think it should be ready for some other tests.

@Josue-T Josue-T mentioned this pull request Aug 29, 2018
@Josue-T
Copy link

Josue-T commented Aug 29, 2018

If nobody mind I purpose to merge this in 10 days

@Jibec
Copy link
Author

Jibec commented Aug 29, 2018 via email

@Josue-T
Copy link

Josue-T commented Aug 29, 2018

Ok,

I you want I can give you the access to this repos. It's you want.

@Josue-T
Copy link

Josue-T commented Sep 2, 2018

Hello,

I discovered some issue (when I restart the server) with uwsgi. @Jibec what is the reason to not use the main uwsgi service (which automatically start all service in /etc/uwsgi/app-enabled) ?

@Josue-T
Copy link

Josue-T commented Sep 6, 2018

Hello,
I have pushed some new fix which might fix some problem especially on the reboot. Without this fix ffsync didn't started correctly on the reboot.

If somebody can try this it could be good. And if it's ok for everybody I purpose to merge this in 10 days if I don't find some new issues.

About the maintainer who will be the maintainer of this app ?

@Josue-T
Copy link

Josue-T commented Dec 5, 2018

Let's merge this.

I'll be the maintainer of this app (if nobody mind).

@Josue-T Josue-T merged commit f021251 into YunoHost-Apps:master Dec 5, 2018
@Jibec
Copy link
Author

Jibec commented Dec 5, 2018 via email

@rigelk
Copy link
Member

rigelk commented Dec 5, 2018

Same for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants