File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ SYNC_COMMAND=" aws s3 sync s3://codeclash/logs/ $HOME /CodeClash/logs/ --exclude \" */rounds/*\" --exclude \" *.tar.gz\ --delete" "
4+ LOG_FILE=" $HOME /sync.log"
5+
6+ while true; do
7+ echo " $( date) : Starting sync..." >> " $LOG_FILE "
8+ eval $SYNC_COMMAND >> " $LOG_FILE " 2>&1
9+ echo " $( date) : Sync completed" >> " $LOG_FILE "
10+ sleep 300 # 5 minutes
11+ done
Original file line number Diff line number Diff line change 1+ export GITHUB_TOKEN=' '
2+
3+ sudo apt update
4+ sudo apt install -y python3-pip python3.12-venv
5+ sudo apt install nginx apache2-utils -y
6+ sudo snap install aws-cli --classic
7+ sudo apt install certbot python3-certbot-nginx -y
8+
9+ git clone https://klieret:${GITHUB_TOKEN} @github.com/emagedoc/CodeClash.git
10+ cd CodeClash
11+ python3 -m venv .venv
12+ source .venv/bin/activate
13+ pip install -e .
14+
15+ aws configure
16+
17+ mkdir logs
18+
19+ sudo htpasswd -c /etc/nginx/.htpasswd admin
20+
21+ sudo tee /etc/nginx/sites-available/default > /dev/null << 'EOF '
22+ server {
23+ listen 80;
24+ server_name emagedoc.xyz;
25+
26+ location / {
27+ auth_basic "Restricted Access";
28+ auth_basic_user_file /etc/nginx/.htpasswd;
29+
30+ proxy_pass http://127.0.0.1:5001;
31+ proxy_set_header Host $host;
32+ proxy_set_header X-Real-IP $remote_addr;
33+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
34+ }
35+ }
36+ EOF
37+
38+ sudo systemctl start nginx
39+ sudo systemctl enable nginx
40+
41+ sudo certbot --nginx -d emagedoc.xyz
You can’t perform that action at this time.
0 commit comments