Compare commits
21 Commits
revamp-pro
...
mobile_vie
Author | SHA1 | Date | |
---|---|---|---|
cd31bd4476 | |||
3d843667ad | |||
617a799ad8 | |||
0be8e51af4 | |||
381f67189a | |||
2e56c7aed4 | |||
5b7a04dc69 | |||
485110bf43 | |||
3498cb7d8e | |||
ed3f307b9b | |||
7070a12e16 | |||
6bda1a91bd | |||
559b7ec03b | |||
602ae1f396 | |||
f3c439d038 | |||
2b3a9dd6ec | |||
59b071d8be | |||
f732582d0d | |||
de72342018 | |||
b54bbda71f | |||
20bab54235
|
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,6 +1,7 @@
|
||||
/result
|
||||
/config.php
|
||||
*.sqlite
|
||||
/cache
|
||||
/config.php
|
||||
/result
|
||||
/test.sql
|
||||
/vendor/
|
||||
/www/simplesaml
|
||||
|
62
README.md
62
README.md
@@ -1,3 +1,4 @@
|
||||
|
||||
# Programvareverkstedets nettside
|
||||
|
||||
A website created with the latest and greatest web technologies.
|
||||
@@ -5,59 +6,25 @@ May contain blackjack and other things one tends to include in awesome projects.
|
||||
|
||||
## Installation
|
||||
|
||||
git clone --recursive https://github.com/Programvareverkstedet/nettsiden.git
|
||||
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`.
|
||||
The development environment can be setup with:
|
||||
|
||||
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.
|
||||
|
||||
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`
|
||||
Installing nix with your package manager might not work without some tweaking, but the upstream script should just work which you can find [here](https://nixos.org/download/).
|
||||
|
||||
Alternatively you may use `cmd` on Windows.
|
||||
In this case you'll have to perform a `composer install` manually beforehand.
|
||||
Good luck.
|
||||
experimental-features = flakes nix-command
|
||||
|
||||
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
|
||||
You can then run the server with:
|
||||
|
||||
runDev
|
||||
|
||||
### Admin account
|
||||
|
||||
@@ -65,15 +32,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`)
|
||||
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);'
|
||||
|
||||
sqlite3 pvv.sqlite "INSERT INTO users (uname, groups) VALUES ('YOUR_USERNAME', 1);"
|
||||
|
||||
## Hosting
|
||||
|
1
dist/simplesamlphp-authsources.php
vendored
1
dist/simplesamlphp-authsources.php
vendored
@@ -6,6 +6,7 @@ $config = [
|
||||
/* This is the name of this authentication source, and will be used to access it later. */
|
||||
'default-sp' => [
|
||||
'saml:SP',
|
||||
'entityID' => 'https://www.pvv.ntnu.no/simplesaml/',
|
||||
'idp' => 'https://idp.pvv.ntnu.no/',
|
||||
],
|
||||
];
|
||||
|
@@ -27,9 +27,9 @@ use pvv\side\Agenda;
|
||||
$agenda = new Agenda([
|
||||
// new \pvv\side\social\NerdepitsaActivity,
|
||||
// new \pvv\side\social\AnimekveldActivity,
|
||||
new pvv\side\social\HackekveldActivity(),
|
||||
new pvv\side\social\BrettspillActivity(),
|
||||
new pvv\side\social\DriftkveldActivity(),
|
||||
// new pvv\side\social\HackekveldActivity(),
|
||||
// new pvv\side\social\BrettspillActivity(),
|
||||
// new pvv\side\social\DriftkveldActivity(),
|
||||
new pvv\side\DBActivity($pdo),
|
||||
]);
|
||||
|
||||
|
@@ -35,7 +35,7 @@ pkgs.mkShellNoCC {
|
||||
cp dist/config.local.php config.php
|
||||
|
||||
ln -s ../vendor/simplesamlphp/simplesamlphp/public/ www/simplesaml
|
||||
popd "$PROJECT_ROOT"
|
||||
popd
|
||||
fi
|
||||
'';
|
||||
}
|
||||
|
@@ -55,6 +55,7 @@ $day = (isset($_GET['day']))
|
||||
<em><?php echo $event->getRelativeDate(); ?></em>
|
||||
<?php if (Agenda::isToday($event->getStart())) { ?></strong><?php } ?>
|
||||
<?php if ($event->getURL()) { ?>
|
||||
<br>
|
||||
<a href="<?php echo $event->getURL(); ?>"><?php echo $event->getName(); ?></a>
|
||||
<?php } else { ?>
|
||||
<?php echo $event->getName(); ?>
|
||||
|
@@ -11,7 +11,6 @@ h2 em {
|
||||
font-size: .5em;
|
||||
line-height: 2em;
|
||||
float: left;
|
||||
margin-right: 1em;
|
||||
border: .1em solid gray;
|
||||
padding: 0 1em;
|
||||
border-radius: .25em;
|
||||
@@ -107,7 +106,6 @@ p + .subtext {
|
||||
}
|
||||
@media screen and (max-width: 50rem) {
|
||||
h2 {
|
||||
text-align: center;
|
||||
position: relative;
|
||||
border-bottom-left-radius: 0.3em;
|
||||
border-bottom-right-radius: 0.3em;
|
||||
@@ -133,4 +131,8 @@ p + .subtext {
|
||||
article >.subtext {
|
||||
margin-top: -1em !important;
|
||||
}
|
||||
|
||||
.subtext li {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
@@ -24,6 +24,7 @@ main {
|
||||
}
|
||||
|
||||
.categoryLabel {
|
||||
padding-top: 5px;
|
||||
background-color: #002244;
|
||||
color: white;
|
||||
|
||||
@@ -45,6 +46,7 @@ main {
|
||||
|
||||
.serviceContent {
|
||||
flex-grow: 1;
|
||||
margin-right: 4%;
|
||||
}
|
||||
|
||||
.serviceTitle {
|
||||
@@ -91,3 +93,27 @@ main {
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.categoryContainer {
|
||||
border-radius: unset;
|
||||
border: unset;
|
||||
box-shadow: unset;
|
||||
margin-bottom: unset;
|
||||
}
|
||||
.serviceWrapper {
|
||||
width: 100%;
|
||||
}
|
||||
.serviceImage {
|
||||
width: 25%;
|
||||
height: auto;
|
||||
}
|
||||
.serviceContent {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 360px) {
|
||||
.serviceContent {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
@@ -66,9 +66,5 @@ $translation = ['I dag', 'I morgen', 'Denne uka', 'Neste uke', 'Denne måneden',
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<div style="text-align: center; margin-bottom: 2em;">
|
||||
<a style="padding-left: 2em; padding-right: 2em;" class="btn" style="" href="../kalender/">Kalender</a>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
</body>
|
||||
|
@@ -37,7 +37,7 @@ if (!$event) {
|
||||
<?php if (Agenda::isToday($event->getStart())) { ?><strong><?php } ?>
|
||||
<em><?php echo $event->getRelativeDate(); ?></em>
|
||||
<?php if (Agenda::isToday($event->getStart())) { ?></strong><?php } ?>
|
||||
|
||||
<br>
|
||||
<?php echo $event->getName(); ?>
|
||||
</h2>
|
||||
<ul class="subtext">
|
||||
|
@@ -109,6 +109,8 @@ $doorTime = date('H:i', $doorEntry->time);
|
||||
</div>
|
||||
|
||||
<div class="gridl">
|
||||
<img src="/sosiale/fadderuke-2025.png" width="100%">
|
||||
<br>
|
||||
<?php
|
||||
$title = $motd['title'];
|
||||
|
||||
|
BIN
www/sosiale/fadderuke-2025.png
Normal file
BIN
www/sosiale/fadderuke-2025.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 380 KiB |
@@ -129,29 +129,29 @@ require_once \dirname(__DIR__, 2) . implode(\DIRECTORY_SEPARATOR, ['', 'inc', 'i
|
||||
|
||||
<div class="service">
|
||||
<div class="serviceContent">
|
||||
<h2 class="serviceTitle">Proxmox @joshua</h2>
|
||||
<p class="serviceDescription">Joshua er en av våre VM-tjenere, her kan du kjøre enten fulle VM-er eller konteinere. Bare Drift har tilgang på disse tjenerne.</p>
|
||||
<div class="serviceLink"><a href="https://joshua.pvv.ntnu.no:8006" target="_blank">Gå til joshua.pvv.ntnu.no</a></div>
|
||||
<h2 class="serviceTitle">Proxmox @blossom</h2>
|
||||
<p class="serviceDescription">Blossom er den sterkeste av våre VM-tjenere, her kan du kjøre enten fulle VM-er eller konteinere. Bare Drift har tilgang på disse tjenerne.</p>
|
||||
<div class="serviceLink"><a href="https://blossom.pvv.ntnu.no:8006" target="_blank">Gå til blossom.pvv.ntnu.no</a></div>
|
||||
</div>
|
||||
<img class="serviceImage" src="img/proxmox.png" alt="Proxmox-logo">
|
||||
</div>
|
||||
|
||||
<div class="service">
|
||||
<div class="serviceContent">
|
||||
<h2 class="serviceTitle">Proxmox @andresbu</h2>
|
||||
<p class="serviceDescription">Andresbu er en kraftigere VM-tjener, men har fortsatt en del rusk i maskineriet.</p>
|
||||
<div class="serviceLink"><a href="https://andresbu.pvv.ntnu.no:8006" target="_blank">Gå til andresbu.pvv.ntnu.no</a></div>
|
||||
<h2 class="serviceTitle">Proxmox @bubbles</h2>
|
||||
<p class="serviceDescription">Bubbles er den svakeste av våre VM-tjenere.</p>
|
||||
<div class="serviceLink"><a href="https://bubbles.pvv.ntnu.no:8006" target="_blank">Gå til bubbles.pvv.ntnu.no</a></div>
|
||||
</div>
|
||||
<img class="serviceImage" src="img/proxmox.png" alt="Proxmox-logo">
|
||||
</div>
|
||||
|
||||
<div class="service">
|
||||
<div class="serviceContent">
|
||||
<h2 class="serviceTitle">ESXI @asgore</h2>
|
||||
<p class="serviceDescription">Asgore er vår eldste og største VM-tjener, og kjører ESXI.</p>
|
||||
<div class="serviceLink"><a href="https://asgore.pvv.ntnu.no" target="_blank">Gå til asgore.pvv.ntnu.no</a></div>
|
||||
<h2 class="serviceTitle">Proxmox @buttercup</h2>
|
||||
<p class="serviceDescription">Buttercup er en av våre VM-tjenere.</p>
|
||||
<div class="serviceLink"><a href="https://buttercup.pvv.ntnu.no:8006" target="_blank">Gå til buttercup.pvv.ntnu.no</a></div>
|
||||
</div>
|
||||
<img class="serviceImage" src="img/esxi.png" alt="ESXI-logo">
|
||||
<img class="serviceImage" src="img/proxmox.png" alt="Proxmox-logo">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -164,7 +164,7 @@ require_once \dirname(__DIR__, 2) . implode(\DIRECTORY_SEPARATOR, ['', 'inc', 'i
|
||||
<div class="serviceContent">
|
||||
<h2 class="serviceTitle">Minecraft</h2>
|
||||
<p class="serviceDescription">Vi har en egen Minecraft-server <b>for medlemmer</b>, som du kan koble til med IP-adressen <b>minecraft.pvv.ntnu.no</b>. Spør om whitelist på matrix/discord.</p>
|
||||
<div class="serviceLink"><a href="https://isvegg.pvv.ntnu.no/kart/" target="_blank">Gå til verdenskartet vårt</a></div>
|
||||
<div class="serviceLink"><a href="https://minecraft.pvv.ntnu.no" target="_blank">Gå til verdenskartet vårt</a></div>
|
||||
</div>
|
||||
<img class="serviceImage" src="img/minecraft.png" alt="Minecraft-logo">
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user