Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Next you need to apply migrations to create the database tables:
```bash
ddev exec bin/cake migrations migrate
ddev exec bin/cake migrations migrate -p Tags
ddev exec bin/cake migrations migrate -p ADmad/SocialAuth
```

After that you can perform a fresh sync via
Expand All @@ -21,9 +22,27 @@ After that you can perform a fresh sync via
ddev exec bin/cake sync_packages
```

While that is running (takes quite a while) you should install node modules and start the dev server via

```bash
ddev exec npm i
ddev exec bin/cake devserver
```

With that you should now see what is currently on the production site.

## Cleaning up tables
## Get social auth working

If you want to test/develop social auth via Github you need to set the following 2 environment variables in your `config/.env` file:

```
export AUTH_ID_GITHUB="someid"
export AUTH_SECRET_GITHUB="somesecret"
```

You can get these tokens via creating a Github OAuth App on https://github.com/settings/developers

## Cleaning up packages

If you want to clean up package data, you can run the following command:

Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"homepage": "https://cakephp.org",
"require": {
"php": ">=8.1",
"admad/cakephp-social-auth": "^2.2",
"cakephp/authentication": "^4.0",
"cakephp/cakephp": "5.3.*",
"cakephp/migrations": "^5.0.0",
"cakephp/plugin-installer": "^2.0",
Expand Down
245 changes: 244 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions config/Migrations/20260405153913_Users.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);

use Migrations\BaseMigration;

class Users extends BaseMigration
{
/**
* Change Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/5/en/migrations.html#the-change-method
*
* @return void
*/
public function change(): void
{
$this->table('users')
->addColumn('first_name', 'string', ['null' => true])
->addColumn('last_name', 'string', ['null' => true])
->addColumn('email', 'string')
->addColumn('username', 'string')
->addColumn('is_cakephp_dev', 'boolean', ['default' => false])
->addTimestamps('created', 'modified')
->addIndex('email', ['unique' => true])
->addIndex('username', ['unique' => true])
->create();
}
}
Binary file modified config/Migrations/schema-dump-default.lock
Binary file not shown.
9 changes: 9 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@
// 'cacheTime' => '+1 year'
],

'GitHub' => [
'applicationId' => env('AUTH_ID_GITHUB'),
'applicationSecret' => env('AUTH_SECRET_GITHUB'),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already set the env vars in the dokku app

],

'Packages' => [
'featured' => [
'markstory/asset_compress',
Expand Down Expand Up @@ -470,4 +475,8 @@
'errorLevel' => null,
'fixtureStrategy' => null,
],

'Migrations' => [
'add_timestamps_use_datetime' => true,
],
];
Loading
Loading