Gitea: allow_import_local not parsed

Created on 13 Sep 2017  路  6Comments  路  Source: go-gitea/gitea

  • Gitea version (or commit ref): Gitea version 1.2.0+rc1-6-g002fa73 built with: bindata, sqlite
  • same behavior in Gitea version 1.2.0+rc2 built with: bindata, sqlite
  • Git version: git version 2.1.4
  • Operating system: Debian GNU/Linux 8.9 (jessie)
  • Database (use [x]):

    • [ ] PostgreSQL

    • [x] MySQL

    • [ ] MSSQL

    • [ ] SQLite

  • Can you reproduce the bug at https://try.gitea.io:

    • [ ] Yes (provide example URL)

    • [x] No

    • [ ] Not relevant

  • Log gist:
    -

    Description

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)

kindocs kinquestion kinui stale

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/

All 6 comments

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.

Was this page helpful?
0 / 5 - 0 ratings