mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
wip
This commit is contained in:
81
docs/server/admin-interface.md
Normal file
81
docs/server/admin-interface.md
Normal file
@@ -0,0 +1,81 @@
|
||||
---
|
||||
title: Admin Interface
|
||||
order: 3
|
||||
---
|
||||
|
||||
# Admin Interface
|
||||
|
||||
The Expose server comes with a beautiful admin interface, that makes configuring your server a breeze.
|
||||
|
||||
The admin interface is available at a specific subdomain on your expose server. By default it is called "expose", but you can change this in the configuration file:
|
||||
|
||||
```
|
||||
...
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Subdomain
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is the subdomain that your expose admin dashboard will be available at.
|
||||
| The given subdomain will be reserved, so no other tunnel connection can
|
||||
| request this subdomain for their own connection.
|
||||
|
|
||||
*/
|
||||
'subdomain' => 'expose',
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
So you can reach the admin interface at http://expose.your-domaion.com.
|
||||
|
||||
## Authentication
|
||||
|
||||
Since the expose admin interface allows you to change and modify your expose server configuration at runtime, access to the admin interface is protected using basic authentication.
|
||||
You can define which user/password combinations are allowed in the configuration file:
|
||||
|
||||
> **Note:** You will need to restart your expose server, once you change this setting in order for the changes to take effect.
|
||||
|
||||
```
|
||||
...
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| 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' => 'password'
|
||||
],
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
### Users
|
||||
|
||||

|
||||
|
||||
Here you can list, add and delete all users that you want to be able to connect to your expose server.
|
||||
The users will be stored in a SQLite database that can be modified in the expose configuration file.
|
||||
|
||||
You only need to add users to your expose server, if you have the auth token validation enabled.
|
||||
|
||||
### Shared sites
|
||||
|
||||

|
||||
|
||||
Once you and others start sharing their local sites with your server, you can see a list of all connectes sites here.
|
||||
You can see the original client host that was shared, the subdomain that was associated to this and the time and date the site was shared.
|
||||
|
||||
The expose server can also disconnect a site from the server. Just press on the "Disconnect" button and the client connection will be closed.
|
||||
|
||||
### Settings
|
||||
|
||||

|
||||
|
||||
Here you can see and modify your Expose server settings.
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
title: Administrators
|
||||
order: 10
|
||||
---
|
||||
|
||||
# Sharing local sites
|
||||
|
||||
This page will be under the "Basic Usage" submenu.
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
title: Configuration
|
||||
order: 1
|
||||
---
|
||||
|
||||
# Sharing local sites
|
||||
|
||||
This page will be under the "Basic Usage" submenu.
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
title: Maximum connection length
|
||||
order: 10
|
||||
---
|
||||
|
||||
# Sharing local sites
|
||||
|
||||
This page will be under the "Basic Usage" submenu.
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
title: Extending
|
||||
order: 10
|
||||
---
|
||||
|
||||
# Sharing local sites
|
||||
|
||||
This page will be under the "Basic Usage" submenu.
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
title: Message of the day
|
||||
order: 10
|
||||
---
|
||||
|
||||
# Sharing local sites
|
||||
|
||||
This page will be under the "Basic Usage" submenu.
|
||||
34
docs/server/server-configuration.md
Normal file
34
docs/server/server-configuration.md
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
title: Server Configuration
|
||||
order: 5
|
||||
---
|
||||
|
||||
# Server Configuration
|
||||
|
||||
Within the Expose admin interface, you can configure how you want your specific expose server to behave.
|
||||
|
||||
Here are the available settings:
|
||||
|
||||

|
||||
|
||||
## Authentication
|
||||
|
||||
When you start your expose server, anyone is able to connect to it by default. If you want to restrict your server only to users that have a valid "authentication token", you can simply check the checkbox. Only registered users / authentication tokens are then able to connect to your server.
|
||||
|
||||
> **Note:** This is only a temporary modification for as long as your expose server is running. To permanently enable this feature, modify your expose config file.
|
||||
|
||||
## Message of the day
|
||||
|
||||
This message will be shown when a sucessful connection to the expose server can be established. You can change it on demand, or modify it permanently in your expose configuration file.
|
||||
|
||||
## Maximum connection length
|
||||
|
||||
You can define how long you want your users connection to your expose server to be open at maximum. This time can be configured in minutes. Once the connection exceeds the specified duration, the client connection gets closed automatically.
|
||||
|
||||
## Authentication failed
|
||||
|
||||
This message will be shown when a user tries to connect with an invalid authentication token. If your users can somehow obtain an authentication token, this is a great place to let them know how to do it.
|
||||
|
||||
## Subdomain taken
|
||||
|
||||
This message will be shown when a user tries to connect with an already registered subdomain. This could be any user-registered subdomain, as well as the expose admin dashboard subdomain.
|
||||
39
docs/server/ssl.md
Normal file
39
docs/server/ssl.md
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: SSL Support
|
||||
order: 2
|
||||
---
|
||||
|
||||
# SSL Support
|
||||
|
||||
Once your Expose server is running, you can onyl access it over the port that you configure when the server gets started.
|
||||
|
||||
If you want to enable SSL support, you will need to use a proxy service - like Nginx, HAProxy or Caddy - to handle the SSL configurations and proxy all requests in plain HTTP to your expose server.
|
||||
|
||||
A basic Nginx configuration would look like this, but you might want to tweak the SSL parameters to your liking.
|
||||
|
||||
```
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
server_name expose.yourapp.tld;
|
||||
|
||||
# Start the SSL configurations
|
||||
ssl on;
|
||||
ssl_certificate /etc/letsencrypt/live/expose.yourapp.tld/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/expose.yourapp.tld/privkey.pem;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8080;
|
||||
proxy_read_timeout 60;
|
||||
proxy_connect_timeout 60;
|
||||
proxy_redirect off;
|
||||
|
||||
# Allow the use of websockets
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
}
|
||||
}
|
||||
```
|
||||
122
docs/server/starting-the-server.md
Normal file
122
docs/server/starting-the-server.md
Normal file
@@ -0,0 +1,122 @@
|
||||
---
|
||||
title: Starting the server
|
||||
order: 1
|
||||
---
|
||||
|
||||
# Starting the server
|
||||
|
||||
You can host your own custom Expose server in order to make use of your own domain, when sharing your local sites.
|
||||
|
||||
The expose binary that you install via composer contains both the server and the client, so you do not need any additional software for this to work.
|
||||
|
||||
Once you have successfully downloaded expose, you can start the server using this command:
|
||||
|
||||
````bash
|
||||
expose serve my-domain.com
|
||||
````
|
||||
|
||||
This will start listening for incoming expose client connections on port 8080 by default.
|
||||
|
||||
If you want, you can customize the port:
|
||||
|
||||
```bash
|
||||
expose serve my-domain.com --port=3000
|
||||
```
|
||||
|
||||
## Validating auth tokens
|
||||
|
||||
When you start your expose server, anyone is able to connect to it by default. If you want to restrict your server only to users that have a valid "authentication token", you can start the server with the `--validateAuthTokens` option:
|
||||
|
||||
```bash
|
||||
expose serve my-domain.com --validateAuthTokens
|
||||
```
|
||||
|
||||
Don't worry - you can also changes this later on through the admin interface.
|
||||
|
||||
## Keeping the expose server running with supervisord
|
||||
|
||||
The `expose serve` daemon needs to always be running in order to accept connections. This is a prime use case for `supervisor`, a task runner on Linux.
|
||||
|
||||
First, make sure `supervisor` is installed.
|
||||
|
||||
```bash
|
||||
# On Debian / Ubuntu
|
||||
apt install supervisor
|
||||
|
||||
# On Red Hat / CentOS
|
||||
yum install supervisor
|
||||
systemctl enable supervisord
|
||||
```
|
||||
|
||||
Once installed, add a new process that `supervisor` needs to keep running. You place your configurations in the `/etc/supervisor/conf.d` (Debian/Ubuntu) or `/etc/supervisord.d` (Red Hat/CentOS) directory.
|
||||
|
||||
Within that directory, create a new file called `expose.conf`.
|
||||
|
||||
```bash
|
||||
[program:expose]
|
||||
command=/usr/bin/php /home/expose/expose serve
|
||||
numprocs=1
|
||||
autostart=true
|
||||
autorestart=true
|
||||
user=forge
|
||||
```
|
||||
|
||||
Once created, instruct `supervisor` to reload its configuration files (without impacting the already running `supervisor` jobs).
|
||||
|
||||
```bash
|
||||
supervisorctl update
|
||||
supervisorctl start expose
|
||||
```
|
||||
|
||||
Your expose server should now be running (you can verify this with `supervisorctl status`). If it were to crash, `supervisor` will automatically restart it.
|
||||
|
||||
Please note that, by default, `supervisor` will force a maximum number of open files onto all the processes that it manages. This is configured by the `minfds` parameter in `supervisord.conf`.
|
||||
|
||||
If you want to increase the maximum number of open files, you may do so in `/etc/supervisor/supervisord.conf` (Debian/Ubuntu) or `/etc/supervisord.conf` (Red Hat/CentOS):
|
||||
|
||||
```
|
||||
[supervisord]
|
||||
minfds=10240; (min. avail startup file descriptors;default 1024)
|
||||
```
|
||||
|
||||
After changing this setting, you'll need to restart the supervisor process (which in turn will restart all your processes that it manages).
|
||||
|
||||
|
||||
## Connecting the client
|
||||
|
||||
To configure a client to connect to your custom server, first [publish the configuration file](/docs/expose/client/configuration) on the client. Once that is done, you can change the `host` and `port` configuration values on your client.
|
||||
|
||||
```php
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Host
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The expose server to connect to. By default, expose is using the free
|
||||
| expose.dev server, offered by Beyond Code. You will need a free
|
||||
| Beyond Code account in order to authenticate with the server.
|
||||
| Feel free to host your own server and change this value.
|
||||
|
|
||||
*/
|
||||
'host' => 'my-domain.com',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Port
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The port that expose will try to connect to. If you want to bypass
|
||||
| firewalls and have proper SSL encrypted tunnels, make sure to use
|
||||
| port 443 and use a reverse proxy for Expose.
|
||||
|
|
||||
| The free default server is already running on port 443.
|
||||
|
|
||||
*/
|
||||
'port' => 3030,
|
||||
|
||||
// ...
|
||||
```
|
||||
|
||||
Now that your basic expose server is running, let's take a look at how you can add SSL support.
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
title: Subdomain Generator
|
||||
order: 10
|
||||
---
|
||||
|
||||
# Sharing local sites
|
||||
|
||||
This page will be under the "Basic Usage" submenu.
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
title: User Repository
|
||||
order: 10
|
||||
---
|
||||
|
||||
# Sharing local sites
|
||||
|
||||
This page will be under the "Basic Usage" submenu.
|
||||
Reference in New Issue
Block a user