Mirror your GitPage by Flask.
-
Install Python3.6+ in your machine.
-
Install requirements by pip.
pip install -r requirements.txt
- Execute below code to add your repository mirror.
python manage.py add_repo
- If config this program on server, pay attention to grant file permission for runtime directory.
- Execute below code just OK.
python manage.py runserver -p [port]
- Execute below commands To Install Apache.
# Below code just use on Ubuntu.
apt install apache2
apt install libapache2-mod-wsgi-py3
a2enmod wsgi
- Put Apache EnvVar Config.
# Add below code in the end of "/etc/apache2/envvars".
export LANG='en_US.UTF-8'
export LC_ALL='en_US.UTF-8'
- Add vHost.
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/GitPagesMirror
WSGIScriptAlias / /var/www/GitPagesMirror/wsgi.py
</VirtualHost>
- Put This Program To "/var/www".
- Add path mappings.
location / {
include uwsgi_params;
uwsgi_pass unix:///tmp/git-pages-mirror.sock;
}
- Run uWSGI.
uwsgi uwsgi.ini