diff --git a/.dev/.env b/.dev/.env new file mode 100644 index 0000000..e0cbb66 --- /dev/null +++ b/.dev/.env @@ -0,0 +1,16 @@ +JWT_ISSUER: https://auth.siteworxpro.com/application/o/postman/ +JWT_AUDIENCE: 1RWyqJFlyA4hmsDzq6kSxs0LXvk7UgEAfgmBCpQ9 +JWT_SIGNING_KEY: https://auth.siteworxpro.com/application/o/postman/.well-known/openid-configuration +QUEUE_BROKER: redis +PHP_IDE_CONFIG: serverName=localhost +WORKERS: 1 +GRPC_WORKERS: 1 +DEBUG: 1 +REDIS_HOST: redis +DB_HOST: postgres +DEV_MODE: 1 +APP_ENCRYPTION_KEY: base64:40U+IWaPTpp5o23quMfxcZJ0lOzkNy07SQ1rH6AV13o= +DB_USERNAME: siteworxpro +DB_PASSWORD: password +DB_DATABASE: siteworxpro +DB_PORT: 5432 diff --git a/.dev/docker-compose.yml b/.dev/docker-compose.yml index 32f6ac5..80bc08a 100644 --- a/.dev/docker-compose.yml +++ b/.dev/docker-compose.yml @@ -73,12 +73,8 @@ services: depends_on: postgres: condition: service_healthy - environment: - DB_USERNAME: ${DB_USERNAME:-siteworxpro} - DB_PASSWORD: ${DB_PASSWORD:-password} - DB_DATABASE: ${DB_DATABASE:-siteworxpro} - DB_HOST: ${DB_HOST-postgres} - DB_PORT: ${DB_PORT-5432} + env_file: + - .env dev-runtime: labels: @@ -116,18 +112,8 @@ services: condition: service_healthy postgres: condition: service_healthy - environment: - JWT_ISSUER: https://auth.siteworxpro.com/application/o/postman/ - JWT_AUDIENCE: 1RWyqJFlyA4hmsDzq6kSxs0LXvk7UgEAfgmBCpQ9 - JWT_SIGNING_KEY: https://auth.siteworxpro.com/application/o/postman/.well-known/openid-configuration - QUEUE_BROKER: redis - PHP_IDE_CONFIG: serverName=localhost - WORKERS: 1 - GRPC_WORKERS: 1 - DEBUG: 1 - REDIS_HOST: redis - DB_HOST: postgres - DEV_MODE: 1 + env_file: + - .env ## Kafka and Zookeeper for local development kafka-ui: diff --git a/config.php b/config.php index 4b00213..67c6e31 100644 --- a/config.php +++ b/config.php @@ -7,6 +7,8 @@ return [ 'app' => [ 'log_level' => Env::get('LOG_LEVEL', 'debug'), 'dev_mode' => Env::get('DEV_MODE', false, 'bool'), + 'url' => Env::get('APP_URL', 'https://localhost'), + 'encryption_key' => Env::get('APP_ENCRYPTION_KEY', 'base64:change_me'), ], /** diff --git a/db/migrations/000001_create_users_table.up.sql b/db/migrations/000001_create_users_table.up.sql index 0205ad9..809d7eb 100644 --- a/db/migrations/000001_create_users_table.up.sql +++ b/db/migrations/000001_create_users_table.up.sql @@ -1,41 +1,41 @@ create table clients ( - id uuid default gen_random_uuid() + id VARCHAR(26) not null constraint client_pk primary key, - client_id varchar not null + client_id varchar not null constraint client_client_id_key unique, - client_secret varchar not null, - name varchar not null, - description varchar default '', - private_key text not null, - encryption_key text not null, - grant_types jsonb not null default '[]'::jsonb, - capabilities jsonb not null default '[]'::jsonb, - confidential boolean not null default true, - created_at timestamp default now(), - updated_at timestamp default now() + client_secret varchar not null, + name varchar not null, + description varchar default '', + private_key text not null, + encryption_key text not null, + grant_types jsonb not null default '[]'::jsonb, + capabilities jsonb not null default '[]'::jsonb, + confidential boolean not null default true, + created_at timestamp default now(), + updated_at timestamp default now() ); create table client_redirect_uris ( - id uuid default gen_random_uuid() + id VARCHAR(26) not null constraint client_redirect_uris_pk primary key, - client_id uuid not null + client_id VARCHAR(26) not null constraint client_redirect_uris_client_id_fk references clients on delete cascade, - redirect_uri varchar not null + redirect_uri varchar not null ); create table scopes ( - id uuid default gen_random_uuid() + id VARCHAR(26) not null constraint scopes_pk primary key, - name varchar not null + name varchar not null constraint scopes_name_key unique, description varchar @@ -43,14 +43,14 @@ create table scopes create table client_scopes ( - id uuid default gen_random_uuid() + id VARCHAR(26) not null constraint client_scopes_pk primary key, - client_id uuid not null + client_id VARCHAR(26) not null constraint client_scopes_client_id_fk references clients on delete cascade, - scope_id uuid not null + scope_id VARCHAR(26) not null constraint client_scopes_scope_id_fk references scopes on delete cascade, @@ -60,29 +60,29 @@ create table client_scopes create table users ( - id uuid default gen_random_uuid() + id VARCHAR(26) not null constraint users_pk primary key, - first_name varchar not null, - last_name varchar not null, - email varchar not null + first_name varchar not null, + last_name varchar not null, + email varchar not null constraint users_email_key unique, - password varchar not null, + password varchar not null, created_at timestamp default now(), updated_at timestamp default now() ); create table client_users ( - id uuid default gen_random_uuid() + id VARCHAR(26) not null constraint client_users_pk primary key, - client_id uuid not null + client_id VARCHAR(26) not null constraint client_users_client_id_fk references clients on delete cascade, - user_id uuid not null + user_id VARCHAR(26) not null constraint client_users_user_id_fk references users on delete cascade, diff --git a/front-end/src/pages/login.vue b/front-end/src/pages/login.vue index 3dd6a85..b261fd5 100644 --- a/front-end/src/pages/login.vue +++ b/front-end/src/pages/login.vue @@ -4,9 +4,7 @@