Der Beitrag Setup XMPP Chat server for cruise ship WiFis without Internet erschien zuerst auf repats blog.
]]>These also support OTR and/or OMEO encryption, which only work on one device per user though.
As an XMPP server, I’ve used Prosody.
Der Beitrag Setup XMPP Chat server for cruise ship WiFis without Internet erschien zuerst auf repats blog.
]]>Der Beitrag Default Filter in Laravel Nova erschien zuerst auf repats blog.
]]>php artisan make:scope DefaultFilterScope
public static function indexQuery(NovaRequest $request, $query) {
return $query->withGlobalScope(DefaultFilterScope::class, new DefaultFilterScope);
}
$query = $query->withoutGlobalScope(DefaultFilterScope::class);
in the first line of the apply
method, to remove the Global Scope added in the indexQuery
method, and just use whatever the Filter does.Der Beitrag Default Filter in Laravel Nova erschien zuerst auf repats blog.
]]>Der Beitrag 404 with content using basic auth with nginx erschien zuerst auf repats blog.
]]>However, when you would like to restrict a section that’s part of an application, whatever rules you defined in your /etc/nginx/sites-available/domain.tld.conf you have to now add to the new location section.
Example
On a staging server, you want to restrict access to /register and /login. Head to servers/X/sites/Y/security URL by clicking on the server, then select a site and click on „Security“. These entries create 2 files in /etc/nginx/forge-conf/domain.tld/server where ID is the ID you can see in Forge..
However, when you now navigate to e.g. /login and enter your credentials, you will see a 404 for /login in the debug console. A request has been made and returned the content – just with the wrong status code. This is happening because there is no file called „login“ in the webserver public folder and nginx hasn’t been instructed to use PHP for this particular location.
tl;dr: You need to add this line to the location entry in the .conf files:
try_files $uri $uri/ /index.php?$query_string;
The whole file now looks like this:
location /register {
auth_basic "Restricted Area";
auth_basic_user_file /etc/nginx/forge-conf/domain.tld/server/.htpasswd-42;
try_files $uri $uri/ /index.php?$query_string;
}
Der Beitrag 404 with content using basic auth with nginx erschien zuerst auf repats blog.
]]>Der Beitrag Send private end-to-end encrypted Broadcast notifications with Laravel through Pusher erschien zuerst auf repats blog.
]]>This is assuming you set up the authentication callback routes/broadcasting.php and it’s reachable (by default under /broadcasting/auth.)
public function receivesBroadcastNotificationsOn()
{
// `private-` is added automatically
return 'encrypted-App.Models.User.' . $this->id;
}
The default implementation would be for a normal (not e2e) private channel and just return the FQCN in dot notation, followed by the Model ID.
Simply adding encrypted- before the channel name you now choose (or stick with the default suffix as above) will signal to Laravel to encrypt the messages before sending them out to pusher.
2. Add a shared key to config/broadcasting.php
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'useTLS' => true,
'encryption_master_key_base64' => env('PUSHER_APP_E2E_MASTER_KEY_BASE64'),
],
The end2end encryption is done synchronously with a shared key, stored base64 encoded. Of course, it’s important to keep this key secret. This encryption does not provide PFS, meaning, if the key ever leaks all old messages can be decrypted. Therefore, it’s probably a good idea to rotate it regularly or possibly not even use the same key for every user by manually changing the config before sending the message.
You can securely generate a key on the commandline or use PHP:
// Commandline
$ openssl rand -base64 32
// PHP
base64_encode(bin2hex(random_bytes(32)));
3. Client side
The client side using a pusher library recognizes the private-encrypted prefix. On successful authentication against /broadcasting/auth (or your custom authentication route) the shared key is transmitted in the response and used by the client to decrypt messages sent on that channel. You don’t need to worry about key distribution.
4. Double Check in the pusher.com debug console
You should only be able to see the none and the cyphertext, but not the plaintext message. If you do, something isn’t setup correctly yet.
5. Misc
The event for notifications to listen to is .Illuminate\\Notifications\\Events\\BroadcastNotificationCreated – don’t forget the . in front of it.
Der Beitrag Send private end-to-end encrypted Broadcast notifications with Laravel through Pusher erschien zuerst auf repats blog.
]]>Der Beitrag Laravel Nova: Move cards in Resource Detail View erschien zuerst auf repats blog.
]]>However, while a bit dirty, a solution can be to let it load that way and then use Javascript to cut and paste the div somewhere else like so:
<template>
<card class="flex flex-col justify-center" id="custom-card">
2. Use vanilla JS to move it underneath the first div
with the name of the resource + detail-component
for the dusk
attribute
let customCard = document.querySelector('#custom-card');
if(customCard) {
let anotherComponent = document.querySelector('div[dusk=resourcename-detail-component]');
if(anotherComponent) {
anotherComponent.appendChild(customCard);
} else {
console.error('Could not find another resourcename detail component')
}
}
Der Beitrag Laravel Nova: Move cards in Resource Detail View erschien zuerst auf repats blog.
]]>Der Beitrag Autoload class alias order in Laravel tinker erschien zuerst auf repats blog.
]]>$ tinker
UserPsy Shell v0.10.8 (PHP 8.0.8 — cli) by Justin Hileman
>>> User::first()
[!] Aliasing 'User' to 'App\Http\Livewire\User' for this Tinker session.
PHP provides the class_alias function but e.g. writing your own Service Provider for this will not work.
class ClassAliasesProvider extends ServiceProvider
{
/**
* Class Aliases defaults for tinker / tinkerwell.dev
*
* @return void
*/
public function boot()
{
class_alias(User::class, 'User');
//
}
}
Instead, add your classes to the array in config(‚app.alias‘).
// other default Laravel aliases
'View' => Illuminate\Support\Facades\View::class,
// Better autoloading for tinker / tinkerwell
'User' => \App\Models\User::class,
The next time loading up tinker / tinkerwell, it will use the correct alias.
Der Beitrag Autoload class alias order in Laravel tinker erschien zuerst auf repats blog.
]]>Der Beitrag How to install curl with HTTP/3 and QUIC support on MacOS erschien zuerst auf repats blog.
]]>$ curl -vs --http3 https://quic.rocks:4433
option --http3: the installed libcurl version doesn't support this
After reading https://github.com/cloudflare/quiche/issues/319 and fiddling around with it a arrived at this solution:
$ wget https://raw.githubusercontent.com/cloudflare/homebrew-cloudflare/master/curl.rb
$ brew uninstall curl
$ brew install --HEAD -s curl.rb # takes a while
$ curl --version
curl 7.74.0-DEV
$ curl -vs --http3 https://quic.rocks:4433
Der Beitrag How to install curl with HTTP/3 and QUIC support on MacOS erschien zuerst auf repats blog.
]]>Der Beitrag Contribute to wappalyzer erschien zuerst auf repats blog.
]]>I just created a pull request for Alpine.js, A rugged, minimal framework for composing JavaScript behavior in your markup, that I like to pull in when Vue or React would be overkill.
Der Beitrag Contribute to wappalyzer erschien zuerst auf repats blog.
]]>Der Beitrag Deploy with envoyer and artisan erschien zuerst auf repats blog.
]]>Updated envoyer:deploy package on packagist
As you can tell from the README, Install like so:
composer require repat/envoyer-deploy --dev
Then publish the config file by executing this and selecting the number that says JustPark\Deploy\ServiceProviders\EnvoyerServiceProvider.
php artisan vendor:publish
In the envoyer.php config file, fill in the unique ID that comes after the /deploy in the link you can find in the Deployment Hooks tab in envoyer, e.g. https://envoyer.io/deploy/4aLDdfsfsd4s6fSzeKGNfakekey75R45wOwTQULEDJNrj
You can now deploy with
php artisan envoyer:deploy
Sourcecode for repat/envoyer-deploy on GitHub
Der Beitrag Deploy with envoyer and artisan erschien zuerst auf repats blog.
]]>Der Beitrag Pipe text from commandline into clipboard erschien zuerst auf repats blog.
]]>Der Beitrag Pipe text from commandline into clipboard erschien zuerst auf repats blog.
]]>