ENABLE_SWAGGER_ENDPOINT = false does not disable API docs page #1820

Closed
opened 2025-11-02 04:14:16 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @methodbox on GitHub (May 25, 2018).

  • Gitea version (or commit ref):
  • Git version: 1.3.2 (binary as your repo does not work on Ubunut w/Digital Ocean)
  • Operating system: Ubuntu 16.04
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I am running the binary version with the provided systemd service. It seems to run fine.

However, it ignores the setting ENABLE_SWAGGER_ENDPOINT in the /custom/conf/app.ini file.

Setting this to true or false changes nothing; the API URL still works, even after stopping/restarting the service.

For security I'd prefer to have this disabled. I will force a redirect using Nginx eventually but the config should work as per the documentation.

Screenshots

Originally created by @methodbox on GitHub (May 25, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): - Git version: 1.3.2 (binary as your repo does not work on Ubunut w/Digital Ocean) - Operating system: Ubuntu 16.04 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description I am running the binary version with the provided systemd service. It seems to run fine. However, it ignores the setting ENABLE_SWAGGER_ENDPOINT in the /custom/conf/app.ini file. Setting this to true or false changes nothing; the API URL still works, even after stopping/restarting the service. For security I'd prefer to have this disabled. I will force a redirect using Nginx eventually but the config should work as per the documentation. ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
Author
Owner

@lafriks commented on GitHub (May 25, 2018):

API can not be disabled as it is used also from web interface. This option just disables API documentation

@lafriks commented on GitHub (May 25, 2018): API can not be disabled as it is used also from web interface. This option just disables API documentation
Author
Owner

@methodbox commented on GitHub (May 25, 2018):

No, it doesn't. It's still at /api/swagger. That's the purpose of this issue.

@methodbox commented on GitHub (May 25, 2018): No, it doesn't. It's still at /api/swagger. That's the purpose of this issue.
Author
Owner

@methodbox commented on GitHub (May 25, 2018):

Updated title appropriately.

@methodbox commented on GitHub (May 25, 2018): Updated title appropriately.
Author
Owner

@jonasfranz commented on GitHub (May 25, 2018):

@methodbox I cannot reproduce that with the current master version.

@jonasfranz commented on GitHub (May 25, 2018): @methodbox I cannot reproduce that with the current `master` version.
Author
Owner

@jonasfranz commented on GitHub (May 25, 2018):

This feature is only implemented since #3502 which will be available in the coming 1.5.0 release or in the current master version.

@jonasfranz commented on GitHub (May 25, 2018): This feature is only implemented since #3502 which will be available in the coming 1.5.0 release or in the current `master` version.
Author
Owner

@lunny commented on GitHub (May 25, 2018):

@methodbox Yes, v1.3.2 is not implemented yet.

@lunny commented on GitHub (May 25, 2018): @methodbox Yes, v1.3.2 is not implemented yet.
Author
Owner

@methodbox commented on GitHub (May 25, 2018):

Can you clarify what you mean by “master version”?

Does this require compiling from the master branch?

I’m using the binary linked from your site which is currently 1.3.2.

@methodbox commented on GitHub (May 25, 2018): Can you clarify what you mean by “master version”? Does this require compiling from the master branch? I’m using the binary linked from your site which is currently 1.3.2.
Author
Owner

@jonasfranz commented on GitHub (May 25, 2018):

@methodbox The "master" version is the current development version which could be found at https://dl.gitea.io/gitea/master/ . For more information about our version system please have a look at https://github.com/go-gitea/gitea/blob/master/CONTRIBUTING.md#versions .

The latest release is currently 1.4.1 and could be found at https://dl.gitea.io/gitea/1.4.1/ .

@jonasfranz commented on GitHub (May 25, 2018): @methodbox The "master" version is the current development version which could be found at https://dl.gitea.io/gitea/master/ . For more information about our version system please have a look at https://github.com/go-gitea/gitea/blob/master/CONTRIBUTING.md#versions . The latest release is currently 1.4.1 and could be found at https://dl.gitea.io/gitea/1.4.1/ .
Author
Owner

@methodbox commented on GitHub (May 25, 2018):

Kind of odd that the master branch isn’t the current release branch, isn’t it?

@methodbox commented on GitHub (May 25, 2018): Kind of odd that the master branch isn’t the current release branch, isn’t it?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1820