diff --git a/README.md b/README.md index 271d4e7..a33aabd 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,12 @@ :aerial_tramway: A modern, minimalist, and lightweight URL shortener. -[![GitHub license](https://img.shields.io/badge/license-GPLv2%2B-blue.svg)]() +[![GitHub license](https://img.shields.io/badge/license-GPLv2%2B-blue.svg)]() +[![GitHub release](https://img.shields.io/github/release/cydrobolt/polr.svg)](https://github.com/cydrobolt/polr/releases) [![Builds status](https://travis-ci.org/cydrobolt/polr.svg)](https://travis-ci.org/cydrobolt/polr) [![Docs](https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat)](http://polr.readthedocs.org/en/latest/) + Polr is an intrepid, self-hostable open-source link shortening web application with a robust API. It allows you to host your own URL shortener, to brand your URLs, and to gain control over your data. Polr is especially easy to use, and provides a modern, themable feel. [Getting Started](http://docs.polr.me/en/latest/user-guide/installation/) - [API Documentation](http://docs.polr.me/en/latest/developer-guide/api/) - [Contributing](https://github.com/cydrobolt/polr/blob/master/.github/CONTRIBUTING.md) - [Bugs](https://github.com/cydrobolt/polr/issues) - [IRC](http://webchat.freenode.net/?channels=#polr) diff --git a/app/Http/Controllers/Api/ApiLinkController.php b/app/Http/Controllers/Api/ApiLinkController.php index e6449b1..78ca6ac 100644 --- a/app/Http/Controllers/Api/ApiLinkController.php +++ b/app/Http/Controllers/Api/ApiLinkController.php @@ -43,7 +43,7 @@ class ApiLinkController extends ApiController { $user = self::getApiUserInfo($request); // Validate URL form data - $validator = \Validator::make($request, [ + $validator = \Validator::make($request->all(), [ 'url_ending' => 'required|alpha_dash' ]); diff --git a/composer.lock b/composer.lock index 8cd14bb..232733f 100644 --- a/composer.lock +++ b/composer.lock @@ -400,16 +400,16 @@ }, { "name": "doctrine/dbal", - "version": "v2.5.10", + "version": "v2.5.11", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "fc376f7a61498e18520cd6fa083752a4ca08072b" + "reference": "1b1effbddbdc0f40d1c8f849f44bcddac4f52a48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/fc376f7a61498e18520cd6fa083752a4ca08072b", - "reference": "fc376f7a61498e18520cd6fa083752a4ca08072b", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/1b1effbddbdc0f40d1c8f849f44bcddac4f52a48", + "reference": "1b1effbddbdc0f40d1c8f849f44bcddac4f52a48", "shasum": "" }, "require": { @@ -467,7 +467,7 @@ "persistence", "queryobject" ], - "time": "2017-01-23T23:17:10+00:00" + "time": "2017-02-04T21:20:13+00:00" }, { "name": "doctrine/inflector", diff --git a/database/migrations/2017_02_08_003907_alter_link_clicks_to_integer.php b/database/migrations/2017_02_08_003907_alter_link_clicks_to_integer.php new file mode 100644 index 0000000..9879d67 --- /dev/null +++ b/database/migrations/2017_02_08_003907_alter_link_clicks_to_integer.php @@ -0,0 +1,35 @@ +integer('clicks')->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('links', function (Blueprint $table) + { + $table->string('clicks')->change(); + }); + } +} diff --git a/docs/css/base.css b/docs/css/base.css index 2a21eda..f239325 100644 --- a/docs/css/base.css +++ b/docs/css/base.css @@ -1,3 +1,9 @@ h1, h2, h3, h4, h5, h6 { text-transform: none !important; } + +img { + /* Force auto height & width to prevent deformed images on mobile */ + width: auto !important; + height: auto !important; +} diff --git a/docs/developer-guide/api.md b/docs/developer-guide/api.md index a89e7d4..ccad048 100644 --- a/docs/developer-guide/api.md +++ b/docs/developer-guide/api.md @@ -94,7 +94,7 @@ Arguments: Remember that the `url` argument must be URL encoded. -Example: GET `http://example.com/api/v2/action/lookup?key=API_KEY_HERE&ending=2` +Example: GET `http://example.com/api/v2/action/lookup?key=API_KEY_HERE&url_ending=2` Response: ``` { diff --git a/docs/index.md b/docs/index.md index 80a0203..e23b6ea 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ ![Polr Logo](logo.png) [![GitHub license](https://img.shields.io/badge/license-GPLv2%2B-blue.svg)](about/license) -[![GitHub release](https://img.shields.io/badge/stable-2.1.1-green.svg)](https://github.com/cydrobolt/polr/releases) +[![GitHub release](https://img.shields.io/github/release/cydrobolt/polr.svg)](https://github.com/cydrobolt/polr/releases) Polr is a beautiful, modern, lightweight, and minimalist open-source URL shortening application. It allows you to host your own URL shortener, to brand your URLs, and to gain control over your data. Polr is especially easy to use, and provides a modern, themable interface. diff --git a/docs/user-guide/upgrading.md b/docs/user-guide/upgrading.md new file mode 100644 index 0000000..e55f288 --- /dev/null +++ b/docs/user-guide/upgrading.md @@ -0,0 +1,14 @@ +# Upgrading Polr +----------------- +To upgrade your Polr instance to the latest `master` or to a new release, you must back up your database and files before proceeding to avoid data loss. + +## Upgrading from 2.x: + +- Back up your database and files +- Update your files by using `git pull` or downloading a release +- Run `composer install --no-dev -o` to ensure dependencies are up to date +- Migrate database with `php artisan migrate` to ensure database structure is up to date + +## Upgrading from 1.x: + +There are breaking changes between 2.x and 1.x; it is not yet possible to automatically upgrade to 2.x. diff --git a/mkdocs.yml b/mkdocs.yml index dba877f..81f9b7a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -3,6 +3,7 @@ pages: - Home: index.md - User Guide: - 'Installation': 'user-guide/installation.md' + - 'Upgrading': 'user-guide/upgrading.md' - 'Troubleshooting': 'user-guide/troubleshooting.md' - Developer Guide: - 'Libraries': 'developer-guide/libraries.md' diff --git a/public/fonts/glyphicons-halflings-regular.eot b/public/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 0000000..b93a495 Binary files /dev/null and b/public/fonts/glyphicons-halflings-regular.eot differ diff --git a/public/fonts/glyphicons-halflings-regular.svg b/public/fonts/glyphicons-halflings-regular.svg new file mode 100644 index 0000000..94fb549 --- /dev/null +++ b/public/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/fonts/glyphicons-halflings-regular.ttf b/public/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 0000000..1413fc6 Binary files /dev/null and b/public/fonts/glyphicons-halflings-regular.ttf differ diff --git a/public/fonts/glyphicons-halflings-regular.woff b/public/fonts/glyphicons-halflings-regular.woff new file mode 100644 index 0000000..9e61285 Binary files /dev/null and b/public/fonts/glyphicons-halflings-regular.woff differ diff --git a/public/fonts/glyphicons-halflings-regular.woff2 b/public/fonts/glyphicons-halflings-regular.woff2 new file mode 100644 index 0000000..64539b5 Binary files /dev/null and b/public/fonts/glyphicons-halflings-regular.woff2 differ diff --git a/util/version.py b/util/version.py index 9ee8f1c..612e711 100644 --- a/util/version.py +++ b/util/version.py @@ -1,8 +1,11 @@ import re, datetime, string, random -print "New version name (e.g 2.0.0):" +print "> New version name (e.g 2.0.0):" new_version = raw_input() +print "> Is this a stable release? [y, n]" +is_stable = raw_input() + with open('.env.setup', 'r+') as setup_env: setup_env_lines = setup_env.read() now = datetime.datetime.now() @@ -12,7 +15,7 @@ with open('.env.setup', 'r+') as setup_env: # Update setup key setup_env_lines = re.sub(r'(?is)APP_KEY=[^\n]+', 'APP_KEY={}'.format(new_setup_key), setup_env_lines) # Update date and release in setup env - setup_env_lines = re.sub(r'(?is)VERSION=[0-9a-zA-Z\.]+', 'VERSION={}'.format(new_version), setup_env_lines) + setup_env_lines = re.sub(r'cVERSION=[0-9a-zA-Z\.]+', 'VERSION={}'.format(new_version), setup_env_lines) setup_env_lines = re.sub(r'(?is)VERSION_RELMONTH=\w+', 'VERSION_RELMONTH={}'.format(now.strftime('%B')), setup_env_lines) setup_env_lines = re.sub(r'(?is)VERSION_RELDAY=\w+', 'VERSION_RELDAY={}'.format(now.day), setup_env_lines) setup_env_lines = re.sub(r'(?is)VERSION_RELYEAR=\w+', 'VERSION_RELYEAR={}'.format(now.year), setup_env_lines)