doc: replace mysql with sqlite

This commit is contained in:
King Kévin 2023-03-09 11:24:46 +01:00
parent d530af9677
commit b6cc7ef060
1 changed files with 7 additions and 14 deletions

View File

@ -41,7 +41,7 @@ components
Part information is: Part information is:
- stored in a MariaDB/mySQL database - stored in a sqlite3 database
- retrieved using a sinatra HTTP/REST server - retrieved using a sinatra HTTP/REST server
- displayed using minimal HTML+JS pages - displayed using minimal HTML+JS pages
@ -51,25 +51,18 @@ installation
install software dependencies (here for Arch linux): install software dependencies (here for Arch linux):
~~~ ~~~
sudo pacman -S mariadb sudo pacman -S sqlite ruby ruby-rake
sudo pacman -S ruby-sinatra ruby-webrick gem install json sqlite3 sinatra puma
pikaur -S ruby-mysql2
~~~ ~~~
configure database create database
~~~ ~~~
sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql sqlite partdb.db < schema.sql
sudo mysql
CREATE DATABASE partdb;
CREATE USER 'partdb'@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON partdb.* TO 'partdb'@localhost;
exit
mysql --user=partdb --password=password --database=partdb < schema.sql
~~~ ~~~
put the database access information in `credentials.json` and run `server.rb`. now just run `server.rb`.
now go to http://localhost:4245 and you are ready to use it. now go to http://localhost:4245 and you are ready to use it.
the port is defined in `server.rb`. the port and database file is defined in `server.rb`.
use a proxy web server to handle the authentication, TLS, compression, ... use a proxy web server to handle the authentication, TLS, compression, ...