From 0ec78a32ca433f2eabb04fe660deaf56cadcb65d Mon Sep 17 00:00:00 2001 From: Stanislaw Adaszewski Date: Mon, 4 May 2020 08:26:48 +0200 Subject: [PATCH] Relaxed access to markdown api. --- example/gitea-disable/files/nginx.conf | 2 ++ example/gitea/focker-compose.yml | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/example/gitea-disable/files/nginx.conf b/example/gitea-disable/files/nginx.conf index c55bdc9..b984e81 100644 --- a/example/gitea-disable/files/nginx.conf +++ b/example/gitea-disable/files/nginx.conf @@ -32,6 +32,8 @@ http { if ($test = "settings_not-get") { return 403; } + rewrite ^/api/v1/repos/[^/]*/[^/]*/markdown$ $uri break; + rewrite ^/api/v1/markdown(/raw)?$ $uri break; if ($test = "api_not-get") { return 403; } diff --git a/example/gitea/focker-compose.yml b/example/gitea/focker-compose.yml index 0bbd671..0c7e467 100644 --- a/example/gitea/focker-compose.yml +++ b/example/gitea/focker-compose.yml @@ -22,12 +22,13 @@ jails: ip4.addr: 127.0.8.1 exec.start: | export IP4_ADDR=127.0.8.1 && \ - export DOMAIN_NAME=xyz.com && \ + export SCHEME=http && \ + export DOMAIN_NAME=localhost:3001 && \ export GITEA_CONF=/usr/local/etc/gitea/conf/app.ini && \ chown git:git /var/db/gitea && \ sed -i -e "s/127.0.0.1/${IP4_ADDR}/g" $GITEA_CONF && \ sed -i -e "s/localhost/${DOMAIN_NAME}/g" $GITEA_CONF && \ - crudini --set --inplace $GITEA_CONF server ROOT_URL https://${DOMAIN_NAME} && \ + crudini --set --inplace $GITEA_CONF server ROOT_URL ${SCHEME}://${DOMAIN_NAME} && \ if [ ! -f /var/db/gitea/gitea.db ]; then \ su git -c 'gitea migrate -c $GITEA_CONF' && \ su git -c 'gitea admin -c $GITEA_CONF create-user --username admin1 --password "AdminAdmin1+" --email "invaliduser@nonexistentdomain.com" --admin'; \