Move to nginx, fixing #43

This commit is contained in:
Kai Hendry
2014-06-02 17:01:26 +00:00
parent 7de61743e9
commit b29c51dee6
5 changed files with 33 additions and 16 deletions

4
.gitignore vendored
View File

@@ -1,4 +0,0 @@
u/*
active-users.txt
version.txt
secret.php

View File

@@ -10,7 +10,7 @@
# Known limitations # Known limitations
* API only allows 3200 tweets to be downloaded this way :( * API only allows 3200 tweets to be downloaded this way at one time :(
* 300 API limit using a [Application only Auth](https://dev.twitter.com/docs/auth/application-only-auth) bearer token (which doesn't seem to expire...) * 300 API limit using a [Application only Auth](https://dev.twitter.com/docs/auth/application-only-auth) bearer token (which doesn't seem to expire...)
* Won't work on protected accounts (duh!) * Won't work on protected accounts (duh!)
* No @mentions or DMs from other accounts * No @mentions or DMs from other accounts
@@ -48,3 +48,25 @@ Save that SECRETEXAMPLESTRING to secret.php:
<?php <?php
$bearer_token = 'SECRETEXAMPLESTRING'; $bearer_token = 'SECRETEXAMPLESTRING';
?> ?>
# nginx configuration
server {
server_name greptweet.com;
root /srv/www/greptweet.com;
charset utf-8;
access_log /var/log/nginx/greptweet.access.log;
error_log /var/log/nginx/greptweet.error.log;
location / {
index index.php index.html;
rewrite ^/f/(.*)$ /create.php?id=$1 last;
}
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
}

View File

@@ -1,5 +1,4 @@
<?php <?php
apache_setenv('no-gzip', '1');
$HTTP_HOST = $_SERVER['SERVER_NAME']; $HTTP_HOST = $_SERVER['SERVER_NAME'];
$id = strtolower($_GET["id"]); $id = strtolower($_GET["id"]);

View File

@@ -15,12 +15,13 @@
<div class="container"> <div class="container">
<div class="content"> <div class="content">
<div class="page-header"> <div class="page-header">
<h1><a href="http://twitter.com/greptweet">@Greptweet</a> <small>you can search your tweets</small></h1> <h1><a href="http://twitter.com/greptweet">@Greptweet</a> <small>you can search your tweets</small></h1>
</div> </div>
<form name="f" action="create.cgi" method="get"> <form name="f" action="create.php" method="get">
<div class="well"> <div class="well">
@@ -42,12 +43,11 @@
</form> </form>
<footer> <footer>
<p>Super-geeks please <a href="https://github.com/kaihendry/Greptweet">report issues and contribute on Github</a> :)</p> <p>Please <a href="https://github.com/kaihendry/Greptweet">report issues and contribute on Github</a> :)</p>
<p>Active accounts: <!--#include virtual="active-users.txt" --> <a href=http://stats.webconverger.org/gb.webconverger.com/greptweet/google.html>Graph</a></p> <p><span class="label-danger label">Move to nginx</span> To fix <a href="https://github.com/kaihendry/greptweet/issues/43">#43</a>, I have moved greptweet to a new ext4 based server running nginx. When creating a new account, nginx will timeout on long running processes. The fetch should still work, but we need to refactor the UX.</p>
<p>Version: <a href=https://github.com/kaihendry/Greptweet/commit/<!--#include virtual="version.txt" -->> <p>Version: <a href=https://github.com/kaihendry/Greptweet/commit/<?php include("version.txt"); ?>>
<!--#include virtual="version.txt" --> <?php include("version.txt"); ?>
</a></p> </a></p>
<p>Backup: <code>rsync -rz --include "*/" --include "*.txt" --exclude "*" greptweet.com::greptweet .</code></p>
</footer> </footer>
</div> </div>

8
jquery.js vendored

File diff suppressed because one or more lines are too long