A comprehensive app for accessing, managing, and sharing Hutterite literature.
-
Install Node.js.
-
Install Git.
-
Install Python.
-
Clone the repository with
git clone https://github.com/TheCodingJsoftware/Hutterite-Bookshelf.git
-
Run
npm install
to install the dependencies. -
Setup a virtual environment with
python -m virtualenv venv
. -
Activate the virtual environment with
source venv/bin/activate
or runvenv\Scripts\activate.bat
on Windows. -
Install the dependencies with
pip install -r requirements.txt
. -
Run
npm run build
to build the app. -
Setup enviroment variables in the
.env
file:POSTGRES_USER=your_username POSTGRES_PASSWORD=your_password POSTGRES_DB=your_database POSTGRES_HOST=localhost POSTGRES_PORT=5434 MAX_POSTGRES_WORKERS=50
-
Run
python main.py
to start the app.
To deploy your application running in Docker on your Synology NAS and set it up with a custom domain name, follow these steps:
Ensure your Synology NAS has Docker installed. If not, install Docker from the Synology Package Center.
Make sure your Dockerfile
, requirements.txt
, and main.py
are ready. Then, build the Docker image locally:
docker build -t app-name .
If you want to push the image to Docker Hub, you can do so. Replace your-docker-username
with your actual Docker Hub username:
docker tag app-name your-docker-username/app-name
docker push your-docker-username/app-name
If you pushed the image to Docker Hub, pull it on your Synology NAS:
- Open Docker from the main menu.
- Go to the "Registry" tab and search for your Docker Hub image (
your-docker-username/app-name
). - Download the image.
- Go to the "Image" tab, find your image, and click "Launch" to create a new container.
- Configure the container settings:
- General Settings: Set a container name.
- Advanced Settings: Enable auto-restart and set environment variables if needed.
- Volume: Mount any necessary volumes.
- Network: Make sure the container is in the correct network. Usually, bridge mode is fine.
- Port Settings: Use port 5052 for local and container port. (Leave as TCP)
To use your custom domain, you'll need to set up a reverse proxy:
- Open Synology DSM and go to "Control Panel".
- Go to "Application Portal" and then the "Reverse Proxy" tab.
- Click "Create" and configure the following:
- Description: Give it a name (e.g., Flask App).
- Source:
- Protocol: HTTP
- Hostname:
hutteritebookshelf.hbni.net
- Port: 80
- Destination:
- Protocol: HTTP
- Hostname:
localhost
- Port: 5052 (or the port you mapped in Docker)
- Make sure websockets are enabled.
- Open Control Panel > Application Portal
- Change to the Reverse Proxy tab
- Select the proxy rule for which you want to enable Websockets and click on Edit
- Change to the Custom Headers tab
- Add two entries in the list:
- Name:
Upgrade
, Value:$http_upgrade
- Name:
Connection
, Value:$connection_upgrade
- Name:
Ensure your domain hutteritebookshelf.hbni.net
points to your Synology NAS's public IP address. Update your DNS records with your domain registrar:
- Log in to your domain registrar's website.
- Go to the DNS settings for
hutteritebookshelf.hbni.net
. - Add an A record pointing to your Synology NAS's public IP address.
Use Let’s Encrypt to secure your domain with HTTPS:
- Go to "Control Panel" > "Security" > "Certificate".
- Click "Add" and select "Get a certificate from Let's Encrypt".
- Follow the prompts to issue a certificate for
hutteritebookshelf.hbni.net
.
Open a web browser and navigate to http://hutteritebookshelf.hbni.net
or https://hutteritebookshelf.hbni.net
if you set up HTTPS. Your Flask application should be running.
- Build and push your Docker image if needed.
- Pull the image and run it on your Synology NAS.
- Set up a reverse proxy in Synology DSM.
- Update DNS records to point your domain to your NAS.
- Secure with HTTPS using Let’s Encrypt.
By following these steps, your Flask application should be accessible via your custom domain hosted on your Synology NAS.