diff --git a/.env b/.env --- a/.env +++ b/.env @@ -1 +1 @@ -src/.env \ No newline at end of file +config/env \ No newline at end of file diff --git a/bin/configure.sh b/bin/configure.sh new file mode 100755 --- /dev/null +++ b/bin/configure.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +if [ ! -d config ]; then + echo "Failed to find a configuration folder. Use e.g. 'ln -s config.local config'" + exit 1 +fi + +rm -f src/resources/themes/active +if [ -d config/theme ]; then + cp -r config/theme src/resources/themes/active +else + ln -s ../default src/resources/themes/active +fi + +rm -rf src/database/seeds +cp -rL config/seeds src/database/seeds + +if [ -d config/seed-migrations ]; then + rm -rf src/database/seed-migrations + cp -rL config/seed-migrations src/database/seed-migrations +fi + +rm -f .env +ln -s config/env .env +rm -f src/.env +cp config/env src/.env diff --git a/bin/quickstart.sh b/bin/quickstart.sh --- a/bin/quickstart.sh +++ b/bin/quickstart.sh @@ -16,14 +16,7 @@ base_dir=$(dirname $(dirname $0)) -# Always reset .env with .env.example -cp src/.env.example src/.env -if [ -f "src/env.local" ]; then - # Ensure there's a line ending - echo "" >> src/.env - cat src/env.local >> src/.env -fi export DOCKER_BUILDKIT=0 @@ -37,17 +30,13 @@ docker volume rm kolab_imap || : docker volume rm kolab_ldap || : -if [ "$1" != "--nodev" ]; then - src/artisan octane:stop >/dev/null 2>&1 || : - src/artisan horizon:terminate >/dev/null 2>&1 || : -else - # If we switch from an existing development setup to a compose deployment, - # we don't have a nice way to terminate octane/horizon. - # We can't use the artisan command because it will just block if redis is, - # no longer available, so we just kill all artisan processes running. - pkill -9 -f artisan || : -fi +# We can't use the following artisan commands because it will just block if redis is unavailable: +# src/artisan octane:stop >/dev/null 2>&1 || : +# src/artisan horizon:terminate >/dev/null 2>&1 || : +# we therefore just kill all artisan processes running. +pkill -9 -f artisan || : +bin/configure.sh bin/regen-certs docker-compose build coturn kolab mariadb meet pdns proxy redis haproxy docker-compose ${COMPOSE_ARGS} up -d coturn kolab mariadb meet pdns redis @@ -147,7 +136,7 @@ pushd ${base_dir}/src/ rm -rf database/database.sqlite ./artisan db:ping --wait -php -dmemory_limit=512M ./artisan migrate:refresh --seed +php -dmemory_limit=512M ./artisan migrate:refresh --path=/database/migrations --path=/database/seed-migrations --seed ./artisan data:import || : nohup ./artisan octane:start --host=$(grep OCTANE_HTTP_HOST .env | tail -n1 | sed "s/OCTANE_HTTP_HOST=//") > octane.out & nohup ./artisan horizon > horizon.out & diff --git a/config.local/README.md b/config.local/README.md new file mode 100644 --- /dev/null +++ b/config.local/README.md @@ -0,0 +1,7 @@ + + +src/resources/themes/$theme + +# Custom Theme + +Add to theme subdirectory diff --git a/src/.env.example b/config.local/env rename from src/.env.example rename to config.local/env --- a/src/.env.example +++ b/config.local/env @@ -7,7 +7,7 @@ APP_PUBLIC_URL=https://kolab.local APP_DOMAIN=kolab.local APP_WEBSITE_DOMAIN=kolab.local -APP_THEME=default +APP_THEME=active APP_TENANT_ID=5 APP_LOCALE=en APP_LOCALES= @@ -187,3 +187,27 @@ PROXY_SSL_CERTIFICATE=/etc/certs/imap.hosted.com.cert PROXY_SSL_CERTIFICATE_KEY=/etc/certs/imap.hosted.com.key + +APP_KEY=base64:FG6ECzyAMSmyX+eYwO/FW3bwnarbKkBhqtO65vlMb1E= +COTURN_STATIC_SECRET=uzYguvIl9tpZFMuQOE78DpOi6Jc7VFSD0UAnvgMsg5n4e74MgIf6vQvbc6LWzZjz + +APP_LDAP=1 + +MOLLIE_KEY="from mollie" +STRIPE_KEY="from stripe" +STRIPE_PUBLIC_KEY="from stripe" +STRIPE_WEBHOOK_SECRET="from stripe" + +OX_API_KEY="from openexchange" +FIREBASE_API_KEY="from firebase" + +#Generated by php artisan passport:client --password, but can be left hardcoded (the seeder will pick it up) +PASSPORT_PROXY_OAUTH_CLIENT_ID=942edef5-3dbd-4a14-8e3e-d5d59b727bee +PASSPORT_PROXY_OAUTH_CLIENT_SECRET=L6L0n56ecvjjK0cJMjeeV1pPAeffUBO0YSSH63wf + +#Generated by php artisan passport:client --password, but can be left hardcoded (the seeder will pick it up) +PASSPORT_COMPANIONAPP_OAUTH_CLIENT_ID=9566e018-f05d-425c-9915-420cdb9258bb +PASSPORT_COMPANIONAPP_OAUTH_CLIENT_SECRET=XjgV6SU9shO0QFKaU6pQPRC5rJpyRezDJTSoGLgz + +APP_TENANT_ID=42 +APP_PASSPHRASE=simple123 diff --git a/src/database/migrations/2021_01_26_150000_change_sku_descriptions.php b/config.local/seed-migrations/2021_01_26_150000_change_sku_descriptions.php rename from src/database/migrations/2021_01_26_150000_change_sku_descriptions.php rename to config.local/seed-migrations/2021_01_26_150000_change_sku_descriptions.php diff --git a/src/database/migrations/2021_02_19_100000_transaction_amount_fix.php b/config.local/seed-migrations/2021_02_19_100000_transaction_amount_fix.php rename from src/database/migrations/2021_02_19_100000_transaction_amount_fix.php rename to config.local/seed-migrations/2021_02_19_100000_transaction_amount_fix.php diff --git a/src/database/migrations/2021_12_15_100000_rename_beta_skus.php b/config.local/seed-migrations/2021_12_15_100000_rename_beta_skus.php rename from src/database/migrations/2021_12_15_100000_rename_beta_skus.php rename to config.local/seed-migrations/2021_12_15_100000_rename_beta_skus.php diff --git a/config.local/seed-migrations/2022_05_13_090000_permissions_and_room_subscriptions.php b/config.local/seed-migrations/2022_05_13_090000_permissions_and_room_subscriptions.php new file mode 100644 --- /dev/null +++ b/config.local/seed-migrations/2022_05_13_090000_permissions_and_room_subscriptions.php @@ -0,0 +1,57 @@ + 'group-room', + 'name' => 'Group conference room', + 'description' => 'Shareable audio & video conference room', + 'cost' => 0, + 'units_free' => 0, + 'period' => 'monthly', + 'handler_class' => 'App\Handlers\GroupRoom', + 'active' => true, + ]); + + \App\Sku::create([ + 'title' => 'room', + 'name' => 'Standard conference room', + 'description' => 'Audio & video conference room', + 'cost' => 0, + 'units_free' => 0, + 'period' => 'monthly', + 'handler_class' => 'App\Handlers\Room', + 'active' => true, + ]); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + \App\Sku::where('title', 'room')->delete(); + \App\Sku::where('title', 'group-room')->delete(); + + \App\Sku::create([ + 'title' => 'meet', + 'name' => 'Voice & Video Conferencing (public beta)', + 'description' => 'Video conferencing tool', + 'cost' => 0, + 'units_free' => 0, + 'period' => 'monthly', + 'handler_class' => 'App\Handlers\Meet', + 'active' => true, + ]); + } +}; diff --git a/src/database/migrations/2022_07_08_100000_fix_group_sku_name.php b/config.local/seed-migrations/2022_07_08_100000_fix_group_sku_name.php rename from src/database/migrations/2022_07_08_100000_fix_group_sku_name.php rename to config.local/seed-migrations/2022_07_08_100000_fix_group_sku_name.php diff --git a/config.local/seed-migrations/2022_09_08_100001_plans_free_months.php b/config.local/seed-migrations/2022_09_08_100001_plans_free_months.php new file mode 100644 --- /dev/null +++ b/config.local/seed-migrations/2022_09_08_100001_plans_free_months.php @@ -0,0 +1,26 @@ +update(['free_months' => 1]); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + } +}; diff --git a/config.local/seeds/DatabaseSeeder.php b/config.local/seeds/DatabaseSeeder.php new file mode 100644 --- /dev/null +++ b/config.local/seeds/DatabaseSeeder.php @@ -0,0 +1,32 @@ +call([ + Local\IP4NetSeeder::class, + Local\TenantSeeder::class, + Local\DiscountSeeder::class, + Local\DomainSeeder::class, + Local\SkuSeeder::class, + Local\PackageSeeder::class, + Local\PlanSeeder::class, + Local\PowerDNSSeeder::class, + Local\UserSeeder::class, + Local\OauthClientSeeder::class, + Local\ResourceSeeder::class, + Local\SharedFolderSeeder::class, + Local\MeetRoomSeeder::class, + ]); + } +} diff --git a/src/database/seeds/local/DiscountSeeder.php b/config.local/seeds/DiscountSeeder.php rename from src/database/seeds/local/DiscountSeeder.php rename to config.local/seeds/DiscountSeeder.php diff --git a/src/database/seeds/local/DomainSeeder.php b/config.local/seeds/DomainSeeder.php rename from src/database/seeds/local/DomainSeeder.php rename to config.local/seeds/DomainSeeder.php diff --git a/src/database/seeds/local/IP4NetSeeder.php b/config.local/seeds/IP4NetSeeder.php rename from src/database/seeds/local/IP4NetSeeder.php rename to config.local/seeds/IP4NetSeeder.php diff --git a/src/database/seeds/local/MeetRoomSeeder.php b/config.local/seeds/MeetRoomSeeder.php rename from src/database/seeds/local/MeetRoomSeeder.php rename to config.local/seeds/MeetRoomSeeder.php diff --git a/src/database/seeds/local/OauthClientSeeder.php b/config.local/seeds/OauthClientSeeder.php rename from src/database/seeds/local/OauthClientSeeder.php rename to config.local/seeds/OauthClientSeeder.php diff --git a/src/database/seeds/local/PackageSeeder.php b/config.local/seeds/PackageSeeder.php rename from src/database/seeds/local/PackageSeeder.php rename to config.local/seeds/PackageSeeder.php diff --git a/src/database/seeds/local/PlanSeeder.php b/config.local/seeds/PlanSeeder.php rename from src/database/seeds/local/PlanSeeder.php rename to config.local/seeds/PlanSeeder.php diff --git a/src/database/seeds/local/PowerDNSSeeder.php b/config.local/seeds/PowerDNSSeeder.php rename from src/database/seeds/local/PowerDNSSeeder.php rename to config.local/seeds/PowerDNSSeeder.php diff --git a/src/database/seeds/local/ResourceSeeder.php b/config.local/seeds/ResourceSeeder.php rename from src/database/seeds/local/ResourceSeeder.php rename to config.local/seeds/ResourceSeeder.php diff --git a/src/database/seeds/local/SharedFolderSeeder.php b/config.local/seeds/SharedFolderSeeder.php rename from src/database/seeds/local/SharedFolderSeeder.php rename to config.local/seeds/SharedFolderSeeder.php diff --git a/src/database/seeds/local/SkuSeeder.php b/config.local/seeds/SkuSeeder.php rename from src/database/seeds/local/SkuSeeder.php rename to config.local/seeds/SkuSeeder.php diff --git a/src/database/seeds/local/TenantSeeder.php b/config.local/seeds/TenantSeeder.php rename from src/database/seeds/local/TenantSeeder.php rename to config.local/seeds/TenantSeeder.php diff --git a/src/database/seeds/local/UserSeeder.php b/config.local/seeds/UserSeeder.php rename from src/database/seeds/local/UserSeeder.php rename to config.local/seeds/UserSeeder.php diff --git a/docker/webapp/init.sh b/docker/webapp/init.sh --- a/docker/webapp/init.sh +++ b/docker/webapp/init.sh @@ -32,7 +32,7 @@ rm -rf database/database.sqlite ./artisan db:ping --wait -php -dmemory_limit=512M ./artisan migrate:refresh --seed +php -dmemory_limit=512M ./artisan migrate:refresh --path=/database/migrations --path=/database/seed-migrations --seed ./artisan data:import || : nohup ./artisan horizon >/dev/null 2>&1 & ./artisan octane:start --host=$(grep OCTANE_HTTP_HOST .env | tail -n1 | sed "s/OCTANE_HTTP_HOST=//") diff --git a/src/.gitignore b/src/.gitignore --- a/src/.gitignore +++ b/src/.gitignore @@ -24,4 +24,7 @@ composer.lock resources/countries.php resources/build/js/ +database/seeds/ +database/seed-migrations/ +src/public/themes/active cache diff --git a/src/database/migrations/2021_04_08_150000_signup_code_headers.php b/src/database/migrations/2021_04_08_150000_signup_code_headers.php --- a/src/database/migrations/2021_04_08_150000_signup_code_headers.php +++ b/src/database/migrations/2021_04_08_150000_signup_code_headers.php @@ -2,7 +2,6 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; -use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; // phpcs:ignore diff --git a/src/database/migrations/2021_07_12_100000_create_tenant_settings_table.php b/src/database/migrations/2021_07_12_100000_create_tenant_settings_table.php --- a/src/database/migrations/2021_07_12_100000_create_tenant_settings_table.php +++ b/src/database/migrations/2021_07_12_100000_create_tenant_settings_table.php @@ -2,7 +2,6 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; -use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; // phpcs:ignore diff --git a/src/database/migrations/2022_05_13_100000_permissions_and_room_subscriptions.php b/src/database/migrations/2022_05_13_100000_permissions_and_room_subscriptions.php --- a/src/database/migrations/2022_05_13_100000_permissions_and_room_subscriptions.php +++ b/src/database/migrations/2022_05_13_100000_permissions_and_room_subscriptions.php @@ -38,54 +38,32 @@ ); // Create the new SKUs - if (!\App\Sku::where('title', 'room')->first()) { - $sku = \App\Sku::create([ - 'title' => 'group-room', - 'name' => 'Group conference room', - 'description' => 'Shareable audio & video conference room', - 'cost' => 0, - 'units_free' => 0, - 'period' => 'monthly', - 'handler_class' => 'App\Handlers\GroupRoom', - 'active' => true, - ]); + $sku = \App\Sku::where('title', 'room')->first(); - $sku = \App\Sku::create([ - 'title' => 'room', - 'name' => 'Standard conference room', - 'description' => 'Audio & video conference room', - 'cost' => 0, - 'units_free' => 0, - 'period' => 'monthly', - 'handler_class' => 'App\Handlers\Room', - 'active' => true, - ]); + // Create the entitlement for every existing room + foreach (\App\Meet\Room::get() as $room) { + $user = \App\User::find($room->user_id); // @phpstan-ignore-line + if (!$user) { + $room->forceDelete(); + continue; + } - // Create the entitlement for every existing room - foreach (\App\Meet\Room::get() as $room) { - $user = \App\User::find($room->user_id); // @phpstan-ignore-line - if (!$user) { - $room->forceDelete(); - continue; - } - - // Set tenant_id - if ($user->tenant_id) { - $room->tenant_id = $user->tenant_id; - $room->save(); - } - - $wallet = $user->wallets()->first(); - - \App\Entitlement::create([ - 'wallet_id' => $wallet->id, - 'sku_id' => $sku->id, - 'cost' => 0, - 'fee' => 0, - 'entitleable_id' => $room->id, - 'entitleable_type' => \App\Meet\Room::class - ]); + // Set tenant_id + if ($user->tenant_id) { + $room->tenant_id = $user->tenant_id; + $room->save(); } + + $wallet = $user->wallets()->first(); + + \App\Entitlement::create([ + 'wallet_id' => $wallet->id, + 'sku_id' => $sku->id, + 'cost' => 0, + 'fee' => 0, + 'entitleable_id' => $room->id, + 'entitleable_type' => \App\Meet\Room::class + ]); } // Remove 'meet' SKU/entitlements @@ -137,19 +115,6 @@ ); \App\Entitlement::where('entitleable_type', \App\Meet\Room::class)->forceDelete(); - \App\Sku::where('title', 'room')->delete(); - \App\Sku::where('title', 'group-room')->delete(); - - \App\Sku::create([ - 'title' => 'meet', - 'name' => 'Voice & Video Conferencing (public beta)', - 'description' => 'Video conferencing tool', - 'cost' => 0, - 'units_free' => 0, - 'period' => 'monthly', - 'handler_class' => 'App\Handlers\Meet', - 'active' => true, - ]); Schema::dropIfExists('permissions'); } diff --git a/src/database/migrations/2022_09_08_100000_plans_free_months.php b/src/database/migrations/2022_09_08_100000_plans_free_months.php --- a/src/database/migrations/2022_09_08_100000_plans_free_months.php +++ b/src/database/migrations/2022_09_08_100000_plans_free_months.php @@ -2,7 +2,6 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; -use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; return new class extends Migration @@ -20,8 +19,6 @@ $table->tinyInteger('free_months')->unsigned()->default(0); } ); - - DB::table('plans')->update(['free_months' => 1]); } /** diff --git a/src/database/seeds/DatabaseSeeder.php b/src/database/seeds/DatabaseSeeder.php deleted file mode 100644 --- a/src/database/seeds/DatabaseSeeder.php +++ /dev/null @@ -1,44 +0,0 @@ - $name) { - $class = "Database\\Seeds\\$env\\$name"; - $seeders[$idx] = class_exists($class) ? $class : null; - } - - $seeders = array_filter($seeders); - - $this->call($seeders); - } -} diff --git a/src/database/seeds/production/DiscountSeeder.php b/src/database/seeds/production/DiscountSeeder.php deleted file mode 100644 --- a/src/database/seeds/production/DiscountSeeder.php +++ /dev/null @@ -1,33 +0,0 @@ - 'Free Account', - 'discount' => 100, - 'active' => true, - ] - ); - - Discount::create( - [ - 'description' => 'Student or Educational Institution', - 'discount' => 30, - 'active' => true, - ] - ); - } -} diff --git a/src/database/seeds/production/DomainSeeder.php b/src/database/seeds/production/DomainSeeder.php deleted file mode 100644 --- a/src/database/seeds/production/DomainSeeder.php +++ /dev/null @@ -1,52 +0,0 @@ - $domain, - 'status' => Domain::STATUS_CONFIRMED + Domain::STATUS_ACTIVE, - 'type' => Domain::TYPE_PUBLIC - ] - ); - } - } -} diff --git a/src/database/seeds/production/PackageSeeder.php b/src/database/seeds/production/PackageSeeder.php deleted file mode 100644 --- a/src/database/seeds/production/PackageSeeder.php +++ /dev/null @@ -1,86 +0,0 @@ - 'activesync']); - $skuGroupware = Sku::firstOrCreate(['title' => 'groupware']); - $skuMailbox = Sku::firstOrCreate(['title' => 'mailbox']); - $skuStorage = Sku::firstOrCreate(['title' => 'storage']); - - $package = Package::create( - [ - 'title' => 'kolab', - 'name' => 'Groupware Account', - 'description' => 'A fully functional groupware account.', - 'discount_rate' => 0 - ] - ); - - $skus = [ - $skuMailbox, - $skuGroupware, - $skuStorage, - $skuActiveSync - ]; - - $package->skus()->saveMany($skus); - - // This package contains 2 units of the storage SKU, which just so happens to also - // be the number of SKU free units. - $package->skus()->updateExistingPivot( - $skuStorage, - ['qty' => 2], - false - ); - - $package = Package::create( - [ - 'title' => 'lite', - 'name' => 'Lite Account', - 'description' => 'Just mail and no more.', - 'discount_rate' => 0 - ] - ); - - $skus = [ - $skuMailbox, - $skuStorage - ]; - - $package->skus()->saveMany($skus); - - $package->skus()->updateExistingPivot( - Sku::firstOrCreate(['title' => 'storage']), - ['qty' => 2], - false - ); - - $package = Package::create( - [ - 'title' => 'domain-hosting', - 'name' => 'Domain Hosting', - 'description' => 'Use your own, existing domain.', - 'discount_rate' => 0 - ] - ); - - $skus = [ - Sku::firstOrCreate(['title' => 'domain-hosting']) - ]; - - $package->skus()->saveMany($skus); - } -} diff --git a/src/database/seeds/production/PlanSeeder.php b/src/database/seeds/production/PlanSeeder.php deleted file mode 100644 --- a/src/database/seeds/production/PlanSeeder.php +++ /dev/null @@ -1,76 +0,0 @@ -Everything you need to get started or try Kolab Now, including:

- -EOD; - - $plan = Plan::create( - [ - 'title' => 'individual', - 'name' => 'Individual Account', - 'description' => $description, - 'free_months' => 1, - 'discount_qty' => 0, - 'discount_rate' => 0 - ] - ); - - $packages = [ - Package::firstOrCreate(['title' => 'kolab']) - ]; - - $plan->packages()->saveMany($packages); - - $description = <<<'EOD' -

All the features of the Individual Account, with the following extras:

- -EOD; - - $plan = Plan::create( - [ - 'title' => 'group', - 'name' => 'Group Account', - 'description' => $description, - 'free_months' => 1, - 'discount_qty' => 0, - 'discount_rate' => 0 - ] - ); - - $packages = [ - Package::firstOrCreate(['title' => 'domain-hosting']), - Package::firstOrCreate(['title' => 'kolab']), - ]; - - $plan->packages()->saveMany($packages); - } -} diff --git a/src/database/seeds/production/SkuSeeder.php b/src/database/seeds/production/SkuSeeder.php deleted file mode 100644 --- a/src/database/seeds/production/SkuSeeder.php +++ /dev/null @@ -1,172 +0,0 @@ - 'mailbox', - 'name' => 'User Mailbox', - 'description' => 'Just a mailbox', - 'cost' => 444, - 'units_free' => 0, - 'period' => 'monthly', - 'handler_class' => 'App\Handlers\Mailbox', - 'active' => true, - ], - [ - 'title' => 'domain', - 'name' => 'Hosted Domain', - 'description' => 'Somewhere to place a mailbox', - 'cost' => 100, - 'period' => 'monthly', - 'handler_class' => 'App\Handlers\Domain', - 'active' => false, - ], - [ - 'title' => 'domain-registration', - 'name' => 'Domain Registration', - 'description' => 'Register a domain with us', - 'cost' => 101, - 'period' => 'yearly', - 'handler_class' => 'App\Handlers\DomainRegistration', - 'active' => false, - ], - [ - 'title' => 'domain-hosting', - 'name' => 'External Domain', - 'description' => 'Host a domain that is externally registered', - 'cost' => 100, - 'units_free' => 1, - 'period' => 'monthly', - 'handler_class' => 'App\Handlers\DomainHosting', - 'active' => true, - ], - [ - 'title' => 'domain-relay', - 'name' => 'Domain Relay', - 'description' => 'A domain you host at home, for which we relay email', - 'cost' => 103, - 'period' => 'monthly', - 'handler_class' => 'App\Handlers\DomainRelay', - 'active' => false, - ], - [ - 'title' => 'storage', - 'name' => 'Storage Quota', - 'description' => 'Some wiggle room', - 'cost' => 50, - 'units_free' => 2, - 'period' => 'monthly', - 'handler_class' => 'App\Handlers\Storage', - 'active' => true, - ], - [ - 'title' => 'groupware', - 'name' => 'Groupware Features', - 'description' => 'Groupware functions like Calendar, Tasks, Notes, etc.', - 'cost' => 555, - 'units_free' => 0, - 'period' => 'monthly', - 'handler_class' => 'App\Handlers\Groupware', - 'active' => true, - ], - [ - 'title' => 'resource', - 'name' => 'Resource', - 'description' => 'Reservation taker', - 'cost' => 0, - 'period' => 'monthly', - 'handler_class' => 'App\Handlers\Resource', - 'active' => true, - ], - [ - 'title' => 'shared-folder', - 'name' => 'Shared Folder', - 'description' => 'A shared folder', - 'cost' => 89, - 'period' => 'monthly', - 'handler_class' => 'App\Handlers\SharedFolder', - 'active' => false, - ], - [ - 'title' => '2fa', - 'name' => '2-Factor Authentication', - 'description' => 'Two factor authentication for webmail and administration panel', - 'cost' => 0, - 'units_free' => 0, - 'period' => 'monthly', - 'handler_class' => 'App\Handlers\Auth2F', - 'active' => true, - ], - [ - 'title' => 'activesync', - 'name' => 'Activesync', - 'description' => 'Mobile synchronization', - 'cost' => 100, - 'units_free' => 0, - 'period' => 'monthly', - 'handler_class' => 'App\Handlers\Activesync', - 'active' => true, - ], - [ - 'title' => 'beta', - 'name' => 'Private Beta (invitation only)', - 'description' => 'Access to the private beta program subscriptions', - 'cost' => 0, - 'units_free' => 0, - 'period' => 'monthly', - 'handler_class' => 'App\Handlers\Beta', - 'active' => false, - ], - [ - 'title' => 'group', - 'name' => 'Distribution list', - 'description' => 'Mail distribution list', - 'cost' => 0, - 'units_free' => 0, - 'period' => 'monthly', - 'handler_class' => 'App\Handlers\Group', - 'active' => true, - ], - [ - 'title' => 'group-room', - 'name' => 'Group conference room', - 'description' => 'Shareable audio & video conference room', - 'cost' => 0, - 'units_free' => 0, - 'period' => 'monthly', - 'handler_class' => 'App\Handlers\GroupRoom', - 'active' => true, - ], - [ - 'title' => 'room', - 'name' => 'Standard conference room', - 'description' => 'Audio & video conference room', - 'cost' => 0, - 'units_free' => 0, - 'period' => 'monthly', - 'handler_class' => 'App\Handlers\Room', - 'active' => true, - ], - ]; - - foreach ($skus as $sku) { - // Check existence because migration might have added this already - if (!Sku::where('title', $sku['title'])->first()) { - Sku::create($sku); - } - } - } -}