Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
matrix-stickers
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneurs
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Elliu
matrix-stickers
Validations
9834d84a
Valider
9834d84a
rédigé
Il y a 4 ans
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
The sshfs install is working
parent
baf7392c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
stpkg
+36
-16
36 ajouts, 16 suppressions
stpkg
avec
36 ajouts
et
16 suppressions
stpkg
+
36
−
16
Voir le fichier @
9834d84a
#!/bin/bash
STPKG_CONF_FILE
=
~/config/stpkg.sh
STPKG_CONF_FILE
=
~/
.
config/stpkg.sh
BASE_DIR
=
"
$PWD
"
DISPLAY_DEPS_NOTES
=
"yes"
# Detect install
if
[
"x
$1
"
=
"x-install"
]
;
then
INSTALL
=
"yes"
fi
if
[
"x
$STPKG_COLORS
"
=
"x"
]
;
then
STPKG_COLORS
=
"yes"
error
()
{
__red
"
$*
\n
"
>
/dev/stderr
;
}
...
...
@@ -28,6 +33,11 @@ else
alias
__bold
=
echo
fi
die
()
{
error
$*
exit
1
}
# Source conf file, may have the sshfs hook
[
-f
$STPKG_CONF_FILE
]
&&
source
$STPKG_CONF_FILE
...
...
@@ -97,11 +107,6 @@ EOF
exit
0
}
die
()
{
error
$*
exit
1
}
require
()
{
local
__cmd
=
`
which
$1
`
[
$?
-ne
0
]
&&
die
"Failed to find the '
$1
' command"
...
...
@@ -120,6 +125,7 @@ default_index() {
\"
packs
\"
: [
\"
scalar-privacy_pam.json
\"
] }"
}
# Be paranoid
require column
require uuidgen
require convert
...
...
@@ -161,26 +167,39 @@ __install() {
# Create the ~/config/stpkg.sh
[
!
-d
~/config
]
&&
mkdir
~/config
echo
"STPKG_BASE=
$BASE_DIR
"
>
$STPKG_CONF_FILE
echo
"STPKG_HOMESERV='matrix.org'"
>>
$STPKG_CONF_FILE
echo
"STPKG_TOKEN=''"
>>
$STPKG_CONF_FILE
cat
>
$STPKG_CONF_FILE
<<
EOF
if [ ! "x
\$
INSTALL" = "xyes" ]; then
STPKG_BASE="
$BASE_DIR
"
STPKG_HOMESERV='matrix.org'
STPKG_TOKEN=''
STPKG_COLORS='yes'
STPKG_NO_MSG='no'
EOF
chmod
00600
$STPKG_CONF_FILE
# Set install dir. Oh boi, tricky things going around here because we
# handle the sshfs ourself.
if
[
!
"x
$SSHFS
"
=
"x"
]
;
then
info
"Detected a sshfs install"
[
"x
$MNT
"
=
"x"
]
&&
die
"You must specify a mount point with '-local /mount/pount' when using the '-sshfs' option"
local
STPKG_INSTALL
=
$1
STPKG_INSTALL
=
$MNT
${
STPKG_INSTALL
:
=
"/html/stickerpicker/"
}
# The sshfs hook
echo
"STPKG_INSTALL=
$STPKG_INSTALL
"
>>
$STPKG_CONF_FILE
echo
"[ ! -d
\"
$MNT
\"
] && mkdir -p
\"
$MNT
\"
|| die 'Failed to recreate mount point'"
>>
$STPKG_CONF_FILE
echo
"[ ! -d
\"\$
STPKG_INSTALL
\"
] && sshfs
$SSHFS
:~/
$MNT
"
>>
$STPKG_CONF_FILE
echo
"[ ! -d
\"\$
STPKG_INSTALL
\"
] && die 'Failed to mount
$SSHFS
:~/ to
$MNT
, sshfs problems?'"
>>
$STPKG_CONF_FILE
cat
>>
$STPKG_CONF_FILE
<<
EOF
STPKG_SSHFS='yes'
STPKG_INSTALL="
$STPKG_INSTALL
"
mountpoint
$MNT
>/dev/null 2>&1
if [
\$
? -ne 0 -a ! "x
\$
INSTALL" = "xyes" ]; then
[ ! -d "
\$
STPKG_INSTALL" ] && { sshfs
$SSHFS
:
$MNT
|| die "Failed to mount
$SSHFS
:~/ to
$MNT
"; }
[ ! -d "
\$
STPKG_INSTALL" ] && die 'Failed to mount
$SSHFS
:~/ to
$MNT
, sshfs problems?'
fi
EOF
# Do the sshfs hook
sshfs
$SSHFS
:~/
$MNT
mountpoint
$MNT
>
/dev/null 2>&1
[
$?
-eq
0
]
&&
die
"The '
$MNT
' folder is already a mountpoint"
sshfs
$SSHFS
:
$MNT
||
die
"Failed to mount
$SSHFS
:~/ to
$MNT
"
else
local
STPKG_INSTALL
=
$1
STPKG_INSTALL
=
${
STPKG_INSTALL
:
=
"~/html/stickerpicker/"
}
...
...
@@ -202,7 +221,8 @@ __install() {
default_index
>
$STPKG_INSTALL
/web/packs/index.json
||
die
"Failed to create default index.json file"
info
"You may edit the
$STPKG_CONF_FILE
to setup your home server and token"
echo
"fi"
>>
$STPKG_CONF_FILE
info
"You may edit the
$STPKG_CONF_FILE
to setup your home server and token (variable STPKG_TOKEN)"
}
if
[
"x
$1
"
=
"x-install"
]
;
then
[
"x
$STPKG_NO_MSG
"
=
"xyes"
]
\
...
...
@@ -223,7 +243,7 @@ if [ ! -d "$STPKG_INSTALL" ]; then
error
"STPKG_INSTALL folder (
$STPKG_INSTALL
) doesn't exist. Did you use the install script?"
usage
fi
info
"Use STPKG_INSTALL:
$STPKG_INSTALL
"
info
"Use STPKG_INSTALL:
$STPKG_INSTALL
`
[
"x
$STPKG_SSHFS
"
=
"xyes"
]
&&
echo
' (this is an sshfs install)'
`
"
if
[
"x
$STPKG_BASE
"
=
"x"
]
;
then
die
"The STPKG_BASE env var is mendatory, it must point to the sticker repo."
\
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter