Installation, I encountered some bumps #2901

Closed
opened 2025-11-02 04:53:12 -06:00 by GiteaMirror · 4 comments
Owner

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

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
GiteaMirror added the type/questionissue/stale labels 2025-11-02 04:53:12 -06:00
Author
Owner

@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 password for 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): 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 password` for 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'.
Author
Owner

@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

@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
Author
Owner

@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 (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.
Author
Owner

@stale[bot] commented on GitHub (May 2, 2019):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (May 2, 2019): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2901