[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] how to disable actions in eprints



Hi John!

 ?what is the meaning of access table? I think the webserver log or a 
specialized log file would be enough, instead of a millions lines table 
(which can be a problem when you dump the database).

I apreciate the idea of running a static site when in mantainance, which 
is what we do already for the public (most of). So the basic idea of 
making a static site with the html directory content is a good idea when 
to go in mantainance mode. This could be also a feature of Eprints. 
Eprints 4 also cite a different approach here:

https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FEPrints4_Status&data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C0ac97de8e9bc47a0002908d65c13c8c2%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&sdata=TAQZkYwzHyhLNsmxccTDuE7uwK7%2B%2BuocVX97%2BNvPUcY%3D&reserved=0

# read-only: make the dataset read-only, no modifications are allowed via 
the API (whether HTTP, CLI ...)
# web-read-only (TOFIX): make the dataset read-only ONLY for HTTP requests 
- CLI scripts can still change data


Il 06/12/18 17:11, John Salter via Eprints-tech ha scritto:
> One word of warning:
> Any 'hits' on the abstract page or downloads of full text will result in data being added to the access tables in the database.
>
> If the reason behind your question is around migration from one database server to another, then the outline David provided is good, but your requirement to maintain access to items means that some part of your database will change.
>
> If you are migrating the database, you can do something like this:
> 'Live' server is pointing to database A (DB-X).
> Database is being migrated to database B (DB-Y)
>
> 1) Stop 'edit' access to EPrints (as outlines by others). Most of DB-X is now static.
> 2) Migrate all tables to DB-Y (including the access ones which are volatile - you might need to work out the best way to do this).
>
> At this point any access data is being added to DB-X, but won't be in DB-Y
>
> 3) Make an estimate of how many accesses/downloads you may get in your cut-over period.
> E.g. for a 1-hour cutover period:
> On DB-X
> mysql> SELECT COUNT(*) FROM access WHERE datestamp_year = YEAR(NOW()) AND datestamp_month = MONTH(NOW()) AND datestamp_day = DAY(NOW()) AND datestamp_hour = HOUR(NOW())-1 \G
> *************************** 1. row ***************************
> COUNT(*): 3762
>
> 4) Add this number to the value from the counters table, and update the counters table in DB-Y to the new value e.g.
> On DB-Y
> mysql> SELECT counter from counters WHERE countername = 'accessid' \G
> *************************** 1. row ***************************
> counter: 65804963
>
> Value to update to: 65804963+3762 = 65808725.
> I'd suggest rounding this up to a sensible figure = 65810000.
>
> On DB-Y
> mysql> UPDATE counters SET counter = 65810000 WHERE countername = 'accessid';
>
> ----
> Now point the live server to DB-Y.
> Any new access data will start at the value above, but there is a 'hole' in the access data that should be large enough for you to add the records from, DB-X in - without collisions on the primary key.
>
> You can now select the rows of data from DB-X access and access_ordervalues_en, where the accessid is greater than the value from (4) e.g.
> On DB-X
> SELECT * FROM access WHERE accessid > 65804963;
>
> These can be inserted into the access table on DB-Y, and you should have lost no download stats...
>
> Cheers,
> John
>
>
>
> -----Original Message-----
> From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Newman D.R. via Eprints-tech
> Sent: 06 December 2018 14:43
> To: Jonathan NORRIS <jnorris at ist.ac.at>; eprints-tech at ecs.soton.ac.uk
> Subject: Re: [EP-tech] how to disable actions in eprints
>
> Hi Jonathan,
>
> The Apache redirect should be fine.  Make sure this works for both HTTP
> and HTTPS, as I have been caught out by that before.  I would still
> recommend setting the cgi/login:page_layout phrase to be empty just in
> case.
>
> Yuri's suggestion of making the database read-only might be OK but for
> me there are too many things that I worry it might break, so I would
> avoid this unless absolutely necessary.
>
> Regards
>
> David Newman
>
>
> On Thu, 2018-12-06 at 15:13 +0100, Jonathan NORRIS wrote:
>> Hey,
>>
>> Thank you for the information. My original idea was to disable the
>> (conventional) login somehow but was not sure how to handle existing
>> login sessions. Here's what I think I will do:
>>
>> apache redirect the login route two a page giving information as to
>> why
>> this is disabled
>> truncate the loginticket table
>> switch off the indexer and cronjobs
>>
>> Thanks again for your help,
>> Jonathan Norris
>> IST Austria
>>
>> On 12/6/18 15:07, Newman D.R. wrote:
>>> Hi Jonathan,
>>>
>>> There are several things I would do:
>>>
>>> 1. Disable the indexer from the admin menu.
>>>
>>> 1. Modify the phrase cgi/login:page_layout (by default in
>>> /opt/eprints3/lib/lan/en/phrases/system.xml, you can override at an
>>> archive level) to remove the login form.
>>>
>>> 2. Truncate (i.e. delete all records from) the loginticket table to
>>> remove any current logged in sessions.
>>>
>>> 4. Edit the EPrints user's crontab to make sure you disable any
>>> scripts
>>> that could modify publications data/metadata.
>>>
>>> This advice assumes you are using conventional login (not
>>> Shibboleth/ADFS or similar).  Also the access table in the database
>>> will still get records added to it.  However, it sounds like this
>>> would
>>> not be an issue, as it would not effect the data/metadata of the
>>> publication records.
>>>
>>> Regards
>>>
>>> David Newman
>>>
>>> On Thu, 2018-12-06 at 14:47 +0100, Jonathan NORRIS via Eprints-tech
>>> wrote:
>>>> Hello,
>>>>
>>>> I need to disable user actions within eprints for a period of
>>>> time
>>>> but
>>>> still allow access to it because of existing citations and DOIs
>>>> that
>>>> link back to it. We need to stop any sort of interaction that
>>>> would
>>>> change the data inside, including adding new records, updating
>>>> existing
>>>> and deleting records.
>>>>
>>>> Would anyone have any advice on how I may achieve this?
>>>>
>>>>
>>>> Thanks,
>>>> Jonathan Norris
>>>> IST Austria
>>>> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/epri
>>>> nts-
>>>> tech
>>>> *** Archive: https://emea01.safelinks.protection.outlook.com/?url
>>>> =htt
>>>> p%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=01%7C01%7Cdrn%40
>>>> ecs.
>>>> soton.ac.uk%7C1bad55970a634dc30fac08d65b824079%7C4a5378f929f44d3e
>>>> be89
>>>> 669d03ada9d8%7C1&amp;sdata=vQc9Tjx3lHOhqA2Y8JfWa93l4W%2FLkGPapw2r
>>>> vVDH
>>>> rE0%3D&amp;reserved=0
>>>> *** EPrints community wiki: https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Femea01.safelinks.protection.o&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C0ac97de8e9bc47a0002908d65c13c8c2%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=x3a5l5uYERId9SWkYrZB9IVEvboP1aazNsCf3mKBuKE%3D&amp;reserved=0
>>>> utlook.com/?url=https%3A%2F%2Femea01.safelinks.protection.outlo&a
>>>> mp;data=01%7C01%7Cdrn%40ecs.soton.ac.uk%7C4c899ea696cf40248d5b08d
>>>> 65b84eedb%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=z3%2Fd
>>>> Ds%2FFyZL%2FdAHLdDEjPW2DWBJ8xgI8ukFreVKPnGw%3D&amp;reserved=0
>>>> ok.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=01%7C01%7Cd
>>>> rn%4
>>>> 0ecs.soton.ac.uk%7C1bad55970a634dc30fac08d65b824079%7C4a5378f929f
>>>> 44d3
>>>> ebe89669d03ada9d8%7C1&amp;sdata=bEL6BwAdx%2FrR8uREZ7kBTR%2Br8lN1M
>>>> tUZ%
>>>> 2BpyvvBVJ4Dc%3D&amp;reserved=0
>>>> *** EPrints developers Forum: https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Femea01.safelinks.protection&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C0ac97de8e9bc47a0002908d65c13c8c2%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=g3Mql9IhLRA%2BKdYnJACGTI0%2BfDkSLtCF0ME0cmaaPpY%3D&amp;reserved=0
>>>> .outlook.com/?url=https%3A%2F%2Femea01.safelinks.protection.out&a
>>>> mp;data=01%7C01%7Cdrn%40ecs.soton.ac.uk%7C4c899ea696cf40248d5b08d
>>>> 65b84eedb%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=%2Fc0t
>>>> JoJqijDcR6RHJKHNGgezFA%2BGzXjXqDaewWmziIE%3D&amp;reserved=0
>>>> look.com/?url=http%3A%2F%2Fforum.eprints.org%2F&amp;data=01%7C01%
>>>> 7Cdr
>>>> n%40ecs.soton.ac.uk%7C1bad55970a634dc30fac08d65b824079%7C4a5378f9
>>>> 29f4
>>>> 4d3ebe89669d03ada9d8%7C1&amp;sdata=tWb54v0pb0ku88avou5L3dNK2Hlcyr
>>>> 0leo
>>>> MKgXfEBD8%3D&amp;reserved=0
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C0ac97de8e9bc47a0002908d65c13c8c2%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=RI%2FUtiVkKkDd9NzzUoHw9V3ccBuaHeCmfxN5RlqL560%3D&amp;reserved=0
> *** EPrints community wiki: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C0ac97de8e9bc47a0002908d65c13c8c2%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=K3fU6pG%2Fcn1t476%2BZL%2B6slKM3U3yDjI0OoItNGUbBHY%3D&amp;reserved=0
> *** EPrints developers Forum: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C0ac97de8e9bc47a0002908d65c13c8c2%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=5w369B973jPvfa44DdQDNyYKqd6apdlIaU3c%2F%2Bw3Fu8%3D&amp;reserved=0
>
> *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** Archive: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C0ac97de8e9bc47a0002908d65c13c8c2%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=RI%2FUtiVkKkDd9NzzUoHw9V3ccBuaHeCmfxN5RlqL560%3D&amp;reserved=0
> *** EPrints community wiki: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C0ac97de8e9bc47a0002908d65c13c8c2%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=K3fU6pG%2Fcn1t476%2BZL%2B6slKM3U3yDjI0OoItNGUbBHY%3D&amp;reserved=0
> *** EPrints developers Forum: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C0ac97de8e9bc47a0002908d65c13c8c2%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=5w369B973jPvfa44DdQDNyYKqd6apdlIaU3c%2F%2Bw3Fu8%3D&amp;reserved=0