Automatic update of ACE2 addons / cronjob / Question

Support and feedback for UniAdmin

Automatic update of ACE2 addons / cronjob / Question

Postby lunzet » Tue Nov 20, 2007 1:34 am

As I would like to update my ACE2 addons using UU also I have been thinking about running a cronjob hourly to retrieve the latest files from http://files.wowace.com/. That is working already fine for the file retrieval but unfortunately UniAdmin does not recognize that these are new files which need another MD5 hash rebuild. And therefore UU does not download the new version.

Question:
Is there any [shell] command I can run to make UA aware that there is a new file downloaded to the addon_zips folder to make it rehash the file?

If not any other Idea on how to make this happen?

This feature would help me a lot as more and more people are using the ACE2 tools but there is a huge variety on the update frequency of each Individual :roll:

Any helps is highly appreciated.
User avatar
lunzet
WR.net Journeyman
WR.net Journeyman
 
Posts: 119
Joined: Sat Jan 13, 2007 1:23 pm

Automatic update of ACE2 addons / cronjob / Question

Postby zanix » Tue Nov 20, 2007 1:55 am

There is no shell command and UA doesn't have a method for auto-updating wowace addons
I am also not familiar with making shell php scripts

I intend to work on UA more when Roster 2.0 final is released
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Automatic update of ACE2 addons / cronjob / Question

Postby lunzet » Tue Nov 20, 2007 2:31 am

I am not fixed to ace addons. I am just wondering which command could be used to make UA aware that the zipfile needs to be rehashed. This might be useful for any kind of addon.

Maybe parts of the code for usual upload in UA can be used for doing that. I just would need to know where UA gets the trigger to calculate the MD5.
User avatar
lunzet
WR.net Journeyman
WR.net Journeyman
 
Posts: 119
Joined: Sat Jan 13, 2007 1:23 pm

Automatic update of ACE2 addons / cronjob / Question

Postby PleegWat » Tue Nov 20, 2007 2:34 am

I'll see if I've got time to look at this. Meanwhile, have you tried a suitable wget to localhost? This may be more dependable than a separate shell entry point.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Automatic update of ACE2 addons / cronjob / Question

Postby lunzet » Tue Nov 20, 2007 4:00 am

The files are already downloaded using wget. So the file is already replaced with the newer version. I just need to get it recognized by UA....

If that would work this would really help a lot.....thanks for checking this out
User avatar
lunzet
WR.net Journeyman
WR.net Journeyman
 
Posts: 119
Joined: Sat Jan 13, 2007 1:23 pm

Re: Automatic update of ACE2 addons / cronjob / Question

Postby Willowhealer » Tue Nov 20, 2007 5:03 am

Since we're on the topic... what would be the best way to keep the addons up to date at this time?

Currently I am going through and updating one at a time manually... OMG the pain :)

Everyone else loves it... but they don't have to do any of the back end work.

And yes... I can be patient in waiting for Roster2 to be released if that is really the best answer :)
Willowhealer
WR.net Apprentice
WR.net Apprentice
 
Posts: 14
Joined: Wed Apr 11, 2007 8:32 am

Automatic update of ACE2 addons / cronjob / Question

Postby PleegWat » Tue Nov 20, 2007 6:08 am

lunzet: I mean, wget the UA url to process the uploaded addons. I know there's a facility that lets you put addons in the DB after you've manually uploaded them, though I'm not sure if it's a single-request action if need be. You may need to do multiple calls. Check the wget manpage on how to store cookies.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Re: Automatic update of ACE2 addons / cronjob / Question

Postby MattM » Tue Nov 20, 2007 6:54 am

PleegWat wrote:lunzet: I mean, wget the UA url to process the uploaded addons. I know there's a facility that lets you put addons in the DB after you've manually uploaded them, though I'm not sure if it's a single-request action if need be. You may need to do multiple calls. Check the wget manpage on how to store cookies.


wget may be a good idea, you may have to modify UA and include an extra parameter in the query URL like &aukey={yourkey} to bypass authentication within UA

Also I dont know, but it's possible that you may be able to copy the URL's for each mouse click to delete the addon, then another mouse click for add addon (depending on how the URL's in UA work, I'm not sure anymore)
MattM
UA/UU Developer
UA/UU Developer
Gimpy Developer
Gimpy Developer
 
Posts: 886
Joined: Tue Jul 04, 2006 9:53 pm
Location: USA

Re: Automatic update of ACE2 addons / cronjob / Question

Postby lunzet » Tue Nov 20, 2007 7:02 am

How can i find out what these urls are? I have to admit that I am an entire php noob...so any help is really needed...
User avatar
lunzet
WR.net Journeyman
WR.net Journeyman
 
Posts: 119
Joined: Sat Jan 13, 2007 1:23 pm

Automatic update of ACE2 addons / cronjob / Question

Postby MattM » Tue Nov 20, 2007 7:06 am

open the web page for adding an ace addon, hover the mouse over a "button" and look at the status bar in the browser.

If nothing shows, or some gobblygook shows, its probably javascript and requires deeper digging
MattM
UA/UU Developer
UA/UU Developer
Gimpy Developer
Gimpy Developer
 
Posts: 886
Joined: Tue Jul 04, 2006 9:53 pm
Location: USA

Re: Automatic update of ACE2 addons / cronjob / Question

Postby Willowhealer » Tue Nov 20, 2007 11:11 am

BTW... this thread kicks ass... thanks alot for all the help so far... the development team on this project works very hard and I am very thankful for that...

Hovering my curser over a button returns a simple link style response in the status bar. In addition to that... the download button is a simple link to the file in the addon_zips folder.

I wish I could help devise a solid plan here... but I am not a programer... however I have noted that at some point some documentation had been lost... I am in the process (slowly) in trying to compile a set of FAQ of some sort for the list of challenges I have had to help contribute...
Willowhealer
WR.net Apprentice
WR.net Apprentice
 
Posts: 14
Joined: Wed Apr 11, 2007 8:32 am

Automatic update of ACE2 addons / cronjob / Question

Postby zanix » Tue Nov 20, 2007 11:41 am

Willowhealer wrote:however I have noted that at some point some documentation had been lost... I am in the process (slowly) in trying to compile a set of FAQ of some sort for the list of challenges I have had to help contribute...

Yeah, this is my fault
I took over UA in version 0.7.0, and it gained quite a few changes

Documentation takes forever for me, so I have been concentrating on Roster
And any help in this aspect would be extremely welcome
Last edited by zanix on Tue Nov 20, 2007 11:43 am, edited 1 time in total.
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Automatic update of ACE2 addons / cronjob / Question

Postby zanix » Wed Nov 21, 2007 4:14 am

The url to process addon zips that are not processed yet is
Code: Select all
index.php?p=addons&orphan


It's takes a POST of each filename you want to process
I would have to delve deeper into how this works exactly again, but here is the function that processes the un-scanned addons

modules/addons.php
Code: Select all
function process_orphan_addons()
{
    global 
$uniadmin$user;

    foreach( 
$_POST as $addon => $dl )
    {
        if( 
$dl == 'on' )
        {
            
$download[] = $addon;
        }
    }

    if( 
$_POST[UA_URI_ACTION] == UA_URI_ADD )
    {
        foreach( 
$download as $key => $addon )
        {
            
$addon $_SESSION[$addon];

            
$filename UA_BASEDIR $uniadmin->config['addon_folder'] . DIR_SEP "$addon";

            
$toPass = array();
            
$toPass['name'] = $addon;
            
$toPass['type'] = 'application/zip';
            
$toPass['tmp_name'] = $filename;

            if( 
is_readable($toPass['tmp_name']) )
            {
                
$toPass['error'] = 0;
            }
            else
            {
                
$toPass['error'] = 1;
            }
            
$toPass['size'] = filesize($toPass['tmp_name']);
            
process_addon($toPass);
        }
    }
    elseif( 
$_POST[UA_URI_ACTION] == UA_URI_DELETE )
    {
        foreach( 
$download as $key => $addon )
        {
            
$addon $_SESSION[$addon];

            
$filename UA_BASEDIR $uniadmin->config['addon_folder'] . DIR_SEP "$addon";
            if( 
file_exists($filename) )
            {
                
$try_unlink unlink($filename);
                if( !
$try_unlink )
                {
                    
$uniadmin->error(sprintf($user->lang['error_unlink'],$filename));
                }
            }
            
$uniadmin->message(sprintf($user->lang['addon_deleted'],$addon));
        }
    }


It looks like it uses sessions, and I cannot remember why... :s
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Automatic update of ACE2 addons / cronjob / Question

Postby lunzet » Wed Nov 21, 2007 4:51 am

I am not really sure how to use these Informations but I will stay tuned further....

An URL to just specify which addon needs to be refreshed would be perfect.

e.g. ..../index.php?p=addons&update=Omen.zip
User avatar
lunzet
WR.net Journeyman
WR.net Journeyman
 
Posts: 119
Joined: Sat Jan 13, 2007 1:23 pm

Automatic update of ACE2 addons / cronjob / Question

Postby zanix » Wed Nov 21, 2007 5:44 am

PleegWat and I are kicking around ideas on the IRC chat room
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Next

Return to UniAdmin

Who is online

Users browsing this forum: No registered users and 1 guest

cron