From 9ddcb441582e61fa2e149cf1f05c58974933051e Mon Sep 17 00:00:00 2001 From: George King Date: Wed, 5 Mar 2025 15:08:36 +0800 Subject: [PATCH] chore: fix admin password in server config file and optimize service orchestration configuration --- Dockerfile | 11 +++-- config/expose-server.php | 88 ++++++++++++++++++++-------------------- docker-compose.yml | 3 ++ 3 files changed, 53 insertions(+), 49 deletions(-) diff --git a/Dockerfile b/Dockerfile index f9c44ac..01cf215 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,12 @@ -FROM php:8.1-cli +FROM php:8.2-cli RUN apt-get update -RUN apt-get install -y git libzip-dev zip +RUN apt-get install -y git libzip-dev zip libicu-dev -RUN docker-php-ext-install zip +RUN docker-php-ext-configure intl; \ + docker-php-ext-install intl zip; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* # Get latest Composer COPY --from=composer:latest /usr/bin/composer /usr/bin/composer @@ -12,7 +15,7 @@ COPY . /src WORKDIR /src # install the dependencies -RUN composer install -o --prefer-dist && chmod a+x expose +RUN composer install -o --prefer-dist && chmod a+x builds/expose-server ENV port=8080 ENV domain=localhost diff --git a/config/expose-server.php b/config/expose-server.php index 3d36320..0b65d5a 100644 --- a/config/expose-server.php +++ b/config/expose-server.php @@ -9,8 +9,7 @@ | */ 'memory_limit' => '128M', - - + /* |-------------------------------------------------------------------------- | Database @@ -26,7 +25,7 @@ '.expose', 'expose.db', ]), - + /* |-------------------------------------------------------------------------- | Validate auth tokens @@ -40,7 +39,7 @@ | */ 'validate_auth_tokens' => false, - + /* |-------------------------------------------------------------------------- | Maximum connection length @@ -53,7 +52,7 @@ | */ 'maximum_connection_length' => 0, - + /* |-------------------------------------------------------------------------- | Maximum number of open connections @@ -68,7 +67,7 @@ | */ 'maximum_open_connections_per_user' => 0, - + /* |-------------------------------------------------------------------------- | Subdomain @@ -80,7 +79,7 @@ | */ 'subdomain' => 'expose', - + /* |-------------------------------------------------------------------------- | Reserved Subdomain @@ -91,7 +90,7 @@ | */ 'reserved_subdomains' => [], - + /* |-------------------------------------------------------------------------- | Subdomain Generator @@ -103,7 +102,7 @@ | */ 'subdomain_generator' => \Expose\Server\SubdomainGenerator\RandomSubdomainGenerator::class, - + /* |-------------------------------------------------------------------------- | Connection Callback @@ -115,45 +114,44 @@ | */ 'connection_callback' => null, - - + 'connection_callbacks' => [ 'webhook' => [ 'url' => null, 'secret' => null, ], ], - + /* - |-------------------------------------------------------------------------- - | Users - |-------------------------------------------------------------------------- - | - | The admin dashboard of expose is protected via HTTP basic authentication - | Here you may add the user/password combinations that you want to - | accept as valid logins for the dashboard. - | - */ + |-------------------------------------------------------------------------- + | Users + |-------------------------------------------------------------------------- + | + | The admin dashboard of expose is protected via HTTP basic authentication + | Here you may add the user/password combinations that you want to + | accept as valid logins for the dashboard. + | + */ 'users' => [ - 'username' => 'secret', + 'username' => 'password', ], - + /* - |-------------------------------------------------------------------------- - | User Repository - |-------------------------------------------------------------------------- - | - | This is the user repository, which by default loads and saves all authorized - | users in a SQLite database. You can implement your own user repository - | if you want to store your users in a different store (Redis, MySQL, etc.) - | - */ + |-------------------------------------------------------------------------- + | User Repository + |-------------------------------------------------------------------------- + | + | This is the user repository, which by default loads and saves all authorized + | users in a SQLite database. You can implement your own user repository + | if you want to store your users in a different store (Redis, MySQL, etc.) + | + */ 'user_repository' => \Expose\Server\UserRepository\DatabaseUserRepository::class, - + 'subdomain_repository' => \Expose\Server\SubdomainRepository\DatabaseSubdomainRepository::class, - + 'logger_repository' => \Expose\Server\LoggerRepository\DatabaseLogger::class, - + /* |-------------------------------------------------------------------------- | Messages @@ -168,27 +166,27 @@ 'resolve_connection_message' => function ($connectionInfo, $user) { return config('expose-server.messages.message_of_the_day'); }, - + 'message_of_the_day' => 'Thank you for using expose.', - + 'invalid_auth_token' => 'Authentication failed. Please check your authentication token and try again.', - + 'subdomain_taken' => 'The chosen subdomain :subdomain is already taken. Please choose a different subdomain.', - + 'subdomain_reserved' => 'The chosen subdomain :subdomain is not available. Please choose a different subdomain.', - + 'custom_subdomain_unauthorized' => 'You are not allowed to specify custom subdomains. Please upgrade to Expose Pro. Assigning a random subdomain instead.', - + 'custom_domain_unauthorized' => 'You are not allowed to use this custom domain. If you think this should work, double-check the server setting and try again.', - + 'maximum_connection_length_reached' => 'You have reached the maximum connection length for this server. Please upgrade to Expose Pro for unlimited connection length.', ], - + 'statistics' => [ 'enable_statistics' => true, - + 'interval_in_seconds' => 3600, - + 'repository' => \Expose\Server\StatisticsRepository\DatabaseStatisticsRepository::class, ], ]; diff --git a/docker-compose.yml b/docker-compose.yml index e3d4b5d..e1acd4e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,6 +2,9 @@ version: "3.7" services: expose: image: beyondcodegmbh/expose-server:latest + build: + context: . + dockerfile: Dockerfile extra_hosts: - "host.docker.internal:host-gateway" ports: