The idea of this Panel is to be deployed with the stremio-beamup project.
The BeamUp Web Panel includes the following features:
- log in with github
- see deployed projects and their status
- download logs for a deployed project
- restart a deployed project
- delete a deployed project
npm install
npm run build
For production mode you need the following variables set either in .env
file or exported to the environment:
NODE_ENV=production
CLIENT_ID=The GitHub Client ID
CLIENT_SECRET=The GitHub Client secret
SLACK_WEBHOOK=https://hooks.slack.com/services/...
SLACK_CHANNEL=H190TA7TKD2
SERVER_PORT=4000
- To set up the application as a service, copy the
scripts/beamup-panel.service
file to/etc/systemd/system/
. - Edit the file to update the paths according to your setup.
- Enable and start the service:
sudo systemctl daemon-reload sudo systemctl enable beamup-panel.service sudo systemctl start beamup-panel.service
Use the scripts/production-deploy.sh
script to deploy updates to the application:
- Make the script executable:
chmod +x scripts/production-deploy.sh
- Run the script to deploy updates:
./scripts/production-deploy.sh
This script will pull the latest changes from the repository, install dependencies, build the application, and restart the service.
The user must have permissions to restart the service, this can be done by adding a line like this with visudo
:
beamup ALL=(ALL) NOPASSWD: /bin/systemctl restart beamup-panel.service
beamup ALL=(ALL) NOPASSWD: /bin/systemctl restart nginx
server {
listen 80;
server_name beamup.dev;
location / {
proxy_pass http://localhost:4000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
This can be saved in /etc/nginx/sites-available/ with a symbolic link in /etc/nginx/sites-enabled/
To configure the firewall as configured in stremio-beamup, and following same example, this commands should suffice
sudo iptables -A INPUT -p tcp --dport 4000 -j ACCEPT
netfilter-persistent save
The app ports need to be set manually, create a .env
file in the root folder of the project, and add:
REACT_APP_SERVER_PORT=5050
REACT_APP_PORT=3999
SERVER_PORT=$REACT_APP_SERVER_PORT
PORT=$REACT_APP_PORT
WDS_SOCKET_PORT=$REACT_APP_PORT
In this example's case, the app should be accessed from http://localhost:5050
.
Three more env vars will need to be added to the .env
file for the app to work, these are explained below.
Create an OAuth app under your github username (these are required for CLIENT_ID
and CLIENT_SECRET
env vars), see this article for details: https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/
(Note: while creating the OAuth app, you can set your Homepage URL to http://localhost:5050/
and Authorization Callback URL to http://localhost:5050/login
)
After setting all required ENV vars, start the app with npm start
SESSIONS_FOLDER=../ # a folder that is persisted for sessions data
SESSIONS_EXPIRE=2592000000 # 30 days
To include a custom news.html
page for deployment:
-
Create
news.html
: Develop your custom HTML file. -
Place in
public
directory: Add thenews.html
file to thepublic
directory of the project. -
Verify: Ensure the server is running and access the page at
https://your-deployment-url/news.html
.