Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

Commit 65654ec

Browse files
authored
Merge pull request #6 from Westie/modern-rewrite
Modern rewrite
2 parents 5a4c114 + 7252460 commit 65654ec

405 files changed

Lines changed: 3707 additions & 89101 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.DS_Store
2+
app/configuration.php
3+
app/databases/phpuush.db
4+
app/uploads/
5+
app/vendor/

README.md

Lines changed: 20 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,82 +2,40 @@
22

33
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.
44

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.
66

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.
88

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?
1010

11-
# Oh. Okay. What do I do next?
11+
### Preamble
1212

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).
1414

15-
## Create the database
15+
There are three files and folders you'll need to find:
1616

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)
1820

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.
2022

21-
## More configuration
23+
Now you figure out where those files and folders are, you'll need to create a separate installation of phpuush.
2224

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.
2426

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.
3928

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!**
4130

42-
## Setting up webservers
31+
### Moving files to new homes
4332

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.
4534

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.
4736

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.
4938

50-
You just edit `%AppData%\puush\puush.ini` to resemble something like this:
39+
Then, you'll need to run `composer install`
5140

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

Comments
 (0)