Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds all the things 🎉 #1

Merged
merged 100 commits into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
9083252
Add RSS feeds and more
austinkregel Jul 18, 2023
376b55d
Update docker and add the ssh2 php package
austinkregel Jul 18, 2023
88cc282
PHP Linting (Pint)
austinkregel Jul 18, 2023
9d6ed22
Update the app a little
austinkregel Jul 20, 2023
a747a74
Add key generator
austinkregel Jul 20, 2023
0368f47
PHP Linting (Pint)
austinkregel Jul 20, 2023
7565132
update routes
austinkregel Jul 25, 2023
7e47ac4
wip
austinkregel Jul 25, 2023
2feec95
Add new routes
austinkregel Aug 4, 2023
e9d3316
Merge branch 'task/QUEST-57-deploy-a-domain' of github.com:austinkreg…
austinkregel Aug 4, 2023
f188262
PHP Linting (Pint)
austinkregel Aug 4, 2023
f5b56b0
CS fix
austinkregel Aug 4, 2023
f5a33a3
Merge remote-tracking branch 'origin/main' into task/QUEST-57-deploy-…
austinkregel Aug 4, 2023
111315a
Merge branch 'task/QUEST-57-deploy-a-domain' of github.com:austinkreg…
austinkregel Aug 4, 2023
21c7771
Fix silly little bug
austinkregel Aug 4, 2023
e05a9f8
wip
austinkregel Aug 5, 2023
df06e56
PHP Linting (Pint)
austinkregel Aug 5, 2023
ee9efc6
Update the design a little to better respect the color themeing I am …
austinkregel Aug 5, 2023
68b4c53
Merge branch 'task/QUEST-57-deploy-a-domain' of github.com:austinkreg…
austinkregel Aug 6, 2023
aee3e93
Fix broken merge
austinkregel Aug 6, 2023
e5115f3
PHP Linting (Pint)
austinkregel Aug 6, 2023
53ac4aa
maybe patch a bug I think
austinkregel Aug 6, 2023
d41502e
Merge branch 'task/QUEST-57-deploy-a-domain' of github.com:austinkreg…
austinkregel Aug 6, 2023
614484c
Add relation
austinkregel Aug 6, 2023
d077c13
Add feeds relation
austinkregel Aug 6, 2023
08d15b3
Update the today controller to try and fix a difference in the mysql …
austinkregel Aug 6, 2023
d2cd3d0
Add flare
austinkregel Aug 6, 2023
a260cd4
wip
austinkregel Aug 6, 2023
7202b89
Update proxies
austinkregel Aug 6, 2023
4f30831
wip
austinkregel Aug 6, 2023
036cc8f
update domain
austinkregel Aug 6, 2023
5fef370
Fix bug
austinkregel Aug 6, 2023
02c005f
Publish the route
austinkregel Aug 6, 2023
80ee660
disable registration
austinkregel Aug 6, 2023
0314b1c
PHP Linting (Pint)
austinkregel Aug 6, 2023
a154e5f
wip
austinkregel Aug 6, 2023
65bf322
Merge branch 'task/QUEST-57-deploy-a-domain' of github.com:austinkreg…
austinkregel Aug 6, 2023
871f52a
PHP Linting (Pint)
austinkregel Aug 6, 2023
a94c66b
Update method name
austinkregel Aug 6, 2023
13390e4
Merge branch 'task/QUEST-57-deploy-a-domain' of github.com:austinkreg…
austinkregel Aug 6, 2023
95ede95
Rearrange the controllers
austinkregel Sep 6, 2023
e32f003
Update the views
austinkregel Sep 6, 2023
2b90b2d
Migrate the routes
austinkregel Sep 6, 2023
54fa345
Add casts
austinkregel Sep 6, 2023
8245904
Add php8.2-ssh2 ext
austinkregel Sep 6, 2023
82530bc
PHP Linting (Pint)
austinkregel Sep 6, 2023
aa5fb91
Add spork pages
austinkregel Sep 15, 2023
112422d
Merge branch 'task/QUEST-57-deploy-a-domain' of github.com:austinkreg…
austinkregel Sep 15, 2023
22a2dad
Update composer json
austinkregel Sep 15, 2023
1ed55d1
PHP Linting (Pint)
austinkregel Sep 15, 2023
1d3d1d4
Remove new dep
austinkregel Sep 19, 2023
6bcbd5d
boy this expanded beyond what I expected.... Add Protonmail client, …
austinkregel Dec 3, 2023
238a971
Remove old files, roll keys
austinkregel Dec 4, 2023
9733380
Wip
austinkregel Dec 12, 2023
83ad989
Update the design
austinkregel Dec 17, 2023
bf5c9fa
Add dynamically created event generation, add bugsnag
austinkregel Dec 26, 2023
d23edef
CS fixes
austinkregel Dec 26, 2023
4a96c56
Cs fixes
austinkregel Dec 26, 2023
6556166
Fix minor bug in bugsnag
austinkregel Dec 26, 2023
683d56f
Add admin email?
austinkregel Dec 26, 2023
c202b56
Update the banking routes'
austinkregel Dec 26, 2023
b6fc48b
csfixes
austinkregel Dec 26, 2023
a2940b3
Update tests
austinkregel Dec 28, 2023
52621c1
Add operations
austinkregel Dec 28, 2023
55e3848
Add additional workflows
austinkregel Dec 28, 2023
664a528
register the thing we need for our tests
austinkregel Dec 28, 2023
4865c92
Add some conditional tests
austinkregel Dec 29, 2023
d6906b4
Update env
austinkregel Dec 29, 2023
fb55942
Add .env to source
austinkregel Dec 29, 2023
6ca24fe
sourdce .env to bash....
austinkregel Dec 29, 2023
07251dc
Remove and invalidate bugsnag
austinkregel Dec 29, 2023
e9acb31
Use the password we set
austinkregel Dec 29, 2023
478c0b0
Change order of imports
austinkregel Dec 29, 2023
c7d0768
Change out the pipeline forthe containers.... Mayabe thatll work
austinkregel Dec 29, 2023
62ee76e
Use sail bin script
austinkregel Dec 29, 2023
dec9149
swap out the image for sail
austinkregel Dec 29, 2023
233734a
Update for the docker
austinkregel Dec 29, 2023
3219a7a
Change install order
austinkregel Dec 29, 2023
cafa463
Add basic log files
austinkregel Dec 30, 2023
c4c3959
I Need to know the user name
austinkregel Dec 30, 2023
66f3379
Rename the checks
austinkregel Dec 30, 2023
a8c7734
Would a little npm stuff help at all
austinkregel Dec 30, 2023
8ff3002
Maybe we can build after we sail up
austinkregel Dec 30, 2023
3744512
Change the to the testing database
austinkregel Dec 30, 2023
89e0cc2
Change the host to mariadb
austinkregel Dec 30, 2023
c112364
Update the dependencies for the containers to see if github would res…
austinkregel Dec 30, 2023
573ed80
Force uninstall the mysql
austinkregel Dec 30, 2023
0ae2370
Ensure we run the create testing db bit before
austinkregel Dec 30, 2023
9960d6b
Fix the tests
austinkregel Dec 30, 2023
897e03f
Try swapping out the cmd
austinkregel Dec 30, 2023
983eaaf
Try Changing the username
austinkregel Dec 30, 2023
bc7d8a8
Phpunit
austinkregel Dec 30, 2023
b7d7038
CHmod the storage because omfg im about done
austinkregel Dec 30, 2023
12bb2a6
ug
austinkregel Dec 30, 2023
9bbb275
Revert
austinkregel Dec 30, 2023
fef98a3
Update the logic for applying tags and verify that the test actually …
austinkregel Dec 31, 2023
7261f52
Updategit ignore;
austinkregel Dec 31, 2023
ec4ab55
Ensure we create the keys directory if it doesnt already exist'
austinkregel Dec 31, 2023
02bd9aa
Add logfor empty user
austinkregel Dec 31, 2023
6419f0d
Remove old legacy POC crap that was causing the tests to default to t…
austinkregel Jan 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
106 changes: 106 additions & 0 deletions .env.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=mariadb
DB_PORT=3306
DB_DATABASE=testing
DB_USERNAME=sail
DB_PASSWORD=password

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=database
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1

VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"


PLAID_ENVIRONMENT=sandbox
PLAID_CLIENT_ID=
PLAID_DEVELOPMENT_SECRET=
PLAID_PRODUCTION_SECRET=prod_super_secret
PLAID_SANDBOX_SECRET=

SCOUT_DRIVER=meilisearch
MEILISEARCH_HOST=http://meilisearch:7700

WEATHER_API_KEY=
OPEN_WEATHER_KEY=

REDIS_QUEUE=

FTP_HOST=
FTP_USERNAME=
FTP_PASSWORD=

SPORK_ADMIN_EMAILS=

MATRIX_USERNAME=""
MATRIX_PASSWORD=""
MATRIX_HOST=""
MATRIX_ACCESS_TOKEN=""
MATRIX_DEVICE=""
MATRIX_JWT_TOKEN=""

GITHUB_TOKEN=""

[email protected]
[email protected]
SMTP_PASSWORD=
IMAP_PASSWORD=
SMTP_HOST=proton-bridge
IMAP_HOST=proton-bridge
IMAP_PORT=143
SMTP_PORT=1025

SPORK_DEFAULT_FILESYSTEM=
LINK_SHORTENING_DOMAIN=
RUST_BACKTRACE=

FORGE_CLOUDFLARE_TOKEN=

MATRIX_CLIENT_FOR_COMMUNICATION_VENTURES=
ADMIN_MATRIX_CLIENT_FOR_COMMUNICATION_VENTURES=
49 changes: 49 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,52 @@ VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"


PLAID_ENVIRONMENT=sandbox
PLAID_CLIENT_ID=
PLAID_DEVELOPMENT_SECRET=
PLAID_PRODUCTION_SECRET=prod_super_secret
PLAID_SANDBOX_SECRET=

SCOUT_DRIVER=meilisearch
MEILISEARCH_HOST=http://meilisearch:7700

WEATHER_API_KEY=
OPEN_WEATHER_KEY=

REDIS_QUEUE=

FTP_HOST=
FTP_USERNAME=
FTP_PASSWORD=

SPORK_ADMIN_EMAILS=

MATRIX_USERNAME=""
MATRIX_PASSWORD=""
MATRIX_HOST=""
MATRIX_ACCESS_TOKEN=""
MATRIX_DEVICE=""
MATRIX_JWT_TOKEN=""

GITHUB_TOKEN=""

[email protected]
[email protected]
SMTP_PASSWORD=
IMAP_PASSWORD=
SMTP_HOST=proton-bridge
IMAP_HOST=proton-bridge
IMAP_PORT=143
SMTP_PORT=1025

SPORK_DEFAULT_FILESYSTEM=
LINK_SHORTENING_DOMAIN=
RUST_BACKTRACE=

FORGE_CLOUDFLARE_TOKEN=

MATRIX_CLIENT_FOR_COMMUNICATION_VENTURES=
ADMIN_MATRIX_CLIENT_FOR_COMMUNICATION_VENTURES=
#BUGSNAG_API_KEY=
9 changes: 2 additions & 7 deletions .github/workflows/cs-checks.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PHP Linting (Pint)
name: Linting (Pint)
on:
workflow_dispatch:
push:
Expand All @@ -15,9 +15,4 @@ jobs:
uses: aglipanci/[email protected]
with:
preset: laravel

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: PHP Linting (Pint)
skip_fetch: true

32 changes: 17 additions & 15 deletions .github/workflows/php-unit.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Checks
name: PHP Unit
on: [ pull_request ]
jobs:
phpunit:
Expand All @@ -10,23 +10,25 @@ jobs:
fetch-depth: 0 # important!
- name: setup php
run: |
sudo apt update
sudo apt install -y software-properties-common
sudo add-apt-repository ppa:ondrej/php -y
sudo apt install -y php8.2-{common,cli,gd,curl,mysql,mbstring,dom,xml,simplexml}
curl -s https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
git submodule init
git submodule update --remote --merge
- name: Install dependencies
run: |
sudo systemctl start mysql.service
mysql -uroot -h127.0.0.1 -proot -e 'CREATE DATABASE IF NOT EXISTS testing;'
sudo apt update && sudo apt install -y php-mysql
composer install --prefer-dist --no-progress --no-suggest
sudo apt update && sudo apt remove mysql* -y
touch storage/logs/laravel.log
touch storage/logs/crontab.log
touch storage/logs/horizon.log
touch database/database.sqlite
npm install
cp .env.ci .env
./bin/sail up -d
npm run build
- name: Run tests
run: |
cp .env.ci .env
touch database/database.sqlite
php artisan key:generate
php vendor/bin/phpunit
./bin/sail art key:generate
export $(cat .env | xargs)
./bin/sail exec mariadb /docker-entrypoint-initdb.d/10-create-testing-database.sh
./bin/sail test
- name: tear down containers
run: |
./bin/sail down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ yarn-error.log
/.vscode
/*.log
/*.pid
storage/*.bin
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ $ ./sail up -d
- [x] DNS Validation/Verification
- [x] Projects, with relations to domains, servers, rss feeds, pages (and redirects), and people in a one to many association for organization.
- [-] Automatically adding and configuring purchased domains to Cloudflare & Laravel Forge, and provision out the routing automatically. (Still in progress)
- [x] Automatic SSL configuration via forge.

## Planned
- [ ] Automatic SSL configuration via forge.
- [ ] IFTTT inspired Dynamic Automations
- [ ] Plaid integration for asset syncing
- [ ] Budgeting per project
Expand All @@ -32,6 +32,32 @@ $ ./sail up -d
- [ ] List tasks from all projects
- [ ] List events from all projects
- [ ] List budget usage -- if applicable.
- [ ] Domain Purchasing and Renewals


### Happily built with Laravel Jetstream Inertia
- Single Chat interface
- Email interface
# Domain Feature Details
This presently uses Cloudflare DNS.

We can configure and manage any DNS records that Cloudflare supports.

We also want to be able to update the NS of registrars to point to Cloudflare

## Domain Syncing
This will sync domains from Namecheap to Cloudflare. It will also sync domains from Cloudflare to Laravel Forge.

# Server Feature Details
We can manage any server listed in our database as long as there is at least an SSH server configured.

Servers house code or perform jobs. They are not necessarily web servers, but can be. When accessed via SSH, you have full access to everything that user has access to.

## Server Feature Details
Laravel Forge, and Digital Ocean are both supported providers, but any server can be added manually and accessed via SSH.

# RSS Feature Details
RSS feeds are synced and updated on a schedule. This is done via a job that runs every 15 minutes.

# Page Feature Details
Pages are dynamic routes that can be configured to point to any domain, or server. They can also be configured to redirect to another page, or domain.

22 changes: 22 additions & 0 deletions app/Actions/Spork/CustomAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

namespace App\Actions\Spork;

use Illuminate\Database\Eloquent\Model;

/**
* Actions are implemented as invokable controllers.
* They should expect to be sent an array of ids that represent the main model.
* public function __invoke(Dispatcher $dispatcher, Request $request)
*/
abstract class CustomAction
{
public function __construct(
public string $name = 'Set Namecheap DNS',
public string $slug = 'custom-action',
public ?string $models = null,
) {
}
}
33 changes: 33 additions & 0 deletions app/Actions/Spork/Domains/SyncNamecheapDnsAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

declare(strict_types=1);

namespace App\Actions\Spork\Domains;

use App\Contracts\ActionInterface;

class SyncNamecheapDnsAction implements ActionInterface
{
public function __invoke()
{
request()->validate([
'domains' => 'required|array',
'nameservers' => 'required',
]);

$domains = request()->get('domains');

$nameservers = explode(',', request()->get('nameservers', ''));

foreach ($domains as $domain) {
$this->service->updateDomainNs($domain, $nameservers);
}

return 'OK';
}

public function show(): bool
{
return auth()->check();
}
}
37 changes: 37 additions & 0 deletions app/Actions/Spork/SyncDataFromCredential.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

declare(strict_types=1);

namespace App\Actions\Spork;

use App\Jobs\FetchDomainsForCredential;
use App\Jobs\FetchRegistrarForCredential;
use App\Jobs\FetchServersForCredential;
use App\Jobs\Finance\SyncPlaidTransactionsJob;
use App\Jobs\Servers\LaravelForgeServersSyncJob;
use App\Models\Credential;
use Illuminate\Contracts\Bus\Dispatcher;
use Illuminate\Http\Request;

class SyncDataFromCredential extends CustomAction
{
public function __construct($name = 'Sync Data From Credential', $slug = 'sync-data-from-credential')
{
parent::__construct($name, $slug, models: Credential::class);
}

public function __invoke(Dispatcher $dispatcher, Request $request)
{
$credentials = Credential::where('user_id', $request->user()->id)->whereIn('id', $request->get('items'))->get();

foreach ($credentials as $credential) {
$dispatcher->dispatch(match ($credential->type) {
Credential::TYPE_REGISTRAR => new FetchRegistrarForCredential($credential),
Credential::TYPE_DOMAIN => new FetchDomainsForCredential($credential),
Credential::TYPE_SERVER => new FetchServersForCredential($credential),
Credential::TYPE_DEVELOPMENT, 'forge' => new LaravelForgeServersSyncJob($credential),
Credential::TYPE_FINANCE => new SyncPlaidTransactionsJob($credential, now()->subWeek(), now(), false),
});
}
}
}
Loading
Loading