/spatie.be-docs

The source code of spatie.be

Primary LanguagePHP

The source code of spatie.be

Tests Tuple

This repo contains the source code of our company website. This blog post series at freek.dev contains a lot of info on how this code works.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Credits

This website was principally designed by Willem Van Bockstal. Everyone at Spatie has made cool contributions during development.

License

If you'd like to reuse or repost something, feel free to hit us up at info@spatie.be. Please remember that the design is not meant to be forked!

License

This project and the Laravel framework are open-sourced software licensed under the MIT license.

Apple sign-in

Every 6 months, the token for Sign-in with Apple expires, this can be renewed using the "Spatie apple login - private key" in our team's 1Password vault and the following ruby script:

require 'jwt'

key_file = 'key.txt'
team_id = '' # Found in the top right when signed in on the Apple developer site
client_id = 'be.spatie.website'
key_id = '' # The key ID, found here https://developer.apple.com/account/resources/authkeys/list

ecdsa_key = OpenSSL::PKey::EC.new IO.read key_file

headers = {
'kid' => key_id
}

claims = {
    'iss' => team_id,
    'iat' => Time.now.to_i,
    'exp' => Time.now.to_i + 86400*180,
    'aud' => 'https://appleid.apple.com',
    'sub' => client_id,
}

token = JWT.encode claims, ecdsa_key, 'ES256', headers

puts token

Then execute it using

ruby client_secret.rb

Which gives you a new token that is valid for 6 months.

GeoIP lookup

We use Maxmind's geo IP dataset to provide PPP based on IP location. This is built using the excellent laravel-geoip package.

To set it this up the first time you'll need a Maxmind license key (free for personal use) in the MAXMIND_LICENSE_KEY environment variable. Next, run the php artisan geoip:update command to pull in the geo IP dataset.

In production, the geoip:update command is scheduled to run weekly.