summaryrefslogtreecommitdiffstats
path: root/bin/updater/README.rst
blob: f5b6b91564d64145437e9391fbd22e45c951488f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
ownCloud News Updater
=====================

ownCloud does not require people to install threading or multiprocessing libraries. Because the feed update process is mainly limited by I/O, parallell fetching of RSS feed updates can speed up the updating process significantly. In addition the cronjob can get `into a deadlock <https://github.com/owncloud/core/issues/3221>`_ which will cause the updater to get stuck resulting in your feeds not to being updated anymore. This can be solved by using a script that uses the `updater API <https://github.com/owncloud/news/wiki/Cron-1.2>`_

Preinstallation
---------------

To run the updates via an external threaded script the cron updater has to be disabled. To do that go to the admin section an uncheck the "Use ownCloud cron" checkbox or open **owncloud/data/news/config/config.ini** set::

    useCronUpdates = true

to::

    useCronUpdates = false

Then install the following packages (my vary depending on your distribution):

* python3-pip
* python3-setuptools
* make

If you are **on Debian 7** you want to create a symlink for pip to make use of the Makefile::

    sudo ln -s /usr/bin/pip-3.2 /usr/bin/pip3


Updating
--------

.. note:: In general it is recommended to update the updater after every News app update

If you have installed the updater on your system you can update it by running::

    sudo make update

The **init and config files won't be updated** and you need to update them manually in case there is a breaking change therefore follow the `CHANGELOG.md <https://github.com/owncloud/news/blob/master/CHANGELOG.md>`_ to stay up to date with the updater changes.

Finally reload the systemd service::

    sudo systemctl restart owncloud-news-updater

or SysVinit script::

    sudo /etc/init.d/owncloud-news-updater restart


No installation
---------------

If you do not want to install the script at all you can call it directly using::

    python3 -m owncloud_news_updater -c /path/to/config.ini

.. note:: Keep in mind that you need to restart the script if you want to run a new version


Installation: No init system
----------------------------

If you decide against using an init system to run the script simply run::

    sudo setup.py install

Then you can run the updater daemon using::

    owncloud-news-updater --user USERNAME --password PASSWORD http://yourcloud.com

or if you are using a config file::

    owncloud-news-updater -c /path/to/config


To see all config options run::

    owncloud-news-updater -h

.. note:: Keep in mind that you need to restart the script if you want to run a new version


Installation: SystemD
---------------------

To install the script for systemd run::

    sudo make install-systemd

Then edit the config in **/etc/owncloud/news/updater.ini** with your details and run::

    owncloud-news-updater -c /etc/owncloud/news/updater.ini

to test your settings. If everything worked out fine, enable the systemd unit with::

    sudo systemctl enable owncloud-news-updater.service
    sudo systemctl start owncloud-news-updater.service

If you make changes to the **updater.ini** file don't forget to reload the service with::

    sudo systemctl restart owncloud-news-updater.service


Installation: SysVinit
----------------------

.. note:: Debian 7 (wheezy) is the only supported Linux distribution for SysVinit and support will be dropped once Debian 8.1 is released

To install the script for SysVinit run::

    sudo make install-sysvinit

Then edit the config in **/etc/owncloud/news/updater.ini** with your details and run::

    owncloud-news-updater -c /etc/owncloud/news/updater.ini

to test your settings. If everything worked out fine, enable the init script with::

    sudo update-rc.d owncloud-news-updater defaults
    sudo /etc/init.d/owncloud-news-updater start

If you make changes to the **updater.ini** file don't forget to reload the service with::

    sudo /etc/init.d/owncloud-news-updater restart


Uninstallation
--------------

To uninstall the updater run::

    sudo make uninstall


Self signed certificates
------------------------

Should you use a self signed certificate over SSL, first consider getting a free valid cert signed by `StartSSL <http://startssl.com>`_. If you don't want to get a valid certificate, you need to add it to the installed certs::

    cat /path/to/your/cert/cacert.pem >> /usr/local/lib/python3.X/dist-packages/requests/cacert.pem

The directories might vary depending on your distribution and Python version.


Debugging
---------

If you are using JournalD which is included in SystemD you can read the error log using::

    journalctl -u owncloud-news-updater.service


Development
-----------

If you want to edit the python code and test it run::

    python3 -m owncloud_news -c /path/to/config.ini