mirror of
https://github.com/YunoHost-Apps/gogs_ynh.git
synced 2024-09-03 20:36:23 +02:00
Fix ssh usage and add infos to readme
This commit is contained in:
parent
8d109bbb55
commit
7133f1a14c
4 changed files with 29 additions and 2 deletions
20
README.md
20
README.md
|
@ -22,6 +22,26 @@ From command line:
|
|||
|
||||
`sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/gogs_ynh gogs`
|
||||
|
||||
Notes on SSH usage
|
||||
------------------
|
||||
|
||||
If you want to use gogs with ssh and be able to pull/push with you ssh key, your ssh daemon need to be properly configured to use private/public key. Here is a sample configuration (in `/etc/ssh/sshd_config` that works with gogs:
|
||||
|
||||
```
|
||||
PubkeyAuthentication yes
|
||||
AuthorizedKeysFile %h/.ssh/authorized_keys
|
||||
ChallengeResponseAuthentication no
|
||||
PasswordAuthentication no
|
||||
UsePAM no
|
||||
```
|
||||
You also need to add your public key to your gogs profile.
|
||||
|
||||
If you use ssh on another port than 22, you need to add theses lines to your ssh config in `~/.ssh/config`
|
||||
```
|
||||
Host domain.tld
|
||||
port 2222 # change this with the port you use
|
||||
```
|
||||
|
||||
Infos on upgrade from the old package version (gogs <0.9.xx)
|
||||
-------
|
||||
Previous versions of this package used to build gogs from sources instead of using precompiled binary. It also leave data to many places which was not good. The upgrade try to take care of moving everything to the right place **BUT, it's strongly advised to do a backup of your repositories and of the gogs directory before the update**. Your avatars and issue attachments files may be lost in the process.
|
||||
|
|
|
@ -46,7 +46,7 @@ ynh_app_setting_set $app secret_key $is_public
|
|||
|
||||
# Add users
|
||||
id -g "$app" &>/dev/null || sudo addgroup "$app" --system --quiet
|
||||
id -u "$app" &>/dev/null || sudo adduser "$app" --disabled-login \
|
||||
id -u "$app" &>/dev/null || sudo adduser "$app" \
|
||||
--ingroup "$app" --system --quiet --shell /bin/bash
|
||||
|
||||
# create needed directories
|
||||
|
|
|
@ -32,7 +32,7 @@ DESTDIR="/opt/$app"
|
|||
|
||||
# Add users
|
||||
id -g "$app" &>/dev/null || sudo addgroup "$app" --system --quiet
|
||||
id -u "$app" &>/dev/null || sudo adduser "$app" --disabled-login \
|
||||
id -u "$app" &>/dev/null || sudo adduser "$app" \
|
||||
--ingroup "$app" --system --quiet --shell /bin/bash
|
||||
|
||||
# Check configuration files
|
||||
|
|
|
@ -100,3 +100,10 @@ sudo systemctl restart "$app".service || true
|
|||
# Restore ldap config
|
||||
sudo sed -i "s@yuno_admin@$admin@g" ../conf/login_source.sql
|
||||
ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" < ../conf/login_source.sql
|
||||
|
||||
# test if user gogs is locked because of an old installation of the package.
|
||||
# if it's blocked, unlock it to allow ssh usage with git
|
||||
if [[ $(grep "$app" /etc/shadow | cut -d: -f2) == '!' ]]
|
||||
then
|
||||
usermod -p '*' "$app"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue