Skip to content

Commit ba33c85

Browse files
committed
Restart. Sketching out project structure and README/config
0 parents  commit ba33c85

25 files changed

+1753
-0
lines changed

.gitattributes

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.jkson text linguist-language=JavaScript -linguist-detectable
2+
3+
*.java text diff=java
4+
*.gradle text diff=java
5+
6+
*.html text diff=html
7+
*.html.hbs text diff=html
8+
9+
*.css text diff=css

.gitignore

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
*.class
2+
*.jar
3+
hs_err_pid*
4+
.project
5+
.settings
6+
.classpath
7+
.idea
8+
*.iml
9+
.*.kate-swp
10+
.swp.*
11+
nbbuild
12+
nbproject
13+
dist
14+
nbdist
15+
.nb-gradle
16+
.gradle
17+
/build/
18+
!/gradle/wrapper/gradle-wrapper.jar
19+
.directory
20+
Thumbs.db
21+
Thumbs.db:encryptable
22+
ehthumbs.db
23+
ehthumbs_vista.db
24+
[Dd]esktop.ini
25+
.DS_Store
26+
.AppleDouble
27+
.LSOverride
28+
._*
29+
*.orig
30+
*.tmp
31+
*~
32+
.Trash-*
33+
bin/
34+
run/
35+
work/

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "third-party/Jankson"]
2+
path = third-party/Jankson
3+
url = https://github.com/falkreon/Jankson.git

HEADER

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
This file is part of ionChannel.
2+
3+
ionChannel is free software: you can redistribute it and/or modify
4+
it under the terms of the GNU Affero General Public License as
5+
published by the Free Software Foundation, version 3.
6+
7+
ionChannel is distributed in the hope that it will be useful,
8+
but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
GNU Affero General Public License for more details.
11+
12+
You should have received a copy of the GNU Affero General Public License
13+
along with ionChannel. If not, see <https://www.gnu.org/licenses/>.

LICENSE

+661
Large diffs are not rendered by default.

README.md

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<img src="doc/logo.png" align="right" width="180px"/>
2+
3+
# ionChannel
4+
## Radically-Inclusive Jean Technology
5+
6+
ionChannel, or ionch for short, is (or at least, will be) an open-source lightweight federated
7+
microblogging server written in Java 11. By default it's configured for a single user or a few users
8+
to run a private instance out-of-the-box, but due to its modular nature it can support a wide range
9+
of backends, federation models, and instance-specific features and quirks.
10+
11+
The built-in ActivityPub plugin lets ionch talk to Mastodon, Pleroma, and many other existing
12+
servers on the fediverse. So you can think of ionch as an AP or Mastodon-compatible server.
13+
14+
## Name
15+
ionChannel is named after [ion channels](https://en.wikipedia.org/wiki/Ion_channel), essential and
16+
diverse parts of every living creature. ionch is simply a contraction of it. The i is lowercase to
17+
avoid confusion with a lowercase L in many sans-serif fonts, and also it just looks cooler.
18+
19+
ionChannel should always be written as camelCase, like in this README. ionch should always be
20+
written as all lowercase, even at the beginning of a sentence. If you absolutely must, "Ion Channel"
21+
is also an acceptable form of the name.
22+
23+
ionch is pronounced like "ion" (EYE-on) followed by the "-ch" in "crunch".
24+
25+
## Logo
26+
It's a flamingo[!](https://youtube.com/watch?v=rY-FJvRqK0E) A very stylized one, but a flamingo
27+
nonetheless. The beak, when rotated to be horizontal, additionally resembles a rectangularly speech
28+
bubble.
29+
30+
## Project Status
31+
ionChannel is a very early work-in-progress at this point. Progress is slow, but it is there.
32+
33+
## Why Java
34+
Java is an extremely mature and fast platform with an innumerable amount of person-hours poured into
35+
it. The OpenJ9 JVM we recommend has a long heritage beginning at IBM, and has been very thoroughly
36+
proven in server use cases, and is more than efficient enough to run on small boxes too.
37+
38+
As well, Java is a well-known language with a lot of good tooling available for it, and it is very
39+
easy to get one's feet wet with the language. As a high-level language, it also lacks the problems
40+
often run into with "low-level" languages like C such as buffer overflows and related memory
41+
corruption issues, which are *disastrous* with networked use cases.
42+
43+
We also choose to ban reflection and similar dynamic programming tricks, to make the codebase highly
44+
explorable with basic tools and basic knowledge of the language. Some other languages have dynamic
45+
programming paradigms at their core while additionally having poor or expensive tooling, making
46+
exploring such a project as an outsider an ordeal.
47+
48+
At no point do instance admins have to think about the fact ionChannel is written in Java; we bundle
49+
our releases as native executables and include a stripped-down version of OpenJ9. Only developers
50+
have to be aware of and use Java development tools.
51+
52+
## Goals
53+
54+
### Efficiency
55+
ionch should be as efficient as possible and run easily on a Raspberry Pi 2 or slower. The usage of
56+
Java and a modular plugin-based design facilitates this.
57+
58+
### Ease of Use
59+
It should be easy to get started with ionch, with as much as possible having sensible defaults and
60+
wizards being provided where defaults cannot be assumed.
61+
62+
### Extensibility
63+
As much of ionch as possible should be able to be extended, replaced, or removed. One size does not
64+
fit all, and monolithic servers, especially in the fediverse landscape, are simply a dead end.
65+
Instance admins should not have to maintain entire forks of the software just to add a couple
66+
tweaks.
67+
68+
## Social Pillars
69+
70+
### Safety and Respect
71+
There are ways to structure social media which are inherently unsafe or disrespectful:
72+
automated systems which are vulnerable to astroturfing and abuse-report abuse, pinning
73+
personally-identifying information on users or forcing them to use their legal names, etc.
74+
75+
Any suggestion or PR that puts users at risk or denies someone their dignity or identity will be
76+
rejected.
77+
78+
79+
### Inclusion and Approachability
80+
Without diverse voices like Lovelace and Turing, we would not have computers as we know them.
81+
Without people like Mary Jackson or Margaret Hamilton we wouldn't have made it to the moon.
82+
Social media might not be as groundbreaking as all that, but it has hard problems that no one
83+
person, nor any one kind of person, can solve. We'll need a bigger boat.
84+
85+
At every step, from ionch governance, to code, to distribution, to instance administration, to
86+
post moderation, to bug reporting and feature requests, we want to lower the bar to entry and
87+
give everyone's voice a chance to be heard.
88+
89+
90+
### Openness
91+
Not all open-source software is developed in the open. Some software just gets source pushes
92+
for point releases, accepts no PRs, and gives very little insight into how it was developed or
93+
the reasons behind its design choices.
94+
95+
The public repository for ionch is where it is developed. We welcome PRs, talk a lot about the
96+
development process right in the fediverse where it matters, and thrive on user and developer
97+
feedback.

build.gradle

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
plugins {
2+
id 'java'
3+
id 'eclipse'
4+
id 'net.minecrell.licenser' version '0.4.1'
5+
id 'com.github.johnrengelman.shadow' version '5.2.0'
6+
}
7+
8+
repositories {
9+
mavenCentral()
10+
maven {
11+
url "https://repo.unascribed.com"
12+
}
13+
}
14+
15+
sourceCompatibility = 11
16+
targetCompatibility = 11
17+
18+
dependencies {
19+
implementation project(':Jankson')
20+
21+
implementation 'com.google.guava:guava:28.2-jre'
22+
implementation 'com.playsawdust:toolbox:2.1.1'
23+
24+
implementation 'org.slf4j:slf4j-api:1.7.9'
25+
implementation 'com.unascribed:asyncsimplelog:4.6.0'
26+
implementation 'org.slf4j:log4j-over-slf4j:1.7.9'
27+
implementation 'org.slf4j:jul-to-slf4j:1.7.9'
28+
implementation 'org.slf4j:jcl-over-slf4j:1.7.9'
29+
30+
implementation 'org.eclipse.jetty:jetty-server:9.4.24.v20191120'
31+
32+
implementation 'org.jline:jline-terminal:3.13.3'
33+
implementation 'org.jline:jline-reader:3.13.3'
34+
implementation 'org.jline:jline-terminal-jansi:3.13.3'
35+
36+
implementation 'com.h2database:h2:1.4.200'
37+
38+
implementation 'com.github.spullara.mustache.java:compiler:0.9.6'
39+
}
40+
41+
license {
42+
header = file('HEADER')
43+
44+
include '**/*.java'
45+
}
46+
47+
shadowJar {
48+
manifest {
49+
attributes 'Main-Class': 'social.ionch.Bootstrap'
50+
}
51+
}

doc/logo.png

5.25 KB
Loading

gradle/wrapper/gradle-wrapper.jar

54.1 KB
Binary file not shown.
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Thu Aug 01 13:32:59 PDT 2019
2+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
3+
distributionBase=GRADLE_USER_HOME
4+
distributionPath=wrapper/dists
5+
zipStorePath=wrapper/dists
6+
zipStoreBase=GRADLE_USER_HOME

gradlew

+172
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
#!/usr/bin/env sh
2+
3+
##############################################################################
4+
##
5+
## Gradle start up script for UN*X
6+
##
7+
##############################################################################
8+
9+
# Attempt to set APP_HOME
10+
# Resolve links: $0 may be a link
11+
PRG="$0"
12+
# Need this for relative symlinks.
13+
while [ -h "$PRG" ] ; do
14+
ls=`ls -ld "$PRG"`
15+
link=`expr "$ls" : '.*-> \(.*\)$'`
16+
if expr "$link" : '/.*' > /dev/null; then
17+
PRG="$link"
18+
else
19+
PRG=`dirname "$PRG"`"/$link"
20+
fi
21+
done
22+
SAVED="`pwd`"
23+
cd "`dirname \"$PRG\"`/" >/dev/null
24+
APP_HOME="`pwd -P`"
25+
cd "$SAVED" >/dev/null
26+
27+
APP_NAME="Gradle"
28+
APP_BASE_NAME=`basename "$0"`
29+
30+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31+
DEFAULT_JVM_OPTS=""
32+
33+
# Use the maximum available, or set MAX_FD != -1 to use that value.
34+
MAX_FD="maximum"
35+
36+
warn ( ) {
37+
echo "$*"
38+
}
39+
40+
die ( ) {
41+
echo
42+
echo "$*"
43+
echo
44+
exit 1
45+
}
46+
47+
# OS specific support (must be 'true' or 'false').
48+
cygwin=false
49+
msys=false
50+
darwin=false
51+
nonstop=false
52+
case "`uname`" in
53+
CYGWIN* )
54+
cygwin=true
55+
;;
56+
Darwin* )
57+
darwin=true
58+
;;
59+
MINGW* )
60+
msys=true
61+
;;
62+
NONSTOP* )
63+
nonstop=true
64+
;;
65+
esac
66+
67+
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68+
69+
# Determine the Java command to use to start the JVM.
70+
if [ -n "$JAVA_HOME" ] ; then
71+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72+
# IBM's JDK on AIX uses strange locations for the executables
73+
JAVACMD="$JAVA_HOME/jre/sh/java"
74+
else
75+
JAVACMD="$JAVA_HOME/bin/java"
76+
fi
77+
if [ ! -x "$JAVACMD" ] ; then
78+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79+
80+
Please set the JAVA_HOME variable in your environment to match the
81+
location of your Java installation."
82+
fi
83+
else
84+
JAVACMD="java"
85+
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86+
87+
Please set the JAVA_HOME variable in your environment to match the
88+
location of your Java installation."
89+
fi
90+
91+
# Increase the maximum file descriptors if we can.
92+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93+
MAX_FD_LIMIT=`ulimit -H -n`
94+
if [ $? -eq 0 ] ; then
95+
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96+
MAX_FD="$MAX_FD_LIMIT"
97+
fi
98+
ulimit -n $MAX_FD
99+
if [ $? -ne 0 ] ; then
100+
warn "Could not set maximum file descriptor limit: $MAX_FD"
101+
fi
102+
else
103+
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104+
fi
105+
fi
106+
107+
# For Darwin, add options to specify how the application appears in the dock
108+
if $darwin; then
109+
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110+
fi
111+
112+
# For Cygwin, switch paths to Windows format before running java
113+
if $cygwin ; then
114+
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115+
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116+
JAVACMD=`cygpath --unix "$JAVACMD"`
117+
118+
# We build the pattern for arguments to be converted via cygpath
119+
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120+
SEP=""
121+
for dir in $ROOTDIRSRAW ; do
122+
ROOTDIRS="$ROOTDIRS$SEP$dir"
123+
SEP="|"
124+
done
125+
OURCYGPATTERN="(^($ROOTDIRS))"
126+
# Add a user-defined pattern to the cygpath arguments
127+
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128+
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129+
fi
130+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
131+
i=0
132+
for arg in "$@" ; do
133+
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134+
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135+
136+
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137+
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138+
else
139+
eval `echo args$i`="\"$arg\""
140+
fi
141+
i=$((i+1))
142+
done
143+
case $i in
144+
(0) set -- ;;
145+
(1) set -- "$args0" ;;
146+
(2) set -- "$args0" "$args1" ;;
147+
(3) set -- "$args0" "$args1" "$args2" ;;
148+
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149+
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150+
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151+
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152+
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153+
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154+
esac
155+
fi
156+
157+
# Escape application args
158+
save ( ) {
159+
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160+
echo " "
161+
}
162+
APP_ARGS=$(save "$@")
163+
164+
# Collect all arguments for the java command, following the shell quoting and substitution rules
165+
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166+
167+
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168+
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169+
cd "$(dirname "$0")"
170+
fi
171+
172+
exec "$JAVACMD" "$@"

0 commit comments

Comments
 (0)