Skip to content

Commit fba79c7

Browse files
authored
Merge pull request #271 from introlab/dev
Main merge for 1.3.1 release
2 parents b0fe8a2 + 0c517ff commit fba79c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+463
-355
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,5 @@ build-teraserver-Desktop_Qt_6_6_1_MSVC2019_64bit-Debug
8282
python-3.10
8383
/teraserver/python/config/certificates
8484
/teraserver/python/tests/*.pem
85+
/teraserver/python/env/python-3.12
86+
/teraserver/python/env/python-3.13

docs/Architecture-Overview.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ This module can also automatically launch external services as stand-alone proce
6060
## System services
6161
Those services are features that are shared by modules and external services. Each of them serves a specific purpose and will run in a separate process. Communication between modules and services will be done using the [Main OpenTera REST API](services/teraserver/api/API) and the [internal communication protocols - subscribe-publish](developers/Internal-services-communication-module).
6262

63+
### Email service
64+
The email service is a service that manages sending emails from OpenTera using a secure API.
65+
66+
More information on this service can be found [here](services/Email-Service).
67+
6368
### File transfer service
6469
The file transfer service is a service that manages file transfers (upload and download) within OpenTera. It allows other services to upload files in a central repository. While specific services can also implements file storage and indexing, this service can be used to quickly reuse components.
6570

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
88

99
project = 'OpenTera'
10-
copyright = '2024, Simon Brière, Dominic Létourneau'
10+
copyright = '2025, Simon Brière, Dominic Létourneau'
1111
author = 'Simon Brière, Dominic Létourneau'
12-
release = '1.3.0'
12+
release = '1.3.1'
1313
version = release
1414

1515
html_logo = 'images/LogoOpenTera200px.png'

docs/deployment/DeployWithLinuxNative.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ This section configures the depending packages and software before installing th
2525
5. Create required database and assign `teraagent` user to them:
2626
```
2727
CREATE DATABASE opentera WITH OWNER=teraagent;
28+
CREATE DATABASE openteraemails WITH OWNER=teraagent;
2829
CREATE DATABASE openterafiles WITH OWNER=teraagent;
2930
CREATE DATABASE openteralogs WITH OWNER=teraagent;
3031
```
@@ -101,6 +102,7 @@ There is a few config files to edit. You should edit each of them and put the co
101102
102103
* `teraserver/python/config/TeraServerConfig.ini`: the main config file. "port" and "hostname" shouldn't be changed.
103104
* `teraserver/python/config/nginx.conf`: nginx config file. Unless listening to a different port and setting correct ssl certificates, nothing should be changed in that file.
105+
* `teraserver/python/services/EmailService/EmailService.json`: the email service configuration.
104106
* `teraserver/python/services/FileTransferService/FileTransferService.json`: the file transfer service configuration.
105107
* `teraserver/python/services/LoggingService/LoggingService.json`: the logging service configuration.
106108
* `teraserver/python/services/VideoRehabService/VideoRehabService.json`: make sure to set the "WebRTC - hostname" value to the external server address.
@@ -129,8 +131,8 @@ Group=**PUT THE EXECUTING GROUP HERE**
129131
Environment=PYTHONPATH=**(path to opentera)**/opentera/teraserver/python
130132
ExecStart=**(path to opentera)**/opentera/teraserver/python/env/python-3.11/bin/python3 **(path to opentera)**/opentera/teraserver/python/TeraServer.py
131133
WorkingDirectory=**(path to opentera)**/opentera/teraserver/python
132-
StandardOutput=syslog+console
133-
StandardError=syslog+console
134+
StandardOutput=journal+console
135+
StandardError=journal+console
134136
Restart=always
135137
RestartSec=10s
136138
KillMode=process

docs/developers/Developer-Setup-for-Linux.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ Each system service will requires its own database. The default database that ne
100100
* `opentera`, the [main OpenTera service](../services/teraserver/teraserver.rst) database
101101
* `openterafiles`, the database for the [file transfer](../services/FileTransfer-Service) service
102102
* `openteralogs`, the database for the [logging service](../services/Logging-Service)
103+
* `openteraemails`, the database for the [email service](../services/Email-Service)
103104

104105
The steps to create a database are as follow. Those steps should be repeated for each database to create.
105106
1. In pgAdmin, under `Servers`, right-click on the correct server instance (for example `PostgreSQL 13`).
@@ -123,14 +124,14 @@ If using PyCharm, the correct Python interpreter and environment will need to be
123124
1. Open PyCharm, loading the project from `<base folder>/teraserver/python`
124125
2. In `Files -> Settings-> Project : python -> Python Interpreter`, click on the `Show all` option in the selection bar.
125126
3. In the `Virtualenv` tab, choose the existing environment. Change the interpreter to the following :
126-
`...\teraserver\python\env\python-3.8\python.exe`
127+
`...\teraserver\python\env\python-3.##\python.exe`, where `##` is the current python version of the project.
127128
The end result should look like this :
128129
![ ](images/Windows/PyCharm.PNG)
129130

130131
**6. Self-signed certificates generation**
131132
Self-signed certificates should be generated for the development server and to sign device certificates.
132133

133-
This can simply be done by running the `CreatesCertificates.py` script (directly in PyCharm if configured)
134+
This can simply be done by running the `CreateCertificates.py` script (directly in PyCharm if configured)
134135

135136
## Starting the main OpenTera service
136137
If all the configuration was properly done, you should now be able to run the main script, `TeraServer.py`.

docs/developers/Developer-Setup-for-Mac.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ Each system service will requires its own database. The default database that ne
105105
* `opentera`, the [main OpenTera service](../services/teraserver/teraserver.rst) database
106106
* `openterafiles`, the database for the [file transfer](../services/FileTransfer-Service) service
107107
* `openteralogs`, the database for the [logging service](../services/Logging-Service)
108+
* `openteraemails`, the database for the [email service](../services/Email-Service)
108109

109110
The steps to create a database are as follow. Those steps should be repeated for each database to create.
110111
1. In pgAdmin, under `Servers`, right-click on the correct server instance (for example `PostgreSQL 13`).
@@ -128,14 +129,14 @@ If using PyCharm, the correct Python interpreter and environment will need to be
128129
1. Open PyCharm, loading the project from `<base folder>/teraserver/python`
129130
2. In `Files -> Settings-> Project : python -> Python Interpreter`, click on the `Show all` option in the selection bar.
130131
3. In the `Virtualenv` tab, choose the existing environment. Change the interpreter to the following :
131-
`...\teraserver\python\env\python-3.8\python`
132+
`...\teraserver\python\env\python-3.##\python`, where `##` is the current python version of the project.
132133
The end result should look like this :
133134
![ ](images/Windows/PyCharm.PNG)
134135

135136
**6. Self-signed certificates generation**
136137
Self-signed certificates should be generated for the development server and to sign device certificates.
137138

138-
This can simply be done by running the `CreatesCertificates.py` script (directly in PyCharm if configured)
139+
This can simply be done by running the `CreateCertificates.py` script (directly in PyCharm if configured)
139140

140141
## Starting the main OpenTera service
141142
If all the configuration was properly done, you should now be able to run the main script, `TeraServer.py`.

docs/developers/Developer-Setup-for-Windows.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Getting Started for Developers - Windows 10
1+
# Getting Started for Developers - Windows
22
## Pre-requisites
33
To get started on Windows, the following components are needed:
44
* [Git](https://git-scm.com) required to get the code. Optionally, a helper software such as [TurtoiseGit](https://tortoisegit.org/) or [GitHub Desktop](https://desktop.github.com/) could be used.
@@ -104,6 +104,7 @@ Each system service will requires its own database. The default database that ne
104104
* `opentera`, the [main OpenTera service](../services/teraserver/teraserver.rst) database
105105
* `openterafiles`, the database for the [file transfer](../services/FileTransfer-Service) service
106106
* `openteralogs`, the database for the [logging service](../services/Logging-Service)
107+
* `openteraemails`, the database for the [email service](../services/Email-Service)
107108

108109
The steps to create a database are as follow. Those steps should be repeated for each database to create.
109110
1. In pgAdmin, under `Servers`, right-click on the correct server instance (for example `PostgreSQL 13`).
@@ -127,18 +128,18 @@ If using PyCharm, the correct Python interpreter and environment will need to be
127128
1. Open PyCharm, loading the project from `<base folder>/teraserver/python`
128129
2. In `Files -> Settings-> Project : python -> Python Interpreter`, click on the `Show all` option in the selection bar.
129130
3. In the `Virtualenv` tab, choose the existing environment. Change the interpreter to the following :
130-
`...\teraserver\python\env\python-3.8\python.exe`
131+
`...\teraserver\python\env\python-3.##\python.exe`, where `##` is the current python version of the project.
131132
The end result should look like this :
132133
![ ](images/Windows/PyCharm.PNG)
133134

134135
**6. Self-signed certificates generation**
135136
Self-signed certificates should be generated for the development server and to sign device certificates.
136137

137-
This can simply be done by running the `CreatesCertificates.py` script (directly in PyCharm if configured)
138+
This can simply be done by running the `CreateCertificates.py` script (directly in PyCharm if configured)
138139

139140
## Starting the main OpenTera service
140141
If all the configuration was properly done, you should now be able to run the main script, `TeraServer.py`.
141142

142143
Don't forget to start the NGINX router beforehand and any other component that were not set to auto-run or as a Windows service.
143144

144-
If all went well, you should be able to see the `About` page in your browser: [https://localhost:40075/about](https://localhost:40075/about)
145+
If all went well, you should be able to see the `About` page in your browser: [https://127.0.0.1:40075/about](https://127.0.0.1:40075/about)

docs/services/Email-Service.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Email Service
2+
The email service is intented to provide email communications (sending) from the OpenTera platform. It uses an external SMTP server - the service
3+
doesn't implement its own server.
4+
5+
## Main script
6+
The Email service can be launched by running the
7+
[EmailService.py](https://github.com/introlab/opentera/blob/main/teraserver/python/services/EmailService/EmailService.py)
8+
script. As a system service, it is also launched automatically when running the
9+
[main OpenTera service](teraserver/teraserver.rst).
10+
11+
## Configuration
12+
Configuration files for the email service are similar to the basic
13+
[configuration files](../Configuration-files). They, however, add a specific section for that service.
14+
15+
### Email config section
16+
`hostname`: Hostname of the SMTP email server to use.
17+
`port`: Port of the STMP email server
18+
`tls`: If true, TLS encryption will be used when communicating with the SMTP email server
19+
`ssl`: If true, SSL encryption will be used when communicating with the SMTP email server
20+
`username`: Username to use when authenticating with the SMTP email server
21+
`password`: Password to use when authenticating with the SMTP email server
22+
`default_sender`: Default email address to use as sender when none is specified
23+
`max_emails`: Maximum number of emails to send to the SMTP email server in one connection.
24+
25+
## Default port and location
26+
By default, the service will listen to port 4043 (non-ssl) and will be at `/email` behind the NGINX router.
27+
28+
## Web URLs and REST API
29+
**Doc page** - by default at https://127.0.0.1:40075/email/doc. Will display the [REST API](teraserver/api/API)
30+
documentation and test system. Useful to test queries manually.
31+
32+
## Specific notes
33+
Since the email server is usually associated to a domain, it's easy for emails sent that way to be classified as "junkmail" by email clients.
34+
35+
To prevent that, ensure that users are using emails in the same domain or that you are sending emails using a default "noreply" email in the correct domain.
36+
37+
## Web Frontend
38+
Currently, no web front-end is available for that service
39+
40+
## RPC API
41+
None. This service uses the [asynchronous communication system](../developers/Internal-services-communication-module).

teraserver/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ endif(NOT CMAKE_BUILD_TYPE)
1010
# Software version
1111
SET(OPENTERA_VERSION_MAJOR "1")
1212
SET(OPENTERA_VERSION_MINOR "3")
13-
SET(OPENTERA_VERSION_PATCH "0")
13+
SET(OPENTERA_VERSION_PATCH "1")
1414

1515
SET(OPENTERA_SERVER_VERSION OpenTera_v${OPENTERA_VERSION_MAJOR}.${OPENTERA_VERSION_MINOR}.${OPENTERA_VERSION_PATCH})
1616

teraserver/README.md

Lines changed: 2 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,3 @@
11
## Getting Started for Developers
2-
Please follow those steps to setup your development environment. Clone this directory (change branch if not default dev) with submodules using :
3-
4-
```
5-
git clone --recursive -b dev https://github.com/introlab/opentera.git
6-
```
7-
8-
### Requirements
9-
1. Make sure you have a valid compiler installed:
10-
1. Linux : gcc/g++. Install it with ```sudo apt-get install build-essential```
11-
2. Mac : LLVM through XCode from the App Store
12-
3. Windows: [Visual Studio C++ 2017 Community Edition](https://visualstudio.microsoft.com/fr/vs/older-downloads/)
13-
14-
2. Install CMake
15-
1. Linux : ```sudo apt-get install cmake```
16-
2. Mac & Windows: Download from [here.](https://cmake.org/download/)
17-
18-
3. Install [Qt + QtCreator](https://www.qt.io/)
19-
1. Use the [Qt Online Installer](https://www.qt.io/download-open-source) (will require a free Qt Account)
20-
2. Linux: run the installer script, do not forget to make it executable first ```chmod +x <qt-unified-linux...>```
21-
3. Install the latest Qt Open Source Edition (Qt 5.14.2 Desktop or later, will be useful for Qt client application)
22-
4. Install all components except "Android" and "WebAssembly".
23-
5. Use default directories
24-
25-
4. Install MiniConda3
26-
1. Use installer from [here](https://conda.io/miniconda.html)
27-
2. Install Python 3.x version for current user (in default user directory).
28-
3. Use default settings.
29-
30-
5. Install [PyCharm Community Edition](https://www.jetbrains.com/pycharm/)
31-
32-
6. Install PostgreSQL with default parameters
33-
1. Linux : ```sudo apt-get install postgresql```
34-
2. Mac & Windows: Download and install from : https://www.postgresql.org/download/
35-
36-
7. Install redis server.
37-
1. Recommanded: Install redis from [Docker](https://hub.docker.com/_/redis)
38-
2. Linux, Install redis with apt with `sudo apt-get install redis-server`
39-
3. Windows: install [redis binaries](https://github.com/MicrosoftArchive/redis/releases)
40-
41-
8. Install NGINX.
42-
1. Windows: http://nginx.org/en/docs/windows.html
43-
2. Mac: install with [brew](https://brew.sh/index)
44-
3. Linux: install with package manager : ```sudo apt-get install nginx```
45-
46-
### Step1 : Create the database and database users (only once)
47-
This step needs to be done only once.
48-
```
49-
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'test';"
50-
sudo -u postgres psql -c "create database opentera;"
51-
sudo -u postgres psql -c "create user TeraAgent with encrypted password 'test';"
52-
sudo -u postgres psql -c "grant all privileges on database opentera to TeraAgent;"
53-
sudo -u postgres psql -c "ALTER USER TeraAgent WITH PASSWORD 'tera';"
54-
sudo -u postgres psql -c "create database openteralogs;"
55-
sudo -u postgres psql -c "grant all privileges on database openteralogs to TeraAgent;"
56-
sudo -u postgres psql -c "create database openterafiles;"
57-
sudo -u postgres psql -c "grant all privileges on database openterafiles to TeraAgent;"
58-
sudo -u postgres psql -c "create database bureauactif;"
59-
sudo -u postgres psql -c "create user bureauactif with encrypted password 'bureauactif';"
60-
sudo -u postgres psql -c "grant all privileges on database bureauactif to bureauactif;"
61-
sudo -u postgres psql -c "ALTER USER bureauactif WITH PASSWORD 'bureauactif';"
62-
sudo -u postgres psql -c "\l"
63-
```
64-
### Step 2 : Open the root CMakeLists.txt in QtCreator (only once)
65-
1. Opening the root teraserver/CMakeLists.txt will allow to create and build the project
66-
1. Build the project **using the python-all target**, it will automatically generate the Python environment in env/python-3.6
67-
2. Click on the "Projects" and change Build steps target by clicking on "Details"
68-
2. All python dependencies will be automatically downloaded
69-
3. Once the project is built, you will not need QtCreator (for now).
70-
71-
### Step 3 : Create a PyCharm project (only once)
72-
1. Using PyCharm, opening the directory "{PROJECT_ROOT}/python"
73-
1. Select the existing Python 3.6 environment in "{PROJECT_ROOT}/python/env/python-3.6" in the app menu: PyCharm->Preferences->Project:python->Project Interpreter
74-
75-
### Step 4: Generate the TLS certicates (only once)
76-
1. Using PyCharm, run the CreateCretificates.py script. This will generate the TLS certificates used by nginx.
77-
78-
### Step 5 : Run the nginx reverse proxy (every time)
79-
1. Go to the **{PROJECT_ROOT}/teraserver/python/config** directory.
80-
2. Create the logs directory (only once) : ```mkdir logs```
81-
3. Run the script : ```./start_nginx.sh```
82-
83-
### Step 6 : Run the application (every time)
84-
1. Run the TeraServer.py application from PyCharm
85-
2. Edit the code as you would normally do in a python program.
86-
3. Run tests in the tests directory
87-
88-
### Step 7 : Try the API with swagger UI" (as needed)
89-
1. Navigate to : [API](https://localhost:40075/doc)
90-
91-
### Notes
92-
1. In a near future, we hope to have everything in the QtCreator IDE. Stay tuned!
93-
94-
Enjoy!
2+
Instructions to create a development setup are available here:
3+
https://introlab.github.io/opentera/developers/Developers.html

0 commit comments

Comments
 (0)