Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/sh

# checks for filenames with non-ASCII characters
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=$(git hash-object -t tree /dev/null)
fi

# If you want to allow non-ASCII filenames set this variable to true.
allownonascii=$(git config --type=bool hooks.allownonascii)

# Redirect output to stderr.
exec 1>&2

# Cross platform projects tend to avoid non-ASCII filenames; prevent
# them from being added to the repository. We exploit the fact that the
# printable range starts at the space character and ends with tilde.
if [ "$allownonascii" != "true" ] &&
# Note that the use of brackets around a tr range is ok here, (it's
# even required, for portability to Solaris 10's /usr/bin/tr), since
# the square bracket bytes happen to fall in the designated range.
test $(git diff-index --cached --name-only --diff-filter=A -z $against |
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
then
cat <<\EOF
Error: Attempt to add a non-ASCII file name.

This can cause problems if you want to work with people on other platforms.

To be portable it is advisable to rename the file.

If you know what you are doing you can disable this check using:

git config hooks.allownonascii true
EOF
exit 1
fi

# runs pseudo-lint on staged files
git diff --name-only --cached | grep -E ".*\.(ex|exs)$" | xargs mix format --check-formatted

PSEUDOLINT_STATUS=$?
if [ "$PSEUDOLINT_STATUS" != "0" ]; then
echo 'run `mix format` then use `git add` to restage the formatted file'
exit $PSEUDOLINT_STATUS
fi
8 changes: 4 additions & 4 deletions .github/workflows/hc-pkgcaller.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: hc-pkg
on:
workflow_dispatch:
workflow_dispatch:

jobs:
hcpkgrelease:
uses: mozilla/hubs-ops/.github/workflows/HcPkgPreReleaseGitops.yaml@master
uses: Hubs-Foundation/hubs-ops/.github/workflows/HcPkgPreReleaseGitops.yaml@master
with:
main: master
releaseTrackingBranch: polycosm
qaTestBranch: qa-test
qaTestBranch: qa-test
31 changes: 24 additions & 7 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,17 @@ jobs:
- elixir: '1.17'
otp: '27.3'

- elixir: '1.18'
otp: '25.1'
- elixir: '1.18'
otp: '28.0'

os:
- 'ubuntu-22.04'
- 'ubuntu-24.04'

exclude:
- versions: # current
- versions: # current versions; already tested above
elixir: '1.16'
otp: '25.3'

Expand Down Expand Up @@ -142,23 +147,35 @@ jobs:


pseudo-lint:
continue-on-error: true # TODO: use `mix format` & check in files, then set this false
continue-on-error: false # `mix format` MUST be run before committing
strategy:
fail-fast: false
matrix:
versions:
- elixir: '1.14'
otp: '24.3'

- elixir: '1.15'
otp: '24.3'
# - elixir: '1.14'
# otp: '24.3'
#
# - elixir: '1.15'
# otp: '24.3'

- elixir: '1.16'
otp: '24.3'

# - elixir: '1.16'
# otp: '25.1'

- elixir: '1.17'
otp: '25.3'

# - elixir: '1.18'
# otp: '25.1'

# - elixir: '1.17'
# otp: '25.0'

- elixir: '1.18'
otp: '28.0'

runs-on: 'ubuntu-24.04'

steps:
Expand Down
12 changes: 3 additions & 9 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
# Community Participation Guidelines

This repository is governed by Mozilla's code of conduct and etiquette guidelines.
This repository is governed by the Hubs Foundation's code of conduct and etiquette guidelines.
For more details, please read the
[Mozilla Community Participation Guidelines](https://www.mozilla.org/about/governance/policies/participation/).
[Hubs Community Participation Guidelines](https://github.com/Hubs-Foundation/hubs/blob/master/CODE_OF_CONDUCT.md).

## How to Report
For more information on how to report violations of the Community Participation Guidelines, please read our '[How to Report](https://www.mozilla.org/about/governance/policies/participation/reporting/)' page.
For more information on how to report violations of the Community Participation Guidelines, please read our '[How to Report](https://github.com/Hubs-Foundation/hubs/blob/master/CODE_OF_CONDUCT.md)' page.

<!--
## Project Specific Etiquette

In some cases, there will be additional project etiquette i.e.: (https://bugzilla.mozilla.org/page.cgi?id=etiquette.html).
Please update for your project.
-->
8 changes: 4 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pipeline {
stage('build') {
steps {
sh '''
/usr/bin/script --return -c \\\\"sudo /usr/bin/hab-docker-studio -k mozillareality run /bin/bash scripts/build.sh\\\\" /dev/null
/usr/bin/script --return -c \\\\"sudo /usr/bin/hab-docker-studio -k Hubs-Foundation run /bin/bash scripts/build.sh\\\\" /dev/null
'''

sh 'sudo /usr/bin/hab-pkg-upload $(ls -t results/*.hart | head -n 1)'
Expand Down Expand Up @@ -58,9 +58,9 @@ pipeline {
def text = (
"*<http://localhost:8080/job/${jobName}/${buildNumber}|#${buildNumber}>* *${jobName}* " +
"<https://bldr.habitat.sh/#/pkgs/${packageIdent}|${packageIdent}>\n" +
"<https://github.com/mozilla/reticulum/commit/$gitSha|$gitSha> " +
"<https://github.com/Hubs-Foundation/reticulum/commit/$gitSha|$gitSha> " +
"Reticulum -> ${retPoolIcon} `${retPool}`: ```${gitSha} ${gitMessage}```\n" +
"<https://smoke-hubs.mozilla.com/0zuesf6c6mf/smoke-test?required_ret_version=${retVersion}&required_ret_pool=${retPool}|Smoke Test> - to push:\n" +
"<https://smoke-hubs.hubsfoundation.org/0zuesf6c6mf/smoke-test?required_ret_version=${retVersion}&required_ret_pool=${retPool}|Smoke Test> - to push:\n" +
"`/mr ret deploy ${retVersion} ${retPool}`"
)
sendSlackMessage(text, "#mr-builds", ":gift:", slackURL);
Expand All @@ -73,7 +73,7 @@ pipeline {
def text = (
"*<http://localhost:8080/job/${jobName}/${buildNumber}|#${buildNumber}>* *${jobName}* " +
"<https://bldr.reticulum.io/#/pkgs/${packageIdent}|${packageIdent}>\n" +
"<https://github.com/mozilla/reticulum/commit/$gitSha|$gitSha> " +
"<https://github.com/Hubs-Foundation/reticulum/commit/$gitSha|$gitSha> " +
"${packageIdent} built and uploaded - to promote:\n" +
"`/mr promote-ret-qa ${packageIdent}`"
)
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Reticulum
Note: **Due to our small team size, we don't support setting up Reticulum locally due to restrictions on developer credentials. Although relatively difficult and new territory, you're welcome to set up this up yourself. In addition to running Reticulum locally, you'll need to also run [Hubs](https://github.com/mozilla/hubs) and [Dialog](https://github.com/mozilla/dialog) locally because the developer Dialog server is locked down and your local Reticulum will not connect properly)**
Note: **Due to our small team size, we don't support setting up Reticulum locally due to restrictions on developer credentials. Although relatively difficult and new territory, you're welcome to set up this up yourself. In addition to running Reticulum locally, you'll need to also run [Hubs](https://github.com/Hubs-Foundation/hubs) and [Dialog](https://github.com/Hubs-Foundation/dialog) locally because the developer Dialog server is locked down and your local Reticulum will not connect properly)**

Reference [this discussion thread](https://github.com/mozilla/hubs/discussions/3323) for more information.
Reference [this discussion thread](https://github.com/Hubs-Foundation/hubs/discussions/3323) for more information.

A hybrid game networking and web API server, focused on Social Mixed Reality.

Expand Down Expand Up @@ -37,7 +37,14 @@ https://hexdocs.pm/phoenix/installation.html

https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html

### 2. Setup Reticulum:
### 2. Enable git hooks

Run
```shell
. scripts/setup.sh
```

### 3. Setup Reticulum:

Run the following commands at the root of the reticulum directory:

Expand All @@ -48,7 +55,7 @@ Run the following commands at the root of the reticulum directory:
- If you receive an error that the `ret_dev` database does not exist, (using psql again) enter `create database ret_dev;`
3. From the project directory `mkdir -p storage/dev`

### 3. Start Reticulum
### 4. Start Reticulum

Run `scripts/run.sh` if you have the hubs secret repo cloned. Otherwise `iex -S mix phx.server`

Expand Down Expand Up @@ -79,7 +86,7 @@ Example:
Clone the Hubs repository and install the npm dependencies.

```bash
git clone https://github.com/mozilla/hubs.git
git clone https://github.com/Hubs-Foundation/hubs.git
cd hubs
npm ci
```
Expand Down
2 changes: 1 addition & 1 deletion bin/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bin/
====
These scripts allow you to run common commands inside the
[Hubs Compose](https://github.com/mozilla/hubs-compose) Reticulum container
[Hubs Compose](https://github.com/Hubs-Foundation/hubs-compose) Reticulum container
from your own shell
4 changes: 2 additions & 2 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ config :ret, RetWeb.Plugs.AddCSP,
font_src: asset_hosts,
style_src: asset_hosts,
connect_src:
"https://#{host}:8080 https://sentry.prod.mozaws.net #{asset_hosts} #{websocket_hosts} https://www.mozilla.org",
"https://#{host}:8080 #{asset_hosts} #{websocket_hosts} https://hubsfoundation.org",
img_src: asset_hosts,
media_src: asset_hosts,
manifest_src: asset_hosts
Expand All @@ -174,7 +174,7 @@ config :ret, Ret.Guardian,
ttl: {12, :weeks}

config :web_push_encryption, :vapid_details,
subject: "mailto:admin@mozilla.com",
subject: "mailto:admin@hubsfoundation.org",
public_key:
"BAb03820kHYuqIvtP6QuCKZRshvv_zp5eDtqkuwCUAxASBZMQbFZXzv8kjYOuLGF16A3k8qYnIN10_4asB-Aw7w",
# This config value is for local development only.
Expand Down
2 changes: 1 addition & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ config :sentry,

config :ret, Ret.Repo.Migrations.AdminSchemaInit, postgrest_password: "password"
config :ret, Ret.Locking, lock_timeout_ms: 1000 * 60 * 15
config :ret, Ret.Account, admin_email: "admin@mozilla.com"
config :ret, Ret.Account, admin_email: "admin@hubsfoundation.org"

config :ret, RetWeb.HubChannel, enable_terminate_actions: false

Expand Down
10 changes: 5 additions & 5 deletions habitat/plan.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pkg_name=reticulum
pkg_origin=mozillareality
pkg_origin=hubsfoundation
pkg_version="1.0.1"
pkg_maintainer="Mozilla Mixed Reality <mixreality@mozilla.com>"
pkg_upstream_url="http://github.com/mozilla/reticulum"
pkg_maintainer="Hubs Foundation <info@hubsfoundation.org>"
pkg_upstream_url="http://github.com/Hubs-Foundation/reticulum"
pkg_license=('MPL-2.0')
pkg_deps=(
core/coreutils/8.30/20190115012313
Expand All @@ -12,8 +12,8 @@ pkg_deps=(
pkg_build_deps=(
core/coreutils/8.30/20190115012313
core/git/2.23.0
mozillareality/erlang/23.3.4.18
mozillareality/elixir/1.14.3
hubsfoundation/erlang/23.3.4.18
hubsfoundation/elixir/1.14.3
)
pkg_exports=(
[port]=phx.port
Expand Down
3 changes: 1 addition & 2 deletions lib/ret/media_resolver.ex
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ defmodule Ret.MediaResolver do
|> resolved()}
end

# Necessary short circuit around google.com root_host to skip YT-DL check for Poly
def resolve(%MediaResolverQuery{url: %URI{host: "api.icosa.gallery"}} = query, root_host) do
rate_limited_resolve(query, root_host, @icosa_rate_limit, fn ->
resolve_non_video(query, root_host)
Expand Down Expand Up @@ -338,7 +337,7 @@ defmodule Ret.MediaResolver do

defp resolve_non_video(
%MediaResolverQuery{
url: %URI{host: "api.icosa.gallery", path: "/v1/assets/" <> asset_id} = uri
url: %URI{host: "api.icosa.gallery", path: "/v1/assets/" <> asset_id}
},
"icosa.gallery"
) do
Expand Down
2 changes: 1 addition & 1 deletion lib/ret/storage_used.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ defmodule Ret.StorageUsed do
line = lines |> String.split("\n") |> Enum.at(1)

{:ok, [_FS, _kb, used, _Avail], _RestStr} =
:io_lib.fread('~s~d~d~d', line |> to_charlist)
:io_lib.fread(~c"~s~d~d~d", line |> to_charlist)

{:ok, [{:storage_used, used}]}

Expand Down
2 changes: 1 addition & 1 deletion lib/ret_web/controllers/api/v1/slack_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule RetWeb.Api.V1.SlackController do
plug RetWeb.Plugs.RateLimit

@slack_api_base "https://slack.com"
@help_prefix "Hi! I'm the Hubs bot. I connect Slack channels with rooms on Hubs (https://hubs.mozilla.com/). Type `/hubs help` for more information."
@help_prefix "Hi! I'm the Hubs bot. I connect Slack channels with rooms on Hubs (https://hubsfoundation.org/). Type `/hubs help` for more information."
@help_text "Command reference:\n\n" <>
"🦆 `/hubs help` - Shows the help text you're reading right now.\n" <>
"🦆 `/hubs create` - Creates a default Hubs room and puts its URL into the channel topic. " <>
Expand Down
4 changes: 2 additions & 2 deletions lib/ret_web/controllers/api/v1/whats_new_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ defmodule RetWeb.Api.V1.WhatsNewController do
do: []

defp fetch_pull_requests("hubs" = _source, cursor, token),
do: fetch_pull_requests("mozilla", "hubs", cursor, token)
do: fetch_pull_requests("Hubs-Foundation", "hubs", cursor, token)

defp fetch_pull_requests("spoke" = _source, cursor, token),
do: fetch_pull_requests("mozilla", "spoke", cursor, token)
do: fetch_pull_requests("Hubs-Foundation", "spoke", cursor, token)

defp fetch_pull_requests(_source, _cursor, _token),
do: []
Expand Down
2 changes: 1 addition & 1 deletion lib/ret_web/controllers/page_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ defmodule RetWeb.PageController do
make_reverse_proxy_request(conn, url, body, is_head, opts)
end

{:ok, %HTTPoison.Response{status_code: status_code}} ->
{:ok, %HTTPoison.Response{}} ->
# Not a redirect, use ReverseProxyPlug for the actual request
make_reverse_proxy_request(conn, url, body, is_head, opts)

Expand Down
6 changes: 1 addition & 5 deletions lib/ret_web/templates/page/index.html.eex
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<br>
<div class="center">
<a href="https://blog.mozvr.com/enabling-the-social-3d-web/">Read about Mozilla's Social Mixed Reality</a>
</div>
<br>
<div class="center">
<a href="https://github.com/mozilla/reticulum">https://github.com/mozilla/reticulum</a>
<a href="https://github.com/Hubs-Foundation/reticulum">https://github.com/Hubs-Foundation/reticulum</a>
</div>
<br>

Expand Down
Binary file modified priv/static/spoke-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pushd "$DIR/.."

pkg_test_deps=(
core/git
mozillareality/postgresql
hubsfoundation/postgresql
)

export LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
Expand All @@ -34,7 +34,7 @@ ln -s "$(hab pkg path core/coreutils)/bin/env" /usr/bin/env
deps="$(join_by " " "${pkg_deps[@]}") $(join_by " " "${pkg_build_deps[@]}") $(join_by " " "${pkg_test_deps[@]}")"

hab pkg install -b $deps
hab svc load mozillareality/postgresql &
hab svc load hubsfoundation/postgresql &
while ! [ -f /hab/svc/postgresql/PID ] ; do sleep 1; done

MIX_ENV=test
Expand All @@ -47,7 +47,7 @@ TEST_EXIT_CODE=$?

echo "Test and build exit code: $TEST_EXIT_CODE"

hab svc unload mozillareality/postgresql
hab svc unload hubsfoundation/postgresql
popd

exit $TEST_EXIT_CODE
Loading