Source code for victorwesterlund.com
Find a file
Victor Westerlund 36345199e3
Version 11 (#23)
* wip(22w6a): add glitch bg

* wip(22w6b): add content and more glitching

* wip(22w7a): add card backdrop-filter

* wip(22w7b): add visibilitychange event

* wip(22w7c): add link click handler

* wip(22w7d): add webkit backdrop filter support

* wip(22w7e): fix font size

* wip(22w7f): refactor glitch

* wip(22w7g): add forceBg to glitch

* wip(22w7h): add error page

* wip(22w7i): hide contact button

* feat: add OGP tags

Co-authored-by: Cloud Shell <cloud-shell@victor-westerlund.iam.gserviceaccount.com>
2022-02-22 04:46:05 -08:00
.github/ISSUE_TEMPLATE Version 11 (#23) 2022-02-22 04:46:05 -08:00
public Version 11 (#23) 2022-02-22 04:46:05 -08:00
.gitignore Version 11 (#23) 2022-02-22 04:46:05 -08:00
codeql-analysis.yml Create codeql-analysis.yml 2022-02-20 07:31:07 -08:00
LICENSE Version 11 (#23) 2022-02-22 04:46:05 -08:00
README.md Version 11 (#23) 2022-02-22 04:46:05 -08:00

www.victorwesterlund.com

The source code for victorwesterlund.com

How to install

This guide is for Unix-based systems with NGINX, PHP 8.0 and MariaDB installed and configured.

  1. Clone this repo.
    git clone https://github.com/VictorWesterlund/victorwesterlund.com /var/www
  2. Expose the directory /public to the web.
    This can be done in multiple ways, but an NGINX location block or symlink should do the trick.
  3. Rewrite api.php to api/*.
    All requests to example.com/api/* should be routed to the PHP file at /src/api.php.
    Just like the previous step, this can be done in multiple ways. Here is one way with an NGINX location block:
    location ~ /api/* {
         try_files /src/api.php =503;
         include snippets/fastcgi-php.local.conf;
         fastcgi_pass unix:/run/php/php8.0-fpm.sock;
    }
  4. Add support for the .mjs extension.
    NGINX doesn't have an entry for the ECMAScript module (.mjs) file extension in its default /etc/nginx/mime.types file. We need to add this manually:
    types {
         ...
         application/javascript                js mjs;
         ...
    }
    
    PS: If you want to make your Content-Type WG compliant, replace application/javascript with text/javascript
  5. Import the standard structure to a MariaDB database.
    A MySQL-compatible .sql can be downloaded here and imported into a database with this command:
    mysql -u username -p database_name < db_structure.sql
    You will have to create an empty database if you don't have one already.
  6. Add your MariaDB connection details to /src/database/config.json.
    You can add as many fallback servers as you want
    {
      "servers": [
          {
             "host": "db.example.com",
             "user": "mysql_user",
             "pass": "mysql_pass",
             "db": "mysql_db"
          },
          {
             "host": "fallback.db.example.com",
             "user": "mysql_user",
             "pass": "mysql_pass",
             "db": "mysql_db"
          }
      ]
    }
    

That was a lot, but now we're done! Navigate to the location you exposed in step 2 and cross your fingers 🤞