2016-08-15 17:43:41 +02:00
# Programvareverkstedet nettside
A website created with the latest and greatest web technologies.
May contain blackjack and other things one tends to include in awesome projects.
## Installation
2017-10-11 01:50:11 +02:00
git clone --recursive https://github.com/Programvareverkstedet/nettsiden.git
2016-08-15 17:43:41 +02:00
Put it in a folder your webserver can find.
2016-08-18 23:08:31 +02:00
## Development setup
2017-10-11 01:50:11 +02:00
Make sure you have sqlite3 and PHP installed, with pdo-sqlite module.
2016-08-29 18:50:24 +02:00
These can be obtained from your package manager.
2016-08-18 23:08:31 +02:00
./dev.sh
2017-10-11 01:50:11 +02:00
2021-03-16 20:00:02 +01:00
On Windows, you have to perform a `composer install` manually beforehand. Make sure you have PHP and sqlite3 available in path:
2017-10-11 01:50:11 +02:00
dev.bat
2021-03-16 20:00:02 +01:00
### Dependency management
2021-03-16 20:49:25 +01:00
`dev.sh` will ensure the git submodules have been pulled, then download the `composer` package manager to the php archive file `composer.phar` and run it.
2021-08-11 22:28:48 +02:00
Composer will check for the php extension `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` :
2021-03-16 20:07:56 +01:00
[PHP]
extension=pdo_sqlite
extension=sqlite3
2021-03-16 20:26:38 +01:00
extension=ext-curl
2021-03-16 20:07:56 +01:00
Composer is used as such:
2021-03-16 20:00:02 +01:00
php composer.phar update
php composer.phar install
2021-08-11 22:28:48 +02:00
### 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
2021-08-12 13:44:22 +02:00
### Admin account
Login goes through `idp.pvv.ntnu.no` via SAML, so you have to use your PVV account.
(This only works if you use the hostname `localhost` )
To make your account into an admin accout, run:
sqlite3 pvv.sqlite 'INSERT INTO users (uname, groups) VALUES ("your_username", 1);'
If using docker, when 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);'
2021-03-16 20:00:02 +01:00
## Hosting