Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Getting started

Pavel Skipenes edited this page Feb 10, 2022 · 25 revisions

This guide will help you to set up your development environment so you can start development as soon as possible.

The code base is being run inside a docker container that contains all the packages. This is recommended because you will not trash your computer with a ton of programs and the development environment will stay the same across different systems.

First installation

pacman -Syu yay # update the system repositories and install AUR helper
yay -Syu github-desktop-bin git docker docker-compose insomnia visual-studio-code-bin composer unzip --no-confirm # install packages
sudo usermod -aG docker $USER # A shell restart might be needed after this command.

git clone --recursive [email protected]:pavelskipenes/org.ntnu.svommer.git
cd org.ntnu.svommer
systemctl enable docker --now
composer install
docker-compose --build -d

You should now be up and running. The web site is accessible at https://127.0.0.1

Note: the docker image is creating it's own self signed certificate. That means when you access the site for the first time after it's built you'll need to accept the self signed certificate.

Now that the site is up you can access it however it does not have any content. The repository is more like a template than a complete project.

Import content

assuming your username is pavelgs and live server is hosted on login.stud.ntnu.no

scp -r [email protected]:svommer/{translations,img} .

Accessing phpmyadmin

phpmyadmin can be accessed through web interface on http://127.0.0.1:42069. Default credentials are svommer_web, testing_password

Enrollment

Enrollment may or may not be disabled. You'll need to enter the docker container manually and change the settings accordingly. run docker exec -it web /bin/bash to get shell access. Then modify the file /srv/http/settings/settings.json.

  "enrollment": {
      "open": "auto",
      "start_month": "january",
      "start_day": 5,
      "end_month": "december",
      "end_day": 1
  }

This are the default settings. open accepts true, false and "auto". When "open" is set to auto it will read the following lines and open / close the enrollment accordingly.

Update API keys

API keys are stored in /srv/http/settings/settings.json. You'll need to get docker shell access by running docker exec -it web /bin/bash and modify these lines:

  "captcha_key": "CAPTCHA_API_KEY",
  "stripe": {
    "secret_key": "STRIPE_SECRET_KEY",
    "publishable_key": "STRIPE_PUBLISHABLE_KEY",
    "signing_key": "STRIPE_SIGNING_KEY"
  }

Stripe API keys can be obtained by logging in to stripe, navigating to somewhere where it says API keys and remember to turn on testing mode so you get the testing keys.

TODO: Google captcha keys

Clone this wiki locally