Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove branded assets #49

Merged
merged 9 commits into from
Oct 18, 2023
Merged
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Example contents for `config.json`:
{
"SERVER_URL": "https://server.sourcify-integration.hedera-devops.com",
"REPOSITORY_SERVER_URL": "https://repository.sourcify-integration.hedera-devops.com",
"HASHSCAN_URL": "https://hashscan.io",
"EXPLORER_URL": "http://localhost:8080",
"REMOTE_IMPORT": false,
"GITHUB_IMPORT": false,
"CONTRACT_IMPORT": false,
Expand All @@ -123,7 +123,7 @@ The following properties can be provided in config.json
|-------------------------|------------------------------------------------------------------------------|
| `SERVER_URL` | URL of the server (from outside the cluster). |
| `REPOSITORY_SERVER_URL` | HTTP port exposed by container |
| `HASHSCAN_URL` | URL of HashScan |
| `EXPLORER_URL` | URL of the mirror-node explorer |
| `REMOTE_IMPORT` | Flag to activate mode "Import from remote" |
| `GITHUB_IMPORT` | Flag to activate mode "Import from GitHub" |
| `CONTRACT_IMPORT` | Flag to activate mode "Import from contract's metadata" |
Expand Down
20 changes: 10 additions & 10 deletions charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ serverRepository:
## Configurations for the server-repository containers
config:
REPOSITORY_PATH: "/data"
SERVER_URL: "http://sourcify-server:5555"
REPOSITORY_SERVER_URL: "http://sourcify-repository"
SERVER_URL: "http://127.0.0.1:5555"
REPOSITORY_SERVER_URL: "http://127.0.0.1:10000"
TESTING: true
NODE_ENV: "development"
UI_DOMAIN_NAME: sourcify.example.com
UI_DOMAIN_NAME: verify.example.com
repository:
{
"SERVER_URL": "http://sourcify-server:5555",
"REPOSITORY_SERVER_URL": "http://sourcify-repository:10000",
"HASHSCAN_URL": "http://127.0.0.1:8080",
"SERVER_URL": "http://127.0.0.1:5555",
"REPOSITORY_SERVER_URL": "http://127.0.0.1:10000",
"EXPLORER_URL": "http://127.0.0.1:8080",
}

ui:
Expand Down Expand Up @@ -141,11 +141,11 @@ ui:
## Configurations for the UI container
config:
{
"SERVER_URL": "http://sourcify-server:5555",
"REPOSITORY_SERVER_URL": "http://sourcify-repository:10000",
"HASHSCAN_URL": "http://127.0.0.1:8080",
"SERVER_URL": "http://127.0.0.1:5555",
"REPOSITORY_SERVER_URL": "http://127.0.0.1:10000",
"EXPLORER_URL": "http://127.0.0.1:8080",
}

## Pod environment variables for UI
env:
UI_DOMAIN_NAME: "sourcify.example.com"
UI_DOMAIN_NAME: "verify.example.com"
45 changes: 0 additions & 45 deletions environments/.env.poc.hedera

This file was deleted.

2 changes: 1 addition & 1 deletion environments/example-docker-config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"SERVER_URL": "http://localhost:5002",
"REPOSITORY_SERVER_URL": "http://localhost:10000",
"HASHSCAN_URL": "https://hashscan-latest.hedera-devops.com"
"EXPLORER_URL": "http://localhost:8080"
}
5 changes: 0 additions & 5 deletions environments/hedera-poc-docker-config.json

This file was deleted.

48 changes: 0 additions & 48 deletions nginx/conf/nginx.conf

This file was deleted.

14 changes: 0 additions & 14 deletions nginx/docker-compose.yaml

This file was deleted.

1 change: 0 additions & 1 deletion src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import cors from "cors";
import routes from "./routes";
import bodyParser from "body-parser";
import config, { etherscanAPIs } from "../config";
import { SourcifyEventManager } from "../common/SourcifyEventManager/SourcifyEventManager";
import "../common/SourcifyEventManager/listeners/logger";
import genericErrorHandler from "./middlewares/GenericErrorHandler";
import notFoundHandler from "./middlewares/NotFoundError";
Expand Down
8 changes: 5 additions & 3 deletions ui/public/config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"SERVER_URL": "http://localhost:5002",
"REPOSITORY_SERVER_URL": "http://localhost:10000",
"HASHSCAN_URL": "https://hashscan-latest.hedera-devops.com",
"REMOTE_IMPORT": true,
"GITHUB_IMPORT": true,
"EXPLORER_URL": "http://localhost:8080",
"BRAND_PRODUCT_LOGO_URL": "",
"TERMS_OF_SERVICE_URL": "",
"REMOTE_IMPORT": false,
"GITHUB_IMPORT": false,
"CONTRACT_IMPORT": false,
"JSON_IMPORT": false,
"OPEN_IN_REMIX": false
Expand Down
3 changes: 0 additions & 3 deletions ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import {configuration} from "./utils/Configuration";
function App() {
const [loading, setLoading] = useState(true);
useEffect(() => {
// if (process.env.REACT_APP_TAG === "latest") {
// document.title = "(staging) sourcify.eth";
// }
document.title = " Smart Contract Verifier";

configuration.readConfig()
Expand Down
Binary file removed ui/src/assets/brand-product-logo-black.png
Binary file not shown.
23 changes: 17 additions & 6 deletions ui/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState } from "react";
import { HiMenu } from "react-icons/hi";
import { Link } from "react-router-dom";
import ReactTooltip from "react-tooltip";
import logoText from "../../assets/brand-product-logo-black.png";
import logoText from "../../assets/logo-rounded.svg";
import { DOCS_URL } from "../../constants";
import {configuration} from "../../utils/Configuration";

Expand All @@ -19,9 +19,20 @@ const Header = () => {
return (
<header className="flex justify-between py-4 md:py-6 w-auto flex-wrap md:flex-nowrap">
<ReactTooltip effect="solid" />
<Link to="/" className="flex items-center">
<img src={logoText} alt="HashScan logo" style={{minWidth:220,maxWidth:220}}/>
</Link>
<div className="flex items-center">
{configuration.brandProductLogoUrl ? (
<Link to="/" className="flex items-center">
<img src={configuration.brandProductLogoUrl} alt="Brand product logo" style={{minWidth: 220, maxWidth: 220}}/>
</Link>
) : (
<Link to="/" className="flex items-center">
<img src={logoText} alt="Hedera logo" className="max-h-10"/>
<span className="ml-3 text-gray-700 font-vt323 text-2xl">
Hedera
</span>
</Link>
)}
</div>
<button className="block md:hidden" onClick={toggleNav}>
<HiMenu className="text-gray-700 text-3xl hover:text-ceruleanBlue-500" />
</button>
Expand Down Expand Up @@ -57,9 +68,9 @@ const Header = () => {
</a>
<a
className="link-underline mx-2 my-2 md:mx-6 hover:text-ceruleanBlue-500"
href={configuration.hashScanUrl}
href={configuration.explorerUrl}
>
HashScan
Explorer
</a>
</nav>
</div>
Expand Down
1 change: 0 additions & 1 deletion ui/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ export const GITTER_URL = `https://gitter.im/ethereum/source-verify`;
export const GITHUB_URL = `https://github.com/ethereum/sourcify`;
export const TWITTER_URL = `https://twitter.com/sourcifyeth`;
export const SOLIDITY_ETHEREUM_URL = `https://solidity.ethereum.org/2020/06/25/sourcify-faq/`;
export const TERMS_OF_SERVICE_URL = "https://swirldslabs.com/terms-of-service"
10 changes: 6 additions & 4 deletions ui/src/pages/Lookup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Field from "./Field";
import Result from "./Result";
import { useParams, useNavigate } from "react-router-dom";
import { isAddress, getAddress } from "@ethersproject/address";
import {TERMS_OF_SERVICE_URL} from "../../constants";
import {configuration} from "../../utils/Configuration";

const Lookup = () => {
const navigate = useNavigate();
Expand Down Expand Up @@ -85,9 +85,11 @@ const Lookup = () => {
<Field loading={loading} handleRequest={handleRequest} />
)}
</div>
<div className="text-center text-xs italic mx-2 mt-1 text-gray-400">
<a href={TERMS_OF_SERVICE_URL}>See Terms of Service</a>
</div>
{configuration.termsOfServiceUrl && (
<div className="text-center text-xs italic mx-2 mt-1 text-gray-400">
<a href={configuration.termsOfServiceUrl}>See Terms of Service</a>
</div>
)}
</div>
</div>
);
Expand Down
10 changes: 5 additions & 5 deletions ui/src/pages/Verifier/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import bytes from "bytes";
import { useCallback, useContext, useEffect, useState } from "react";
import Header from "../../components/Header";
import Toast from "../../components/Toast";
import { DOCS_URL, TERMS_OF_SERVICE_URL } from "../../constants";
import { DOCS_URL } from "../../constants";
import { Context } from "../../Context";
import {
Create2VerificationInput,
Expand Down Expand Up @@ -59,9 +59,7 @@ const Verifier: React.FC = () => {
<>
<div>Possibly a CORS error, check the browser console.</div>
<div>
Are you on a different domain than sourcify.dev or
sourcify.eth? API v2 is not available except the official
UI. See{" "}
See{" "}
<a
className="font-bold"
href={DOCS_URL}
Expand Down Expand Up @@ -245,7 +243,9 @@ const Verifier: React.FC = () => {
</div>
<div className="text-center text-xs italic mx-2 mt-1 text-gray-400">
<p>Note: Once a contract is verified it can't be removed from the repository.</p>
<a href={TERMS_OF_SERVICE_URL}>See Terms of Service</a>
{configuration.termsOfServiceUrl && (
<a href={configuration.termsOfServiceUrl}>See Terms of Service</a>
)}
</div>
</div>
);
Expand Down
18 changes: 14 additions & 4 deletions ui/src/utils/Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export class Configuration {
private _serverUrl: string | undefined;
private _repositoryServerUrl: string | undefined;
private _repositoryServerUrlFullMatch: string | undefined;
private _hashScanUrl: string | undefined;
private _explorerUrl: string | undefined;
private _brandProductLogoUrl: string | undefined;
private _termsOfServiceUrl: string | undefined;
private _remoteImport: boolean | undefined;
private _githubImport: boolean | undefined;
private _contractImport: boolean | undefined;
Expand Down Expand Up @@ -59,8 +61,14 @@ export class Configuration {
get repositoryServerUrlPartialMatch(): string {
return this._repositoryServerUrlPartialMatch ?? ""
}
get hashScanUrl(): string {
return this._hashScanUrl ?? ""
get explorerUrl(): string {
return this._explorerUrl ?? ""
}
get brandProductLogoUrl(): string {
return this._brandProductLogoUrl ?? ""
}
get termsOfServiceUrl(): string {
return this._termsOfServiceUrl ?? ""
}
get repositoryServerUrlFullMatch(): string {
return this._repositoryServerUrlFullMatch ?? ""
Expand Down Expand Up @@ -101,7 +109,9 @@ export class Configuration {

this._serverUrl = configData.SERVER_URL
this._repositoryServerUrl = configData.REPOSITORY_SERVER_URL
this._hashScanUrl = configData.HASHSCAN_URL
this._explorerUrl = configData.EXPLORER_URL
this._brandProductLogoUrl = configData.BRAND_PRODUCT_LOGO_URL
this._termsOfServiceUrl = configData.TERMS_OF_SERVICE_URL
this._remoteImport = configData.REMOTE_IMPORT
this._githubImport = configData.GITHUB_IMPORT
this._contractImport = configData.CONTRACT_IMPORT
Expand Down
Loading