Skip to content

Commit

Permalink
Merge pull request #601 from Kovah/dev
Browse files Browse the repository at this point in the history
v1 Release
  • Loading branch information
Kovah authored Jan 22, 2023
2 parents 5aef7c5 + e902e7c commit 0baf858
Show file tree
Hide file tree
Showing 19 changed files with 977 additions and 830 deletions.
1 change: 1 addition & 0 deletions .env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ DB_PORT=3306
DB_DATABASE=linkace
# Set both username and password of the user accessing the database
DB_USERNAME=linkace
# Wrap your password into quotes (") if it contains special characters
DB_PASSWORD=ChangeThisToASecurePassword!

## Redis cache configuration
Expand Down
1 change: 1 addition & 0 deletions .env.docker.production
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ DB_PORT=3306
DB_DATABASE=linkace
# Set both username and password of the user accessing the database
DB_USERNAME=linkace
# Wrap your password into quotes (") if it contains special characters
DB_PASSWORD=ChangeThisToASecurePassword!

## Redis cache configuration
Expand Down
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ DB_PORT=3306
DB_DATABASE=linkace
# Set both username and password of the user accessing the database
DB_USERNAME=linkace
# Wrap your password into quotes (") if it contains special characters
DB_PASSWORD=ChangeThisToASecurePassword!
2 changes: 1 addition & 1 deletion app/Actions/ImportHtmlBookmarks.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public function run(string $data, string $userId, bool $generateMeta = true): bo
$description = $link['note'];
}

Log::debug($link['uri'] .': '. $link['pub']);
$newLink = new Link([
'user_id' => $userId,
'url' => $link['uri'],
Expand All @@ -80,6 +79,7 @@ public function run(string $data, string $userId, bool $generateMeta = true): bo
$newTag = Tag::firstOrCreate([
'user_id' => $userId,
'name' => $tag,
'is_private' => usersettings('tags_private_default') === '1',
]);
$newTags[] = $newTag->id;
}
Expand Down
34 changes: 34 additions & 0 deletions app/Console/Commands/CompleteSetupCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace App\Console\Commands;

use App\Models\Setting;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Log;

class CompleteSetupCommand extends Command
{
protected $signature = 'setup:complete';

protected $description = 'Use this command in case the setup cannot be completed automatically.';

public function handle()
{
try {
Setting::updateOrCreate(
['key' => 'system_setup_completed'],
['key' => 'system_setup_completed', 'value' => true]
);
Cache::forget('systemsettings');
} catch (\Exception $e) {
$this->error('Could not complete the setup because of an error: ' . $e->getMessage());
$this->error('Check the log files for further details.');
Log::warning($e);
return;
}

$this->info('Successfully marked the setup as completed. You can now visit the web interface.');
$this->line('Hint: If you install LinkAce with PostgreSQL or SQLite, use the <options=reverse>registeruser</> command now.');
}
}
22 changes: 0 additions & 22 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,11 @@

namespace App\Console;

use App\Console\Commands\CheckLinksCommand;
use App\Console\Commands\CleanupLinkHistoriesCommand;
use App\Console\Commands\ImportCommand;
use App\Console\Commands\ListUsersCommand;
use App\Console\Commands\RegisterUserCommand;
use App\Console\Commands\ResetPasswordCommand;
use App\Console\Commands\UpdateLinkThumbnails;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
RegisterUserCommand::class,
CheckLinksCommand::class,
ResetPasswordCommand::class,
CleanupLinkHistoriesCommand::class,
ImportCommand::class,
UpdateLinkThumbnails::class,
ListUsersCommand::class,
];

/**
* Define the application's command schedule.
*
Expand Down
3 changes: 2 additions & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Collection;
use Laravel\Fortify\TwoFactorAuthenticatable;

/**
Expand Down Expand Up @@ -52,7 +53,7 @@ public function rawSettings(): HasMany
return $this->hasMany(Setting::class, 'user_id', 'id');
}

public function settings(): \Illuminate\Support\Collection
public function settings(): Collection
{
if ($this->rawSettings->isEmpty()) {
$this->load('rawSettings');
Expand Down
Loading

0 comments on commit 0baf858

Please sign in to comment.