mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-11 00:21:16 -05:00
Installation, I encountered some bumps #2901
Closed
opened 2025-11-02 04:53:12 -06:00 by GiteaMirror
·
4 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.1
v1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
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#2901
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DanLanglois on GitHub (Feb 12, 2019).
I mucked about with troubleshooting the installation a bit, before it worked.
I built v1.7.1 from source, but at first I had an error:
package github.com/jteeuwen/go-bindata/go-bindata: cannot find package "github.com/jteeuwen/go-bindata/go-bindata"
I got this when I was doing 'make generate build'. The fix was simple though I tried git, and multiple tags, after failing with 'go get -d -u code.gitea.io/gitea' with the same issue. I had to do this:
go get -u github.com/jteeuwen/go-bindata/...
By the way, the docs offer this:
'Building
From the root of the source tree, run:
TAGS="bindata" make generate all'
I infer that the idea here is to run 'make generate build', after setting the TAGS environment variable to 'bindata'. If I am correct, 'build' and 'all' do the same thing, but still, the part about setting the TAGS environment variable does make me pause -- how to do that, depends on what Linux shell you might be using. Or indeed, you might be building on Windows. For the record, on Windows, one would use setx.exe. Which, does not set the environment variable in the current command prompt, but it will be available in subsequent command prompts. I might not approve of using Windows but there is no operating system that you actually give instructions for. At least, not instructions for the literal-minded, who even might balk at 'From the root of the source tree', asking 'where is that?' And sure, 'tree' here means the directory tree. Humor me, as I relate how many times I've been there before, obviously, or I wouldn't have succeeded in wrestling this thing into submission, more or less. I know, docs say this sort of thing all the time, which is useless enough:
"Execute the cmake command on the shell replacing path/to/source with the path to the top of your ROOT source tree."
Okay, what shell? Any shell? Let's look at this again:
'Building
From the root of the source tree, run:
TAGS="bindata" make generate all'
That will not run on any shell. Even if I do find 'the root of the source tree'. What, indeed, is 'run'? Sure, I can guess. The point here, is that I did have to guess. We are running,
make, which is an external task automation tool, of course. Many people on Linux/Unix like to use it because that's were it comes from. Of course. But what if I have no idea what the path is to 'the root of the source tree', nor do I even know what that is to be honest.Here is my 'tree':
--go
----src
------github.com
------code.gitea.io
--------gitea
----------src
------------github.com
Note that there are not one, but two 'src' directories, here. Which of them is
my source tree? Trick question, neither of them. But 'the root of the source tree' is actually visible here. It's 'gitea', and I guess that is supposed to be obvious. Or at least, I did find it possible to guess. Maybe it wasn't my first guess, but my bad. And by the way, I remember that issue with 'cannot find package "github.com/jteeuwen/go-bindata/go-bindata"'. Is there, more than one 'root of the source tree'? I am unclear where the 'github.com' directory is supposed to be. I have two of those, which can't be right.
An addendum is I found this:
--
Installation from binary
All downloads come with SQLite, MySQL and PostgreSQL support, and are built with embedded assets. This can be different for older releases. Choose the file matching the destination platform from the downloads page, copy the URL and replace the URL within the commands below:
wget -O gitea https://dl.gitea.io/gitea/1.7.0/gitea-1.7.0-linux-amd64
chmod +x gitea
Well, note that 'wget' is Linux wget command. A useful GNU command line utility. But these instructions are for Windows too. And anyways, why would I use 'wget' instead of a browser? I will offer as I don't know any better, that typically you would never use it "instead of a browser". Just to be clear, I ponder that there's literally no upside to using wget as a human. In short, browsers are applications for humans looking at the internet, and browsers and wget actually have very different normal uses. I can only imagine that whoever wrote this documentation here is of the opinion that there is very little point in installing the OS GUI. So, I kind of wonder, but won't insist on the last word..
So where I am at, is I have tested the webserver. This means, I am now ready for installation. I'll past all this stuff about recommended server installation, to belabor the point that this is linux-centric:
Create user to run gitea (ex. git)
adduser
--system
--shell /bin/bash
--gecos 'Git Version Control'
--group
--disabled-password
--home /home/git
git
Create required directory structure
mkdir -p /var/lib/gitea/{custom,data,indexers,public,log}
chown git:git /var/lib/gitea/{data,indexers,log}
chmod 750 /var/lib/gitea/{data,indexers,log}
mkdir /etc/gitea
chown root:git /etc/gitea
chmod 770 /etc/gitea
NOTE: /etc/gitea is temporary set with write rights for user git so that Web installer could write configuration file. After installation is done it is recommended to set rights to read-only using:
chmod 750 /etc/gitea
chmod 644 /etc/gitea/app.ini
Copy gitea binary to global location
cp gitea /usr/local/bin/gitea
Okay, so I already have the webserver running, I found the 'initial configuration' page, with the 'Install Gitea' button. It gives back an error, though:
'The database settings are invalid: dial tcp 127.0.0.1:3306: connectex: No connection could be made because the target machine actively refused it.'
Now, that's fine, I haven't configured, or even personally installed, MySql or anything. There would need to be a database server, a username, password, database name. But if I skipped a step, I didn't find it in the documentation. Which mentions only this, in what I did find: 'All downloads come with SQLite, MySQL and PostgreSQL support'. Which is interesting because the webpage for 'initial configuration' gives me a dropdown box for 'Database type', which offers these options: MySQL, PostgreSQL, MSSQL. Missing, then, is SQLite3.
What, then, about documentation for all this configuration that needs doing? What I find is this webpage:
https://wiki.archlinux.org/index.php/Gitea
I have gone rather far afield, as this is not simply Gitea docs. I'm going to install and configure PostgreSQL, or somesuch. Fine, though I have a grave concern that I need to revisit the issue of the tags, I discussed that 'bindata' tag. Now we are perhaps contemplating a 'sqlite' tag, or such. I spot this:
--
In the default release build of our continuous integration system the build tags are: TAGS="bindata sqlite sqlite_unlock_notify". The simplest recommended way to build from source is therefore:
TAGS="bindata sqlite sqlite_unlock_notify" make generate build
Okay I'm just journaling everything here, I missed this. I have to rebuild? If I need a 'sqlite' tag or such, then we are going to probably encounter a need to download that driver, and of course that may not work automagically, as also go-bindata was supposed to be there and wasn't in the right place or something.. anyways, I see the makefile and 'test-mysql' and so forth. Just checking, the documentation of this step is actually best as I can ascertain, what there is, is found at this website?:
https://wiki.archlinux.org/index.php/Gitea
It talks about how to install and configure PostgreSQL and such, though briefly. So okay, just documenting the documentation.. and ain't got it working yet..
P.S. I peruse the issues, and find the one about dogfooding, that's right, isn't it?
https://github.com/go-gitea/gitea/issues/1029
@DanLanglois commented on GitHub (Feb 12, 2019):
I hope to itemize some points for improved documentation, so this isn't simply one person asking for help. I might be able to come up with a tutorial..
I notice there is a 'scripts' folder, under go-gitea/gitea. And two files there:
generate-gitignores.go
generate-licenses.go
Some other ideas come to mind, such as a *.sql file containing 'CREATE DATABASE' and such. I mean, to create a database called gitea (default). Well, I've mentioned finding this page of Gitea documentation:
https://wiki.archlinux.org/index.php/Gitea
It includes this:
Configure Gitea:
/etc/gitea/app.ini
DB_TYPE = postgres
HOST = hostadress:port
NAME = gitea
USER = gitea
; Use PASSWD =
your passwordfor quoting if you use special characters in the password.PASSWD = password
And also this:
Create the new user while connecting to the server as postgres user (you will be prompted for a password for the new user):
[postgres]$ createuser -P gitea
Create the Gitea database, owned by gitea user:
[postgres]$ createdb -O gitea gitea
Well, I guess it woudn't be much of a script if you used a script, but it might also be worth having an'installation' page, which lists 'prerequisites', and 'Install database'. Even the idea that you would download and install Git might be, well, rather pedantic to include as a step, but sure, if you're going to support Windows at least. I also might add a 'Troubleshooting' page. With a section on 'Installation'. And another, on 'Database'. Perhaps on 'Windows'.
@DanLanglois commented on GitHub (Feb 12, 2019):
A note, I find this documentation:
https://computingforgeeks.com/how-to-install-gitea-self-hosted-git-service-on-centos-7-with-nginx-reverse-proxy/
Here's an excerpt:
Step 3: Install MariaDB database server
We will use MariaDB to store Gitea data, install MariaDB on your server by following our previous guide
Install MariaDB 10.x on Ubuntu 18.04 and CentOS 7
Create a database for Attendize
mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 608168
Server version: 10.3.9-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> CREATE DATABASE gitea;
Query OK, 1 row affected (0.001 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON gitea.* TO 'gitea'@'localhost' IDENTIFIED BY "StrongPassword";
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.002 sec)
MariaDB [(none)]> exit
@stale[bot] commented on GitHub (Apr 18, 2019):
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.
@stale[bot] commented on GitHub (May 2, 2019):
This issue has been automatically closed because of inactivity. You can re-open it if needed.