This guide explains how to set up and manage the Quacker application on Ubuntu.
Ensure you have the following installed on your system:
Certbot is used to manage SSL certificates.
-
Install Certbot:
sudo apt update sudo apt install certbot
-
Verify installation:
certbot --version
Redis is used for application data storage.
-
Install Redis:
sudo apt update sudo apt install redis
-
Enable and start Redis as a systemd service:
sudo systemctl enable redis-server sudo systemctl start redis-server
-
Verify Redis is running:
redis-cli ping
It should return
PONG
. -
Install nginx
sudo apt install nginx sudo apt install certbot python3-certbot-nginx -y
-
Configure nginx
sudo nano /etc/nginx/sites-available/example.com
-
Add this to the file
server { listen 80; server_name quacker.eu;
# Redirect HTTP to HTTPS
return 301 https://$host$request_uri;
}
7. Enable the domain
```bash
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
-
Get a certificate
sudo certbot --nginx -d example.com
-
Add the quacker process to nginx for HTTPS
-
Add the certificate and https info to the NGINX file
server {
listen 80;
server_name quacker.eu;
# Redirect HTTP to HTTPS
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name quacker.eu;
ssl_certificate /etc/letsencrypt/live/quacker.eu/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/quacker.eu/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
proxy_pass http://127.0.0.1:8085;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Optional: Improve performance and logging
access_log /var/log/nginx/quacker.access.log;
error_log /var/log/nginx/quacker.error.log;
# Additional settings for large uploads
client_max_body_size 50M;
}
- Verify the config and restart nginx
sudo nginx -t
sudo systemctl reload nginx
To add the Quacker
binary to your system's PATH
so you can run it from anywhere, follow these steps:
Run this in your bash shell (Ubuntu only):
curl -sL https://github.com/mreider/quacker/install.sh | bash
-
Download the Binary:
- Go to the Releases section.
- Download the appropriate binary for your operating system and architecture:
- For Linux 64-bit systems:
quacker-linux-amd64
- For Linux ARM systems:
quacker-linux-arm64
- For Linux 64-bit systems:
-
Make the Binary Executable: After downloading the binary, navigate to its directory and make it executable:
chmod +x ./quacker-linux-amd64
-
Move the Binary to a Directory in Your
PATH
: The easiest way to make the binary globally accessible is to move it to a directory that's already in your system'sPATH
. A common choice is/usr/local/bin
:sudo mv ./quacker-linux-amd64 /usr/local/bin/quacker
Admins (like you) will need to set up a Github OAuth app to authenticate users. Make sure the homepage is the domain where you are hosting Quacker (example.com) and the authorization callback URL is https://example.com/login/callback
Before running any other commands, set up the Quacker application:
quacker --setup
Values look like this:
Use test hostname (localhost)? (y/n): n
Hostname for Quacker (example.com): example.com
Mailgun API Key: bba1d728399(etc)
Mailgun Host (sandbox.mailgun.org): example.com
GitHub Client ID: Ov2(etc)
GitHub Client Secret: 4003bca7(etc)
GitHub Redirect URI (e.g., http://yourdomain.com/login/callback): https://example.com/login/callback
Invite a github user to join
quacker --allow
To start the Quacker application:
quacker --run
The server will start on port 8085 using HTTPS.
To run the Quacker background job (e.g., for sending emails):
quacker --job
This can be scheduled using cron
.
-
Create a service file for Quacker:
sudo nano /etc/systemd/system/quacker.service
-
Add the following content:
[Unit] Description=Quacker Service After=network.target redis.service [Service] ExecStart=quacker --run Restart=always User=www-data Group=www-data Environment=PATH=/usr/bin:/usr/local/bin [Install] WantedBy=multi-user.target
-
Enable the service to start on boot:
sudo systemctl enable quacker
-
Start the service:
sudo systemctl start quacker
-
Verify the service is running:
sudo systemctl status quacker
To schedule the --job
command every 5 minutes:
-
Open the crontab editor:
crontab -e
-
Add the following line:
*/5 * * * * /path/to/quacker --job
Replace /path/to/quacker
with the path to your Quacker binary.
You are now ready to run Quacker on your server!