We recommend using Docker-compose for the simplest way to deploy Omnivore. We have provided a configuration in the self-hosting/docker-compose
folder.
All networking and persistent storage is handled by the docker-compose file.
- Docker
- Docker Compose
Clone the repository at [email protected]:omnivore-app/omnivore.git
The Docker-compose file and necessary environment variables are found in the self-hosting folder under docker-compose.
These files provide all you need to get Omnivore up and running on your local environment.
This will pull some premade images. If you want to build these images yourself, you can use the file found in self-hosting/docker-compose/self-build. You might want to do this if you are making development adjustments.
There is a .env.example file located within the docker-compose folder that should give you the necessary environment variables to begin running.
You can use these by mv .env.example .env
The following environment variables should be changed to reflect where you are running your application.
Environment Variable | Description | Local Parameter |
---|---|---|
BASE URL | The URL of the Front End of the Application. | http://localhost:3000 |
SERVER_BASE_URL | The URL of the API Server. | http://localhost:4000 |
HIGHLIGHTS_BASE_URL | The URL of the Front end of the Application | http://localhost:3000 |
NEXT_PUBLIC_BASE_URL | Same as above BASE URL, but for NEXT | http://localhost:3000 |
NEXT_PUBLIC_SERVER_BASE_URL | Same as above SERVER_BASE_URL, but for NEXT | http://localhost:4000 |
NEXT_PUBLIC_HIGHLIGHTS_BASE_URL | Same as above HIGHLIGHTS_BASE_URL but for NEXT | http://localhost:3000 |
CLIENT_URL | The URL of the Front end of the Application | http://localhost:3000 |
IMAGEPROXY_URL | Service that proxies images to avoid blocking | http://localhost:7070 |
Additionally, when doing a docker-compose build, if you are hosting this application you must change the args in the docker-compose
file.
web:
build:
context: ../../
dockerfile: ./packages/web/Dockerfile-self
args:
- APP_ENV=prod
- BASE_URL=http://localhost:3000
- SERVER_BASE_URL=http://localhost:4000
- HIGHLIGHTS_BASE_URL=http://localhost:3000
They are the same as the listed environment variables above.
Running docker compose build
will go through and build all the necessary docker images.
Running docker compose up
will start the services.
During the first deployment omnivore-migrate will go through and set up the necessary Postgres tables. This will also create a demo user with email: [email protected], password: demo_password.
When the service is ready you can access the web-app by using localhost:3000
With the default .env file you will be able to use Omnivore, add RSS Feeds, add stories etc.
A PGVector image is used to provide Postgres functionality. If you have another postgres service running it is possible to remove this from the docker-compose and provide the host, username and password of the Postgres instance.
Redis is used as a queueing system, and for caching. If you have a Redis Instance already it is possible to remove this from the docker-compose and rely on the hosted Redis. You must replace the redis url for this.
Minio is an AWS S3 compatible Object storage service that you can self-host. It is included in the docker-compose file. It allows you to use the S3 Storage API.
We also have a small client that creates the necessary buckets (createbuckets). See below:
until (/usr/bin/mc config host add myminio http://minio:9000 minio miniominio) do echo '...waiting...' && sleep 1; done;
/usr/bin/mc mb myminio/omnivore;
/usr/bin/mc policy set public myminio/omnivore;
If you use GCS, or S3 buckets you can do the following:
S3 is an AWS Block Storage Service. You can also use S3 as your storage service, rather than the included MinIO self-host. In order to use S3, you must do the following.
Replace the following with the correct parameters.
AWS_ACCESS_KEY_ID=minio # Used for Minio S3 Client
AWS_SECRET_ACCESS_KEY=miniominio
AWS_REGION=us-east-1
Replace the following with an endpoint URL from here
LOCAL_MINIO_URL=http://localhost:1010
Remove the following Environment Variable:
GCS_USE_LOCAL_HOST=true
and populate
GCS_UPLOAD_SA_KEY_FILE_PATH
with the path of the JSON key file for the service account.
Nginx is a reverse proxy that receives requests, and directs them to the correct service internally. Omnivore runs 4 services we want to redirect to.
- Omnivore Web
- Omnivore API
- Omnivore Bucket [Optional]
- Omnivore Image Proxy [Optional]
We have included an example Nginx Configuration that redirects traffic from http (80) to https (443), and then directs traffic to the correct service based on the request path.
Cloudflare tunnels is an easy way to expose a service running on a local machine to the internet without a publicly routable IP Address.
You run a daemon on your host machine, which creates outbound connections to the
Omnivore is no way affiliated with Cloudflare, it is just the method to which the person writing this guide used, and found pretty painless overall.
Another Feature of Omnivore is the ability to receive Newsletters directly into your Inbox using email. This feature is described more here.
This works by generating an email address, and subscribing to a newsletter using that email address.
In order to get this working in a self-hosted way we have created a new endpoint that allows you to send an API request with the emails contents.
We will go over
-
On the Omnivore website or app, tap your photo, initial, or avatar in the top right corner to access the profile menu. Select Emails from the menu.
-
Tap Create a New Email Address to add a new email address (e.g. [email protected]) to the list.
-
Click the Copy icon next to the email address.
-
Navigate to the signup page for the newsletter you wish to subscribe to.
-
Paste the Omnivore email address into the signup form.
-
New newsletters will be automatically delivered to your Omnivore inbox.
One way to get this functionality back is to host your own mail server. In this example we will only be using this mail server as an incoming mailbox to receive emails. I would not recommend this method, as it's largely more effort than it is worth.
We have used Docker-mailserver here. A guide on how to set this up is found here.
We have included a docker file self-hosting/docker-compose/mail/docker-compose-mail
. This file does a few things.
- Setups Docker-mailserver with minimal settings.
- Creates a user
[email protected]
wheredomain.tld
is your email servers domain. - Reroutes all mail from
*@domain.tld
to[email protected]
- Watches for any new mail incoming, converts it to a payload for the mail proxy, and forwards it on.
There are a few environment variables that need to be set.
WATCHER_API_KEY=mail-api-key # The API Key that runs the mail-watcher-api
MAIL_FILE_PATH=/var/mail/domain.tld/user/new # where domain.tld is the name of your domain
WATCHER_API_ENDPOINT=https://omnivore-watch.domain.tld # The hosted watcher api - where mail is proxied to and processed.
Additionally you need to change a few things in the docker-file.
hostname: mail.domain.tld
environment:
- DOMAIN="domain.tld"
docker exec -ti mailserver setup email add [email protected] pass123;
echo '@domain.tld [email protected]' > /tmp/docker-mailserver/config/postfix-virtual.cf
replace domain.tld with your mail servers domain.
Additionally you need to replace the following environment variables for the API.
WATCHER_API_KEY=mail-api-key # The same as the one in the mail server.
LOCAL_EMAIL_DOMAIN=domain.tld # Your email domain.
Setting up your own email server is a bit overkill for what we are trying to achieve. Below are some additional services that can be used to achieve the mail functionality. These are just a few examples, but others will also work.
Amazon Simple Email Service (SES) has options for email receiving. We can use this to add the email functionality to Omnivore-self hosted.
Create your identity using Amazon SES. This will be your domain.
See instructions on how to do that here
In SNS you must setup a subscription to your Omnivore Host.
If you are just looking for a simple way to import emails into your Self Hosted Omnivore Account, you can use a service like Zapier to forward the email into the mail-proxy.
Below is a set of instructions to get this working.
You can either use your own email with a filter, or alternatively create a new gmail account exclusively for your Newsletters.
For the to object use the email provided in step 1.
return { data: JSON.stringify(inputData) }
- POST Request
- Use the x-api-key set in your .env file
- The data is the output from the previous step.
Following these steps you should see your email imported into Omnivore.
Omnivore has the ability to process Youtube Transcripts, using OpenAI to add the necessary grammar, and structure.
This features requires the following Environment Variables
Environment Variable | Description |
---|---|
YOUTUBE_TRANSCRIPT_PROMPT | The Prompt sent to Open AI to format the Transcript. Default provided in .env.example |
YOUTUBE_MAXIMUM_VIDEO_DURATION_TRANSCRIPT | The duration in seconds of the maximum length allowed to be processed. Defaults to 30 minutes. |
OPENAI_API_KEY | The Open AI Key required to send the video to be formatted. |
To learn more about setting up the OpenAI Api key, read here: https://openai.com/index/openai-api/
In future releases we would like to be able to open this up to use different LLMs, such as Anthropic, Mistral, Bedrock, or any of the other myriad LLM Services.