Merge pull request #4341 from pixelfed/staging

Staging
This commit is contained in:
daniel 2023-05-02 20:56:43 -06:00 committed by GitHub
commit 684785500a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 80 additions and 1 deletions

View file

@ -3010,9 +3010,10 @@ class ApiV1Controller extends Controller
$status->caption = $content; $status->caption = $content;
$status->rendered = $rendered; $status->rendered = $rendered;
$status->profile_id = $user->profile_id; $status->profile_id = $user->profile_id;
$status->scope = 'draft';
$status->is_nsfw = $cw; $status->is_nsfw = $cw;
$status->cw_summary = $spoilerText; $status->cw_summary = $spoilerText;
$status->scope = 'draft';
$status->visibility = 'draft';
if($request->has('place_id')) { if($request->has('place_id')) {
$status->place_id = $request->input('place_id'); $status->place_id = $request->input('place_id');
} }

View file

@ -561,6 +561,7 @@ class ComposeController extends Controller
$status->caption = strip_tags($request->caption); $status->caption = strip_tags($request->caption);
$status->rendered = Autolink::create()->autolink($status->caption); $status->rendered = Autolink::create()->autolink($status->caption);
$status->scope = 'draft'; $status->scope = 'draft';
$status->visibility = 'draft';
$status->profile_id = $profile->id; $status->profile_id = $profile->id;
$status->save(); $status->save();

View file

@ -1,6 +1,18 @@
<?php <?php
return [ return [
/*
|--------------------------------------------------------------------------
| Passport Guard
|--------------------------------------------------------------------------
|
| Here you may specify which authentication guard Passport will use when
| authenticating users. This value should correspond with one of your
| guards that is already present in your "auth" configuration file.
|
*/
'guard' => 'web',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -17,4 +29,33 @@ return [
'public_key' => env('PASSPORT_PUBLIC_KEY'), 'public_key' => env('PASSPORT_PUBLIC_KEY'),
/*
|--------------------------------------------------------------------------
| Client UUIDs
|--------------------------------------------------------------------------
|
| By default, Passport uses auto-incrementing primary keys when assigning
| IDs to clients. However, if Passport is installed using the provided
| --uuids switch, this will be set to "true" and UUIDs will be used.
|
*/
'client_uuids' => false,
/*
|--------------------------------------------------------------------------
| Personal Access Client
|--------------------------------------------------------------------------
|
| If you enable client hashing, you should set the personal access client
| ID and unhashed secret within your environment file. The values will
| get used while issuing fresh personal access tokens to your users.
|
*/
'personal_access_client' => [
'id' => env('PASSPORT_PERSONAL_ACCESS_CLIENT_ID'),
'secret' => env('PASSPORT_PERSONAL_ACCESS_CLIENT_SECRET'),
],
]; ];

View file

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$type = config('database.default');
if($type === 'pgsql') {
DB::statement("ALTER TABLE statuses DROP CONSTRAINT statuses_visibility_check");
$types = ['public', 'unlisted', 'private', 'direct', 'draft'];
$result = join( ', ', array_map(function ($value){
return sprintf("'%s'::character varying", $value);
}, $types));
DB::statement("ALTER TABLE statuses ADD CONSTRAINT statuses_visibility_check CHECK (visibility::text = ANY (ARRAY[$result]::text[]))");
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};