1
0
mirror of https://github.com/cottow/6paster.git synced 2024-05-19 06:50:10 +00:00

Make the server_name configurable with a sane default

This commit is contained in:
Joan
2012-11-14 15:23:36 +01:00
parent b27c6fef9a
commit f1ba92eb8f
3 changed files with 8 additions and 1 deletions

View File

@ -14,4 +14,5 @@ $config['ttl_max'] = 3600*24*30; // maximum ttl is 30 days
$config['paste_max_chars'] = 1024*300; // size limit in characters
$config['server_name'] = 'https://p.6core.net/'; // server url

View File

@ -18,6 +18,6 @@
<input value="Save" type="submit"/>
<div class="text">
Hint: put the following oneliner in your .bashrc to use "6p &lt;file&gt;" or "echo hi | 6p" (thanks, Habbie and Reinhart):<br><br>
<code>6p() { curl -s -F "content=<${1--}" -F ttl=604800 -w "%{redirect_url}\n" -o /dev/null https://p.6core.net/; }</code>
<code>6p() { curl -s -F "content=<${1--}" -F ttl=604800 -w "%{redirect_url}\n" -o /dev/null <?=$config['server_name']?> }</code>
</div>
</form>

View File

@ -69,6 +69,12 @@ function check_setup()
die('You should allow less pastes per hour than per day, silly');
}
//
if( empty($config['server_name']) )
{
$config['server_name'] = 'https://p.6core.net';
}
// htaccess installed?
if( !file_exists('.htaccess'))
{