f5df7cf6697ba6b836f6837819d033d8ffefde0f
[stouyapi.git] / README.rst
1 **************************
2 stouyapi - Static OUYA API
3 **************************
4
5 A static API for the OUYA gaming console that still lets you sign in
6 and install games, despite the OUYA server shutdown in 2019.
7
8
9 =====
10 Setup
11 =====
12
13 OUYA config change
14 ==================
15 - Mount via USB (Micro USB cable)
16 - Create file ``ouya_config.properties``
17 - Add::
18
19     OUYA_SERVER_URL=http://stouyapi.boo
20     OUYA_STATUS_SERVER_URL=http://stouyapi.boo/api/v1/status
21
22 The changes should take effect immediately.
23 If they do not, reboot the OUYA once.
24
25
26 OUYA setup
27 ==========
28
29 1. User registration: "Existing account"
30 2. Enter any username, leave password empty. Continue.
31 3. Skip credit card registration
32
33 The username will appear on your ouya main screen.
34
35
36 Apache setup
37 ============
38 Virtual host configuration::
39
40   Script PUT /empty-json.php
41   Script DELETE /api/v1/queued_downloads_delete.php
42
43   <Directory "/path/to/stouyapi/www">
44     AllowOverride All
45   </Directory>
46
47 ``mod_actions``, ``mod_expires`` and ``mod_php`` (or php-fpm) need to be enabled
48 for Apache 2.4.
49
50 The virtual host's document root needs to point to the ``www`` folder.
51
52
53 Test your Apache setup
54 ----------------------
55 ::
56
57    # check if normal API routes work
58    $ curl -I http://stouyapi.cwboo/api/firmware_builds
59    HTTP/1.1 200 OK
60    [...]
61
62    # check if rewritten API routes work
63    $ curl -I http://stouyapi.cwboo/api/v1/discover/discover
64    HTTP/1.1 200 OK
65    [...]
66
67    # check if PHP routes work
68    curl -I http://stouyapi.cwboo/api/v1/gamers/me
69    HTTP/1.1 200 OK
70    [...]
71
72
73 Building API data
74 =================
75 Download the OUYA game data repository from
76 https://github.com/ouya-saviors/ouya-game-data
77 and then generate the API files with it::
78
79     $ git clone https://github.com/ouya-saviors/ouya-game-data.git
80     $ ./bin/import-game-data.php ouya-game-data/folders
81
82
83 Building the web discover store
84 ===============================
85 After building the API files, generate the HTML::
86
87   $ ./bin/build-html.php
88
89
90 ===============
91 Push to my OUYA
92 ===============
93 stouyapi's HTML game detail page have a "Push to my OUYA" button that
94 allows anyone to tell his own OUYA to install that game.
95 It works without any user accounts, and is only based on IP addresses.
96
97 If your PC that you click the Push button on and your OUYA have the same
98 public IP address (IPv4 NAT), or the same IPv6 64bit prefix, then
99 the OUYA will install the game within 5 minutes.
100
101 It will also work if you run stouyapi inside your local network, because
102 all private IP addresses are mapped to a special "local" address.
103
104 You can inspect your own download queue by simply opening
105 ``/api/v1/queued_downloads`` in your browser.
106
107
108 ========
109 See also
110 ========
111
112 - https://gitlab.com/devirich/BrewyaOnOuya - alternative storefront
113 - https://archive.org/details/ouyalibrary - Archived OUYA games
114 - https://github.com/ouya-saviors/ouya-game-data/ - OUYA game data repository
115
116
117 ===========
118 Discoveries
119 ===========
120
121 - data/data/tv.ouya/cache/ion/
122
123   - image cache for main menu image
124
125 - Don't put a trailing slash into ``OUYA_SERVER_URL`` - it will make double slashes