Added some missing required config files and an updated README

This commit is contained in:
Deon George 2018-12-06 16:22:02 +11:00
parent 0eaaa57e8a
commit 631be5fb5c
4 changed files with 133 additions and 39 deletions

102
README.md
View File

@ -1,62 +1,86 @@
# viewdatahost
A simple viewdata service host
Installing vBBS
This is a viewdata host program that attempts to closely emulate the operation of the original GPO/BT Prestel service.
This is so that original period third-party programs and hardware can be used again.
* TL;DR - use docker :)
Code is written in php, because it was easiest for me to get up and running quickly using libraries I
already had. No comments on this choice of language please.
Figure out where you will install this - can be anywhere, call this *$APP_DIR*
You might find https://github.com/irrelevantdotcom/asterisk-Softmodem useful for creating a dial-up port for this.
** Setup a MYSQL/MARIADB database
For docker, you can use the mariadb:latest image:
```docker
docker run --rm -itd --name=vbbs_db \
-v ${APP_DIR}/database:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=secret -e MYSQL_USER=user -e MYSQL_PASSWORD=password -e MYSQL_DATABASE=database mariadb:latest
```
Requires vv.class.php - viewdata viewer library.
https://github.com/irrelevantdotcom/viewdataviewer
Check that docker started OK, it should look something like this (use `docker ps`):
Requires vvdatabase.class.php - viewdata database library
https://github.com/irrelevantdotcom/vvdb
```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fc2f32aaaa55 mariadb:10.3 "docker-entrypoint.s…" 4 seconds ago Up 3 seconds 3306/tcp vbbs_db
```
Requires you create a config/config.php file -
** Clone the git repository
$config = array();
```bash
mkdir -p ${APP_DIR}/composer
mkdir -p ${APP_DIR}/app
cd ${APP_DIR}/app
git clone http://dev.leenooks.net/bbs/vbbs.git .
```
$config['database'] = 'vtext_pages';
$config['dbserver'] = 'localhost';
$config['dbuser'] = '*username*';
$config['dbpass'] = '*password*';
(chown -R 33:33 ${APP_DIR}/composer ${APP_DIR}/app dirs if you use my docker image)
$config['service_id'] = 1; // service and varient within database
$config['varient_id'] = 1;
** Setup the application
cd ${APP_DIR}/app
cp .env.example to .env
$config['port'] = 6502;
edit and update the APP_PORT (something above 1024) and DB_* database entries:
```config
APP_PORT=6502
...
DB_CONNECTION=mysql
DB_HOST=vbbs_db
DB_PORT=3306
DB_DATABASE=database
DB_USERNAME=user
DB_PASSWORD=password
```
** Setup PHP
You're PHP will need SOCKETS and PCNTL and you'll need COMPOSER as well installed.
Current status
If you are using docker, you can use my PHP image, which has all three.
Browsing works fine.
Frame types "t"erminate and "i"nformation(default) work as expected.
You need to run composer, and migrate to test connectivity to the database and seed it - you can do that in a single step
```docker
docker run --rm -u www-data -itd --link=vbbs_db --name=vbbs \
-v ${APP_DIR}/app/php:/var/www/html \
-v ${APP_DIR}/composer:/var/www/.composer/cache \
--entrypoint=/bin/bash registry.leenooks.net/leenooks/php:7.2-fpm-plus -c "composer install; php artisan migrate --seed"
```
No Editor - you will need to add frames to the database using other methods
No Users - default user parameters are used pending login process being writen
Response Frames - basis is done, but do not work correctly yet.
Now, run the app, you need to map it from the host port (can be anything), into the container onto APP_PORT that you specified above.
For example, if you use 6502 for both:
Roadmap
```docker
docker run --rm -u www-data -itd --link=vbbs_db --name=vbbs -p 6502:6502 \
-v ${APP_DIR}/app/php:/var/www/html \
-v ${APP_DIR}/composer:/var/www/.composer/cache \
--entrypoint=/bin/bash registry.leenooks.net/leenooks/php:7.2-fpm-plus -c "php artisan server"
```
create (working) routines for accepting user input.
- used for everything from response frames to editor
If you want to watch is on the console, you can remove the `d` from the option or use `docker attach`
implement modular extensions for other frame types and active pages
- allows for
implement login process module
implement user management
implement editor
other functions, see e.g. featues of Autonomic Host (Gnome at Home) functions??
If it started OK, you should see it running (use `docker ps`):
```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9916ee39d9b7 registry.leenooks.net/leenooks/php:7.2-fpm-plus "/bin/bash -c 'php a…" 13 minutes ago Up 13 minutes 22/tcp, 9000/tcp, 0.0.0.0:6502->6502/tcp vbbs
```
* Voila!
Use your videotex terminal and connect to your host on the APP_PORT that you used (eg: 6502)

36
config/view.php Normal file
View File

@ -0,0 +1,36 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
'paths' => [
resource_path('views'),
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the storage
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => env(
'VIEW_COMPILED_PATH',
realpath(storage_path('framework/views'))
),
];

18
routes/api.php Normal file
View File

@ -0,0 +1,18 @@
<?php
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
#Route::middleware('auth:api')->get('/user', function (Request $request) {
# return $request->user();
#});

16
routes/web.php Normal file
View File

@ -0,0 +1,16 @@
<?php
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
#Route::get('/', function () {
# return view('welcome');
#});