|
2 | 2 |
|
3 | 3 | So, you're probably confused as to what this is. Well, it's a proxy for puush. The developers for puush decided to be all stupid and refused to implement useless features like SFTP and FTP. |
4 | 4 |
|
5 | | -So, my absolutely brilliant friend [jannispl](https://github.com/jannispl) decided to write a new [proxy](https://github.com/jannispl/puushproxy) for puush in node.js. This, as far as we know, was the first alternative implementation of puush. |
| 5 | +So, my absolutely brilliant friend [@jannispl](https://github.com/jannispl) decided to write a new [proxy](https://github.com/jannispl/puushproxy) for puush in node.js. This, as far as we know, was the first alternative implementation of puush. |
6 | 6 |
|
7 | | -However, I wanted to experiment in the joys that is hiphop-php. So, I made this! It was designed on Apache, tested on nginx and compiled with hiphop-php. |
| 7 | +Almost half a decade on, I thought I would improve it to make it better. |
8 | 8 |
|
9 | | -I think I'm one of the only people in the world apart from Facebook using hiphop-php in a product environment, as it may seem. |
| 9 | +## How do I migrate to the new version? |
10 | 10 |
|
11 | | -# Oh. Okay. What do I do next? |
| 11 | +### Preamble |
12 | 12 |
|
13 | | -Well, many things. You could pick your nose and eat it - or you could follow some installation cues and get the damned thing working. |
| 13 | +Firstly, [install composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos). |
14 | 14 |
|
15 | | -## Create the database |
| 15 | +There are three files and folders you'll need to find: |
16 | 16 |
|
17 | | -At the moment, only SQLite is supported, however it's my intention to add mySQL and/or another (no)SQL to make those hipsters all happy and shit. |
| 17 | +- `configuration.php` |
| 18 | +- `databases/phpuush.db` (or whatever your database file is) |
| 19 | +- `uploads/` (or whatever your upload folder is) |
18 | 20 |
|
19 | | -Go into the `databases/` directory and **copy** `phpuush.db-dist` to something like `phpuush.db` or something. |
| 21 | +You can either copy or move - but make sure that you have a backup of this stuff first. |
20 | 22 |
|
21 | | -## More configuration |
| 23 | +Now you figure out where those files and folders are, you'll need to create a separate installation of phpuush. |
22 | 24 |
|
23 | | -Here's a sample `configuration.php` file: |
| 25 | +If you are lazy like me, and want everything in one folder so when you're developing whilst drunk you can simply run `git pull` and things are magically fixed, just clone the repo using git. |
24 | 26 |
|
25 | | - $aGlobalConfiguration = array |
26 | | - ( |
27 | | - "databases" => array |
28 | | - ( |
29 | | - "sql" => __DIR__."/databases/phpuush.db", |
30 | | - "mime" => __DIR__."/databases/mime.types", |
31 | | - ), |
32 | | - |
33 | | - "files" => array |
34 | | - ( |
35 | | - "upload" => __DIR__."/uploads/", |
36 | | - "domain" => "http://your.domain.tld", |
37 | | - ), |
38 | | - ); |
| 27 | +If you are security conscious (like some of my friends) then you can download master as a compressed archive, extract it to somewhere, move certain folders around then edit the `APP_DIR` constant within `index.php` but you shouldn't even need to do this, if you properly re-configure everything. |
39 | 28 |
|
40 | | -You'll need to edit only two things, one being the SQLite DB file (look up!) and the other being the domain. The domain is obviously the one that you *have* to change. |
| 29 | +**Make backups!** |
41 | 30 |
|
42 | | -## Setting up webservers |
| 31 | +### Moving files to new homes |
43 | 32 |
|
44 | | -Oh, so you actually want this thing to be live, eh? Well, what you need to do is set up whatever webserver you have to either accept connections on another port that is not `80` or listen for `puush.me` - whatever floats your boat. There are a million ways to set it up. |
| 33 | +- `configuration.php` **must** be relocated to `app/configuration.php`. You may notice that the format of the configuration has changed - there is no need to change this as the configuration itself is backwards compatible. |
45 | 34 |
|
46 | | -I'll add examples when I can be bothered. |
| 35 | +- `databases/phpuush.db` can be located anywhere that PHP has write access, however for the purposes of this example, move it to `app/databases/phpuush-demo.db`. You need to update the `database.sql` property with the absolute path to this file within the config. |
47 | 36 |
|
48 | | -## Setting up your client on Windows - r85 |
| 37 | +- `uploads/` can be located anywhere that PHP has write access, however for the purposes of this example, move it to `app/uploads`. You need to update the `files.upload` property with the absolute path to this folder within the config. |
49 | 38 |
|
50 | | -You just edit `%AppData%\puush\puush.ini` to resemble something like this: |
| 39 | +Then, you'll need to run `composer install` |
51 | 40 |
|
52 | | - ProxyServer = someproxy |
53 | | - ProxyPort = someport |
54 | | - |
55 | | -And then restart puush. |
56 | | - |
57 | | -## Setting up your client on OS X - r62 |
58 | | - |
59 | | -Only attempt this if you're experienced with how to hexedit binaries and such. You will need to create a SSL certificate (self signed is fine) though. |
60 | | - |
61 | | -### Choosing the domain to point to |
62 | | - |
63 | | -Thankfully I managed to negate the need for a SSL certificate. This has just made the task from extremely hard to relatively easy. |
64 | | - |
65 | | -First thing you have to do is add this to the `/private/etc/hosts` file: |
66 | | - |
67 | | - <address> phpuushed |
68 | | - |
69 | | -Then, you replace your puush binary with the one in the repo. You can find this in |
70 | | -`setup/binaries/OS X/puush` - you need to replace the binary in |
71 | | -`puush.app/Contents/MacOS/puush` with the one on this repo. |
72 | | - |
73 | | -The only change is that I've changed `https://puush.me/` to `http://phpuushed/`. |
74 | | - |
75 | | -## Using the client |
76 | | - |
77 | | -You will need to register by going to: |
78 | | - |
79 | | -`http://someproxy:someport/page/register` |
80 | | - |
81 | | -Don't want to allow anyone else to register? Just rename `controllers/page/register.php` or whatever you want. |
82 | | - |
83 | | -Know of any improvements? Hit me! |
| 41 | +Please make sure that your phpuush.db file is not accessible to the outside world. The best thing to do is to make it so that *every* request to that folder is handled by `index.php`. If you can download your `phpuush.db` or `composer.json` through your browser you've configured it incorrectly. |
0 commit comments