Commit 784ff0b6 authored by Lukas Matt's avatar Lukas Matt

Initial commit

# Federation Tests
This repository is about automating federation unit tests.
If you want to use travis, this could look like following:
sudo: required
- docker
- postgresql
- docker run --name=d1 -e DATABASE=d1 -e PORT=3000 -p 3000:3000 --net=host -d thefederation/testing_diaspora:latest
- curl http://localhost:3000/hcard/users/2d4fa7e0e5380135fa593c970e8692d1
## Projects
For reference implementation you can checkout following projects:
* [](
FROM thefederation/diaspora_image:v1.0.0
COPY post_like_comment.rb /diaspora/post_like_comment.rb
COPY share_with.rb /diaspora/share_with.rb
COPY schema.sql /diaspora/schema.sql
CMD ["/bin/bash", "/"]
FROM debian:jessie
MAINTAINER Lukas Matt <>
ENV DEBIAN_FRONTEND noninteractive
ENV RAILS_ENV production
RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get -y install libreadline-dev cmake build-essential libssl-dev libcurl4-openssl-dev libxml2-dev libxslt-dev imagemagick ghostscript curl libmagickwand-dev git libpq-dev redis-server nodejs postgresql-client
RUN mkdir /tmp/ruby && cd /tmp/ruby \
&& curl -L --progress | tar xz \
&& cd ruby-2.4.2 \
&& ./configure --disable-install-rdoc \
&& make -j2 \
&& make install
RUN gem install bundler
RUN git clone --depth 1
WORKDIR /diaspora
RUN cp config/database.yml.example config/database.yml \
&& cp config/diaspora.yml.example config/diaspora.yml
RUN bundle install --with postgresql
RUN sed -i "s/#rails_environment:.*/rails_environment: 'production'/" config/diaspora.yml
RUN sed -i "s/#url:/url:/" config/diaspora.yml
RUN sed -i "0,/#certificate_authorities/ s/#certificate_authorities:/certificate_authorities:/" config/diaspora.yml
RUN bundle exec rake db:create db:migrate assets:precompile
# Building
Requires a local postgres database then run:
docker build --network=host -t thefederation/diaspora_image:<tag> .
user = User.find_by(username: ARGV[0])
publicPost =
status_message: {
text: "StatusMessageCreationService publicPost"
public: true
privatePost =
status_message: {
text: "StatusMessageCreationService privatePost"
public: false,
aspect_ids: [1]
), "publicComment"), "privateComment")
This source diff could not be displayed because it is too large. You can view the blob instead.
user = User.find_by(username: ARGV[0])
person = Person.find_by(diaspora_handle: ARGV[1])
aspect = Aspect.find_by(id: 1)
user.share_with(person, aspect)
cd /diaspora \
&& sed -i "s/USERNAME/$DATABASE/g" schema.sql \
&& sed -i "s/GUID/$DATABASE/" schema.sql \
&& sed -i "s/PORT/$PORT/g" schema.sql \
&& sed -i "s/database: diaspora_development/database: $DATABASE/" config/database.yml \
&& sed -i "s/url: \".*\"/url: \"http:\/\/localhost:$PORT\/\"/" config/diaspora.yml \
&& bundle exec rails db:migrate \
&& psql -U postgres -h localhost -p 5432 -d $DATABASE < schema.sql \
&& ./script/server
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment