GroundApps / ShoppingList_Backend

Simple Centralized Shoppinglist - php backend
GNU General Public License v3.0
27 stars 23 forks source link

Update function #33

Open ghost opened 9 years ago

ghost commented 9 years ago

The Server/Backend Need an update check. It must check if there is a new Version from the backend, then download and install the new api. Also it should send a notice message back to the user, that the Version on the Server is old and Need to update, when there is a major update like update the SQL Dump or secruity stuff like Password encryption!

jklmnn commented 9 years ago

I see two big points there:

ghost commented 9 years ago

Ok, I have a big Server, were we could hoste a ShoppingList_UpdateServer. So, the app is checking, for a new backend and app Version on every start, if there is a Internet Connection. On backup, the script will read the backup all old files, then clone the new Version and copy the config.php back.

So my way were:

jklmnn commented 9 years ago

Do we want to upgrade automatically or just show if there's an update available? I had the idea that we could just use a stable branch and pull a version file from there and display that a new version is available. I don't see why the app should look for that. The app itself is updated by f-droid, and not every app user want to be notified if there's a server update. That server update notification should only get to the admin. Maybe we could create a .deb and a .rpm?

J-8 commented 9 years ago

We can add a checkbox to the app if the user wants to get notified on backend updates. Then we dont need a check for different user types.

ghost commented 9 years ago

I think the way with the checkbox is greate.

Ok, @jklmnn I think we should have to branchs, stable and working branch. How exactly do you imagine that with the pull of file versions

J-8 commented 9 years ago

If I add a check by the app then I need a function in api.php to give back the current version. type can be somewhere with 1000 again and content just the versioncode. Whatever you think is best.

jklmnn commented 9 years ago

@beli3ver you can access files of a branch directly by going to https://raw.githubusercontent.com/user/repo/branch/file So we could just put a version.json into the repo and you would just access this file directly. For example if you want to see the raw content of the README.md you have to look at https://raw.githubusercontent.com/GroundApps/ShoppingList_Backend/master/README.md

ghost commented 9 years ago

@jklmnn that is a really good way I thinl

jklmnn commented 9 years ago

I have added a PPA, view #45

J-8 commented 9 years ago

Nice! How do we deal with database updates? If the structure of the database changes, the old database would be useless.

If have been working on a php based update method, because like @beli3ver said, some do not have access to the shell.

jklmnn commented 9 years ago

A php method is a good thing. We could do it like owncloud. They bring minor updates with a php updater, and also update the database with php, but the big updates come with packages. We could also seperate the updater. So only people without shell access have to install this updater. Database updates could be done with postinst scripts in the deb.

J-8 commented 9 years ago

What it does is it check the own version and compares it to the latest github release. If that is greater than the own, the option of an update is given. First it checks of the directory is_writeable, if not the whole thing does not work.

jklmnn commented 9 years ago

We should also check somehow if it was installed manually or if it was installed as package. It could break some things if somebody is updating with this script and the tries to update the package.