--- /dev/null
+# Set default behavior
+* text=auto eol=lf
+
+# Ensure sources are processed
+*.conf text
+*.css text
+*.html text diff=html
+*.js text
+*.md text
+*.php text diff=php
+Dockerfile text
+
+# Do not alter images nor minified scripts
+*.ico binary
+*.jpg binary
+*.png binary
+*.min.css binary
+*.min.js binary
+
+# Exclude from Git archives
+.gitattributes export-ignore
+.gitignore export-ignore
+.travis.yml export-ignore
+composer.json export-ignore
+doc/**/*.json export-ignore
+doc/**/*.md export-ignore
+docker/ export-ignore
+Doxyfile export-ignore
+Makefile export-ignore
+phpunit.xml export-ignore
+tests/ export-ignore
* - private: Is this link private? 0=no, other value=yes
* - tags: tags attached to this entry (separated by spaces)
* - title Title of the link
- * - url URL of the link. Can be absolute or relative.
+ * - url URL of the link. Used for displayable links (no redirector, relative, etc.).
+ * Can be absolute or relative.
* Relative URLs are permalinks (e.g.'?m-ukcw')
+ * - real_url Absolute processed URL.
*
* Implements 3 interfaces:
* - ArrayAccess: behaves like an associative array;
--- /dev/null
+Allow from none
+Deny from all
--- /dev/null
+FROM debian:jessie
+MAINTAINER Shaarli Community
+
+RUN apt-get update \
+ && apt-get install -y \
+ nginx-light php5-fpm php5-gd supervisor \
+ git nano
+
+ADD https://getcomposer.org/composer.phar /usr/local/bin/composer
+RUN chmod 755 /usr/local/bin/composer
+
+COPY nginx.conf /etc/nginx/nginx.conf
+COPY supervised.conf /etc/supervisor/conf.d/supervised.conf
+RUN echo "<?php phpinfo(); ?>" > /var/www/index.php
+
+WORKDIR /var/www
+RUN rm -rf html \
+ && git clone https://github.com/shaarli/Shaarli.git shaarli \
+ && chown -R www-data:www-data .
+
+WORKDIR /var/www/shaarli
+RUN composer install
+
+VOLUME /var/www/shaarli/data
+
+EXPOSE 80
+
+CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]
--- /dev/null
+## shaarli:dev
+- [Debian 8 Jessie](https://hub.docker.com/_/debian/)
+- [PHP5-FPM](http://php-fpm.org/)
+- [Nginx](http://nginx.org/)
+- [Shaarli](https://github.com/shaarli/Shaarli)
+
+### Development tools
+- [composer](https://getcomposer.org/)
+- [git](http://git-scm.com/)
+- [nano](http://www.nano-editor.org/)
--- /dev/null
+user www-data www-data;
+daemon off;
+worker_processes 4;
+
+events {
+ worker_connections 768;
+}
+
+http {
+ include mime.types;
+ default_type application/octet-stream;
+ keepalive_timeout 20;
+
+ index index.html index.php;
+
+ server {
+ listen 80;
+ root /var/www/shaarli;
+
+ access_log /var/log/nginx/shaarli.access.log;
+ error_log /var/log/nginx/shaarli.error.log;
+
+ location /phpinfo/ {
+ # add a PHP info page for convenience
+ fastcgi_pass unix:/var/run/php5-fpm.sock;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/index.php;
+ include fastcgi_params;
+ }
+
+ location ~ /\. {
+ # deny access to dotfiles
+ access_log off;
+ log_not_found off;
+ deny all;
+ }
+
+ location ~ ~$ {
+ # deny access to temp editor files, e.g. "script.php~"
+ access_log off;
+ log_not_found off;
+ deny all;
+ }
+
+ location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
+ # cache static assets
+ expires max;
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ location ~ (index)\.php$ {
+ # filter and proxy PHP requests to PHP-FPM
+ fastcgi_pass unix:/var/run/php5-fpm.sock;
+ fastcgi_index index.php;
+ include fastcgi.conf;
+ }
+
+ location ~ \.php$ {
+ # deny access to all other PHP scripts
+ deny all;
+ }
+ }
+}
--- /dev/null
+[program:php5-fpm]
+command=/usr/sbin/php5-fpm -F
+priority=5
+autostart=true
+autorestart=true
+
+[program:nginx]
+command=/usr/sbin/nginx
+priority=10
+autostart=true
+autorestart=true
+stdout_events_enabled=true
+stderr_events_enabled=true
--- /dev/null
+FROM debian:jessie
+MAINTAINER Shaarli Community
+
+RUN apt-get update \
+ && apt-get install -y curl nginx-light php5-fpm php5-gd supervisor
+
+COPY nginx.conf /etc/nginx/nginx.conf
+COPY supervised.conf /etc/supervisor/conf.d/supervised.conf
+
+WORKDIR /var/www
+RUN rm -rf html \
+ && curl -L https://github.com/shaarli/Shaarli/archive/master.tar.gz | tar xvzf - \
+ && mv Shaarli-master shaarli \
+ && chown -R www-data:www-data shaarli
+
+VOLUME /var/www/shaarli/data
+
+EXPOSE 80
+
+CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]
--- /dev/null
+## shaarli:latest
+- [Debian 8 Jessie](https://hub.docker.com/_/debian/)
+- [PHP5-FPM](http://php-fpm.org/)
+- [Nginx](http://nginx.org/)
+- [Shaarli](https://github.com/shaarli/Shaarli)
--- /dev/null
+user www-data www-data;
+daemon off;
+worker_processes 4;
+
+events {
+ worker_connections 768;
+}
+
+http {
+ include mime.types;
+ default_type application/octet-stream;
+ keepalive_timeout 20;
+
+ index index.html index.php;
+
+ server {
+ listen 80;
+ root /var/www/shaarli;
+
+ access_log /var/log/nginx/shaarli.access.log;
+ error_log /var/log/nginx/shaarli.error.log;
+
+ location ~ /\. {
+ # deny access to dotfiles
+ access_log off;
+ log_not_found off;
+ deny all;
+ }
+
+ location ~ ~$ {
+ # deny access to temp editor files, e.g. "script.php~"
+ access_log off;
+ log_not_found off;
+ deny all;
+ }
+
+ location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
+ # cache static assets
+ expires max;
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ location ~ (index)\.php$ {
+ # filter and proxy PHP requests to PHP-FPM
+ fastcgi_pass unix:/var/run/php5-fpm.sock;
+ fastcgi_index index.php;
+ include fastcgi.conf;
+ }
+
+ location ~ \.php$ {
+ # deny access to all other PHP scripts
+ deny all;
+ }
+ }
+}
--- /dev/null
+FROM debian:jessie
+MAINTAINER Shaarli Community
+
+RUN apt-get update \
+ && apt-get install -y curl nginx-light php5-fpm php5-gd supervisor
+
+COPY nginx.conf /etc/nginx/nginx.conf
+COPY supervised.conf /etc/supervisor/conf.d/supervised.conf
+
+WORKDIR /var/www
+RUN rm -rf html \
+ && curl -L https://github.com/shaarli/Shaarli/archive/stable.tar.gz | tar xvzf - \
+ && mv Shaarli-stable shaarli \
+ && chown -R www-data:www-data shaarli
+
+VOLUME /var/www/shaarli/data
+
+EXPOSE 80
+
+CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]
--- /dev/null
+## shaarli:stable
+- [Debian 8 Jessie](https://hub.docker.com/_/debian/)
+- [PHP5-FPM](http://php-fpm.org/)
+- [Nginx](http://nginx.org/)
+- [Shaarli (stable)](https://github.com/shaarli/Shaarli/tree/stable)
--- /dev/null
+user www-data www-data;
+daemon off;
+worker_processes 4;
+
+events {
+ worker_connections 768;
+}
+
+http {
+ include mime.types;
+ default_type application/octet-stream;
+ keepalive_timeout 20;
+
+ index index.html index.php;
+
+ server {
+ listen 80;
+ root /var/www/shaarli;
+
+ access_log /var/log/nginx/shaarli.access.log;
+ error_log /var/log/nginx/shaarli.error.log;
+
+ location ~ /\. {
+ # deny access to dotfiles
+ access_log off;
+ log_not_found off;
+ deny all;
+ }
+
+ location ~ ~$ {
+ # deny access to temp editor files, e.g. "script.php~"
+ access_log off;
+ log_not_found off;
+ deny all;
+ }
+
+ location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
+ # cache static assets
+ expires max;
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ location ~ (index)\.php$ {
+ # filter and proxy PHP requests to PHP-FPM
+ fastcgi_pass unix:/var/run/php5-fpm.sock;
+ fastcgi_index index.php;
+ include fastcgi.conf;
+ }
+
+ location ~ \.php$ {
+ # deny access to all other PHP scripts
+ deny all;
+ }
+ }
+}
--- /dev/null
+[program:php5-fpm]
+command=/usr/sbin/php5-fpm -F
+priority=5
+autostart=true
+autorestart=true
+
+[program:nginx]
+command=/usr/sbin/nginx
+priority=10
+autostart=true
+autorestart=true
+stdout_events_enabled=true
+stderr_events_enabled=true
--- /dev/null
+[program:php5-fpm]
+command=/usr/sbin/php5-fpm -F
+priority=5
+autostart=true
+autorestart=true
+
+[program:nginx]
+command=/usr/sbin/nginx
+priority=10
+autostart=true
+autorestart=true
+stdout_events_enabled=true
+stderr_events_enabled=true
background: #ffffff;
}
-div#permalinkQrcode {
- padding: 20px;
- width: 220px;
- height: 220px;
- background-color: #ffffff;
- border: 1px solid black;
- position: absolute;
- top: -100px;
- left: -100px;
- text-align: center;
- font-size: 8pt;
- z-index: 50;
- -webkit-box-shadow: 2px 2px 20px 2px #333333;
- -moz-box-shadow: 2px 2px 20px 2px #333333;
- -o-box-shadow: 2px 2px 20px 2px #333333;
- -ms-box-shadow: 2px 2px 20px 2px #333333;
- box-shadow: 2px 2px 20px 2px #333333;
-}
-
div.daily {
font-family: Georgia, 'DejaVu Serif', Norasi, serif;
background-color: #E6D6BE;
<?php
/**
- * Shaarli v0.6.1 - Shaare your links...
+ * Shaarli v0.6.2 - Shaare your links...
*
* The personal, minimalist, super-fast, no-database Delicious clone.
*
/*
* PHP configuration
*/
-define('shaarli_version', '0.6.1');
+define('shaarli_version', '0.6.2');
// http://server.com/x/shaarli --> /shaarli/
define('WEB_PATH', substr($_SERVER["REQUEST_URI"], 0, 1+strrpos($_SERVER["REQUEST_URI"], '/', 0)));
--- /dev/null
+.linkqrcode {
+ display: inline;
+ position: relative;
+}
+
+#permalinkQrcode {
+ position: absolute;
+ z-index: 200;
+ padding: 20px;
+ width: 220px;
+ height: 220px;
+ background-color: #ffffff;
+ border: 1px solid black;
+ top: -110px;
+ left: -110px;
+ text-align: center;
+ font-size: 8pt;
+ box-shadow: 2px 2px 20px 2px #333333;
+}
+
+#permalinkQrcode img {
+ margin-bottom: 5px;
+}
-<a href="http://qrfree.kaywa.com/?l=1&s=8&d=%s" onclick="showQrCode(this); return false;" class="qrcode" data-permalink="%s">
- <img src="%s/qrcode/qrcode.png" width="13" height="13" title="QR-Code">
-</a>
+<div class="linkqrcode">
+ <a href="http://qrfree.kaywa.com/?l=1&s=8&d=%s" onclick="showQrCode(this); return false;" class="qrcode" data-permalink="%s">
+ <img src="%s/qrcode/qrcode.png" width="13" height="13" title="QR-Code">
+ </a>
+</div>
$qrcode_html = file_get_contents(PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.html');
foreach ($data['links'] as &$value) {
- $qrcode = sprintf($qrcode_html, $value['real_url'], $value['real_url'], PluginManager::$PLUGINS_PATH);
+ $qrcode = sprintf($qrcode_html,
+ urlencode($value['url']),
+ $value['url'],
+ PluginManager::$PLUGINS_PATH
+ );
$value['link_plugin'][] = $qrcode;
}
return $data;
}
+
+/**
+ * When linklist is displayed, include qrcode CSS file.
+ *
+ * @param array $data - header data.
+ *
+ * @return mixed - header data with qrcode CSS file added.
+ */
+function hook_qrcode_render_includes($data)
+{
+ if ($data['_PAGE_'] == Router::$PAGE_LINKLIST) {
+ $data['css_files'][] = PluginManager::$PLUGINS_PATH . '/qrcode/qrcode.css';
+ }
+
+ return $data;
+}
// Build the div which contains the QR-Code:
var element = document.createElement('div');
- element.id="permalinkQrcode";
+ element.id = 'permalinkQrcode';
// Make QR-Code div commit sepuku when clicked:
if ( element.attachEvent ){
element.appendChild(image);
element.innerHTML += "<br>Click to close";
caller.parentNode.appendChild(element);
+
+ // Show the QRCode
+ qrcodeImage = document.getElementById('permalinkQrcode');
+ // Workaround to deal with newly created element lag for transition.
+ window.getComputedStyle(qrcodeImage).opacity;
+ qrcodeImage.className = 'show';
}
else
{
// Remove any displayed QR-Code
function removeQrcode()
{
- var elem = document.getElementById("permalinkQrcode");
+ var elem = document.getElementById('permalinkQrcode');
if (elem) {
elem.parentNode.removeChild(elem);
}
-<?php /* 0.6.1 */ ?>
+<?php /* 0.6.2 */ ?>
'title' => $str,
'links' => array(
array(
- 'real_url' => $str,
+ 'url' => $str,
)
)
);
$link = $data['links'][0];
// data shouldn't be altered
$this->assertEquals($str, $data['title']);
- $this->assertEquals($str, $link['real_url']);
+ $this->assertEquals($str, $link['url']);
// plugin data
$this->assertEquals(1, count($link['link_plugin']));