Franco Masotti 3 months ago
parent
commit
5b086d6a59
Signed by: frnmst GPG Key ID: 24116ED85666780A
  1. 73
      _posts/2021-09-13-problems-and-solutions-with-gitea-1-15.md

73
_posts/2021-09-13-problems-and-solutions-with-gitea-1-15.md

@ -566,13 +566,16 @@ QUEUE_CONN_STR = network=unix,addr=/var/run/redis/redis-server.sock,db=2,pool_si
```
```sql
CREATE DATABASE backup_giteadb_1_15_2 WITH TEMPLATE giteadb;
CREATE DATABASE backup_giteadb_${major}_${minor}_${patch} WITH TEMPLATE giteadb;
```
where `major`, `minor` and `patch` correspond to the current Gitea version.
3. run the doctor on the original database
```shell
exit
exit
sudo -i -u gitea
HOME=/var/lib/gitea GITEA_WORK_DIR=/var/lib/gitea /usr/bin/gitea -c /etc/gitea/app.ini doctor --all
HOME=/var/lib/gitea GITEA_WORK_DIR=/var/lib/gitea /usr/bin/gitea -c /etc/gitea/app.ini doctor --all --fix
@ -696,41 +699,39 @@ QUEUE_CONN_STR = network=unix,addr=/var/run/redis/redis-server.sock,db=2,pool_si
#########
<IfModule mod_ssl.c>
<VirtualHost *:${APACHE_TCP_PORT}>
UseCanonicalName on
ProxyPreserveHost On
ProxyRequests off
AllowEncodedSlashes NoDecode
Keepalive On
RewriteEngine on
ServerName ${SERVER_NAME}
SSLCompression off
# Disable HTTP push and cloning for TOR.
# TODO: enable only cloning but not push.
RewriteRule ^(.*)/info/refs /errors
<Location "/errors">
Deny from all
</Location>
# Redirect api and login to black holes.
# Specific rules first, generic rules last.
ProxyPass /user/login unix:/var/run/gitea/gitea.sock|http://127.0.0.1:${TCP_PORT}/404 nocanon
ProxyPassReverse /user/login/ unix:/var/run/gitea/gitea.sock|http://127.0.0.1:${TCP_PORT}/404
ProxyPass /api unix:/var/run/gitea/gitea.sock|http://127.0.0.1:${TCP_PORT}/404 nocanon
ProxyPassReverse /api unix:/var/run/gitea/gitea.sock|http://127.0.0.1:${TCP_PORT}/404
ProxyPass / unix:/var/run/gitea/gitea.sock|http://127.0.0.1:${TCP_PORT}/ nocanon
ProxyPassReverse / unix:/var/run/gitea/gitea.sock|http://127.0.0.1:${TCP_PORT}/
RequestHeader set X-Forwarded-Proto "http"
RequestHeader set X-Forwarded-Port "${APACHE_TCP_PORT}"
RequestHeader set X-Forwarded-Host "${SERVER_NAME}"
# Distinguish normal traffic from tor's.
RequestHeader set X-Forwarded-For "tor"
UseCanonicalName on
ProxyPreserveHost On
ProxyRequests off
AllowEncodedSlashes NoDecode
Keepalive On
RewriteEngine on
ServerName ${SERVER_NAME}
SSLCompression off
# Disable HTTP push and cloning for TOR.
# TODO: enable only cloning but not push.
RewriteRule ^(.*)/info/refs /errors
<Location "/errors">
Deny from all
</Location>
# Redirect api and login to black holes.
# Specific rules first, generic rules last.
ProxyPass /user/login unix:/var/run/gitea/gitea.sock|http://127.0.0.1:${TCP_PORT}/404 nocanon
ProxyPassReverse /user/login/ unix:/var/run/gitea/gitea.sock|http://127.0.0.1:${TCP_PORT}/404
ProxyPass /api unix:/var/run/gitea/gitea.sock|http://127.0.0.1:${TCP_PORT}/404 nocanon
ProxyPassReverse /api unix:/var/run/gitea/gitea.sock|http://127.0.0.1:${TCP_PORT}/404
ProxyPass / unix:/var/run/gitea/gitea.sock|http://127.0.0.1:${TCP_PORT}/ nocanon
ProxyPassReverse / unix:/var/run/gitea/gitea.sock|http://127.0.0.1:${TCP_PORT}/
RequestHeader set X-Forwarded-Proto "http"
RequestHeader set X-Forwarded-Port "${APACHE_TCP_PORT}"
RequestHeader set X-Forwarded-Host "${SERVER_NAME}"
# Distinguish normal traffic from tor's.
RequestHeader set X-Forwarded-For "tor"
</VirtualHost>
</IfModule>
```

Loading…
Cancel
Save