{"id":17786876,"url":"https://github.com/perdian/flightlog","last_synced_at":"2025-03-16T07:31:45.589Z","repository":{"id":47546599,"uuid":"100788564","full_name":"perdian/flightlog","owner":"perdian","description":"Flight log web application that keeps track of your personal flight history","archived":false,"fork":false,"pushed_at":"2025-02-22T08:59:32.000Z","size":8042,"stargazers_count":31,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-15T23:50:47.055Z","etag":null,"topics":["flightlog","java","spring-boot","webapplication"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/perdian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-19T10:58:13.000Z","updated_at":"2025-03-04T16:42:48.000Z","dependencies_parsed_at":"2024-08-15T21:15:58.208Z","dependency_job_id":"4a5eeb62-b2b8-4e3f-9255-5197fe4e6b18","html_url":"https://github.com/perdian/flightlog","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perdian%2Fflightlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perdian%2Fflightlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perdian%2Fflightlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perdian%2Fflightlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perdian","download_url":"https://codeload.github.com/perdian/flightlog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841127,"owners_count":20356440,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flightlog","java","spring-boot","webapplication"],"created_at":"2024-10-27T10:08:43.287Z","updated_at":"2025-03-16T07:31:44.818Z","avatar_url":"https://github.com/perdian.png","language":"Java","readme":"# Introduction\n\n[![Releases](https://img.shields.io/github/v/release/perdian/flightlog)](https://github.com/perdian/flightlog/releases)\n[![Build](https://img.shields.io/circleci/build/github/perdian/flightlog/master)](https://circleci.com/gh/perdian/flightlog)\n[![License](http://img.shields.io/:license-apache-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n\nFlightlog was born from my nerdy need for a bookkeeping tool to track all the flights I have taken so far.\n\nFor years, I was quite happy with flugstatistik.de, but unfortunately, it hasn't evolved much over the past few years, resulting in a UI that looks quite outdated and a feature set that is okay-ish, but lacking some elements I would like to see. Additionally, there was (and still is!) no way to back up the data stored there, which leads to considerable vendor lock-in. What happens if they decide to stop providing their service, or if I simply forget my login credentials? No, that's just not acceptable.\n\nFrom what I observed at the time (and still see today), there are no real alternatives. Openflights.org is an excellent idea, but the UI is even worse than flugstatistik.de's, looking as though it was thrown together in an hour or two. Don't get me wrong, I'm pretty sure a significant amount of time has been invested, but to me, it just looks terrible.\n\nTherefore, with no suitable tool available, I decided to create one myself. The overall UI somewhat incorporates ideas from flugstatistik.de but is a bit more modern and streamlined.\n\n![Home screen](docs/screenshots/home.png)\n\n# Installation\n\n### Docker container\n\nThe easiest way to start a flightlog application is by starting a Docker container which can be easily fetched from [DockerHub](https://hub.docker.com/r/perdian/flightlog) (new releases are automatically pushed to Docker Hub so all you need to do is to start a Docker container).\n\n    $ docker run -p 8080:8080 perdian/flightlog:latest\n\nReplace `latest` version with the latest release which can be found at https://github.com/perdian/flightlog/releases.\n\nThe application will be available on the machine on which you're executing the container at:\n\n    http://localhost:8080/flightlog/\n\nAn embedded H2 database file will be used, mounted as volume for the created container. It can be configured using environment variables (see the [**Configuration**](#configuration) section for details).\n\nTo persist the database you have to mount the directory `/var/flightlog/database/` from the Docker container to somewhere on your host machine:\n\n    $ docker run -v /path/to/your/host/directory:/var/flightlog/database -p 8080:8080 perdian/flightlog\n\n# Configuration\n\nThe complete configuration can be done through environment variables so whether you're launching the application as a Docker container or through any other method the same set of environment variables can be used.\n\n## Database\n\nBy default an embedded H2 database is used but any database supported by Hibernate can be configured. The JDBC drivers for PostgreSQL and MySQL are already bundled within the standard Spring Boot application and Docker image.\n\n| Environment variable | Default value | Comment |\n| -------------------- | ------------- | ------- |\n| `FLIGHTLOG_DB_URL` | `jdbc:h2:${FLIGHTLOG_DB_DIRECTORY:~/.flightlog/}/flightlogdb` | The complete JDBC URL of the database |\n| `FLIGHTLOG_DB_DRIVER_CLASS_NAME` | `org.h2.Driver` | The JDBC driver class name. The class must be accessible on the classpath. |\n| `FLIGHTLOG_DB_USERNAME` | `sa` | The JDBC username |\n| `FLIGHTLOG_DB_PASSWORD` | | The JDBC password |\n| `FLIGHTLOG_DB_DIRECTORY`| `~/.flightlog/` for the JAR distribution, `/var/flightlog/database/` for the Docker distribution | The directory where the embedded H2 database is located. Will only be used if `FLIGHTLOG_DB_URL` is not overwritten. |\n\n## Authentication\n\nThe application ships with a few options of authentication providers readily available.\n\nBy default no authentication is required, which means without any additional configuration the application works in a single user mode: All flights are implicitly linked to a single user named `example@example.com`.\nThe user won't have to authenticate but will automatically be authenticated with every request.\n\nThe email of the user can be changed by setting the environment variable `FLIGHTLOG_AUTHENTICATION_FIXED_DEFAULT_EMAIL_ADDRESS`.\n\n### OAuth2 authentication\n\nFlightlog supports OAuth2 authentication via any OAuth2 authentication providers.\nTo enable an OAuth2 authentication provider you have to set the `FLIGHTLOG_AUTHENTICATION_TYPE` environment variable to `OAUTH2`.\n\nFor each login the application will perform an OAuth2 authentication.\nAfter the successful authentication an entry within the `flightuser_user` database table will be made, populated with the values retrieved from the OAuth2 provider.\n\n#### Google\n\nTo enable the OAuth authentication you have to set the `FLIGHTLOG_AUTHENTICATION_TYPE` environment variable to `oauth2`\n\nThe following environment variables have to be set to the OAuth2 credentials retrieved from the Google Cloud console:\n\n* `FLIGHTLOG_AUTHENTICATION_OAUTH2_GOOGLE_CLIENT_ID`\n* `FLIGHTLOG_AUTHENTICATION_OAUTH2_GOOGLE_CLIENT_SECRET`\n\n\u003e The redirect URL `\u003cAPPLICATION_ROOT\u003e/login/oauth2/code/flightlog` must be entered in the Google Cloud console for your Google application.\n\u003e\n\u003e For example if you run Flightlog directly from the Docker container on `localhost` via `http://localhost:8080/flightlog/` then the redirect URL that needs to be configured at Google is `http://localhost:8080/flightlog//login/oauth2/code/flightlog`.\n\n#### Generic OAuth2 authentication provider\n\nAny other OAuth2 authentication provider can be configured in a similar manner to Google but with a few more environment variables required.\n\nThe examples listed below are taken from an [Authentik](https://goauthentik.io) installation run directly from a [Docker container](https://docs.goauthentik.io/docs/installation/docker-compose):\n\n| Environment variable | Required | Default value | Example |\n| -------------------- | -------- | ------------- | ------- |\n| `FLIGHTLOG_AUTHENTICATION_OAUTH2_CLIENT_ID` | Yes | | `abc123` |\n| `FLIGHTLOG_AUTHENTICATION_OAUTH2_CLIENT_SECRET` | Yes | | `xyz987` |\n| `FLIGHTLOG_AUTHENTICATION_OAUTH2_CLIENT_NAME` | No | `flightlog` | |\n| `FLIGHTLOG_AUTHENTICATION_OAUTH2_AUTHORIZATION_URI` | Yes | | `http://localhost:9000/application/o/authorize/` |\n| `FLIGHTLOG_AUTHENTICATION_OAUTH2_TOKEN_URI` | Yes | | `http://localhost:9000/application/o/token/` |\n| `FLIGHTLOG_AUTHENTICATION_OAUTH2_USER_INFO_URI` | Yes | | `http://localhost:9000/application/o/userinfo/` |\n| `FLIGHTLOG_AUTHENTICATION_OAUTH2_USER_NAME_ATTRIBUTE` | No | `name` | |\n| `FLIGHTLOG_AUTHENTICATION_OAUTH2_JWK_SET_URI` | Yes | | `http://localhost:9000/application/o/flightlog/jwks/` |\n\n## Whitelisting users\n\n**By default no new users can register themselves in a Flightlog application**.\n\nThis is a conscious choice to prohibit someone spamming the system and creating entries in the database by simply performing multiple OAuth2 authentications.\n\nThere are two ways to allow an authentication from a new OAuth2 account:\n\n### Disabling registration blocker\n\nSetting the environment variable `FLIGHTLOG_REGISTRATION_ALLOW_BY_DEFAULT` to `true` will bypass the check for existence and will create a new entry in the local database for every new account authenticated via the currently configured OAuth2 authentication provider.\n\n### Adding the email address to the allowlist\n\nWhen a new OAuth2 account is found the system will check the internal *allowlist* whether the email address of the new user is found on the allowlist. If that's the case then the new user will be added into the database and the authentication will succeed.\n\nTo place one or more user(s) on the allowlist add the email addresses to the environment variable `FLIGHTLOG_REGISTRATION_EMAIL_ADDRESSES_ALLOWLIST` (separate multiple addresses by commata).\n\n## Other environment variables\n\n| Environment variable | Default value | Comment |\n| -------------------- | ------------- | ------- |\n| `FLIGHTLOG_SERVER_PORT` | `8080` | The port on which the application will listen for incoming requests |\n| `FLIGHTLOG_SERVER_CONTEXT_PATH` | `/flighlog` | The context path under which the application will be made available. The default value `/flightlog` implies that when using the default port of `8080` the applications main page can be reached at `http://localhost:8080/flightlog`. |\n| `FLIGHTLOG_SERVER_COOKIE_NAME` | `flightlog-session` | The name of the cookie that is used to store session related data. |\n\n# Build\n\nFlightlog is a [Spring Boot application](https://spring.io/guides/gs/spring-boot/) and can be built and executed accordingly:\n\n    $ git clone https://github.com/perdian/flightlog.git\n    $ cd flightlog\n    $ mvn clean package\n\nThis creates the application JAR file into `target/flightlog.jar`\n\n# Run\n\n## JAR\n\nThe JAR file already contains everything needed to start Flighlog with its default settings:\n\n    $ mvn clean package\n    $ java -jar target/flightlog.jar\n\nThe application will now start and is accessible at\n\n    http://localhost:8080/flightlog/\n\nAn embedded H2 database file will be stored at `~/.flightlog/`. Both the database location as well as the database type can be configured using environment variables (see the **Configuration** section for details).\n\n### Build from sources\n\nIf you want to build the Docker image yourself from the sources it can be done like this:\n\n    $ mvn clean package\n    $ docker build -t perdian/flightlog .\n\nAfter the container is built you can verify the application by running it:\n\n    $ docker run -p 8080:8080 perdian/flightlog\n\nThe application will be available on the machine on which you're executing the container at:\n\n    http://localhost:8080/flightlog/\n\n# Credits\n\nThis application would not be possible without the great work of other open source projects.\n\nA big thank you therefore goes to:\n\n* Openflights.org for its collection of airport and airline data as well as inspiration of how to display the flights on the map (\u003chttps://openflights.org/data.html\u003e).\n* Openlayers for the ground work in providing the world map (\u003chttps://openlayers.org/\u003e).\n* arc.js for handling the pain of computing a great circle between two airports (\u003chttps://github.com/springmeyer/arc.js/\u003e).\n* Semantic UI for its beautiful frontend components (\u003chttps://semantic-ui.com/\u003e).\n* JQuery for the ultimate DOM manipulation tool (\u003chttps://jquery.com/\u003e).\n* Spring Boot for the heavy lifting in the backend (\u003chttps://projects.spring.io/spring-boot/\u003e).\n* Hibernate for the SQL abstraction layer (\u003chttp://hibernate.org/\u003e).\n\n# License\n\nFlightlog is licensed under the Apache Licence 2.0 (\u003chttp://www.apache.org/licenses/\u003e).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperdian%2Fflightlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperdian%2Fflightlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperdian%2Fflightlog/lists"}