Difference between revisions of "Talk:Gitea"

From ArchWiki
Jump to navigation Jump to search
(thx for signing notice, strk at #gitea (freenode) noted the superuser option + sockets for better security)
Line 7: Line 7:
 
Start create db wizzard:
 
Start create db wizzard:
 
  [postgres]$ createuser --interactive
 
  [postgres]$ createuser --interactive
name gitea, superuser: yes (no idea if its needed)
+
name gitea, superuser: no (TODO add explanation why not superuser)
 
then createdb named gitea using gitea user (its ok to launch the createdb command as regular user as well)
 
then createdb named gitea using gitea user (its ok to launch the createdb command as regular user as well)
 
  [postgres]$ createdb gitea -U gitea
 
  [postgres]$ createdb gitea -U gitea
 
then try access the the DB via localhost, cause that's how the gittea will try to access it
 
then try access the the DB via localhost, cause that's how the gittea will try to access it
  [postgres]$ psql -d gitea -h 127.0.0.1 -W (host localhost and -W without anything for empty password)
+
  [postgres]$ psql -d gitea -U gitea -h 127.0.0.1 -W (connect to gitea db as gitea user, host localhost and -W without anything for empty password)
  
 
Now to edit the /etc/gitea/app.ini
 
Now to edit the /etc/gitea/app.ini
Line 29: Line 29:
  
 
TODO setup a password, SSL_MODE wanted?
 
TODO setup a password, SSL_MODE wanted?
 +
TODO using localhost:port might be unsecure, better to connect directly at the socket (in "/run/postgresql");
 +
(try connecting to db psql -d gitea -U gitea and typing \conninfo for details)
 +
 
--{{Unsigned|22 June 2018‎|Pulec}}
 
--{{Unsigned|22 June 2018‎|Pulec}}
  

Revision as of 14:31, 25 June 2018

PostgreSQL draft

Install and configure and start the PostgreSQL, then do this to create gitea user and db:

Switch to posgres user:

$ sudo -u postgres -i

Start create db wizzard:

[postgres]$ createuser --interactive

name gitea, superuser: no (TODO add explanation why not superuser) then createdb named gitea using gitea user (its ok to launch the createdb command as regular user as well)

[postgres]$ createdb gitea -U gitea

then try access the the DB via localhost, cause that's how the gittea will try to access it

[postgres]$ psql -d gitea -U gitea -h 127.0.0.1 -W (connect to gitea db as gitea user, host localhost and -W without anything for empty password)

Now to edit the /etc/gitea/app.ini

Default PostgreSQL port is 5432 if you haven't changed it

/etc/gitea/app.ini
[database]
DB_TYPE = postgres
HOST = 127.0.0.1;5432
NAME = gitea
PASSWD = 
USER = postgres
SSL_MODE = disable


TODO setup a password, SSL_MODE wanted? TODO using localhost:port might be unsecure, better to connect directly at the socket (in "/run/postgresql"); (try connecting to db psql -d gitea -U gitea and typing \conninfo for details)

--—This unsigned comment is by Pulec (talk) 22 June 2018‎. Please sign your posts with ~~~~!

Please sign your posts. :)
Any recommendations from Gitea/Gogs for setting up PostgreSQL?
Francoism (talk) 09:38, 24 June 2018 (UTC)