Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2 Release #604

Draft
wants to merge 92 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
f9b07f8
Upgrade to PHP 8 as base dependency
Kovah May 2, 2022
eceee57
Various code formatting fixes and optimizations
Kovah May 2, 2022
433a319
Various code formatting fixes and optimizations
Kovah May 2, 2022
0fe8a19
Various code formatting fixes and optimizations
Kovah May 2, 2022
931859a
Squash migrations of v1
Kovah May 2, 2022
11d6e96
Refactor http request setup into single function
Kovah May 2, 2022
ecc4225
Move from venturecraft/revisionable to owen-it/laravel-auditing (#467)
Kovah Jun 9, 2022
b4d6a6d
Minor adjustments in Link model
Kovah Jun 9, 2022
ac13db9
Refactor implementation of link audits => preparation for other models
Kovah Jun 9, 2022
1808925
Add audit log to lists and tags (#467)
Kovah Jun 9, 2022
d67a04e
Add audit logs for settings (#467)
Kovah Jun 10, 2022
6c35874
Minor code cleanup
Kovah Jun 10, 2022
6960ddf
Add audit logs for users (#467)
Kovah Jun 10, 2022
dbccdeb
Refactor history entry components
Kovah Jun 10, 2022
92c179a
Merge branch 'main' into dev-v2
Kovah Jun 10, 2022
65298fe
Fix wrong merge
Kovah Jun 10, 2022
cce410e
Add migration of existing revisions (#467)
Kovah Jun 14, 2022
50a40e8
Add base for activity logs (#466)
Kovah Jun 21, 2022
1beecae
Lot of code quality updates and smaller corrections, removes deprecat…
Kovah Jun 21, 2022
4e3604a
Replace built-in settings with the Spatie settings package (#494)
Kovah Jun 22, 2022
59bf073
Add default settings for new users, update the setup, fix some smalle…
Kovah Jun 22, 2022
92188bc
Migrate link private status to visibility status (#165)
Kovah Jun 23, 2022
3535ca1
Migrate list private status to visibility status (#165)
Kovah Jun 23, 2022
ba46869
Disable line length warning for phpcs
Kovah Jun 23, 2022
dba872f
Migrate tag private status to visibility status (#165)
Kovah Jun 23, 2022
a92b513
Migrate note private status to visibility status (#165)
Kovah Jun 23, 2022
7ad1950
Add badge for models with visibility status, fix some issues with not…
Kovah Jun 24, 2022
22b7469
Update the settings for model visibility (#165)
Kovah Jun 24, 2022
87915d7
Adjust searching with visibility, add custom rule for the field (#165)
Kovah Jun 24, 2022
5aaf686
Optimize test handling, adjust PHP CS config
Kovah Jun 24, 2022
76f390d
Add new user roles and needed permissions (#165)
Kovah Jun 30, 2022
54a344d
WIP: Prepare user management with controller and basic view
Kovah Jun 30, 2022
3668524
Add warning to readme
Kovah Jun 30, 2022
78ee6ea
WIP: Add blocking and deleting of users
Kovah Jun 30, 2022
95cc1ba
WIP: Add user invitation system
Kovah Jul 1, 2022
2b80d9a
WIP: Add user registration with invitation
Kovah Jul 1, 2022
42a9867
WIP: Add user editing for admins, rename routes, update dependencies
Kovah Jul 1, 2022
575f824
WIP: Add internal user profiles, adjust some queries to display all l…
Kovah Jul 1, 2022
1c65c75
WIP: Update link controllers to reflect user permissions and visibility
Kovah Jul 13, 2022
d7a9e4d
Only allow ordering of entities by predefined columns and directions
Kovah Jul 13, 2022
6e29698
Only allow ordering of entities by predefined columns and directions
Kovah Jul 13, 2022
2365087
WIP: Update list controllers to reflect user permissions and visibility
Kovah Jul 13, 2022
9ccccb9
WIP: Update note controllers to reflect user permissions and visibility
Kovah Jul 13, 2022
0dc8411
WIP: Update tag controllers to reflect user permissions and visibility
Kovah Jul 13, 2022
e26417b
Optimize order validation inside controllers
Kovah Jul 13, 2022
17d1cda
Minor corrections for note api tests
Kovah Jul 13, 2022
e461d3c
Adjust tests to cover more cases
Kovah Jul 13, 2022
836ca15
Adjust tests and order validation in controllers
Kovah Jul 13, 2022
a158467
refactoring and deprecated code removal
Kovah Jul 19, 2022
682b0b7
WIP: Adjust handling of tags and lists while editing and creating links
Kovah Jul 19, 2022
f22d524
WIP: Adjust handling of tags and lists while editing and creating links
Kovah Jul 19, 2022
9bb2e7c
Last adjustments for tag and list handling
Kovah Jul 19, 2022
26ac19a
Minor style adjustments
Kovah Jul 19, 2022
cbebfa4
Add public user profiles (#165)
Kovah Jul 19, 2022
5298fd2
Add api token handling for users (#165)
Kovah Jul 19, 2022
8275fb4
Update dependencies
Kovah Jul 19, 2022
0039fd1
Adjust Docker configuration
Kovah Jul 19, 2022
2dd2810
Correct handling of the trash, fix feed authorization
Kovah Jul 20, 2022
d373077
Properly migrate existing API tokens, adjust register user command
Kovah Jul 20, 2022
8c9c006
Large code cleanup and formatting
Kovah Jul 20, 2022
121cf4b
Large code cleanup and formatting of controllers
Kovah Jul 20, 2022
b38bb3b
Large code cleanup and formatting of existing app code
Kovah Jul 20, 2022
b2705de
WIP: system-wide api tokens (#165)
Kovah Sep 29, 2022
c986d48
Merge branch 'dev' into dev-v2
Kovah Sep 29, 2022
5388ad5
Fix minor issues after merging dev into dev-v2
Kovah Sep 29, 2022
d951088
System api tokens: switch to clear model based authorization, fix lis…
Kovah Sep 29, 2022
89c62f2
Merge v1.11
Kovah Dec 15, 2022
28cfd9e
Merge v1.11.1
Kovah Jan 22, 2023
4611dee
Update dependencies
Kovah Jan 22, 2023
33c6216
Correct tests
Kovah Jan 22, 2023
8959fcf
Adjust actions steps
Kovah Sep 28, 2023
c084752
Merge branch 'main' into dev-v2
Kovah Sep 28, 2023
f0421b7
Update packages, fix merge issues and tests
Kovah Sep 28, 2023
0f0e266
Adjust api model authorization
Kovah Sep 28, 2023
3532889
Simplify test code
Kovah Sep 28, 2023
274eca2
Merge branch 'main' into dev-v2
Kovah Feb 6, 2024
5272399
Upgrade dependencies, correct files after v1 merge
Kovah Feb 6, 2024
e1571f1
Fix migration for tests
Kovah Feb 6, 2024
c68dd90
Simplify the LinkAce Docker setup (#502)
Kovah Feb 6, 2024
c191380
Add toggles for quick-switching the link display mode from pages (#553)
Kovah Feb 7, 2024
0b70d74
Enroll link view toggles across the application (#553)
Kovah Feb 8, 2024
e1bf8a2
Correct system and user settings, optimize inputs
Kovah Feb 8, 2024
3075255
Adjust views for links (#433 #437 #441 #553)
Kovah Feb 8, 2024
e785460
Add bulk editing for links, lists and tags (#26)
Kovah Feb 20, 2024
9ef62a4
Add condensed font for some view to save space (#553)
Kovah Feb 20, 2024
fb50468
Correct handling of link display setting, add missing translations
Kovah Feb 20, 2024
8d28930
Correct handling of audit logs
Kovah Feb 20, 2024
460a735
Add bulk edit for search (#26)
Kovah Feb 20, 2024
3262acd
Add port configuration for Caddy
Kovah Feb 20, 2024
8a240da
Merge branch 'main' into dev-v2
Kovah Feb 20, 2024
f930ec0
Add unique tag to imported links (#757)
Kovah Feb 22, 2024
fa73ba1
Optimize tests with time travelling between multiple actions within t…
Kovah Feb 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ _ide_*
/.git
/.idea
/.tmp
/database/*.sqlite
/storage/app/backups/*
/storage/debugbar/*
/storage/framework/cache/*
Expand Down
27 changes: 4 additions & 23 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Build regular LinkAce Docker image
name: Build the LinkAce Docker image

on:
push:
Expand All @@ -17,7 +17,6 @@ jobs:

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -28,7 +27,7 @@ jobs:
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Login to DockerHub
uses: docker/login-action@v3
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -40,32 +39,14 @@ jobs:
DOCKER_IMAGE=linkace/linkace
DOCKER_IMAGE_GITUHB=ghcr.io/kovah/linkace
VERSION=${GITHUB_REF#refs/tags/}
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:latest,${DOCKER_IMAGE_GITUHB}:${VERSION},${DOCKER_IMAGE_GITUHB}:latest"
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE_GITUHB}:${VERSION}"
echo "tags=${TAGS}" >> $GITHUB_OUTPUT

- name: Build and push advanced image
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./resources/docker/dockerfiles/release-multiplatform.Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ steps.prep.outputs.tags }}

- name: Prepare simple tags
id: prep-simple
run: |
DOCKER_IMAGE=linkace/linkace
DOCKER_IMAGE_GITHUB=ghcr.io/kovah/linkace
VERSION=${GITHUB_REF#refs/tags/}
TAGS="${DOCKER_IMAGE}:${VERSION}-php-nginx,${DOCKER_IMAGE}:php-nginx,${DOCKER_IMAGE}:${VERSION}-simple,${DOCKER_IMAGE}:simple,${DOCKER_IMAGE_GITHUB}:${VERSION}-php-nginx,${DOCKER_IMAGE_GITHUB}:php-nginx,${DOCKER_IMAGE_GITHUB}:${VERSION}-simple,${DOCKER_IMAGE_GITHUB}:simple"
echo "tags=${TAGS}" >> $GITHUB_OUTPUT

- name: Build and push simple image
uses: docker/build-push-action@v5
with:
context: .
file: ./resources/docker/dockerfiles/release-multiplatform-simple.Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ steps.prep-simple.outputs.tags }}
85 changes: 17 additions & 68 deletions .github/workflows/build-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,14 @@ on:
- main

jobs:

build-js:
name: Build assets for the package
build-package:
name: Build final dist package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Reconfigure Git to use HTTP authentication
run: >
git config --global url."https://github.com/".insteadOf
ssh://git@github.com/
- uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v2
with:
node-version: 20

Expand All @@ -28,35 +22,6 @@ jobs:
npm ci
npm run production

- name: Upload built assets
uses: actions/upload-artifact@v4
with:
name: assets
path: public/assets/dist

- name: Upload mix manifest
uses: actions/upload-artifact@v4
with:
name: mix-manifest
path: public/mix-manifest.json

build-package:
name: Build final dist package
runs-on: ubuntu-latest
needs: build-js
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: assets
path: public/assets/dist

- uses: actions/download-artifact@v4
with:
name: mix-manifest
path: public

- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
Expand All @@ -65,7 +30,7 @@ jobs:
- id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- uses: actions/cache@v4
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand All @@ -86,46 +51,30 @@ jobs:
- name: Remove .env file
run: rm .env

- uses: thedoctor0/zip-release@master
with:
filename: linkace.zip
exclusions: '*.git*'

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v3
with:
name: linkace-package
path: linkace.zip
path: |
.
!.git

build-package-docker:
name: Build final dist package for Docker setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v2

- name: Rename files
run: |
mv .env.docker.production .env
chmod 0666 .env
mv docker-compose.production-simple.yml docker-compose.yml

- uses: montudor/action-zip@v1
with:
args: zip -qq linkace-package-docker-simple.zip docker-compose.yml .env LICENSE.md README.md
mv docker-compose.production.yml docker-compose.yml

- uses: actions/upload-artifact@v4
with:
name: linkace-docker-simple
path: linkace-package-docker-simple.zip

- name: Rename files
run: mv docker-compose.production.yml docker-compose.yml

- uses: montudor/action-zip@v1
with:
args: zip -qq linkace-package-docker-advanced.zip docker-compose.yml .env nginx.conf nginx-ssl.conf LICENSE.md README.md

- uses: actions/upload-artifact@v4
with:
name: linkace-docker-advanced
path: linkace-package-docker-advanced.zip

name: linkace-docker
path: |
docker-compose.yml
.env
LICENSE.md
README.md
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:

test-js:
name: Test asset generation process on Node 18 LTS
name: Test asset generation process on Node
runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ docker exec -it linkace-php composer run test
The Base image for LinkAce contains several packages and PHP extensions needed by LinkAce. It shortens the build time of the release images. This step is not needed by any developer working on LinkAce and is just a documentation for maintainers.

```bash
docker buildx build --push --platform "linux/amd64,linux/arm64,linux/arm/v7" -t linkace/base-image:php-8.2-alpine -f resources/docker/dockerfiles/release-base.Dockerfile .
docker buildx build --push --platform "linux/amd64,linux/arm64,linux/arm/v7" -t linkace/base-image:php-8.3-alpine -f resources/docker/dockerfiles/release-base.Dockerfile .
```
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<p align="center"><b>:warning: CAUTION! THIS IS A DEVELOPMENT VERSION OF LINKACE! DO NOT USE IT NOW! :warning:</b></p>

<p align="center">
<img src="https://www.linkace.org/images/linkace-social.jpg" title="Linkace">
</p>
Expand Down
44 changes: 27 additions & 17 deletions app/Actions/Fortify/CreateNewUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

namespace App\Actions\Fortify;

use App\Actions\Settings\SetDefaultSettingsForUser;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str;
use Illuminate\Validation\Rule;
use Illuminate\Validation\ValidationException;
use Laravel\Fortify\Contracts\CreatesNewUsers;
Expand All @@ -13,31 +15,39 @@ class CreateNewUser implements CreatesNewUsers
{
use PasswordValidationRules;

/**
* Validate and create a newly registered user.
*
* @param array $input
* @return User
* @throws ValidationException
*/
public function create(array $input): User
{
Validator::make($input, [
'name' => ['required', 'string', 'max:255'],
Validator::make($input, self::rules())->validate();

$user = User::create([
'name' => $input['name'],
'email' => $input['email'],
'password' => Hash::make($input['password']),
]);

(new SetDefaultSettingsForUser($user))->up();

return $user;
}

public static function rules(): array
{
return [
'name' => [
'required',
'string',
'max:20',
'alpha_dash',
Rule::unique(User::class),
],
'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']),
]);
'password' => self::passwordRules(),
];
}
}
19 changes: 19 additions & 0 deletions app/Actions/Fortify/CreateUserInvitation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace App\Actions\Fortify;

use App\Models\UserInvitation;
use Illuminate\Support\Str;

class CreateUserInvitation
{
public static function run(string $email)
{
return UserInvitation::create([
'token' => Str::random(32),
'email' => $email,
'inviter_id' => auth()->id(),
'valid_until' => now()->addDays(3),
]);
}
}
7 changes: 1 addition & 6 deletions app/Actions/Fortify/PasswordValidationRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@

trait PasswordValidationRules
{
/**
* Get the validation rules used to validate passwords.
*
* @return array
*/
protected function passwordRules(): array
protected static function passwordRules(): array
{
return ['required', 'string', new Password, 'confirmed'];
}
Expand Down
9 changes: 1 addition & 8 deletions app/Actions/Fortify/ResetUserPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,10 @@ class ResetUserPassword implements ResetsUserPasswords
{
use PasswordValidationRules;

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

$user->forceFill([
Expand Down
9 changes: 1 addition & 8 deletions app/Actions/Fortify/UpdateUserPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,11 @@ class UpdateUserPassword implements UpdatesUserPasswords
{
use PasswordValidationRules;

/**
* Validate and update the user's password.
*
* @param mixed $user
* @param array $input
* @throws ValidationException
*/
public function update($user, array $input): void
{
Validator::make($input, [
'current_password' => ['required', 'string'],
'password' => $this->passwordRules(),
'password' => self::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'));
Expand Down