Author Topic: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)  (Read 57827 times)

0 Members and 3 Guests are viewing this topic.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #105 on: August 13, 2013, 11:09:21 am »
Well, sure, but you can't prevent the user from renaming his files, so, the hooking solution on the rename/move function to update the DB seems to be the best compromise?
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #106 on: August 13, 2013, 01:48:17 pm »
Well, sure, but you can't prevent the user from renaming his files, so, the hooking solution on the rename/move function to update the DB seems to be the best compromise?
No, if the user renames the files in MyLib its his problem. Same for a user that roots himself and change the files.
Hooking the Operating System is more convenient to add features to the user, not forbid him from renaming/deleting his files.
Plus, there is no advantage to hook the rename/move functions in order to update the DB. What would it do if its a lib ? There is no use.
Only a hook on the remove function could help the user to purge the hidden files.
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #107 on: August 13, 2013, 02:03:14 pm »
You're talking non-sense.

The user has the possibility to rename.
So, eventually he'll do that. (worst-case scenario / murphy's law). It's his problem indeed if he renames a MyLib file, but this has strictly nothing to do with having a package manager.

Why would you not want to then update the obsolete DB ? I don't see any good reason to not hook the rename function to update the db if there is no technical difficulty in doing so.
It's just one of the advantage of having an ndlessed calc.
« Last Edit: August 13, 2013, 02:05:55 pm by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #108 on: August 13, 2013, 02:12:30 pm »
Why would you not want to then update the obsolete DB ?
As ExtendeD said, I don't see any reason to maintain a database.
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #109 on: August 13, 2013, 03:02:12 pm »
Well, maybe there is another way than having a DB, but filenaming conventions will lead to annoyingly long names.
If there are other solutions, we still haven't found them, then.
« Last Edit: August 13, 2013, 03:02:26 pm by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #110 on: August 13, 2013, 03:11:34 pm »
Well, maybe there is another way than having a DB, but filenaming conventions will lead to annoyingly long names.
If there are other solutions, we still haven't found them, then.
I still don't understand why you need to link the manager to the files. Only the reverse is needed, and, deleting the "link" file, with a hook, will uninstall the installed/hidden files. There is no use to make a reverse link and thus, no need to have a database/naming conventions.
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #111 on: August 14, 2013, 11:38:11 am »
All right, I've finished the first version of the TI-Planet API.

Documentation is here : http://tiplanet.org/forum/archives_voir.php?id=19600

TL;DR :
- search within the archives with filters
- get info about an archive by its id
- output possible in json, xml, php-serialized-array, php-print_r
- get/post requests supported
- http & https supported


tell me what else would be needed for the software

the current apikey (will change later...) for the appstore is ... the name of the package manager ndless program followed by the number 42.
Right now it's for debugging/coding purposes I guess, but for production, we'll get a new, "secret" api key (and this current one disabled)
« Last Edit: August 14, 2013, 11:53:53 am by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #112 on: August 14, 2013, 01:30:20 pm »
Quote
the current apikey (will change later...) for the appstore is ... the name of the package manager ndless program followed by the number 42.
Right now it's for debugging/coding purposes I guess, but for production, we'll get a new, "secret" api key (and this current one disabled)
Why not HTTP auth?

Could you change the author to be always an array? It's better to use foreach($authors as $author) than if(is_array($author))..
Also, it should be possible to retrieve the apps for a given platform. How else should the appstore fetch all available apps?

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #113 on: August 14, 2013, 01:42:11 pm »
Quote
the current apikey (will change later...) for the appstore is ... the name of the package manager ndless program followed by the number 42.
Right now it's for debugging/coding purposes I guess, but for production, we'll get a new, "secret" api key (and this current one disabled)
Why not HTTP auth?
I'll look into that. How is it different/better ?
But the good side of that is having the possiblity of getting results through an ajax call in JS, for example, while I'm not sure if it's possible with the http auth.
If I do get it to work, I'll try to support the 3 ways.

Could you change the author to be always an array? It's better to use foreach($authors as $author) than if(is_array($author))..
Also, it should be possible to retrieve the apps for a given platform. How else should the appstore fetch all available apps?
Why not. Then, same for the categories.

Also, it should be possible to retrieve the apps for a given platform. How else should the appstore fetch all available apps?
Yeah, for the App Store, I guess I'll have to support that, but this would have to be some kind of "unique" request (like, no more than once every x hours), since it's going to be huge....
I thought of having that supported with some "pages" system. Like, request from 0 to 1000, then 1001 to 2000, etc.

(For now, the max amount of results is 500, and I haven't implemented this "page" system nor the cooldown)

What do you think : page or cooldowned big request ?
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #114 on: August 14, 2013, 01:43:29 pm »
Nice start adriweb.
What is the API key for?
Also don't we want any calc archive site be able to become repository? (i.e. have a TI-Nspire repository API instead of a TI-Planet API).
Ndless.me with the finest TI-Nspire programs

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #115 on: August 14, 2013, 01:48:37 pm »
Nice start adriweb.
Thanks :)

What is the API key for?
Basically to avoid misuse/abuse of the API by flooding our server from easily doable (big) requests ... :(
So, the simpler it is for the third-party user (app store developers etc.), the better it is.
Here, it's just another variable to pass, vogt suggested the HTTP auth, I'll take a look.

Also don't we want any calc archive site be able to become repository? (i.e. have a TI-Nspire repository API instead of a TI-Planet API).
Well, I suggested that the App Store could read several calc sites indeed, but the reply was that it would be quite difficult to handle multiple versions/duplicates, and such problems.
Ideally... with proper filtering, it could be great to have multiple sources...

But anyway, I can't make any APIs for websites I don't have the DB control ^^

I can also release the API source code, if that helps, only the queries will have to change, the rest is pretty generic.
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #116 on: August 14, 2013, 01:55:11 pm »
Quote
Yeah, for the App Store, I guess I'll have to support that, but this would have to be some kind of "unique" request (like, no more than once every x hours), since it's going to be huge....
I thought of having that supported with some "pages" system. Like, request from 0 to 1000, then 1001 to 2000, etc.

(For now, the max amount of results is 500, and I haven't implemented this "page" system nor the cooldown)

What do you think : page or cooldowned big request ?
We have some RPC going over a DSL 6000 connection (upload 300 kb/s) and the entire student-database(1800 students: class, name, groups, username, email, uid, birthdate..) can be fetched in under 2 seconds. Maybe gzencode (api.php?gz=1, 0 is default)?

Quote
Quote
Why not HTTP auth?
I'll look into that. How is it different/better ?
But the good side of that is having the possiblity of getting results through an ajax call in JS, for example, while I'm not sure if it's possible with the http auth.
If I do get it to work, I'll try to support the 3 ways.
No probs: http://api:[email protected]/api.php?gz=0

And disabling get helps against spamming the server logs and the client browsers history. Also, there's no request limit.

Quote
Also don't we want any calc archive site be able to become repository? (i.e. have a TI-Nspire repository API instead of a TI-Planet API).
For now, it doesn't matter how it's called. Some fields are missing a well-formed value (like nspire-os: major.minor) and some major features are missing (screenshot). Maybe even an installation count? Increment on installation and decrement on uninstallation?

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #117 on: August 14, 2013, 01:55:15 pm »
Also, it should be possible to retrieve the apps for a given platform. How else should the appstore fetch all available apps?
Yeah, for the App Store, I guess I'll have to support that, but this would have to be some kind of "unique" request (like, no more than once every x hours), since it's going to be huge....
I thought of having that supported with some "pages" system. Like, request from 0 to 1000, then 1001 to 2000, etc.

(For now, the max amount of results is 500, and I haven't implemented this "page" system nor the cooldown)

What do you think : page or cooldowned big request ?

Debian uses the compressed Packages.gz for this for instance. Or if you just fear for you database performance, make use of cache.

Basically to avoid misuse/abuse of the API by flooding our server from easily doable (big) requests ... :(
So, the simpler it is for the third-party user (app store developers etc.), the better it is.
Here, it's just another variable to pass, vogt suggested the HTTP auth, I'll take a look.

But how would the key be allocated? Would it be generated for each user?
Again making use of a cache or regularly generating static content makes this API key useless.

Also don't we want any calc archive site be able to become repository? (i.e. have a TI-Nspire repository API instead of a TI-Planet API).
Well, I suggested that the App Store could read several calc sites indeed, but the reply was that it would be quite difficult to handle multiple versions/duplicates, and such problems.
Ideally... with proper filtering, it could be great to have multiple sources...

But anyway, I can't make any APIs for websites I don't have the DB control ^^

I can also release the API source code, if that helps, only the queries will have to change, the rest is pretty generic.

I mean letting other sites implement the API (as Linux repositories or Eclipse update sites do). The API can be versionned, and a well-defined API doesn't depend on the underlying database structure.
« Last Edit: August 14, 2013, 01:56:16 pm by ExtendeD »
Ndless.me with the finest TI-Nspire programs

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #118 on: August 14, 2013, 05:56:11 pm »
Hmm, sorry I don't have time to reply correctly to your messages (maybe tomorrow, but then, I'll be leaving for some days, so I'm not sure), in the meantime, you can find the source here :
https://github.com/TI-Planet/API

In a few words :
 - gz compression seems like a good idea
 - the TI-Planet archives don't feature a version field in the database (see what I did to hackily find the nspire_os already when there wasn't ...)
 - the key would only be for the app store software, so just one key, not for its users.
 - I'm not sure a cache would be such a great idea as the request can vary quite enormously, and the cache would get quite huge (?)
 - with the source now available, you're welcome to contribute :P
« Last Edit: August 30, 2013, 08:08:36 am by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: pacspire - A simple package manager for the TI-Nspire/Ndless (WIP)
« Reply #119 on: August 15, 2013, 03:31:42 am »
- the key would only be for the app store software, so just one key, not for its users.

Then it's a public key, it can't protect you from anything.

Quote
- I'm not sure a cache would be such a great ID as the request can vary quite enormously, and the cache would get quite huge (?)

It would make sense for requests heavy for the database, search as full-text search (these one are actually not so random) or app listing (a few hundred kb, not so big but I/O intensive for a database).
« Last Edit: August 15, 2013, 03:31:55 am by ExtendeD »
Ndless.me with the finest TI-Nspire programs