From 631be5fb5c13976fe145fbf5e70a6d621ac0d623 Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 6 Dec 2018 16:22:02 +1100 Subject: [PATCH] Added some missing required config files and an updated README --- README.md | 102 ++++++++++++++++++++++++++++++------------------ config/view.php | 36 +++++++++++++++++ routes/api.php | 18 +++++++++ routes/web.php | 16 ++++++++ 4 files changed, 133 insertions(+), 39 deletions(-) create mode 100644 config/view.php create mode 100644 routes/api.php create mode 100644 routes/web.php diff --git a/README.md b/README.md index efa49f3..ae8d2a6 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/config/view.php b/config/view.php new file mode 100644 index 0000000..22b8a18 --- /dev/null +++ b/config/view.php @@ -0,0 +1,36 @@ + [ + 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')) + ), + +]; diff --git a/routes/api.php b/routes/api.php new file mode 100644 index 0000000..aa56f7e --- /dev/null +++ b/routes/api.php @@ -0,0 +1,18 @@ +get('/user', function (Request $request) { +# return $request->user(); +#}); diff --git a/routes/web.php b/routes/web.php new file mode 100644 index 0000000..ae64a68 --- /dev/null +++ b/routes/web.php @@ -0,0 +1,16 @@ +