[x]
):Hi there,
i was not able to set allow_import_local via web interface i set it via mysql.
second, i am admin, so allow_import_local should be overriden...
if posting an api request like
curl -H "Content-Type: application/json" -X POST -d '{"clone_addr":"file:///home/git/import/rbendig/whatever.git","repo_name":"whatever","UID":2}' http://<credentials>@127.0.0.1:3000/api/v1/repos/migrate
i receive the following error:
{"message":"You are not allowed to import local repositories.","url":"https://godoc.org/github.com/go-gitea/go-sdk/gitea"}r
doing a
select id,name,allow_import_local,is_admin from gitea.user WHERE name='rbendig';
results in
MariaDB [(none)]> select id,name,allow_import_local,is_admin from gitea.user WHERE name='rbendig';
+----+---------+--------------------+----------+
| id | name | allow_import_local | is_admin |
+----+---------+--------------------+----------+
| 2 | rbendig | 1 | 1 |
+----+---------+--------------------+----------+
1 row in set (0.00 sec)
You should change the config option at first.
I think it is documentation/help issue. If local imports is disabled on server we shoud show info under disabled checkbox, something like:
(i) Local imports are disabled by server configuration
What config option? /admin/config doesn't display a setting, and in the generated app.ini isn't even a hint about an option, and if it's disabled, why does /repo/migrate say it could be a local path?
Edit: I figured it out, thanks to @lafriks!
Problem was (using 1.2.2):
I can not import local repositories. Checking Admin->Users->(myself) Edit
I can see that the checkbox next to may import local repos is not checked. But checking it and clicking aplly reloads the user settings with the checkbox still unchecked.
Putting IMPORT_LOCAL_PATHS = true into the [security]
namespace in the app.ini fixed the Problem. Would be nice to document this under https://docs.gitea.io/en-us/config-cheat-sheet/
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Most helpful comment
Edit: I figured it out, thanks to @lafriks!
Problem was (using 1.2.2):
I can not import local repositories. Checking
Admin->Users->(myself) Edit
I can see that the checkbox next to may import local repos is not checked. But checking it and clicking aplly reloads the user settings with the checkbox still unchecked.Putting IMPORT_LOCAL_PATHS = true into the
[security]
namespace in the app.ini fixed the Problem. Would be nice to document this under https://docs.gitea.io/en-us/config-cheat-sheet/