update README to reflect changes in dev environment
This commit is contained in:
60
README.md
60
README.md
@@ -11,53 +11,18 @@ Put it in a folder your webserver can find.
|
|||||||
|
|
||||||
## Development setup
|
## Development setup
|
||||||
|
|
||||||
Make sure you have `sqlite3`, `php` and `pdo-sqlite` installed.
|
The development environment can be setup with:
|
||||||
These can be obtained from your package manager.
|
|
||||||
Then make sure PHP has the `curl`, `pdo-sqlite`, `ext-dom` and `sqlite3` extensions enabled, see `/etc/php/php.ini`.
|
|
||||||
|
|
||||||
To install all mentioned requirements on debian: `apt install composer sqlite3 php8.1-sqlite3 simplesamlphp php-xml`, followed by `composer update`.
|
nix develop
|
||||||
|
|
||||||
./dev.sh
|
For this you will need to install the nix package manager and possibly set the experimental features in your nix config, likely located at /etc/nix/nix.conf or $HOME/.config/nix/nix.conf
|
||||||
|
Installing nix with your package manager might not work without some tweaking, but the upstream script should just work which you can find [https://nixos.org/download/](here).
|
||||||
|
|
||||||
On Windows you can use chocolatey and git bash to run `./dev.sh`.
|
experimental-features = flakes nix-command
|
||||||
Install `php` and `sqlite`, then enable these extensions in `C:\tools\php80\php.ini`:
|
|
||||||
`mbstring`, `openssl`, `curl`, `pdo-sqlite` and `sqlite3`
|
|
||||||
|
|
||||||
Alternatively you may use `cmd` on Windows.
|
You can then run the server with:
|
||||||
In this case you'll have to perform a `composer install` manually beforehand.
|
|
||||||
Good luck.
|
|
||||||
|
|
||||||
dev.bat
|
|
||||||
|
|
||||||
|
|
||||||
### Dependency management
|
|
||||||
|
|
||||||
`dev.sh` will ensure the git submodules have been properly pulled, then download the `composer` package manager to a php archive file named `composer.phar`, then run it.
|
|
||||||
Composer will then check for the php extensions needed, such as `pdo_sqlite`, which must be enabled on your system.
|
|
||||||
This usually includes installing a php-sqlite3 package and enabling it in `/etc/php/php.ini`:
|
|
||||||
|
|
||||||
[PHP]
|
|
||||||
extension=pdo_sqlite
|
|
||||||
extension=sqlite3
|
|
||||||
extension=ext-curl
|
|
||||||
|
|
||||||
Composer is used as such:
|
|
||||||
|
|
||||||
php composer.phar update
|
|
||||||
php composer.phar install
|
|
||||||
|
|
||||||
|
|
||||||
### Docker
|
|
||||||
|
|
||||||
We provide a simple docker-compose setup for local development.
|
|
||||||
First ensure that docker is running:
|
|
||||||
|
|
||||||
sudo systemctl start docker
|
|
||||||
|
|
||||||
then
|
|
||||||
|
|
||||||
DOCKER_USER=$(id -u):$(id -g) docker-compose up
|
|
||||||
|
|
||||||
|
runDev
|
||||||
|
|
||||||
### Admin account
|
### Admin account
|
||||||
|
|
||||||
@@ -65,15 +30,6 @@ Login goes through `idp.pvv.ntnu.no` via SAML, so you have to use your PVV accou
|
|||||||
(This only works if you use access the local development site via the the hostname `localhost`)
|
(This only works if you use access the local development site via the the hostname `localhost`)
|
||||||
To make your account into an admin account, run:
|
To make your account into an admin account, run:
|
||||||
|
|
||||||
sqlite3 pvv.sqlite 'INSERT INTO users (uname, groups) VALUES ("YOUR_USERNAME", 1);'
|
sqlite3 pvv.sqlite "INSERT INTO users (uname, groups) VALUES ('YOUR_USERNAME', 1);"
|
||||||
|
|
||||||
If using docker, when already running:
|
|
||||||
|
|
||||||
DOCKER_USER=$(id -u):$(id -g) docker-compose exec nettside sqlite3 pvv.sqlite 'INSERT INTO users (uname, groups) VALUES ("YOUR_USERNAME", 1);'
|
|
||||||
|
|
||||||
If not already running:
|
|
||||||
|
|
||||||
DOCKER_USER=$(id -u):$(id -g) docker-compose run nettside sqlite3 pvv.sqlite 'INSERT INTO users (uname, groups) VALUES ("YOUR_USERNAME", 1);'
|
|
||||||
|
|
||||||
|
|
||||||
## Hosting
|
## Hosting
|
||||||
|
Reference in New Issue
Block a user