Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
955142b3
Commit
955142b3
authored
7 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Abstract out the sharings plugin
parent
d44b5798
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/freedombone-app-gnusocial
+2
-134
2 additions, 134 deletions
src/freedombone-app-gnusocial
src/freedombone-app-postactiv
+2
-1
2 additions, 1 deletion
src/freedombone-app-postactiv
src/freedombone-utils-gnusocialtools
+132
-0
132 additions, 0 deletions
src/freedombone-utils-gnusocialtools
with
136 additions
and
135 deletions
src/freedombone-app-gnusocial
+
2
−
134
View file @
955142b3
...
...
@@ -44,12 +44,6 @@ GNUSOCIAL_BACKGROUND_IMAGE_URL=
GNUSOCIAL_MARKDOWN_REPO
=
"https://git.gnu.io/chimo/markdown.git"
GNUSOCIAL_MARKDOWN_COMMIT
=
'03c53942f94b3376f0946e6e1fe566cc21ccf232'
# Sharings plugin for gnusocial
SHARINGS_REPO
=
"http://git.lasindias.club/bashrc/Sharings"
SHARINGS_COMMIT
=
'd5c6c7f855d9afff9086c09ea706f38c859bc0d4'
SHARINGS_THEME_REPO
=
"http://git.lasindias.club/manuel/SharingsTheme"
SHARINGS_THEME_COMMIT
=
'7106c7ef03'
GNUSOCIAL_TITLE
=
'Pleroma FE'
# Number of months after which posts expire
...
...
@@ -61,10 +55,7 @@ gnusocial_variables=(ONION_ONLY
GNUSOCIAL_WELCOME_MESSAGE
GNUSOCIAL_BACKGROUND_IMAGE_URL
DDNS_PROVIDER
GNUSOCIAL_MARKDOWN_REPO
GNUSOCIAL_MARKDOWN_COMMIT
SHARINGS_REPO
SHARINGS_THEME_REPO
GNUSOCIAL_TITLE
GNUSOCIAL_EXPIRE_MONTHS
MY_USERNAME
)
...
...
@@ -797,129 +788,6 @@ function install_gnusocial_main {
install_completed gnusocial_main
}
function
install_gnusocial_plugin_sharings
{
if
[
!
-d
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/local/plugins
]
;
then
echo
$'No local/plugins directory found for the gnusocial'
exit
72945
fi
apt-get
-yq
install
liblocale-msgfmt-perl gettext
# update to the next commit
function_check set_repo_commit
set_repo_commit /var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/local/plugins
"gnusocial sharings plugin commit"
"
$SHARINGS_COMMIT
"
$SHARINGS_REPO
if
[[
$(
app_is_installed gnusocial_plugin_sharings
)
==
"1"
]]
;
then
return
fi
cd
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/local/plugins
if
[
-d
/repos/sharings
]
;
then
mkdir
Sharings
cp
-r
-p
/repos/sharings/. Sharings
cd
Sharings
git pull
else
function_check git_clone
git_clone
$SHARINGS_REPO
Sharings
fi
if
[
!
-d
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/local/plugins/Sharings
]
;
then
echo
$'Unable to clone gnusocial sharings plugin'
exit
36738
fi
cd
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/local/plugins/Sharings
git stash
git checkout master
git branch
-D
$SHARINGS_COMMIT
git checkout
$SHARINGS_COMMIT
-b
$SHARINGS_COMMIT
# enable the plugin
if
!
grep
-q
"addPlugin('Sharings');"
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/config.php
;
then
echo
"addPlugin('Sharings');"
>>
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/config.php
fi
cd
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs
php scripts/checkschema.php
cd
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/local/plugins/Sharings
php scripts/seedsharings.php
cd
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs
php scripts/upgrade.php
php scripts/checkschema.php
# Languages
cd
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/local/plugins/Sharings/locale/en/LC_MESSAGES
msgfmt
-o
Sharings.mo Sharings.po
if
[
!
-f
Sharings.po
]
;
then
echo
$'English translations for gnusocial sharings plugin were not created'
exit
84352
fi
cd
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/local/plugins/Sharings/locale/en_GB/LC_MESSAGES
msgfmt
-o
Sharings.mo Sharings.po
if
[
!
-f
Sharings.po
]
;
then
echo
$'English (GB) translations for gnusocial sharings plugin were not created'
exit
84352
fi
cd
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/local/plugins/Sharings/locale/en_US/LC_MESSAGES
msgfmt
-o
Sharings.mo Sharings.po
if
[
!
-f
Sharings.po
]
;
then
echo
$'English (US) translations for gnusocial sharings plugin were not created'
exit
84352
fi
# Looks like this update function isn't supported by the current php version
sed
-i
's|ActivityVerb::UPDATE, ||g'
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/local/plugins/Sharings/SharingsPlugin.php
chown
-R
www-data:www-data /var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs
set_completion_param gnusocial
"sharings plugin commit"
"
$SHARINGS_COMMIT
"
install_completed gnusocial_plugin_sharings
}
function
install_gnusocial_plugin_sharings_theme
{
if
[
!
-d
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/local/plugins
]
;
then
echo
$'No local/plugins directory found for the gnusocial'
exit
74458
fi
# update to the next commit
function_check set_repo_commit
set_repo_commit /var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/local/plugins
"gnusocial sharings theme plugin commit"
"
$SHARINGS_THEME_COMMIT
"
$SHARINGS_THEME_REPO
if
[[
$(
app_is_installed gnusocial_plugin_sharings_theme
)
==
"1"
]]
;
then
return
fi
cd
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/local/plugins
function_check git_clone
git_clone
$SHARINGS_THEME_REPO
SharingsTheme
if
[
!
-d
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/local/plugins/SharingsTheme
]
;
then
echo
$'Unable to clone gnusocial sharings plugin theme'
exit
639253
fi
cd
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/local/plugins/SharingsTheme
git stash
git checkout master
git branch
-D
$SHARINGS_THEME_COMMIT
git checkout
$SHARINGS_THEME_COMMIT
-b
$SHARINGS_THEME_COMMIT
# enable the plugin
if
!
grep
-q
"addPlugin('SharingsTheme');"
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/config.php
;
then
echo
"addPlugin('SharingsTheme');"
>>
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs/config.php
fi
cd
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs
php scripts/checkschema.php
chown
-R
www-data:www-data /var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs
set_completion_param
"gnusocial sharings plugin theme commit"
"
$SHARINGS_THEME_COMMIT
"
install_completed gnusocial_plugin_sharings_theme
}
function
install_gnusocial_markdown
{
GNUSOCIAL_PATH
=
/var/www/
$GNUSOCIAL_DOMAIN_NAME
/htdocs
...
...
@@ -977,8 +845,8 @@ function install_gnusocial {
expire_gnusocial_posts
"
$GNUSOCIAL_DOMAIN_NAME
"
"gnusocial"
"
$GNUSOCIAL_EXPIRE_MONTHS
"
install_qvitter
"
$GNUSOCIAL_DOMAIN_NAME
"
"gnusocial"
install_gnusocial_markdown
#
install_gnusocial_plugin_sharings
#
install_gnusocial_plugin_sharings_theme
install_gnusocial_plugin_sharings
"
$GNUSOCIAL_DOMAIN_NAME
"
"gnusocial"
install_gnusocial_plugin_sharings_theme
"
$GNUSOCIAL_DOMAIN_NAME
"
"gnusocial"
# Currently Pleroma won't install on ARM systems
# because it uses node-sass which doesn't support ARM
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-app-postactiv
+
2
−
1
View file @
955142b3
...
...
@@ -807,7 +807,8 @@ function install_postactiv {
install_postactiv_main
install_qvitter
"
$POSTACTIV_DOMAIN_NAME
"
"postactiv"
install_gnusocial_plugin_sharings
"
$POSTACTIV_DOMAIN_NAME
"
"postactiv"
install_gnusocial_plugin_sharings_theme
"
$POSTACTIV_DOMAIN_NAME
"
"postactiv"
#function_check install_nodejs
#install_nodejs pleroma-postactiv
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-utils-gnusocialtools
+
132
−
0
View file @
955142b3
...
...
@@ -37,6 +37,11 @@ PLEROMA_COMMIT='7d46e3965d06e039537066eeb5fac99ebcab978d'
ARMADILLO_REPO
=
"https://git.postactiv.com/maiya/Armadillo"
ARMADILLO_COMMIT
=
'ec3938a678f373156c4cbf37926c9a5ab68222c4'
SHARINGS_REPO
=
"http://git.lasindias.club/bashrc/Sharings"
SHARINGS_COMMIT
=
'd5c6c7f855d9afff9086c09ea706f38c859bc0d4'
SHARINGS_THEME_REPO
=
"http://git.lasindias.club/manuel/SharingsTheme"
SHARINGS_THEME_COMMIT
=
'7106c7ef03'
function
qvitter_update_background
{
domain_name
=
"
$1
"
ext
=
$2
...
...
@@ -877,4 +882,131 @@ function gnusocial_use_armadillo {
systemctl restart nginx
}
function
install_gnusocial_plugin_sharings
{
domain_name
=
$1
social_app_name
=
$2
if
[
!
-d
/var/www/
$domain_name
/htdocs/local/plugins
]
;
then
mkdir
-p
/var/www/
$domain_name
/htdocs/local/plugins
fi
apt-get
-yq
install
liblocale-msgfmt-perl gettext
# update to the next commit
function_check set_repo_commit
set_repo_commit /var/www/
$domain_name
/htdocs/local/plugins
"
$social_app_name
sharings plugin commit"
"
$SHARINGS_COMMIT
"
$SHARINGS_REPO
if
[[
$(
app_is_installed
${
social_app_name
}
_plugin_sharings
)
==
"1"
]]
;
then
return
fi
cd
/var/www/
$domain_name
/htdocs/local/plugins
if
[
-d
/repos/sharings
]
;
then
mkdir
Sharings
cp
-r
-p
/repos/sharings/. Sharings
cd
Sharings
git pull
else
function_check git_clone
git_clone
$SHARINGS_REPO
Sharings
fi
if
[
!
-d
/var/www/
$domain_name
/htdocs/local/plugins/Sharings
]
;
then
echo
$"Unable to clone
$social_app_name
sharings plugin"
exit
36738
fi
cd
/var/www/
$domain_name
/htdocs/local/plugins/Sharings
git stash
git checkout master
git branch
-D
$SHARINGS_COMMIT
git checkout
$SHARINGS_COMMIT
-b
$SHARINGS_COMMIT
# enable the plugin
if
!
grep
-q
"addPlugin('Sharings');"
/var/www/
$domain_name
/htdocs/config.php
;
then
echo
"addPlugin('Sharings');"
>>
/var/www/
$domain_name
/htdocs/config.php
fi
cd
/var/www/
$domain_name
/htdocs
php scripts/checkschema.php
cd
/var/www/
$domain_name
/htdocs/local/plugins/Sharings
php scripts/seedsharings.php
cd
/var/www/
$domain_name
/htdocs
php scripts/upgrade.php
php scripts/checkschema.php
# Languages
cd
/var/www/
$domain_name
/htdocs/local/plugins/Sharings/locale/en/LC_MESSAGES
msgfmt
-o
Sharings.mo Sharings.po
if
[
!
-f
Sharings.po
]
;
then
echo
$"English translations for
$social_app_name
sharings plugin were not created"
exit
782923
fi
cd
/var/www/
$domain_name
/htdocs/local/plugins/Sharings/locale/en_GB/LC_MESSAGES
msgfmt
-o
Sharings.mo Sharings.po
if
[
!
-f
Sharings.po
]
;
then
echo
$"English (GB) translations for
$social_app_name
sharings plugin were not created"
exit
23528
fi
cd
/var/www/
$domain_name
/htdocs/local/plugins/Sharings/locale/en_US/LC_MESSAGES
msgfmt
-o
Sharings.mo Sharings.po
if
[
!
-f
Sharings.po
]
;
then
echo
$"English (US) translations for
$social_app_name
sharings plugin were not created"
exit
567382
fi
# Looks like this update function isn't supported by the current php version
sed
-i
's|ActivityVerb::UPDATE, ||g'
/var/www/
$domain_name
/htdocs/local/plugins/Sharings/SharingsPlugin.php
chown
-R
www-data:www-data /var/www/
$domain_name
/htdocs
set_completion_param gnusocial
"
$social_app_name
sharings plugin commit"
"
$SHARINGS_COMMIT
"
install_completed
${
social_app_name
}
_plugin_sharings
}
function
install_gnusocial_plugin_sharings_theme
{
domain_name
=
$1
social_app_name
=
$2
if
[
!
-d
/var/www/
$domain_name
/htdocs/local/plugins
]
;
then
mkdir
-p
/var/www/
$domain_name
/htdocs/local/plugins
fi
# update to the next commit
function_check set_repo_commit
set_repo_commit /var/www/
$domain_name
/htdocs/local/plugins
"
$social_app_name
sharings theme plugin commit"
"
$SHARINGS_THEME_COMMIT
"
$SHARINGS_THEME_REPO
if
[[
$(
app_is_installed
${
social_app_name
}
_plugin_sharings_theme
)
==
"1"
]]
;
then
return
fi
cd
/var/www/
$domain_name
/htdocs/local/plugins
function_check git_clone
git_clone
$SHARINGS_THEME_REPO
SharingsTheme
if
[
!
-d
/var/www/
$domain_name
/htdocs/local/plugins/SharingsTheme
]
;
then
echo
$"Unable to clone
$social_app_name
sharings plugin theme"
exit
639253
fi
cd
/var/www/
$domain_name
/htdocs/local/plugins/SharingsTheme
git stash
git checkout master
git branch
-D
$SHARINGS_THEME_COMMIT
git checkout
$SHARINGS_THEME_COMMIT
-b
$SHARINGS_THEME_COMMIT
# enable the plugin
if
!
grep
-q
"addPlugin('SharingsTheme');"
/var/www/
$domain_name
/htdocs/config.php
;
then
echo
"addPlugin('SharingsTheme');"
>>
/var/www/
$domain_name
/htdocs/config.php
fi
cd
/var/www/
$domain_name
/htdocs
php scripts/checkschema.php
chown
-R
www-data:www-data /var/www/
$domain_name
/htdocs
set_completion_param
"
$social_app_name
sharings plugin theme commit"
"
$SHARINGS_THEME_COMMIT
"
install_completed
${
social_app_name
}
_plugin_sharings_theme
}
# NOTE: deliberately there is no "exit 0"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment