Use cookie authentication method for wiki #69
This commit is contained in:
parent
203faffb7b
commit
bd3627a14a
|
@ -9,7 +9,6 @@
|
||||||
# Freedom in the Cloud
|
# Freedom in the Cloud
|
||||||
#
|
#
|
||||||
# Federated wiki
|
# Federated wiki
|
||||||
# The only authentication options are proprietary, so deprecated
|
|
||||||
#
|
#
|
||||||
# License
|
# License
|
||||||
# =======
|
# =======
|
||||||
|
@ -29,7 +28,7 @@
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
VARIANTS=""
|
VARIANTS="full full-vim media"
|
||||||
|
|
||||||
IN_DEFAULT_INSTALL=0
|
IN_DEFAULT_INSTALL=0
|
||||||
SHOW_ON_ABOUT=1
|
SHOW_ON_ABOUT=1
|
||||||
|
@ -40,9 +39,11 @@ FEDWIKI_VERSION='0.13.0'
|
||||||
FEDWIKI_ONION_PORT=8131
|
FEDWIKI_ONION_PORT=8131
|
||||||
FEDWIKI_PORT=3053
|
FEDWIKI_PORT=3053
|
||||||
FEDWIKI_DATA=/var/lib/fedwiki
|
FEDWIKI_DATA=/var/lib/fedwiki
|
||||||
|
FEDWIKI_COOKIE=
|
||||||
|
|
||||||
fedwiki_variables=(FEDWIKI_DOMAIN_NAME
|
fedwiki_variables=(FEDWIKI_DOMAIN_NAME
|
||||||
FEDWIKI_CODE
|
FEDWIKI_CODE
|
||||||
|
FEDWIKI_COOKIE
|
||||||
FEDWIKI_ADMIN_PASSWORD
|
FEDWIKI_ADMIN_PASSWORD
|
||||||
ONION_ONLY
|
ONION_ONLY
|
||||||
DDNS_PROVIDER
|
DDNS_PROVIDER
|
||||||
|
@ -81,6 +82,14 @@ function fedwiki_remove_bad_links {
|
||||||
if [ -d /usr/local/lib/node_modules/wiki/node_modules/passport-oauth2 ]; then
|
if [ -d /usr/local/lib/node_modules/wiki/node_modules/passport-oauth2 ]; then
|
||||||
rm -rf /usr/local/lib/node_modules/wiki/node_modules/passport-oauth2
|
rm -rf /usr/local/lib/node_modules/wiki/node_modules/passport-oauth2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d /usr/local/lib/node_modules/wiki/node_modules/passport-twitter ]; then
|
||||||
|
rm -rf /usr/local/lib/node_modules/wiki/node_modules/passport-twitter
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d /usr/local/lib/node_modules/wiki/node_modules/passport-github ]; then
|
||||||
|
rm -rf /usr/local/lib/node_modules/wiki/node_modules/passport-github
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function logging_on_fedwiki {
|
function logging_on_fedwiki {
|
||||||
|
@ -396,8 +405,9 @@ function install_fedwiki {
|
||||||
|
|
||||||
FEDWIKI_ONION_HOSTNAME=$(add_onion_service fedwiki 80 ${FEDWIKI_ONION_PORT})
|
FEDWIKI_ONION_HOSTNAME=$(add_onion_service fedwiki 80 ${FEDWIKI_ONION_PORT})
|
||||||
|
|
||||||
#TODO add a config file for the identity system
|
if [ ! $FEDWIKI_COOKIE ]; then
|
||||||
# $FEDWIKI_DATA/config.json
|
FEDWIKI_COOKIE="$(create_password 30)$(create_password 30)$(create_password 30)"
|
||||||
|
fi
|
||||||
|
|
||||||
echo '[Unit]' > /etc/systemd/system/fedwiki.service
|
echo '[Unit]' > /etc/systemd/system/fedwiki.service
|
||||||
echo 'Description=Fedwiki Decentralized video streaming platform' >> /etc/systemd/system/fedwiki.service
|
echo 'Description=Fedwiki Decentralized video streaming platform' >> /etc/systemd/system/fedwiki.service
|
||||||
|
@ -408,7 +418,7 @@ function install_fedwiki {
|
||||||
echo 'User=fedwiki' >> /etc/systemd/system/fedwiki.service
|
echo 'User=fedwiki' >> /etc/systemd/system/fedwiki.service
|
||||||
echo 'Group=fedwiki' >> /etc/systemd/system/fedwiki.service
|
echo 'Group=fedwiki' >> /etc/systemd/system/fedwiki.service
|
||||||
echo "WorkingDirectory=/usr/local/lib/node_modules/wiki" >> /etc/systemd/system/fedwiki.service
|
echo "WorkingDirectory=/usr/local/lib/node_modules/wiki" >> /etc/systemd/system/fedwiki.service
|
||||||
echo "ExecStart=/usr/local/bin/wiki --config $FEDWIKI_DATA/config.json --data $FEDWIKI_DATA -p $FEDWIKI_PORT" >> /etc/systemd/system/fedwiki.service
|
echo "ExecStart=/usr/local/bin/wiki --security_type friends --cookieSecret '${FEDWIKI_COOKIE}' --session_duration 7 --data $FEDWIKI_DATA -p $FEDWIKI_PORT" >> /etc/systemd/system/fedwiki.service
|
||||||
echo 'StandardOutput=syslog' >> /etc/systemd/system/fedwiki.service
|
echo 'StandardOutput=syslog' >> /etc/systemd/system/fedwiki.service
|
||||||
echo 'StandardError=syslog' >> /etc/systemd/system/fedwiki.service
|
echo 'StandardError=syslog' >> /etc/systemd/system/fedwiki.service
|
||||||
echo 'SyslogIdentifier=fedwiki' >> /etc/systemd/system/fedwiki.service
|
echo 'SyslogIdentifier=fedwiki' >> /etc/systemd/system/fedwiki.service
|
||||||
|
|
Loading…
Reference in New Issue