Skip to content

Commit

Permalink
Merge pull request #170 from Kovah/dev
Browse files Browse the repository at this point in the history
v0.0.44
  • Loading branch information
Kovah committed Nov 20, 2020
2 parents 5118801 + 2c05088 commit fb30d09
Show file tree
Hide file tree
Showing 116 changed files with 2,267 additions and 1,363 deletions.
4 changes: 2 additions & 2 deletions .env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ SESSION_LIFETIME=10080
## Backup configuration
# Enable backups here
BACKUP_ENABLED=false
# Choose the destination of the backup. If you set up AWS S3 credentials below you may choose 'cloud' which is used
# Choose the destination of the backup. If you set up AWS S3 credentials below you may choose 's3' which is used
# as a synonym for AWS. Leave blank or set to 'local' if you want to store backups within /storage/app/backups.
BACKUP_DISK=cloud
BACKUP_DISK=s3
# Set to false if you do not want to be notified about successful or broken backups
BACKUP_NOTIFICATIONS=true
# The notification email may be used to get backup notifications
Expand Down
4 changes: 2 additions & 2 deletions .env.docker.production
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ SESSION_LIFETIME=10080
## Backup configuration
# Enable backups here
BACKUP_ENABLED=false
# Choose the destination of the backup. If you set up AWS S3 credentials below you may choose 'cloud' which is used
# Choose the destination of the backup. If you set up AWS S3 credentials below you may choose 's3' which is used
# as a synonym for AWS. Leave blank or set to 'local' if you want to store backups within /storage/app/backups.
BACKUP_DISK=cloud
BACKUP_DISK=s3
# Set to false if you do not want to be notified about successful or broken backups
BACKUP_NOTIFICATIONS=true
# The notification email may be used to get backup notifications
Expand Down
9 changes: 7 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@ A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
**LinkAce setup (please complete the following information):**
- Version: [e.g. 0.0.43]
- Installed via: [e.g. PHP, Docker]
- OS: [e.g. Ubuntu, CentOS]

**Desktop (please complete the following information if applicable):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
**Smartphone (please complete the following information if applicable):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea for this project
title: ''
labels: New Feature
labels: Enhancement
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
node-version: ['12.x', '14.x']

name: Test asset generation process on Node ${{ matrix.node-version }}

Expand Down
61 changes: 25 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<p align="center">
<img src="./public/assets/img/linkace_logo_padded.png" title="Linkace">
<img src="https://www.linkace.org/images/linkace-social.jpg" title="Linkace">
</p>

<p>&nbsp;</p>

<p align="center"><b>Your selfhosted bookmark archive with a simple interface and advanced features.</b></p>
<p align="center"><b>:warning: This application is still in development! :warning:</b></p>
<p align="center"><b>Your self-hosted bookmark archive. Free and open source.</b></p>

<p align="center">
<a href="https://twitter.com/LinkAceApp"><img src="https://img.shields.io/badge/Twitter-@LinkAceApp-1da1f2" alt="Follow LinkAce on Twitter"></a>
<a href="https://community.linkace.org"><img src="https://img.shields.io/twitter/url?label=Community&logo=discourse&logoColor=44679f&style=social&url=https%3A%2F%2Fcommunity.linkace.org%2F" alt="Get support for LinkAce and chat about the project"></a>
<a href="https://twitter.com/LinkAceApp"><img src="https://img.shields.io/twitter/url?label=%40LinkAceApp&style=social&url=https%3A%2F%2Ftwitter.com%2FLinkAceApp" alt="Follow LinkAce on Twitter"></a>
<a href="https://hub.docker.com/r/linkace/linkace"><img src="https://img.shields.io/badge/Docker-linkace%2Flinkace-2596EC.svg" alt="Docker Repository"></a>
<a href="https://github.com/Kovah/LinkAce/releases"><img src="https://img.shields.io/github/v/release/kovah/linkace?include_prereleases&label=Latest%20Release" alt="Latest Release"></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/github/license/kovah/linkace.svg" alt="License"></a>
<a href="https://crowdin.com/project/linkace"><img src="https://img.shields.io/badge/Translations-Crowdin-2b303d" alt="Translations"></a>
</p>
<p>&nbsp;</p>

Expand All @@ -33,54 +32,46 @@

![Preview Screenshot](https://www.linkace.org/images/preview/linkace_dashboard.png)

LinkAce is a bookmark manager similar to Shaarli and other tools. I built this tool to have something that fits my
actual needs which other bookmark managers couldn't solve, even if most features are almost the same.
LinkAce is a bookmark manager similar to Shaarli and other tools. See this tool as a long-term archive for sites you want to remember, but don't access frequently. I built this tool to have something that fits my actual needs which other bookmark managers couldn't solve, even if some features look almost the same.

#### Features
#### Feature Highlights

* Save links with automatic title and description generation.
* Automated link checks to make sure your bookmarks stay available.
* Automated “backups” of your bookmarks via the Waybackmachine.
* Organize bookmarks in lists and tags.
* Automated link checks inform you when any links become unavailable or were moved.
* Automated “backups” of saved sites via the [Waybackmachine](https://web.archive.org/).
* Organize bookmarks with lists and tags.
* A full REST API offers access to all features of LinkAce from third-party apps and services.
* A bookmarklet to quickly save links from any browser.
* Private or public links, so friends or internet strangers can see your collection.
* Add notes to links to add thoughts or other information.
* Advanced search including different filters and ordering.
* Import existing bookmarks from HTML exports (other methods planned).
* Support for complete database and app backups to Amazon AWS S3.
* Links can be private or public, so friends or internet strangers may see your collection.
* Add notes to links to add thoughts or other relevant information.
* An advanced search including different filters and ordering.
* Import and export of bookmarks from HTML.
* Support for complete database and application backups to Amazon AWS S3.
* A built-in light and dark color scheme.

More features are already planned. Take a look at the [project board](https://github.com/Kovah/LinkAce/projects/1)
for more information.
More features are already planned. Take a look at the [project board](https://github.com/Kovah/LinkAce/projects/1) for more information.

#### Documentation and Community

Any further information about all the available features and how to install the app, can be found on the
[LinkAce Website](https://www.linkace.org/). Additionally, you may visit the [community forums](https://spectrum.chat/linkace/)
to share your ideas, talk with other users or find help for specific problems.
Any further information about all the available features and how to install the app, can be found on the [LinkAce Website](https://www.linkace.org/). Additionally, you may visit the [community forums](https://community.linkace.org/) to share your ideas, talk with other users or find help for specific problems.


---


### :bulb: Support for LinkAce

Free support is highly limited for all my free tools, including LinkAce. If you need help please visit the
[community forum](https://spectrum.chat/linkace/) and post your issue there. I do not offer free personal
support via chat or email.
Please notice that LinkAce has specific requirements to run correctly.
I built LinkAce to solve my problem, and I now offer my solution and code to your without charging anything. I spent a lot of my free time building this application already, so I won't offer any *free* personal support, customization or installation help. If you need help please visit the [community forum](https://community.linkace.org/) and post your issue there.

If you need prioritized support you can **become a [Patreon](https://www.patreon.com/Kovah)**
or **[Github Sponsor](https://github.com/sponsors/Kovah)**. :star:
You can get personal and dedicated support by **becoming a [Patreon](https://www.patreon.com/Kovah)** or **[Github Sponsor](https://github.com/sponsors/Kovah)**. :star:


---


### :gear: Setup

LinkAce provides multiple ways of installing it on your server. The complete documentation for all installation
methods can be found [**in the wiki**](https://www.linkace.org/docs/v1/setup/).
LinkAce provides multiple ways of installing it on your server. The complete documentation for all installation methods can be found [**in the wiki**](https://www.linkace.org/docs/v1/setup/).

* Setup with Docker (_recommended_)
* Simple setup with 1 Docker image
Expand All @@ -93,6 +84,8 @@ methods can be found [**in the wiki**](https://www.linkace.org/docs/v1/setup/).

### :construction: Contribution

[![Translations](https://img.shields.io/badge/Translations-Crowdin-2b303d)](https://crowdin.com/project/linkace) [![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/Kovah/LinkAce) ![Code Climate coverage](https://img.shields.io/codeclimate/coverage/Kovah/LinkAce)](https://codeclimate.com/github/Kovah/LinkAce) [![GitHub Build Status](https://img.shields.io/github/workflow/status/Kovah/LinkAce/Testing/dev?label=Dev%20Build)](https://github.com/Kovah/LinkAce/actions?query=workflow%3ATesting+branch%3Adev)

Please review the [**contribution guidelines**](CONTRIBUTING.md) before starting to work on any features.


Expand All @@ -105,9 +98,7 @@ Please review the [**contribution guidelines**](CONTRIBUTING.md) before starting

#### 1. Basic Setup

The following steps assume that you are using Docker for development, which I highly encourage. If you use
other ways to work with PHP projects you must adapt the commands to your system.
Clone the repository to your machine and run the following commands to start the Docker container system:
The following steps assume that you are using Docker for development, which I highly encourage. If you use other ways to work with PHP projects you must adapt the commands to your system. Clone the repository to your machine and run the following commands to start the Docker container system:

```bash
cp .env.docker .env
Expand All @@ -120,8 +111,7 @@ Now, install all dependencies from inside the PHP container:
docker exec linkace-php bash -c "composer install"
```

Last step: compile all assets. Node 10 LTS is the minimum version required and recommended to use.
You may use either NPM or Yarn for installing the asset dependencies.
Last step: compile all assets. Node 10 LTS is the minimum version required and recommended to use. You may use either NPM or Yarn for installing the asset dependencies.

```bash
npm install
Expand All @@ -133,8 +123,7 @@ npm run dev

#### 2. Working with the Artisan command line

I recommend using the Artisan command line tool in the PHP container only, to make sure that the same environment is
used. To do so, use the following example command:
I recommend using the Artisan command line tool in the PHP container only, to make sure that the same environment is used. To do so, use the following example command:

```bash
docker exec linkace-php bash -c "php artisan migrate"
Expand Down
41 changes: 41 additions & 0 deletions app/Actions/Fortify/CreateNewUser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace App\Actions\Fortify;

use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule;
use Laravel\Fortify\Contracts\CreatesNewUsers;

class CreateNewUser implements CreatesNewUsers
{
use PasswordValidationRules;

/**
* Validate and create a newly registered user.
*
* @param array $input
* @return \App\Models\User
*/
public function create(array $input)
{
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
'email' => [
'required',
'string',
'email',
'max:255',
Rule::unique(User::class),
],
'password' => $this->passwordRules(),
])->validate();

return User::create([
'name' => $input['name'],
'email' => $input['email'],
'password' => Hash::make($input['password']),
]);
}
}
18 changes: 18 additions & 0 deletions app/Actions/Fortify/PasswordValidationRules.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace App\Actions\Fortify;

use Laravel\Fortify\Rules\Password;

trait PasswordValidationRules
{
/**
* Get the validation rules used to validate passwords.
*
* @return array
*/
protected function passwordRules()
{
return ['required', 'string', new Password, 'confirmed'];
}
}
30 changes: 30 additions & 0 deletions app/Actions/Fortify/ResetUserPassword.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace App\Actions\Fortify;

use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Laravel\Fortify\Contracts\ResetsUserPasswords;

class ResetUserPassword implements ResetsUserPasswords
{
use PasswordValidationRules;

/**
* Validate and reset the user's forgotten password.
*
* @param mixed $user
* @param array $input
* @return void
*/
public function reset($user, array $input)
{
Validator::make($input, [
'password' => $this->passwordRules(),
])->validate();

$user->forceFill([
'password' => Hash::make($input['password']),
])->save();
}
}
35 changes: 35 additions & 0 deletions app/Actions/Fortify/UpdateUserPassword.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace App\Actions\Fortify;

use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Laravel\Fortify\Contracts\UpdatesUserPasswords;

class UpdateUserPassword implements UpdatesUserPasswords
{
use PasswordValidationRules;

/**
* Validate and update the user's password.
*
* @param mixed $user
* @param array $input
* @return void
*/
public function update($user, array $input)
{
Validator::make($input, [
'current_password' => ['required', 'string'],
'password' => $this->passwordRules(),
])->after(function ($validator) use ($user, $input) {
if (! Hash::check($input['current_password'], $user->password)) {
$validator->errors()->add('current_password', trans('settings.old_password_invalid'));
}
})->validateWithBag('updatePassword');

$user->forceFill([
'password' => Hash::make($input['password']),
])->save();
}
}
60 changes: 60 additions & 0 deletions app/Actions/Fortify/UpdateUserProfileInformation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php

namespace App\Actions\Fortify;

use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule;
use Laravel\Fortify\Contracts\UpdatesUserProfileInformation;

class UpdateUserProfileInformation implements UpdatesUserProfileInformation
{
/**
* Validate and update the given user's profile information.
*
* @param mixed $user
* @param array $input
* @return void
*/
public function update($user, array $input)
{
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],

'email' => [
'required',
'string',
'email',
'max:255',
Rule::unique('users')->ignore($user->id),
],
])->validateWithBag('updateProfileInformation');

if ($input['email'] !== $user->email && $user instanceof MustVerifyEmail) {
$this->updateVerifiedUser($user, $input);
} else {
$user->forceFill([
'name' => $input['name'],
'email' => $input['email'],
])->save();
}
}

/**
* Update the given verified user's profile information.
*
* @param mixed $user
* @param array $input
* @return void
*/
protected function updateVerifiedUser($user, array $input)
{
$user->forceFill([
'name' => $input['name'],
'email' => $input['email'],
'email_verified_at' => null,
])->save();

$user->sendEmailVerificationNotification();
}
}
2 changes: 1 addition & 1 deletion app/Console/Commands/CheckLinksCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected function checkLink(Link $link): void
$this->output->write('Checking link ' . $link->url . ' ');

try {
$response = Http::timeout(5)->get($link->url);
$response = Http::timeout(10)->get($link->url);
$statusCode = $response->status();
} catch (\Exception $e) {
// Set status code to null so the link will be marked as broken
Expand Down
Loading

0 comments on commit fb30d09

Please sign in to comment.