Skip to content

Commit 84c3e3a

Browse files
committed
Feat: Add live viewer aws repro notes
1 parent 5faa61c commit 84c3e3a

3 files changed

Lines changed: 52 additions & 0 deletions

File tree

aws/setup/ec2_viewer/readme.md

Whitespace-only changes.

aws/setup/ec2_viewer/sync.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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

0 commit comments

Comments
 (0)