Files
Athou_commafeed/README.md

177 lines
7.1 KiB
Markdown
Raw Normal View History

2022-10-25 13:40:39 +02:00
# CommaFeed
2014-12-05 08:22:00 +01:00
2024-08-12 22:43:41 +02:00
Google Reader inspired self-hosted RSS reader, based on Quarkus and React/TypeScript.
2023-05-01 11:20:35 +02:00
![preview](https://user-images.githubusercontent.com/1256795/184886828-1973f148-58a9-4c6d-9587-ee5e5d3cc2cb.png)
## Features
- 4 different layouts
2023-11-24 08:37:41 +01:00
- Light/Dark theme
2024-08-17 22:21:21 +02:00
- Fully responsive, works great on both mobile and desktop
2023-05-01 11:20:35 +02:00
- Keyboard shortcuts for almost everything
- Support for right-to-left feeds
- Translated in 25+ languages
- Supports thousands of users and millions of feeds
- OPML import/export
2024-08-17 22:21:21 +02:00
- REST API
- Fever-compatible API for native mobile apps
- Can automatically mark articles as read based on user-defined rules
- [Browser extension](https://github.com/Athou/commafeed-browser-extension)
2024-08-17 22:21:21 +02:00
- Compiles to native code for blazing fast startup and low memory usage
2024-08-12 22:43:41 +02:00
- Supports 4 databases
- H2 (embedded database)
- PostgreSQL
- MySQL
- MariaDB
2023-10-01 15:13:10 +02:00
## Deployment
2014-12-05 08:22:00 +01:00
2023-04-25 08:57:55 +02:00
### Docker
2023-10-01 15:13:10 +02:00
Docker is the easiest way to get started with CommaFeed.
2023-04-25 08:57:55 +02:00
Docker images are built automatically and are available at https://hub.docker.com/r/athou/commafeed
2023-10-01 15:13:10 +02:00
### Cloud hosting
[PikaPods](https://www.pikapods.com) offers 1-click cloud hosting solutions starting at $1/month with a free $5
welcome credit and officially supports CommaFeed.
PikaPods shares 20% of the revenue back to CommaFeed.
[![PikaPods](https://www.pikapods.com/static/run-button.svg)](https://www.pikapods.com/pods?run=commafeed)
2024-08-12 22:43:41 +02:00
### Download a precompiled package
2015-06-19 08:32:25 +02:00
2024-08-12 22:43:41 +02:00
Go to the [release page](https://github.com/Athou/commafeed/releases) and download the latest version for your operating
system and database of choice.
2015-06-19 08:32:25 +02:00
2024-08-12 22:43:41 +02:00
There are two types of packages:
- The `linux-x86_64` and `windows-x86_64` packages are compiled natively and contain an executable that can be run
directly.
2024-08-13 17:26:51 +02:00
- The `jvm` package is a zip file containing all `.jar` files required to run the application. This package works on all
platforms and is started with `java -jar quarkus-run.jar`.
2024-08-12 22:43:41 +02:00
If available for your operating system, the native package is recommended because it has a faster startup time and lower
memory usage.
2023-04-25 08:57:55 +02:00
### Build from sources
2014-12-05 08:22:00 +01:00
2024-08-17 22:21:21 +02:00
./mvnw clean package [-P<database>] [-Pnative] [-DskipTests]
2014-12-05 08:22:00 +01:00
2024-08-17 22:21:21 +02:00
- `<database>` can be one of `h2`, `postgresql`, `mysql` or `mariadb`. The default is `h2`.
2024-08-13 15:05:40 +02:00
- `-Pnative` compiles the application to native code. This requires GraalVM to be installed (`GRAALVM_HOME` environment
variable pointing to a GraalVM installation).
2024-08-17 22:21:21 +02:00
- `-DskipTests` to speed up the build process by skipping tests.
2024-08-13 17:26:51 +02:00
When the build is complete:
2024-08-14 20:42:28 +02:00
- a zip containing all jars required to run the application is located at
`commafeed-server/target/commafeed-<version>-<database>-jvm.zip`. Extract it and run the application with
2024-08-13 17:26:51 +02:00
`java -jar quarkus-run.jar`
2024-08-14 20:42:28 +02:00
- if you used the native profile, the executable is located at
`commafeed-server/target/commafeed-<version>-<database>-<platform>-<arch>-runner[.exe]`
2024-08-13 17:26:51 +02:00
2024-08-12 22:43:41 +02:00
## Configuration
2024-08-16 14:23:18 +02:00
CommaFeed doesn't require any configuration to run with its embedded database (H2). The database file will be stored in
2024-08-17 22:21:21 +02:00
the `data` directory of the current directory.
2024-08-12 22:43:41 +02:00
2024-08-16 14:23:18 +02:00
To use a different database, you will need to configure the following properties:
2024-08-12 22:43:41 +02:00
2024-08-18 17:00:56 +02:00
- `quarkus.datasource.jdbc.url`
2024-08-16 14:23:18 +02:00
- e.g. for H2: `jdbc:h2:./data/db;DEFRAG_ALWAYS=TRUE`
2024-08-12 22:43:41 +02:00
- e.g. for PostgreSQL: `jdbc:postgresql://localhost:5432/commafeed`
- e.g. for MySQL:
`jdbc:mysql://localhost/commafeed?autoReconnect=true&failOverReadOnly=false&maxReconnects=20&rewriteBatchedStatements=true&timezone=UTC`
- e.g. for MariaDB:
`jdbc:mariadb://localhost/commafeed?autoReconnect=true&failOverReadOnly=false&maxReconnects=20&rewriteBatchedStatements=true&timezone=UTC`
2024-08-16 14:23:18 +02:00
- `quarkus.datasource.username`
- `quarkus.datasource.password`
There are multiple ways to configure CommaFeed:
2024-08-18 19:20:34 +02:00
- a `config/application.properties` [properties](https://en.wikipedia.org/wiki/.properties) file relative to the working
directory (keys in kebab-case)
2024-08-16 14:23:18 +02:00
- Command line arguments prefixed with `-D` (keys in kebab-case)
- Environment variables (keys in UPPER_CASE)
2024-08-18 17:07:31 +02:00
- a `.env` file in the working directory (keys in UPPER_CASE)
2024-08-16 14:23:18 +02:00
The properties file is recommended because CommaFeed will be able to warn about invalid properties and typos.
2024-08-12 22:43:41 +02:00
2024-08-19 09:38:26 +02:00
All [CommaFeed settings](commafeed-server/doc/commafeed.adoc) are optional and have sensible default values.
2024-08-14 20:42:28 +02:00
When logging in, credentials are stored in an encrypted cookie. The encryption key is randomly generated at startup,
meaning that you will have to log back in after each restart of the application. To prevent this, you can set the
`quarkus.http.auth.session.encryption-key` property to a fixed value (min. 16 characters).
2024-08-19 09:38:26 +02:00
All other Quarkus settings can be found [here](https://quarkus.io/guides/all-config).
2024-08-12 22:43:41 +02:00
When started, the server will listen on http://localhost:8082.
The default user is `admin` and the default password is `admin`.
2024-08-17 22:21:21 +02:00
### Memory management (`jvm` package only)
The Java Virtual Machine (JVM) is rather greedy by default and will not release unused memory to the
operating system. This is because acquiring memory from the operating system is a relatively expensive operation.
This can be problematic on systems with limited memory.
#### Hard limit
The JVM can be configured to use a maximum amount of memory with the `-Xmx` parameter.
For example, to limit the JVM to 256MB of memory, use `-Xmx256m`.
#### Dynamic sizing
In addition to the previous setting, the JVM can be configured to release unused memory to the operating system with the
following parameters:
-Xms20m -XX:+UseG1GC -XX:+UseStringDeduplication -XX:-ShrinkHeapInSteps -XX:G1PeriodicGCInterval=10000 -XX:-G1PeriodicGCInvokesConcurrent -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10
See [here](https://docs.oracle.com/en/java/javase/17/gctuning/garbage-first-g1-garbage-collector1.html)
and [here](https://docs.oracle.com/en/java/javase/17/gctuning/factors-affecting-garbage-collection-performance.html) for
more
information.
#### OpenJ9
The [OpenJ9](https://eclipse.dev/openj9/) JVM is a more memory-efficient alternative to the HotSpot JVM, at the cost of
slightly slower throughput.
IBM provides precompiled binaries for OpenJ9
named [Semeru](https://developer.ibm.com/languages/java/semeru-runtimes/downloads/).
This is the JVM used in the [Docker image](https://github.com/Athou/commafeed/blob/master/Dockerfile).
2023-04-25 08:57:55 +02:00
## Translation
2023-04-25 08:57:55 +02:00
Files for internationalization are
located [here](https://github.com/Athou/commafeed/tree/master/commafeed-client/src/locales).
2022-10-25 13:40:39 +02:00
To add a new language:
2023-05-24 18:53:30 +02:00
- add the new locale to the `locales` array in:
- `commafeed-client/.linguirc`
- `commafeed-client/src/i18n.ts`
- run `npm run i18n:extract`
- add translations to the newly created `commafeed-client/src/locales/[locale]/messages.po` file
2023-04-25 08:57:55 +02:00
The name of the locale should be the
two-letters [ISO-639-1 language code](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
2022-10-25 13:40:39 +02:00
## Local development
2022-10-25 13:40:39 +02:00
### Backend
- Open `commafeed-server` in your preferred Java IDE.
2023-04-25 08:57:55 +02:00
- CommaFeed uses Lombok, you need the Lombok plugin for your IDE.
2024-08-13 15:05:40 +02:00
- run `./mvnw quarkus:dev`
2022-10-25 13:40:39 +02:00
### Frontend
2022-10-25 13:40:39 +02:00
- Open `commafeed-client` in your preferred JavaScript IDE.
- run `npm install`
- run `npm run dev`
2023-05-01 17:26:16 +02:00
The frontend server is now running at http://localhost:8082 and is proxying REST requests to the backend running on
port 8083