Projects
/
nettsiden-old
Archived
8
0
Fork 0
Kildekoden bak https://www.pvv.ntnu.no/
This repository has been archived on 2024-07-04. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Felix Albrigtsen cf46725dab update dependencies, init nix package 2024-02-15 22:57:03 +01:00
dist remove deprecated options and dependencies for dataporten/oauth 2024-02-15 16:17:31 +01:00
gammel dokumentasjon Added documentation from outdated repo. Covers alot of the wishes for the new website for the uninformed. 2016-08-29 19:46:52 +02:00
inc remove deprecated options and dependencies for dataporten/oauth 2024-02-15 16:17:31 +01:00
src Re-enable recurring events for Fall 2023 (#48) 2023-09-02 21:25:07 +02:00
www remove deprecated options and dependencies for dataporten/oauth 2024-02-15 16:17:31 +01:00
.gitattributes add .gitattributes 2021-08-12 12:50:01 +02:00
.gitignore remove deprecated options and dependencies for dataporten/oauth 2024-02-15 16:17:31 +01:00
.gitmodules Update OAuth2 client library 2017-11-11 15:37:13 +01:00
Dockerfile Update minor dependency changes 2023-01-19 11:26:56 +01:00
README.md Clarify dependencies 2022-01-25 15:06:27 +01:00
composer.json update dependencies, init nix package 2024-02-15 22:57:03 +01:00
composer.lock update dependencies, init nix package 2024-02-15 22:57:03 +01:00
dev.bat Updated navbar, added aktiviteter, deleted soek, made the ticker into an include 2016-08-30 18:13:31 +02:00
dev.sh remove deprecated options and dependencies for dataporten/oauth 2024-02-15 16:17:31 +01:00
docker-compose.yaml Add dockerfile for local development 2021-08-11 22:28:48 +02:00
flake.lock update dependencies, init nix package 2024-02-15 22:57:03 +01:00
flake.nix update dependencies, init nix package 2024-02-15 22:57:03 +01:00

README.md

Programvareverkstedets 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

git clone --recursive https://github.com/Programvareverkstedet/nettsiden.git

Put it in a folder your webserver can find.

Development setup

Make sure you have sqlite3, php and pdo-sqlite installed. 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.

./dev.sh

On Windows you can use chocolatey and git bash to run ./dev.sh. 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. 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

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 access the local development site via the the hostname localhost) To make your account into an admin account, run:

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