mirror of
https://github.com/YunoHost-Apps/diaspora_ynh.git
synced 2024-09-03 18:26:13 +02:00
upgrade package app for Yunohost 2.4, also update homepage andd readme
This commit is contained in:
parent
e006c0370f
commit
600ffc7529
7 changed files with 73 additions and 41 deletions
|
@ -8,8 +8,10 @@ Notes
|
|||
|
||||
Before installing, you have to:
|
||||
|
||||
- get a valid SSL certificate (can use [startssl.com](https://www.startssl.com/))
|
||||
- get a dedicated domain (must install under web root like **https://diaspora.example.com/** not **https://example.com/diaspora/**)
|
||||
- get a valid SSL certificate
|
||||
- can use [letsencrypt](https://letsencrypt.org/) with this fun [app](https://github.com/alexAubin/letsencrypt_ynh) of alexAubin :)
|
||||
- or more hard, can use [startssl.com](https://www.startssl.com/)
|
||||
|
||||
Installation effects:
|
||||
|
||||
|
@ -17,8 +19,8 @@ Installation effects:
|
|||
- The installation directory can take up to 700MB and app start time can be take 5 minutes.
|
||||
|
||||
Make yourself (your account) an admin:
|
||||
- https://wiki.diasporafoundation.org/FAQ_for_pod_maintainers#What_are_roles_and_how_do_I_use_them.3F_.2F_Make_yourself_an_admin
|
||||
- https://wiki.diasporafoundation.org/FAQ_for_pod_maintainers#What_are_roles_and_how_do_I_use_them.3F_.2F_Make_yourself_an_admin_or_assign_moderators
|
||||
|
||||
Not implement yet:
|
||||
|
||||
- There are not yet active SSO/LDAP integration.
|
||||
- backup and restart scripts.
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
.container{style: "padding-top: 5%;"}
|
||||
.hero-unit
|
||||
= image_tag "branding/logo.png"
|
||||
%h2 diaspora*
|
||||
%hr/
|
||||
%p
|
||||
%b Vous êtes sur le point de changer Internet en utilisant un réseau social anonyme et distribué.
|
||||
%br
|
||||
%b Rejoignez-nous et récupérez votre liberté, votre vie privée et vos données YunoHost et diaspora* !
|
||||
%b Rejoignez-nous et récupérez votre liberté, votre vie privée et vos données avec YunoHost et diaspora* !
|
||||
%p
|
||||
= link_to "Créer un compte ! »", new_user_registration_path, class: "btn btn-primary btn-large"
|
||||
.row
|
||||
|
@ -16,7 +16,7 @@
|
|||
%a.btn{:href => "https://diasporafoundation.org/"} Fondation Diaspora »
|
||||
.span4
|
||||
%h2 Auto-hébergez-vous
|
||||
%p Le site (pod) sur lequel vous êtes est propulsé par YunoHost. Une distribution simple d'outils libres pour créer votre propre "cloud" !
|
||||
%p Le site (pod) sur lequel vous êtes est propulsé par YunoHost. Une distribution simple basée sur des outils libres pour créer votre propre "cloud" !
|
||||
%p
|
||||
%a.btn{:href => "https://yunohost.org/"} YunoHost »
|
||||
.span4
|
||||
|
|
8
conf/diaspora.target
Normal file
8
conf/diaspora.target
Normal file
|
@ -0,0 +1,8 @@
|
|||
[Unit]
|
||||
Description=Diaspora social network
|
||||
Wants=redis.service mysqld.service
|
||||
After=redis.service mysqld.service
|
||||
StopWhenUnneeded=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
17
conf/diaspora_appserver.service
Normal file
17
conf/diaspora_appserver.service
Normal file
|
@ -0,0 +1,17 @@
|
|||
[Unit]
|
||||
Description=Diaspora social network (application server)
|
||||
PartOf=diaspora.target
|
||||
StopWhenUnneeded=true
|
||||
|
||||
[Service]
|
||||
User=diaspora
|
||||
WorkingDirectory=/var/www/diaspora
|
||||
Environment=RAILS_ENV=production
|
||||
ExecStart=/var/www/diaspora/.rvm/scripts/extras/chruby.sh 2.2 -- bin/bundle exec puma -b unix:///var/run/diaspora/diaspora.sock -e $RAILS_ENV
|
||||
Restart=always
|
||||
CPUAccounting=true
|
||||
MemoryAccounting=true
|
||||
BlockIOAccounting=true
|
||||
|
||||
[Install]
|
||||
WantedBy=diaspora.target
|
18
conf/diaspora_worker1.service
Normal file
18
conf/diaspora_worker1.service
Normal file
|
@ -0,0 +1,18 @@
|
|||
[Unit]
|
||||
Description=Diaspora social network (worker %i)
|
||||
PartOf=diaspora.target
|
||||
StopWhenUnneeded=true
|
||||
|
||||
[Service]
|
||||
User=diaspora
|
||||
WorkingDirectory=/var/www/diaspora
|
||||
Environment=RAILS_ENV=production
|
||||
ExecStart=/var/www/diaspora/.rvm/scripts/extras/chruby.sh 2.2 -- bin/bundle exec sidekiq
|
||||
Restart=always
|
||||
CPUAccounting=true
|
||||
MemoryAccounting=true
|
||||
BlockIOAccounting=true
|
||||
|
||||
[Install]
|
||||
WantedBy=diaspora.target
|
||||
DefaultInstance=worker1
|
|
@ -1,20 +1,26 @@
|
|||
{
|
||||
"name": "Diaspora",
|
||||
"id": "diaspora",
|
||||
"url": "https://diasporafoundation.org",
|
||||
"packaging_format": 1,
|
||||
"description": {
|
||||
"en": "Distributed social networking service",
|
||||
"fr": "Service de réseau social distribué"
|
||||
},
|
||||
"developer": {
|
||||
"licence": "free",
|
||||
"maintainer": {
|
||||
"name": "aymhce",
|
||||
"email": "aymhce@gmail.com",
|
||||
"url": "https://diasporafoundation.org"
|
||||
"email": "aymhce@gmail.com"
|
||||
},
|
||||
"multi_instance": "true",
|
||||
"requirements": {
|
||||
"yunohost": ">> 2.3.12.1"
|
||||
},
|
||||
"multi_instance": "false",
|
||||
"arguments": {
|
||||
"install" : [
|
||||
{
|
||||
"name": "domain",
|
||||
"type": "domain",
|
||||
"ask": {
|
||||
"en": "Choose a domain for diaspora*",
|
||||
"fr": "Choisissez un domaine pour diaspora*"
|
||||
|
@ -22,13 +28,13 @@
|
|||
"example": "domain.org"
|
||||
},
|
||||
{
|
||||
"name": "public_site",
|
||||
"name": "site_public",
|
||||
"type": "boolean",
|
||||
"ask": {
|
||||
"en": "Is it a public Diaspora site?",
|
||||
"fr": "Est-ce un site public ?"
|
||||
},
|
||||
"choices": ["yes", "YES", "Yes", "no", "NO", "No"],
|
||||
"default": "Yes"
|
||||
"default": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,18 +2,10 @@
|
|||
|
||||
# Retrieve arguments
|
||||
domain=$1
|
||||
#user=$2
|
||||
is_public=$2
|
||||
|
||||
versionname=$(lsb_release -a | grep Codename | awk -F' ' '{print $2}')
|
||||
|
||||
# Check user parameter
|
||||
#sudo yunohost user list --json | grep -q "\"username\": \"$user\""
|
||||
#if [[ ! $? -eq 0 ]]; then
|
||||
# echo "Wrong user"
|
||||
# exit 1
|
||||
#fi
|
||||
#sudo yunohost app setting diaspora admin_user -v $user
|
||||
# Source YunoHost helpers
|
||||
. /usr/share/yunohost/helpers
|
||||
|
||||
# Check domain/path availability
|
||||
sudo yunohost app checkurl $domain -a diaspora
|
||||
|
@ -28,30 +20,18 @@ full_url=https://$domain
|
|||
|
||||
sudo yunohost app setting diaspora final_path -v $final_path
|
||||
|
||||
# Configure system apt-get
|
||||
cat /etc/os-release | grep -q wheezy
|
||||
if [ $? = 0 ]
|
||||
then
|
||||
cat /etc/apt/sources.list | grep -q backports
|
||||
if [ $? != 0 ]
|
||||
then
|
||||
sudo su -c "echo 'deb http://http.debian.net/debian wheezy-backports main' >> /etc/apt/sources.list"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Get sys deps
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y -- \
|
||||
gawk libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake bison libffi-dev \
|
||||
build-essential libssl-dev libcurl4-openssl-dev libxml2-dev libxslt-dev imagemagick ghostscript git curl libmysqlclient-dev \
|
||||
libmagickwand-dev nodejs-legacy npm
|
||||
|
||||
[ "$versionname" == "wheezy" ] && sudo apt-get install -t wheezy-backports redis-server -y
|
||||
[ "$versionname" != "wheezy" ] && sudo apt-get install redis-server -y
|
||||
libmagickwand-dev nodejs-legacy npm redis-server
|
||||
|
||||
# Get source code
|
||||
git clone -b master git://github.com/diaspora/diaspora.git
|
||||
|
||||
echo $(pwd)
|
||||
|
||||
sudo mkdir -p $final_path
|
||||
tar -cf source.tar.gz diaspora/
|
||||
mv source.tar.gz diaspora/public/source.tar.gz
|
||||
|
@ -61,11 +41,11 @@ sudo cp -ar diaspora $final_path/../.
|
|||
db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{24\}\).*/\1/p')
|
||||
|
||||
# Use 'diaspora' as database name and user
|
||||
db_user=diaspora
|
||||
db_user=diaspora
|
||||
|
||||
# Initialize database and store mysql password for upgrade
|
||||
sudo yunohost app initdb $db_user -p $db_pwd -d diaspora_production
|
||||
sudo yunohost app setting diaspora mysqlpwd -v $db_pwd
|
||||
sudo yunohost app setting diaspora mysqlpwd -v "$db_pwd"
|
||||
ynh_mysql_create_db diaspora_production "$db_user" "$db_pwd"
|
||||
|
||||
# prepare and copy diaspora config file
|
||||
sed -i "s@FULLURLTOCHANGE@$full_url@g" ../conf/diaspora.yml
|
||||
|
@ -85,6 +65,7 @@ sudo chown -R diaspora:diaspora $final_path
|
|||
|
||||
# Config RVM and force get app deps (for debug)
|
||||
sudo su - diaspora -c "curl --retry 5 -sSL https://rvm.io/mpapis.asc | gpg --import - ; curl --retry 5 -L dspr.tk/1t | bash;"
|
||||
sudo su - diaspora -c "curl --retry 5 -sSL https://s.diaspora.software/1t | bash;"
|
||||
|
||||
# Add user to sudoers for install
|
||||
DIASPORASUDOERSCONF="diaspora ALL=(ALL:ALL) NOPASSWD: ALL #yunhost_diaspora"
|
||||
|
|
Loading…
Reference in a new issue