Metadata-Version: 2.4
Name: bfh-ssp
Version: 0.5.0
Summary: BFH Self-service portal
Author-email: Patrik Dufresne <patrik@ikus-soft.com>
License: GPLv3
Project-URL: Homepage, https://gitlab.com/ikus-soft/bfh-ssp
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: CherryPy
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: <4,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: cherrypy-foundation[ldap]<2,>=1.0.2
Requires-Dist: configargparse
Requires-Dist: cryptography
Requires-Dist: msal
Requires-Dist: requests
Requires-Dist: python-openstackclient
Requires-Dist: WTForms>=3.2.1
Provides-Extra: test
Requires-Dist: html5lib; extra == "test"
Requires-Dist: parameterized; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: responses; extra == "test"
Requires-Dist: selenium; extra == "test"
Dynamic: license-file

# BFH Science Self-Service Portal

<p align="center">
<a href="LICENSE"><img alt="License" src="https://img.shields.io/badge/license-GPL--3.0-orange"></a>
<a href=https://gitlab.com/ikus-soft/bfh-ssp/pipelines"><img alt="Build" src="https://gitlab.com/ikus-soft/bfh-ssp/badges/master/pipeline.svg"></a>
<a href="https://sonar.ikus-soft.com/dashboard?id=bfh-ssp"><img alt="Quality Gate Minarca Client" src="https://sonar.ikus-soft.com/api/project_badges/measure?project=bfh-ssp&metric=alert_status"></a>
<a href="https://sonar.ikus-soft.com/dashboard?id=bfh-ssp"><img alt="Coverage" src="https://sonar.ikus-soft.com/api/project_badges/measure?project=bfh-ssp&metric=coverage"></a>
<a href="https://www.djlint.com"><img alt="djlint" src="https://img.shields.io/badge/html%20style-djlint-blue.svg"></a>
</p>

**bfh-ssp** is a web-based self‑service portal developed for users of **Bern University of Applied Sciences (BFH)**, including **students, staff, and authorized external users**.

The application is built on the **CherryPy** web framework and provides a centralized interface for accessing and managing IT-related account information and service entitlements.

The portal enables authenticated users to view detailed information about their personal accounts, including access levels to various university **networks** and **applications**. It also provides transparency into allocated **storage**, **infrastructure**, and **computing** resources, allowing users to understand which resources are available to them.

The application is designed to integrate with existing BFH identity management, authorization, and backend systems. It acts as a secure presentation and request layer rather than a standalone identity or resource management solution.

**bfh-ssp** is intended for deployment within BFH-managed environments and is not designed as a general-purpose self-service portal.

## Install from Git source

The following steps explain how to install BFH Science Self-Service Portal from Git Source.

### 1. Install Dependencies

```bash
apt update
apt install python3.13-venv
```

### 2. Setup Virtual Environment

```bash
cd /srv/ssp-test.bfh.info
python3 -m venv bfh-ssp
source /srv/ssp-test.bfh.info/bfh-ssp/bin/activate
```

### 3. Install BFH SSP Application

```bash
pip install git+https://gitlab.com/ikus-soft/bfh-ssp
```

### 4. Verify Installation

```bash
bfh-ssp --help
```

## 5. Minimal Configuration

Place your configuration in `/etc/bfh-ssp/bfh-ssp.conf`.

Create log folder:
```bash
mkdir /srv/ssp-test.bfh.info/log/bfh-ssp
```

Create minimal configuration file.

```ini
session-dir=/tmp
log-file=/srv/ssp-test.bfh.info/log/bfh-ssp/server.log

#
# Command to executes
#
new-storage-cmd=echo Storage $SSP_STORAGE_NAME for user $SSP_USER_USERNAME failed to be created with success...; exit 1
enable-openstack-cmd=echo OpenStack access for user $SSP_USER_USERNAME as been enabled with success...
replace-ssh-key-cmd=echo SSH Public Key for user $SSP_USER_USERNAME has been replaced successfully with $SSP_SSH_KEY !

#
# OpenStack config
#
openstack-auth-url=https://keystone.admin.openstack.bfh.hosting:5000/v3
openstack-username=bfh-ssp
openstack-password=CHANGEME

#
# Email server
#
smtp-server=localhost:25
smtp-from=ssp@bfh.ch

#
# LDAP config
#
ldap-uri=ldaps://ldap.bfh.info:636
ldap-base-dn=dc=bfh
ldap-user-filter=(objectClass=posixAccount)
ldap-group-filter=(objectClass=posixGroup)
ldap-group-attribute=memberUid
```

### 5. Create Systemd Service

Create the service file `/etc/systemd/system/bfh-ssp.service`:

```ini
[Unit]
Description=BFH SSP Application
After=network.target
Wants=network.target

[Service]
Type=simple
WorkingDirectory=/srv/ssp-test.bfh.info
Environment=PATH=/srv/ssp-test.bfh.info/bin
ExecStart=/srv/ssp-test.bfh.info/bfh-ssp/bin/bfh-ssp
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
```

### 6. Enable and Start Service

```bash
systemctl daemon-reload
systemctl enable bfh-ssp.service
systemctl start bfh-ssp.service
```

## Usage

Once installed, you may start the application with default settings.

    bfh-ssp

You may also customize more option when starting the application. To get a list of options available execute:

    bfh-ssp --help

## Translation

Reference http://babel.edgewall.org/wiki/Documentation/setup.html

BFH Science Self-Service Portal may be translated using `.po` files. This section describe briefly
how to translate the application. It's not a complete instruction set, it's merely a reminder.

Extract the strings to be translated:

    tox -e babel_extract

Create a new translation:

    tox -e babel_init -- --locale fr

Update an existing translation:

    tox -e babel_update -- --locale fr 

Compile catalog

    tox -e babel_compile
