Commit 3a557d35 authored by Sophie Wenzel-Teuber's avatar Sophie Wenzel-Teuber Committed by Aaron Dees
Browse files

Update for new master branch merge

Changelog:
* Build documentation
* Add new flag to CMake to build Documentation with Doxygen, but without the Markdown converter
* Update CI for new CMake variable
* Update README to reflect changes
parent 1f7100b0
Pipeline #1510 passed with stages
in 7 minutes and 18 seconds
......@@ -16,6 +16,7 @@ image: ciaranorourke/fiphoboserver:debian
-DFIPHOBOSERVER_BUILD_TESTS="${FIPHOBOSERVER_BUILD_TESTS}"
-DCMAKE_PREFIX_PATH="${DEPS_DIR}"
-DCUSTOM_DOCU_PATH="${FIPHOBOSERVER_DOC_DIR}"
-DFIPHOBOSERVER_BUILD_DOCUMENTATION="${FIPHOBOSERVER_BUILD_DOCUMENTATION}"
..
)
&& popd
......@@ -89,6 +90,7 @@ Doxygen:
stage: build
variables:
<<: *default_cmake_variables
FIPHOBOSERVER_BUILD_DOCUMENTATION: "ON"
FIPHOBOSERVER_DOC_DIR: /home/superfiphoboserver/external/doxygen-xml-parser/src
CC: clang
CXX: clang++
......
......@@ -15,6 +15,11 @@ option(
"build FiPhoboServer tests. Depends on Catch2."
OFF
)
option(
FIPHOBOSERVER_BUILD_DOCUMENTATION
"build FiPhoboServer Documentation. Depends on Doxygen."
OFF
)
add_subdirectory(src)
......@@ -23,9 +28,9 @@ target_include_directories(
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
)
if(CUSTOM_DOCU_PATH)
if(FIPHOBOSERVER_BUILD_DOCUMENTATION)
add_subdirectory(doc)
endif(CUSTOM_DOCU_PATH)
endif(FIPHOBOSERVER_BUILD_DOCUMENTATION)
# Build tests
if(FIPHOBOSERVER_BUILD_TESTS)
......
......@@ -8,12 +8,13 @@ FIPhoboServer has many dependencies that require much patience to build. It may
FROM ciaranorourke/fiphoboserver:debian
RUN apt-get -y update && apt-get -y upgrade
RUN apt-get -y install doxygen graphviz
RUN apt-get -y install \
[personal installation preferences]
CMD /home/superfiphoboserver/tools/build_phobos.sh -r && [favourite shell]
```
Alternatively, see [SuperFIPhoboServer](oilgas/ltfs/superfiphoboserver) for instructions on how to create your own build environment.
Alternatively, see [SuperFIPhoboServer](https://git.ichec.ie/oilgas/ltfs/superfiphoboserver) for instructions on how to create your own build environment.
It is recommended to run this Docker image by mounting your local branch of the FIPhoboServer project with `docker run -it -v /path/to/fiphoboserver:/destination [name]:[tag]`
......@@ -45,6 +46,13 @@ cmake \
make
```
### Build instructions using the superbuild
When using the Docker image from [SuperFIPhoboServer](https://git.ichec.ie/oilgas/ltfs/superfiphoboserver), some specific values make life a bit easier:
* docker image should be run with `/home/superfiphoboserver/external/fiphoboserver` as `destination` for the mount option (example: `docker run -it -v ./fiphoboserver:/home/superfiphoboserver/external/fiphoboserver phobos:debian`).
* the `CMAKE_PREFIX_PATH` need to be set to `/home/superfiphoboserver/build/install`
* An example script to build this project can be found inside the container under `/home/superfiphoboserver/tools/build_fiphboserver.sh`.
### Useful Options
#### Setting Compile/Link Flags
......@@ -57,7 +65,8 @@ Option | Effect
Option | Effect
------ | ------
`-DFIPHOBOSERVER_BUILD_TESTS=...` | Set to `ON` to build FIPhoboServer tests and enable the `make test` target, or `OFF` to skip (Default `OFF`).
`-DCUSTOM_DOCU_PATH=...` | Set to `doc/` to build FIPhoboServer documentation or don't set to skip (Default `not set`).
`-DFIPHOBOSERVER_BUILD_DOCUMENTATION=...` | Set to `ON` to build FIPhoboServer Doxygen documentation, or `OFF` to skip (Default `OFF`).
`-DCUSTOM_DOCU_PATH=...` | Set to the path to the `src` folder in [DoxygenXMLParser](https://git.ichec.ie/sophie.wenzel-teuber/doxygen-xml-parser) to create the Markdown output from the Doxygen XML, that can also be found [here](doc/Markdown/fiphoboserver) or don't set to skip (Default `not set`).
## Testing
......@@ -91,3 +100,18 @@ Options can also be given to the `start` subcommand using `--config [config_file
```
fiphoboserver --config [config_filename] start
```
### Authentication
The server uses the [Amazon S3 Authentication](https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html) to ensure the requests that are reaching it are from legitimate users.
Since we do not have a proper database for users yet, they are currently stored along with their keys in [users.txt](test/users.txt). This file is copied into the `/tmp` folder by CMake and then read from there for authentication.
Since the authentication is checked for every request, you need to use one of the users and keys from that file for testing the server!
One possible way most SDKs use automatically is the file `~/.aws/credentials`. The tests for the server are done with a file like this:
```
[default]
aws_access_key_id = OPEN_KEY
aws_secret_access_key = SECRET_KEY
```
\ No newline at end of file
......@@ -39,12 +39,20 @@ if(CUSTOM_DOCU_PATH)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Creating the Markdown documentation..."
)
# Target to wire up building the documentation to the ALL target.
add_custom_target(
doc ALL
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/Markdown/index.md
)
else(CUSTOM_DOCU_PATH)
# Target to wire up building the documentation to the ALL target.
add_custom_target(
doc ALL
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/xml/index.xml
)
endif(CUSTOM_DOCU_PATH)
# Target to wire up building the documentation to the ALL target.
add_custom_target(
doc ALL
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/Markdown/index.md
)
......@@ -21,6 +21,7 @@
| [s3_utilities](./s3_utilities/index.md) | namespace for S3 specific utilities |
| [storage](./storage/index.md) | namespace for storage classes that belong to / inherit from from [fiphoboserver::storage::Storage][fiphoboserver-storage-Storage] |
| [stream](./stream/index.md) | namespace for stream classes that belong to / inherit from from [fiphoboserver::stream::Stream][fiphoboserver-stream-Stream] |
| [util](./util/index.md) | namespace for utility classes |
......
# <a name='fiphoboserver-util-Config' /> public fiphoboserver::util::Config
class for handling command line arguments and configuration files
## Private Attributes
| Name | Description |
| ---- | ---- |
| [m_parser](#fiphoboserver-util-Config-m_parser) | CLI11 class to handle parsing. |
| [m_start](#fiphoboserver-util-Config-m_start) | CLI11 class for start subcommand. |
| [m_stop](#fiphoboserver-util-Config-m_stop) | CLI11 class for stop subcommand. |
| [m_restart](#fiphoboserver-util-Config-m_restart) | CLI11 class for restart subcommand. |
| [m_http_port](#fiphoboserver-util-Config-m_http_port) | port to listen on with HTTP protocol |
| [m_http2_port](#fiphoboserver-util-Config-m_http2_port) | port to listen on with HTTP2 protocol |
| [m_hostname](#fiphoboserver-util-Config-m_hostname) | IP/Hostname to bind to. |
| [m_thread_count](#fiphoboserver-util-Config-m_thread_count) | Number of threads to listen on. |
| [m_config_filename](#fiphoboserver-util-Config-m_config_filename) | filename to write configuration options to |
## Public Functions
| Name | Description |
| ---- | ---- |
| [Config](#fiphoboserver-util-Config-Config) | default constructor |
| [~Config](#fiphoboserver-util-Config-~Config) | default destructor |
| [parse](#fiphoboserver-util-Config-parse) | parse command line arguments |
| [start_daemon](#fiphoboserver-util-Config-start_daemon) | query if the server daemon should be started |
| [stop_daemon](#fiphoboserver-util-Config-stop_daemon) | query if the server daemon should be stopped |
| [restart_daemon](#fiphoboserver-util-Config-restart_daemon) | query if the server daemon should be restarted |
## Private Functions
| Name | Description |
| ---- | ---- |
| [define_options](#fiphoboserver-util-Config-define_options) | define the supported command line options |
| [handle_arguments](#fiphoboserver-util-Config-handle_arguments) | perform any required adjustments to options |
## Private Attributes
### <a name='fiphoboserver-util-Config-m_parser' /> private fiphoboserver::util::Config::m_parser
CLI11 class to handle parsing.
[Go to Top](#fiphoboserver-util-Config)
### <a name='fiphoboserver-util-Config-m_start' /> private fiphoboserver::util::Config::m_start
CLI11 class for start subcommand.
[Go to Top](#fiphoboserver-util-Config)
### <a name='fiphoboserver-util-Config-m_stop' /> private fiphoboserver::util::Config::m_stop
CLI11 class for stop subcommand.
[Go to Top](#fiphoboserver-util-Config)
### <a name='fiphoboserver-util-Config-m_restart' /> private fiphoboserver::util::Config::m_restart
CLI11 class for restart subcommand.
[Go to Top](#fiphoboserver-util-Config)
### <a name='fiphoboserver-util-Config-m_http_port' /> private fiphoboserver::util::Config::m_http_port = 11000
port to listen on with HTTP protocol
[Go to Top](#fiphoboserver-util-Config)
### <a name='fiphoboserver-util-Config-m_http2_port' /> private fiphoboserver::util::Config::m_http2_port = 11002
port to listen on with HTTP2 protocol
[Go to Top](#fiphoboserver-util-Config)
### <a name='fiphoboserver-util-Config-m_hostname' /> private fiphoboserver::util::Config::m_hostname
IP/Hostname to bind to.
[Go to Top](#fiphoboserver-util-Config)
### <a name='fiphoboserver-util-Config-m_thread_count' /> private fiphoboserver::util::Config::m_thread_count = 0
Number of threads to listen on.
- default 0 uses the number of available cores
[Go to Top](#fiphoboserver-util-Config)
### <a name='fiphoboserver-util-Config-m_config_filename' /> private fiphoboserver::util::Config::m_config_filename
filename to write configuration options to
[Go to Top](#fiphoboserver-util-Config)
## Public Functions
### <a name='fiphoboserver-util-Config-Config' /> public fiphoboserver::util::Config::Config ()
default constructor
#### Qualifiers:
* inline
[Go to Top](#fiphoboserver-util-Config)
### <a name='fiphoboserver-util-Config-~Config' /> public fiphoboserver::util::Config::~Config ()
default destructor
#### Qualifiers:
* inline
[Go to Top](#fiphoboserver-util-Config)
### <a name='fiphoboserver-util-Config-parse' /> public [cli_options][fiphoboserver-util-cli_options] fiphoboserver::util::Config::parse (int argc, char *argv[])
parse command line arguments
#### Parameters:
| Type | Name | Description |
| ---- | ---- | ---- |
| int | argc | number of command line arguments |
| char * | argv | array of command line arguments |
#### Returns:
| Type | Description |
| ---- | ---- |
| [cli_options][fiphoboserver-util-cli_options] | struct of command line options or error code |
[Go to Top](#fiphoboserver-util-Config)
### <a name='fiphoboserver-util-Config-start_daemon' /> public bool fiphoboserver::util::Config::start_daemon () const
query if the server daemon should be started
#### Returns:
| Type | Description |
| ---- | ---- |
| bool | whether the start subcommand has been parsed |
#### Qualifiers:
* const
* inline
[Go to Top](#fiphoboserver-util-Config)
### <a name='fiphoboserver-util-Config-stop_daemon' /> public bool fiphoboserver::util::Config::stop_daemon () const
query if the server daemon should be stopped
#### Returns:
| Type | Description |
| ---- | ---- |
| bool | whether the stop subcommand has been parsed |
#### Qualifiers:
* const
* inline
[Go to Top](#fiphoboserver-util-Config)
### <a name='fiphoboserver-util-Config-restart_daemon' /> public bool fiphoboserver::util::Config::restart_daemon () const
query if the server daemon should be restarted
#### Returns:
| Type | Description |
| ---- | ---- |
| bool | whether the restart subcommand has been parsed |
#### Qualifiers:
* const
* inline
[Go to Top](#fiphoboserver-util-Config)
## Private Functions
### <a name='fiphoboserver-util-Config-define_options' /> private void fiphoboserver::util::Config::define_options ()
define the supported command line options
[Go to Top](#fiphoboserver-util-Config)
### <a name='fiphoboserver-util-Config-handle_arguments' /> private [cli_options][fiphoboserver-util-cli_options] fiphoboserver::util::Config::handle_arguments ()
perform any required adjustments to options
#### Returns:
| Type | Description |
| ---- | ---- |
| [cli_options][fiphoboserver-util-cli_options] | struct of command line options or error code |
[Go to Top](#fiphoboserver-util-Config)
[fiphoboserver-util-cli_options]:./cli_options.md#fiphoboserver-util-cli_options
# <a name='fiphoboserver-util-cli_options' /> public fiphoboserver::util::cli_options
struct for conveniently passing command line options to main program
# <a name='fiphoboserver-util' /> fiphoboserver::util
namespace for utility classes
## Classes
| Name | Description |
| ---- | ---- |
| [cli_options](./cli_options.md) | struct for conveniently passing command line options to main program |
| [Config](./Config.md) | class for handling command line arguments and configuration files |
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment