Scripts and configuration files for deploying Fileglancer in production at Janelia. This includes a fileglancer-central server and a JupyterHub instance customized with the fileglancer extension, as well as an Nginx reverse proxy server.
Assumes you have a working Pixi installation.
- Clone this repository
git clone [email protected]:JaneliaSciComp/fileglancer-hub.git
cd fileglancer-hub
- Start the Fileglancer Central server
pixi run -e central start
- Start the Fileglancer Hub server
pixi run -e hub start
When working with a shared server, make sure to set your umask so that everything is writeable by the group:
umask 002
In production the servers need to run as root in order to allow for setuid priviledge.
- Download and install Pixi into
/usr/local/bin
curl -fsSL https://pixi.sh/install.sh | sh
sudo cp /groups/scicompsoft/home/$USER/.pixi/bin/pixi /usr/local/bin/
- Create the working directories
sudo install -d -m 2775 -o $USER -g $(id -gn) /opt/deploy /opt/data
mkdir -p /opt/deploy/fileglancer-hub
mkdir -p /opt/deploy/fileglancer-central
mkdir -p /opt/data/fileglancer-central
- Clone the repository into
/opt/deploy/fileglancer-hub
cd /opt/deploy/
git clone [email protected]:JaneliaSciComp/fileglancer-hub.git
cd fileglancer-hub
- Create a file at
/opt/deploy/fileglancer-hub/.env.central
with the following content (modify theFGC_EXTERNAL_PROXY_URL
to use the server hostname):
FGC_EXTERNAL_PROXY_URL=https://fileglancer-dev.int.janelia.org/fg/files
FGC_DB_URL=sqlite:////opt/data/fileglancer-central/sqlite.db
FGC_CONFLUENCE_URL=https://wikis.janelia.org
FGC_CONFLUENCE_TOKEN=<token here>
FGC_JIRA_URL=https://issues.hhmi.org/issues
FGC_JIRA_TOKEN=<token here>
- Create a file at
/opt/deploy/fileglancer-hub/.env.hub
with the following content:
OAUTH_CLIENT_ID=<client id from okta>
OAUTH_CLIENT_SECRET=<client secret from okta>
OAUTH_DOMAIN=<okta domain, e.g. hhmi.okta.com>
OAUTH_CALLBACK_DOMAIN=<the domain of the hub, e.g. fileglancer.int.janelia.org>
- Install the systemd service files
sudo cp fileglancer-central.service /etc/systemd/system/fileglancer-central.service
sudo cp fileglancer-hub.service /etc/systemd/system/fileglancer-hub.service
- Enable the services
sudo systemctl enable fileglancer-central
sudo systemctl enable fileglancer-hub
- Start the service
sudo systemctl start fileglancer-central
sudo systemctl start fileglancer-hub
- Install nginx
sudo yum install nginx
- Copy the nginx configuration file to
/etc/nginx/conf.d/fileglancer.conf
sudo cp nginx.conf /etc/nginx/conf.d/fileglancer.conf
- Set up the static path for the Fileglancer assets
find /opt/deploy/fileglancer-hub/ -name "assets"
Use this path to replace the <path_to_fileglancer_assets>
placeholder in the Nginx configuration file (/etc/nginx/conf.d/fileglancer.conf
).
find /opt/deploy/fileglancer-hub/ -name "ui"
Use this path to replace the <path_to_fileglancer_ui_directory>
placeholder in the Nginx configuration file (/etc/nginx/conf.d/fileglancer.conf
).
- Disable the default server block
- comment out the default server block in the main Nginx configuration file
sudo nano /etc/nginx/nginx.conf
- Obtain the SSL certificate for *.int.janelia.org and install it in
/etc/nginx/certs/
sudo mkdir -p /etc/nginx/certs/
sudo cp cert.pem /etc/nginx/certs/default.crt
sudo cp key.pem /etc/nginx/certs/default.key
- Make sure the permissions are correct
sudo chown root:root /etc/nginx/certs/default.crt
sudo chown root:root /etc/nginx/certs/default.key
sudo chmod 644 /etc/nginx/certs/default.crt
sudo chmod 600 /etc/nginx/certs/default.key
- Enable the service
sudo systemctl enable nginx
- Start the service
sudo systemctl start nginx
First, update to the version of Fileglancer you want to deploy:
cd /opt/deploy/fileglancer-hub
git pull
Then restart the services:
sudo systemctl restart fileglancer-central
sudo systemctl restart fileglancer-hub
sudo systemctl restart nginx
Make sure to check the logs and smoketest the service to ensure everything came up correctly.
sudo systemctl status fileglancer-central
sudo systemctl status fileglancer-hub
sudo systemctl status nginx
sudo journalctl -u fileglancer-central -f
sudo journalctl -u fileglancer-hub -f
sudo journalctl -u nginx -f