-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a4051ad
Showing
486 changed files
with
57,467 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/data/ | ||
/data-ui/ | ||
/data2/ | ||
/.idea/ | ||
/.gradle/ | ||
./jpb/ | ||
/out/ | ||
/build/ | ||
.xeres.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project version="4"> | ||
<component name="PersistenceUnitSettings"> | ||
<persistence-units> | ||
<persistence-unit name="Default"> | ||
<packages> | ||
<package value="io.xeres.app"/> | ||
</packages> | ||
</persistence-unit> | ||
</persistence-units> | ||
</component> | ||
</project> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
# Xeres | ||
|
||
This is an attempted reimplementation of [Retroshare](https://retroshare.cc) in Java. | ||
|
||
## Supported platforms | ||
|
||
- Windows (x86_64) | ||
- Linux (x86_64) | ||
- MacOS (x86_64) _untested_ | ||
|
||
## Build requirements | ||
|
||
- Java 17 | ||
|
||
## Features | ||
|
||
- [AES-NI](https://en.wikipedia.org/wiki/AES_instruction_set) support | ||
- [JavaFX](https://openjfx.io/) UI | ||
- Web UI | ||
- High concurrency | ||
|
||
## Download | ||
|
||
https://xeres.io | ||
|
||
## How to run | ||
|
||
##### IntelliJ IDEA Ultimate | ||
|
||
It is recommended to run the _XeresApplication_ Spring Boot configuration which is the most convenient and fastest way. | ||
Just make sure to configure it in the following way: | ||
|
||
Select _Edit Configurations..._ of the _XeresApplication_ Spring Boot configuration. | ||
|
||
Put the following _VM options_: | ||
|
||
-ea -Djava.net.preferIPv4Stack=true | ||
|
||
And the following _Active profiles_: | ||
|
||
dev | ||
|
||
Optionally, for faster build/test turnarounds you can add in the _program arguments_: | ||
|
||
--fast-shutdown | ||
|
||
Then just run the _XeresApplication_ Spring Boot configuration. | ||
|
||
##### IntelliJ Community Edition | ||
|
||
Run the Gradle ``bootRun`` target. It's in the top right _Gradle_ panel, Tasks / application. It's already preconfigured. | ||
|
||
(This way also works with IntelliJ IDEA Ultimate but you'll miss some extras like colored debug output and faster launch) | ||
|
||
##### Command line | ||
|
||
###### Windows | ||
|
||
gradlew.bat | ||
|
||
###### Linux | ||
|
||
./gradlew | ||
|
||
To pass Xeres arguments, just use the args feature, ie. | ||
|
||
./gradlew bootRun --args="--no-gui --fast-shutdown" | ||
|
||
(Use ``--help`` to know all arguments) | ||
|
||
## How to setup the WebUI | ||
|
||
_Note: the webui is currently nonfunctional._ | ||
|
||
Run the gradle tasks ``installAngular`` (if you don't already have Angular installed) then ``buildAngular``. The later will create the needed files that will be served by Xeres on ``localhost:1066``. | ||
|
||
## Database debugging | ||
|
||
With IntelliJ Ultimate, create the following Database connection with the built-in Datagrip client (aka the _Database_ tool window) | ||
|
||
- Connection type: Embedded | ||
- Driver: H2 | ||
- Path: select ``./data/userdata.mv.db``. If the file is not there, run Xeres once. | ||
- Authentication: User & Password | ||
- User: ``sa`` | ||
- There's no password | ||
|
||
## Misc | ||
|
||
The project was started on 2019-10-30. | ||
|
||
##### How to write proper git commit messages | ||
|
||
https://chris.beams.io/posts/git-commit/ | ||
|
||
##### Branching model | ||
|
||
The current plan is to use *master* for everything. Use a feature branch to work on a feature (ie. feature/165 if there's a ticket). Once it's ready, have someone review it then merge to master. | ||
|
||
Releases will use tags and release branches if further fixes are needed. | ||
|
||
https://reallifeprogramming.com/git-process-that-works-say-no-to-gitflow-50bf2038ccf7 | ||
|
||
## Useful tasks | ||
|
||
##### Cleaning the build directory | ||
|
||
run the ``clean`` task | ||
|
||
##### Cleaning the Angular generated directory | ||
|
||
run the ``cleanAngular`` task | ||
|
||
##### Upgrading Gradle | ||
|
||
- change the version in _build.gradle_ in the _wrapper_ section | ||
- run the ``wrapper`` task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/build/ | ||
/out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
/* | ||
* Copyright (c) 2019-2021 by David Gerber - https://zapek.com | ||
* | ||
* This file is part of Xeres. | ||
* | ||
* Xeres is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Xeres is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Xeres. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
plugins { | ||
id 'org.springframework.boot' | ||
id 'org.flywaydb.flyway' | ||
id 'jacoco' | ||
id 'org.panteleyev.jpackageplugin' | ||
} | ||
|
||
flyway { | ||
url = "jdbc:h2:file:${project.rootDir}/data/userdata" | ||
user = 'sa' | ||
} | ||
|
||
bootJar { | ||
manifest { | ||
attributes 'Implementation-Version': "${project.version}" | ||
attributes 'Implementation-Title': "${project.name}" | ||
} | ||
} | ||
|
||
bootRun { | ||
bootRun.jvmArgs "-ea", "-Djava.net.preferIPv4Stack=true", "-Dfile.encoding=UTF-8" | ||
bootRun.systemProperty 'spring.profiles.active', 'dev' | ||
} | ||
|
||
springBoot { | ||
buildInfo { | ||
properties { | ||
time = null // make the build repeatable | ||
name = rootProject.name | ||
} | ||
} | ||
} | ||
|
||
editorconfig { | ||
includes = ['src/**'] | ||
excludes = ['src/test/resources/upnp/**', 'src/main/webapp/dist/**', 'src/main/webapp/node_modules/**'] | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
test.jvmArgs "-ea", "-Djava.net.preferIPv4Stack=true", "-Dfile.encoding=UTF-8" | ||
} | ||
|
||
// XXX: hack to make IntelliJ actually build properly. Maybe report to JetBrains | ||
processResources { | ||
dependsOn ":ui:processResources" | ||
dependsOn ":webui:processResources" | ||
} | ||
|
||
task copyInstaller(type: Copy) { | ||
from "${parent.rootDir}/installer" | ||
include "*" | ||
into "${project.buildDir}/${project.libsDirName}" | ||
} | ||
|
||
bootBuildImage { | ||
imageName = "zapek/${rootProject.name.toLowerCase()}:${project.version}" | ||
} | ||
|
||
jpackage { | ||
dependsOn "bootJar" | ||
dependsOn "copyInstaller" | ||
appName = parent.project.name | ||
vendor = "David Gerber" | ||
copyright = "Copyright 2019-2021 All Rights Reserved" | ||
appDescription = "Xeres P2P Software" | ||
input = "${project.buildDir}/${project.libsDirName}" | ||
destination = "${project.buildDir}/dist" | ||
mainClass = "org.springframework.boot.loader.JarLauncher" | ||
mainJar = "app-${project.version}.jar" | ||
icon = "${parent.rootDir}/icon.ico" | ||
licenseFile = "${parent.rootDir}/LICENSE" | ||
javaOptions = ['-Djava.net.preferIPv4Stack=true', '-Dfile.encoding=UTF-8', '-splash:$APPDIR/startup.jpg'] | ||
windows { | ||
winMenu = true | ||
winPerUserInstall = true | ||
winDirChooser = true | ||
winMenuGroup = "Xeres" | ||
} | ||
linux { | ||
linuxShortcut = true | ||
} | ||
} | ||
|
||
dependencies { | ||
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' | ||
implementation project(':common') | ||
implementation project(':ui') | ||
implementation project(':webui') | ||
implementation 'org.springframework.boot:spring-boot-starter-json' | ||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
implementation 'org.springframework.boot:spring-boot-starter-validation' | ||
runtimeOnly 'com.h2database:h2:1.4.200' | ||
implementation 'org.springframework.boot:spring-boot-starter-web' | ||
implementation 'org.springframework.boot:spring-boot-starter-websocket' | ||
implementation 'org.springframework.boot:spring-boot-starter-actuator' | ||
implementation 'org.springframework.boot:spring-boot-starter-webflux' // to bring in netty | ||
implementation "org.flywaydb:flyway-core:$flywayVersion" | ||
implementation "org.bouncycastle:bcpg-jdk15on:$bouncycastleVersion" | ||
implementation "org.bouncycastle:bcpkix-jdk15on:$bouncycastleVersion" | ||
implementation 'org.jsoup:jsoup:1.14.2' | ||
implementation 'com.github.peter-gergely-horvath:windpapi4j:1.0' | ||
implementation 'net.harawata:appdirs:1.2.1' | ||
implementation 'com.github.atomashpolskiy:bt-dht:1.9' | ||
implementation "org.apache.commons:commons-lang3:$apacheCommonsLangVersion" | ||
implementation "org.apache.commons:commons-collections4:$apacheCommonsCollectionsVersion" | ||
implementation "org.springdoc:springdoc-openapi-ui:$springOpenApi" | ||
implementation 'io.netty:netty-tcnative-boringssl-static:2.0.43.Final' | ||
developmentOnly 'org.springframework.boot:spring-boot-devtools' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (c) 2019-2021 by David Gerber - https://zapek.com | ||
* | ||
* This file is part of Xeres. | ||
* | ||
* Xeres is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Xeres is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Xeres. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package io.xeres.app; | ||
|
||
import io.xeres.app.application.environment.CommandArgument; | ||
import io.xeres.app.application.environment.HostVariable; | ||
import io.xeres.common.properties.StartupProperties; | ||
import io.xeres.ui.UiStarter; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
import static io.xeres.app.application.environment.Cloud.isRunningOnCloud; | ||
|
||
@SpringBootApplication(scanBasePackageClasses = {io.xeres.app.XeresApplication.class, io.xeres.ui.UiStarter.class}) | ||
public class XeresApplication | ||
{ | ||
private static final Logger log = LoggerFactory.getLogger(XeresApplication.class); | ||
|
||
public static void main(String[] args) | ||
{ | ||
HostVariable.parse(); | ||
CommandArgument.parse(args); | ||
|
||
if (isRunningOnCloud() || !StartupProperties.getBoolean(StartupProperties.Property.UI, true)) | ||
{ | ||
log.info("no gui mode"); | ||
SpringApplication.run(XeresApplication.class, args); | ||
} | ||
else | ||
{ | ||
log.info("gui mode"); | ||
UiStarter.start(XeresApplication.class, args); // this starts spring as well | ||
} | ||
} | ||
|
||
public static boolean isRemoteUiClient() | ||
{ | ||
return "none".equals(System.getProperty("spring.main.web-application-type")); | ||
} | ||
} |
Oops, something went wrong.