Skip to content

gixia-org/aisafetystudy

Repository files navigation

Open Community for AI Safety China

Open Community for AI Safety China is the largest AI safety open community in Chinese internet. We focus on AI risks, AI safety technologies and AI safety governance, aiming to promote the safe and sustainable development of AI. Check our homepage to join the community.

Build & Deploy

Install necessary dependencies.

sudo apt update
sudo apt install nginx certbot python3-certbot-nginx unzip
curl -o- https://fnm.vercel.app/install | bash
source ~/.bashrc
fnm install 24
sudo npm install -g pm2
npm install
npm audit fix --force   # If there are vulnerabilities

Currently it's a small project and directly running on Azure machine.

Option 1: Direct deployment (single app)

Run following to build and start the web app:

npm run build
pm2 start npm --name "aisafetystudy" -- run start
# Or restart if already running
# pm2 restart aisafetystudy

Option 2: Multi-app deployment with nginx

For multiple apps with different subdomains:

# Build and start this app on port 3000
npm run build
PORT=3000 pm2 start npm --name "aisafetystudy" -- run start

Nginx Configuration

Create /etc/nginx/sites-available/react-apps:

# Open Community for AI Safety China - aisafetystudy.gixia.org
server {
    listen 80;
    server_name aisafetystudy.gixia.org;
    
    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        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;
        proxy_cache_bypass $http_upgrade;
    }
}

Enable Nginx server

sudo ln -s /etc/nginx/sites-available/react-apps /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx

HTTPS configuration

Use Certbot to automatically configure the website.

sudo certbot --nginx -d aisafetystudy.gixia.org

Don't forget to enable HTTPS port in the network settings of the server.

Contributing

The code is mostly generated by ChatGPT and Trae IDE. We welcome contributions from all levels of experience. If you have any suggestion or feedback, please feel free to open an issue or submit a pull request.

About

Website of AI Safety Study Group.

Topics

Resources

Stars

Watchers

Forks

Contributors