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

WIP: Quality of life Updates #47

Merged
merged 233 commits into from
Jun 19, 2022
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
233 commits
Select commit Hold shift + click to select a range
e7eb55f
chore[docker]: add submodule for dashboard
sk33z3r Apr 20, 2022
54929f0
chore[docker]: remove PHP
sk33z3r Apr 20, 2022
0d9ad81
fix[docker]: exec command
sk33z3r Apr 20, 2022
64d18c1
fix[docker]: volume placement
sk33z3r Apr 20, 2022
49487a8
fix[docker]:
sk33z3r Apr 20, 2022
4aff1f7
chore[docker]: add restart policy to python
sk33z3r Apr 20, 2022
70c9852
chore[git]: update submodule
sk33z3r Apr 22, 2022
0a0d037
chore[git]: change react submodule to new repo
sk33z3r Apr 22, 2022
cee71b7
chore[git]: update react
sk33z3r Apr 22, 2022
75856d7
fix: metadata tokenId to id
sk33z3r Apr 25, 2022
9a802f6
chore[git]: update react submodule
sk33z3r Apr 25, 2022
2f8c351
chore[git]: update react module
sk33z3r May 2, 2022
cedc4be
fix[docker]: ensure react files are owned correctly
sk33z3r May 3, 2022
9066ebc
chore[git]: update react module
sk33z3r May 3, 2022
a7ecb41
fix: nginx proxy for new react port
sk33z3r May 3, 2022
dedf082
chore[git]: update react module
sk33z3r May 3, 2022
4547c95
chore[git]: start re-organizing user files
sk33z3r May 3, 2022
ccdf7a4
chore[python]: reorg user files
sk33z3r May 3, 2022
3dfa62c
chore[git]: track minter branch dev/LooPyGen
sk33z3r May 3, 2022
c2f5e40
fix[docker]: update .dockerignore
sk33z3r May 5, 2022
9e51215
chore[git]: update react module
sk33z3r May 5, 2022
3edad2d
chore: migration script for new directory structure
sk33z3r May 5, 2022
37eaa33
feat[python]: move generated files
sk33z3r May 7, 2022
8673bf4
fix[ipfs]: implement more robust library
sk33z3r May 8, 2022
7666902
chore[docker]: install new submodule via Docker
sk33z3r May 8, 2022
4414686
fix[bash]: unary operator error
sk33z3r May 10, 2022
19f878f
chore[git]: update minter submodule
sk33z3r May 10, 2022
488c7c2
fix[docker]: remove old php containers
sk33z3r May 10, 2022
6629a15
fix[docker]: remove orphans properly
sk33z3r May 11, 2022
542ff3a
fix[docker]: spin up containers if they are down
sk33z3r May 12, 2022
c35c81c
chore[git]: ensure proper submodule update
sk33z3r May 12, 2022
aef182e
feature[python]: draft of traits.json converters
Montspy May 13, 2022
2a1e136
feature[python]: traits JSON version converter
Montspy May 16, 2022
656fab4
feature[python]: load_traits can convert from v2.0.0 to v1.0.0
Montspy May 16, 2022
ef26d90
chore: revert react addition to PHP
sk33z3r May 26, 2022
3bcfb6f
chore[php]: tweak aesthetics
sk33z3r May 26, 2022
e8c4e85
fix: nginx
sk33z3r May 26, 2022
ee57a14
chore[php]: update config
sk33z3r May 26, 2022
a90f7b5
chore[php]: update setup
sk33z3r May 26, 2022
17be98a
feat[php] add nuke button
sk33z3r May 26, 2022
eb2b80c
fix[php]: file mover
sk33z3r May 26, 2022
ab78701
fix[docker]: missed changes from revert
sk33z3r May 26, 2022
af408fd
feat[php]: sanitize function
sk33z3r May 26, 2022
fb9343b
feat[php]: collection actions in UI
sk33z3r May 26, 2022
45ac0a0
fix[php]: sanitize collection name better
sk33z3r May 26, 2022
ea4f805
feat[php]: new main menu
sk33z3r May 26, 2022
f049d01
chore[php]: enable minting
sk33z3r May 26, 2022
fa6b5f9
chore[php]: tweak rarity scale
sk33z3r May 26, 2022
d0ac15d
chore[php]: re-enable background color
sk33z3r May 26, 2022
d5bda9e
chore[php]: add note to metadata page
sk33z3r May 26, 2022
c6b870b
chore[php]: barebones edit view
sk33z3r May 26, 2022
8de8ab4
chore[php]: remove .tempfile
sk33z3r May 26, 2022
9f8242d
chore[php]: clean-up form layout
sk33z3r May 26, 2022
cf54a32
chore[php]: cleanup more forms, add gas
sk33z3r May 27, 2022
b45ece9
feat: single mint page
sk33z3r May 27, 2022
c1ed3ba
fix[php]: max file uploads
sk33z3r May 27, 2022
689db81
fix[php]: pass collection_lower to next page
sk33z3r May 27, 2022
e971430
fix[php]: command display
sk33z3r May 27, 2022
1e3b500
fix[php]: image gen
sk33z3r May 27, 2022
4f2aa87
fix[php]: meta gen
sk33z3r May 27, 2022
8cd470b
fix[php]: mint
sk33z3r May 27, 2022
90588f9
fix[php]: create folders on first step of traits
sk33z3r May 27, 2022
2805ffa
chore[php]: add version
sk33z3r May 28, 2022
581c8f5
fix[php]: step logic, default to test mint
sk33z3r May 28, 2022
585a375
fix[php]: mint step logic
sk33z3r May 28, 2022
901feae
chore[php]: add generate button after traits setup
sk33z3r May 28, 2022
86243cc
chore[minter]: remove minter submodule
Montspy May 28, 2022
8d2dcfa
fix[minter]: fix hello_loopring submodule
Montspy May 28, 2022
dc6ca39
chore[minter]: cleanup
Montspy May 28, 2022
15a5d85
feature[python]: remove spinners with --php flag (prepare, generate)
Montspy May 29, 2022
0cd36af
chore[git]: add output folder to gitignore
Montspy May 29, 2022
f273b1a
feature[minter]: add --fees flag
Montspy May 29, 2022
a9f8f50
fix[minter]: load config.json for all modes
Montspy May 29, 2022
efb460d
feature[minter]: sanitize args dict before logging
Montspy May 29, 2022
626b481
chore[python]: move all python files to one folder
Montspy May 30, 2022
0ae8d80
feature[python]: load encrypted config.json (JWE)
Montspy May 30, 2022
fcdc7cb
chore[jwe]: example code
Montspy May 30, 2022
c831544
fix[jwe]: remove unnecessary base64 encode/decode
Montspy May 31, 2022
a9c545f
fix[jwe]: remove unsafe print
Montspy May 31, 2022
4549ad5
feat[transfer]: add transfer tool
Montspy Jun 1, 2022
07d76bc
chore[python]: cleanup and previous bugfixes
Montspy Jun 1, 2022
3262d2e
feature[php]: add default royalty_percentage to mint config.json
Montspy Jun 1, 2022
fb73a54
fix[python]: avoid leaking API key in error printouts
Montspy Jun 1, 2022
9386019
chore[python]: move all python files to one folder
Montspy May 30, 2022
2eecfca
feature[python]: load encrypted config.json (JWE)
Montspy May 30, 2022
d2cbf50
chore[jwe]: example code
Montspy May 30, 2022
5dbe365
fix[jwe]: remove unnecessary base64 encode/decode
Montspy May 31, 2022
677f49d
fix[jwe]: remove unsafe print
Montspy May 31, 2022
d8b8065
Revert "fix[jwe]: remove unsafe print"
Montspy Jun 1, 2022
9b7801c
Revert "fix[jwe]: remove unnecessary base64 encode/decode"
Montspy Jun 1, 2022
362b842
Revert "chore[jwe]: example code"
Montspy Jun 1, 2022
856b042
Revert "feature[python]: load encrypted config.json (JWE)"
Montspy Jun 1, 2022
3a66cb2
Revert "chore[python]: move all python files to one folder"
Montspy Jun 1, 2022
f758609
chore[python]: move all python files to one folder
Montspy May 30, 2022
fd99015
feature[python]: load encrypted config.json (JWE)
Montspy May 30, 2022
cc8f68d
chore[jwe]: example code
Montspy May 30, 2022
df354d8
fix[jwe]: remove unnecessary base64 encode/decode
Montspy May 31, 2022
926e33f
fix[jwe]: remove unsafe print
Montspy May 31, 2022
7ad857e
Merge branch 'dev/react-ui' of github.com:sk33z3r/LooPyGen into dev/t…
Montspy Jun 1, 2022
c92122a
chore[ui]: use built-in html tags, remove button-in-link
Montspy Jun 1, 2022
26eb5b2
fix[generate]: simplify compositing ffmpeg command, potential fix
Montspy May 3, 2022
aa637c0
feature[transfer]: complete rewrite
Montspy Jun 3, 2022
5b1ca36
feature[tranfser]: use collection name or metadata-cids.json as nfts …
Montspy Jun 4, 2022
9755047
chore[transfer]: refactor collection code
Montspy Jun 4, 2022
4f29d0b
fix[docker]: issue #62
Montspy Jun 4, 2022
17915b9
feature[transfer]: add --memo argument
Montspy Jun 4, 2022
3313d1f
feature[php]: transfer collection UI
Montspy Jun 4, 2022
f941493
fix[transfer]: get NFT IDs from metadata-cids.json or collection name
Montspy Jun 4, 2022
6368fdf
fix[css]: tooltips for tall elements (e.g. textarea)
Montspy Jun 4, 2022
da68207
feature[docker]: start menu shortcuts for windows
Montspy Jun 6, 2022
551839c
feature[php]: add support for newline in tooltips
Montspy Jun 6, 2022
d21f42e
feature[php]: add transfer for any NFT
Montspy Jun 6, 2022
8021d35
fix[php]: remove mentions of "mint" in collection transfer UI
Montspy Jun 6, 2022
5142f05
feature[php]: add material icons to home
Montspy Jun 6, 2022
15204e2
feature[php]: default bash to ~/LooPyGen for WSL
Montspy Jun 6, 2022
c19c968
fix[transfer]: remove pprint statement
Montspy Jun 6, 2022
95def70
fix[python]: don't ask user for passphrase with --noprompt
Montspy Jun 7, 2022
070f2d6
chore[python]: define get_account_info in minter.py only
Montspy Jun 7, 2022
d74027e
fix[minter]: start and end args warning appear correctly
Montspy Jun 7, 2022
026400b
fix[python]: print correct config file path in passphrase prompt
Montspy Jun 7, 2022
778f4e9
feature[php]: add fees estimate in mint and transfer flows
Montspy Jun 7, 2022
9217c3f
feature[php]: configuration edit (alpha)
Montspy Jun 8, 2022
195059c
fix[php]: traits editor if collection_lower changes
Montspy Jun 8, 2022
13258db
chore[php]: pre-fill files when editing collection
Montspy Jun 9, 2022
816ad60
fix[php]: remove nuking warnings when files did not exist
Montspy Jun 9, 2022
f3a7c41
chore[php]: rename config pages to mint-config and transfer-config
Montspy Jun 9, 2022
29a2620
fix[php]: use browser redirection on some redirections
Montspy Jun 9, 2022
b91175b
fix[php]: $lower variable missing
Montspy Jun 9, 2022
2638fee
fix[php]: missing <section> tag in guide element
Montspy Jun 9, 2022
491c52e
chore[bash]: cleanup migrate command
sk33z3r Jun 9, 2022
8a44345
chore[docker]
sk33z3r Jun 9, 2022
b64e2f0
chore[docker]: use ffmpeg binaries
sk33z3r Jun 9, 2022
dd50824
chore[php]: change jwt libraries
sk33z3r Jun 11, 2022
d6b649f
chore[php]: alpine based php-fpm
Montspy Jun 11, 2022
8d44e61
chore[docker]: change to alpine
sk33z3r Jun 11, 2022
26ca89b
refactor[docker]: single image for docker hub
sk33z3r Jun 11, 2022
f6006da
chore[python]: fix paths for new docker image
sk33z3r Jun 11, 2022
ed5bc2f
chore[php]: fix paths for new docker setup
sk33z3r Jun 11, 2022
3ce6be1
chore[docker]:
sk33z3r Jun 11, 2022
0914a2d
chore[git]: Docker build workflow
sk33z3r Jun 11, 2022
713e962
chore[git]: image build check
sk33z3r Jun 11, 2022
0392dd5
chore[git]: tweak workflows
sk33z3r Jun 11, 2022
2ee3cff
fix[git]: add HUB_TAG var
sk33z3r Jun 11, 2022
cf580dc
fix[git]: checkout submodules in ci
sk33z3r Jun 11, 2022
7e2b75c
fix[git]: ci command
sk33z3r Jun 11, 2022
3b43282
chore[git]: ignore main and semver tags
sk33z3r Jun 11, 2022
558a2f7
fix[git]: add branch name from CI
sk33z3r Jun 11, 2022
ffc325c
fix[git]: use proper context syntax
sk33z3r Jun 11, 2022
01ddc65
chore[docker]: add ci printout
sk33z3r Jun 11, 2022
0a13d12
fix[git]: docker hub login
sk33z3r Jun 11, 2022
33b4412
fix[git]: contexts
sk33z3r Jun 11, 2022
933e512
revert[git]: use secrets context
sk33z3r Jun 11, 2022
cb43444
fix[git]: add HUBTAG as context
sk33z3r Jun 11, 2022
21c88e9
chore[git]: sanitize branch and add to env
sk33z3r Jun 11, 2022
39670ed
fix[docker]: local dev permissions
sk33z3r Jun 11, 2022
997ee22
fix[docker]: remap user files
sk33z3r Jun 11, 2022
0da9b56
fix[docker]: npm warning
sk33z3r Jun 11, 2022
444a82f
chore: update perms
sk33z3r Jun 11, 2022
98f022f
chore: update .env.example
sk33z3r Jun 11, 2022
eb2afa5
fix[docker]: 2nd npm warning
sk33z3r Jun 11, 2022
6399dc5
fix[docker]: set perms on collections folder
sk33z3r Jun 11, 2022
8a409c1
fix[php]: finish step for configs
sk33z3r Jun 11, 2022
b30c14d
fix[docker]: dev env mounts repo files
sk33z3r Jun 11, 2022
934ad00
fix[docker]: expose port 80
sk33z3r Jun 11, 2022
68554fc
fix[bash]: syntax, empty var when inside container
sk33z3r Jun 11, 2022
c8e5947
chore[docker]: change container directory
sk33z3r Jun 11, 2022
ad93195
fix[docker]: compose mount
sk33z3r Jun 11, 2022
3c9c995
fix[php]: always set perms
sk33z3r Jun 11, 2022
321a698
fix[bash]: perms on run, git error
sk33z3r Jun 11, 2022
ddec3c3
fix[docker]: script paths
sk33z3r Jun 11, 2022
8645e8c
fix[docker]: set perms for whole folder
sk33z3r Jun 12, 2022
31a814a
chore: only store configs in container
sk33z3r Jun 12, 2022
be13e58
fix[docker]: stopsignal
sk33z3r Jun 12, 2022
ba1297a
chore: remove old .bat file
sk33z3r Jun 12, 2022
2db343a
chore[docker]: windows start batch script
sk33z3r Jun 12, 2022
7424f4d
chore: remove unused html file
sk33z3r Jun 12, 2022
e30c3df
chore: move batch script to docker assets
sk33z3r Jun 12, 2022
17430a3
chore[docker]: file permissions metadata
sk33z3r Jun 12, 2022
af58293
fix[python]: user_folder path definition
sk33z3r Jun 12, 2022
66214a8
chore[docker]: increase limits in php
sk33z3r Jun 12, 2022
ab38e91
chore[python]: save_config_json utility
sk33z3r Jun 13, 2022
dc3a6b0
chore[git]: organize files better
sk33z3r Jun 13, 2022
c07a75a
chore[git]: remove old submodule
sk33z3r Jun 13, 2022
1e7fd86
chore[git]: add new submodule
sk33z3r Jun 13, 2022
4d0b990
chore[docker]: don't change perms on some files
sk33z3r Jun 13, 2022
e65bd05
chore[docker]: verbose startup logs
sk33z3r Jun 13, 2022
8f790ed
feat[php]: encrypt config inputs with jwe
sk33z3r Jun 13, 2022
58495eb
chore[php]: unify nav button case
sk33z3r Jun 13, 2022
b104ef3
chore[docker]: disable composer mechanism
sk33z3r Jun 13, 2022
833d215
fix[php]: grammar
sk33z3r Jun 13, 2022
57ee304
fix[docker]: increase execution timeout in nginx
sk33z3r Jun 13, 2022
bbb7352
chore[php]: remove command if contains pass
sk33z3r Jun 13, 2022
ee7dcee
chore[php]: add info to commandless pages
sk33z3r Jun 13, 2022
e0c2309
fix[php]: typo
sk33z3r Jun 13, 2022
4a67a23
feat[php]: loading screens for long commands
sk33z3r Jun 13, 2022
8f02f99
chore[transfer]: clearer message when no matching nft found in sender…
Montspy Jun 14, 2022
7017a5d
chore: update README
sk33z3r Jun 14, 2022
94e51ca
add: loading screen assets
sk33z3r Jun 14, 2022
18587f1
fix[docker]: perms for config files
sk33z3r Jun 15, 2022
6d00301
fix: (#64) wider cpmmand output window
sk33z3r Jun 15, 2022
a410595
fix: set whole directory to world writeable
sk33z3r Jun 15, 2022
71f2e27
chore[php]: collection edit page uses rarity %
Montspy Jun 15, 2022
9145567
chore[css]: improve layout for collection edit page
Montspy Jun 15, 2022
fea2563
fix[php]: use correct rarity input id
Montspy Jun 16, 2022
a6b9770
chore[php]: change collection setup page to use rarity percentages
Montspy Jun 16, 2022
2660ef4
fix[php]: correct layer index when editing collections
Montspy Jun 16, 2022
43eb8ab
chore[php]: set opacity default value to 255 (opaque)
Montspy Jun 16, 2022
1d28b8d
fix[css]: remove wide class for trait-row
Montspy Jun 16, 2022
179c3d6
chore[php]: scrubbed tootlip texts
Montspy Jun 16, 2022
2a37e19
chore[php]: scrubbed tootlip texts some more
Montspy Jun 17, 2022
f315a47
feature[php]: display progress
Montspy Jun 17, 2022
fc1ca1d
fix[php]: testing display bug
sk33z3r Jun 17, 2022
c4ce268
fix[python]: image generation progress
Montspy Jun 17, 2022
104132b
fix[php]: loading screen alignment
sk33z3r Jun 17, 2022
b0d472d
chore[git]: ignore .secrets
sk33z3r Jun 17, 2022
be40f9e
chore[docker]: load json directly
sk33z3r Jun 17, 2022
0e8da0e
feat[php]: add favicon
sk33z3r Jun 17, 2022
4ab5078
fix[php]: more loading screen alignment
Montspy Jun 17, 2022
fb56eb4
fix[python]: more consistent metadata progress
Montspy Jun 17, 2022
a927b54
chore[ui]: improve progress display
Montspy Jun 17, 2022
687a631
chore[git]: permissions
sk33z3r Jun 17, 2022
b1aea0b
fix[docker]: faster startup script
sk33z3r Jun 17, 2022
288bdb0
chore[docker]: tweak message timing in logs
sk33z3r Jun 17, 2022
9705b0f
chore[git]: add files to ignore
sk33z3r Jun 17, 2022
b3a8c43
chore[php]: add GME wallet info to transfer config
sk33z3r Jun 18, 2022
3ef5e14
chore[docker]: cherrypick files in final image
sk33z3r Jun 18, 2022
9fe8103
chore[php]: unify tooltips with wiki tables
sk33z3r Jun 19, 2022
e29538f
fix[docker]: ADD syntax
sk33z3r Jun 19, 2022
f2ea011
fix[docker]: add version to container
sk33z3r Jun 19, 2022
ad88e44
chore[php]: fix header
sk33z3r Jun 19, 2022
9805780
Merge branch 'main' into dev/react-ui
sk33z3r Jun 19, 2022
acc64ae
chore[github]: separate pr and release actions
sk33z3r Jun 19, 2022
15183f9
chore[github]: only push on release
sk33z3r Jun 19, 2022
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
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ __pycache__
*.md
*.yml
*.bat
generated
images
collections
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ traits.json
images
.tempfile
config.json
collections/*/

# ---> Python
# Byte-compiled / optimized / DLL files
Expand Down
9 changes: 8 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
[submodule "minter"]
path = minter
url = https://github.com/Montspy/LooPyMinty.git
branch = rel/LooPyGen
branch = rel/LooPyGen
[submodule "react"]
path = react
url = https://github.com/you3h/LooPyGen_Client.git
branch = main
[submodule "ipfs-hash"]
path = ipfs-hash
url = https://github.com/sk33z3r/ipfs-only-hash.git
29 changes: 19 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,33 @@ ADD minter/requirements.txt /minter.txt
ADD minter/hello_loopring/requirements.txt /hello_loopring.txt
RUN pip install -r /generator.txt -r /hello_loopring.txt -r /minter.txt

FROM node:16-alpine as node_modules
FROM node:16 as node_modules
# Set workdir initially just for npm to install
WORKDIR /usr/src/app
# Install the app from npm directly
RUN npm i --only=production pure-ipfs-only-hash
# Install container pre-requisites
RUN apt-get -y update; \
apt-get -y upgrade
RUN apt-get -y install python3
# Install modules
ADD ipfs-hash/package*.json ./
RUN npm install
# Install app files
ADD ipfs-hash/* ./

FROM php:fpm AS php
# install python3.9
FROM python:3.9
# install npm and ffmpeg
RUN dpkg --configure -a
RUN apt-get update; \
apt-get -y upgrade
RUN apt-get install -y python3 npm ffmpeg
RUN apt-get install -y npm ffmpeg
# get compiled modules from previous stages
COPY --from=python_modules /usr/local/lib/python3.9 /usr/lib/python3.9
COPY --from=node_modules /usr/src/app/node_modules /usr/src/app/node_modules
COPY --from=python_modules /usr/local/lib/python3.9 /usr/local/lib/python3.9
COPY --from=node_modules /usr/src/app /usr/src/app
# add the python files for the game
ADD dockerfiles/scripts/* /usr/local/bin/
# link cid calculator
RUN ln -s /usr/src/app/node_modules/pure-ipfs-only-hash/cli.js /usr/bin/cid
RUN ln -s /usr/src/app/cli.js /usr/bin/cid
# finish up container
WORKDIR /var/www/html
WORKDIR /app

CMD [ "tail", "-f", "/dev/null" ]
Empty file added collections/.keep
Empty file.
30 changes: 25 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,47 @@ services:
nginx:
container_name: "loopygen.nginx"
image: nginx:alpine
restart: unless-stopped
depends_on:
- react
ports:
- "8080:80"
volumes:
- ./:/var/www/html:ro
- ./dockerfiles/nginx.conf:/etc/nginx/conf.d/default.conf:ro
networks:
loopygen:
ipv4_address: 172.101.0.100

php:
container_name: "loopygen.php"
build: .
react:
container_name: "loopygen.react"
build:
context: ./react
args:
UID: ${UID}
GID: ${GID}
restart: unless-stopped
user: ${UID}:${GID}
volumes:
- /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro
- ./:/var/www/html:rw
- ./:/usr/src/common:rw
networks:
loopygen:
ipv4_address: 172.101.0.110

python:
container_name: "loopygen.python"
build: .
restart: unless-stopped
user: ${UID}:${GID}
volumes:
- /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro
- ./:/app:rw
networks:
loopygen:
ipv4_address: 172.101.0.115

networks:
loopygen:
name: loopygen
Expand Down
23 changes: 20 additions & 3 deletions docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,37 @@ checkDotenv() {
}

reload() {
docker-compose down
docker-compose down --remove-orphans
checkDotenv
docker builder prune -f
docker-compose up -d --build --force-recreate
}

migrate() {
for i in $(ls images); do
mkdir -p collections/$i/{config,stats,ipfs}
mv images/$i/*.json collections/$i/config/
mv images/$i collections/$i/config/source_layers
mv generated/$i/{gen-stats.json,all-traits.json} collections/$i/stats/
mv generated/$i/metadata-cids.json collections/$i/config/
mv generated/$i/{images,thumbnails,metadata} collections/$i/ipfs/
done
rm -r images generated
}

case $1 in
build) docker-compose build;;
reload) reload;;
update) git pull --recurse-submodules && reload;;
up)
checkDotenv
docker-compose up -d
if [ "$2" = "prod" ]; then
docker-compose up -d react
else
docker-compose up -d
fi
;;
down) docker-compose down;;
*) docker-compose exec php $@;;
migrate) migrate;;
*) docker-compose exec python $@;;
esac
27 changes: 12 additions & 15 deletions dockerfiles/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
server {
listen 0.0.0.0:80;
server_name _;
root /var/www/html;
index index.php index.html;

location ~* /(?!index.php|.*\.(gif|png|css|js|woff|svg|eot|jpg|jpeg|html|htm|zip)$) {
rewrite ^/(.*)$ /index.php?page=$1;
}

location ~ /\.(?!well-known) {
deny all;
}

location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 172.101.0.110:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
location / {
proxy_pass http://172.101.0.110:8080/;
proxy_http_version 1.1;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
client_max_body_size 0;
proxy_buffering off;
}
}
2 changes: 1 addition & 1 deletion dockerfiles/scripts/generate
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

cd /var/www/html
cd /app
python3 generator/generate.py $@
2 changes: 1 addition & 1 deletion dockerfiles/scripts/metadata
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

cd /var/www/html
cd /app
python3 generator/metadata.py $@
2 changes: 1 addition & 1 deletion dockerfiles/scripts/mint
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

cd /var/www/html
cd /app
python3 minter/minter.py --loopygen $@
2 changes: 1 addition & 1 deletion dockerfiles/scripts/prepare
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

cd /var/www/html
cd /app
python3 minter/prepare.py --loopygen $@
2 changes: 1 addition & 1 deletion generator/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def main():
"name": f"{traits.collection_name} #{token_id:03}",
"description": traits.description,
"royalty_percentage": int(traits.royalty_percentage),
"tokenId": token_id,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yessss. Might as well since engineers can't reproduce for some reason

"id": token_id,
"attributes": properties_to_attributes(properties),
"properties": properties
}
Expand Down
31 changes: 18 additions & 13 deletions generator/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ def __repr__(self):
def load_traits(name: str = None):
traits_path = ""
if name:
traits_path = os.path.join("./images", name, "traits.json")
traits_path = os.path.join("./collections", name, "config", "traits.json")
else:
all_jsons = glob("./images/*/traits.json")
all_jsons = glob("./collections/*/config/traits.json")
all_names = []
for f in all_jsons:
with open(f, 'r') as j:
all_names.append(json.load(j).get("collection_name", "Unknown collection name"))
assert len(all_names) > 0, "Found 0 existing collections in ./images"
assert len(all_names) > 0, "Found 0 existing collections in ./collections"

print(f"Found {len(all_names)} collections:\n " + "\n ".join( [ f"{i+1}. {n}" for i,n in enumerate(all_names)] ))
while True:
print(f"Pick one (1~{len(all_names)}): ", end="")
Expand All @@ -48,7 +48,7 @@ def load_traits(name: str = None):
if (s > 0) and (s <= len(all_names)):
break
traits_path = all_jsons[s - 1]

with open(traits_path) as f:
traits_json = json.load(f)
return Struct(traits_json)
Expand All @@ -60,15 +60,20 @@ def load_config(paths: Struct):

def generate_paths(traits: Struct):
paths = Struct()
paths.collection = os.path.join("./generated", traits.collection_lower)
paths.metadata = os.path.join(paths.collection, "metadata")
paths.images = os.path.join(paths.collection, "images")
paths.thumbnails = os.path.join(paths.collection, "thumbnails")
paths.source = os.path.join("./images", traits.collection_lower)
paths.collection = os.path.join("./collections", traits.collection_lower)
paths.ipfs_folder = os.path.join(paths.collection, "ipfs")
paths.metadata = os.path.join(paths.ipfs_folder, "metadata")
paths.images = os.path.join(paths.ipfs_folder, "images")
paths.thumbnails = os.path.join(paths.ipfs_folder, "thumbnails")

paths.gen_conf = os.path.join(paths.collection, "config")
paths.source = os.path.join(paths.gen_conf, "source_layers")
paths.metadata_cids = os.path.join(paths.gen_conf, "metadata-cids.json")

paths.stats = os.path.join(paths.collection, "stats")
paths.all_traits = os.path.join(paths.stats, "all-traits.json")
paths.gen_stats = os.path.join(paths.stats, "gen-stats.json")

paths.all_traits = os.path.join(paths.collection, "all-traits.json")
paths.gen_stats = os.path.join(paths.collection, "gen-stats.json")
paths.metadata_cids = os.path.join(paths.collection, "metadata-cids.json")
paths.config = "./config.json"

return paths
Expand Down
38 changes: 0 additions & 38 deletions index.php

This file was deleted.

1 change: 1 addition & 0 deletions ipfs-hash
Submodule ipfs-hash added at 6c0849
2 changes: 1 addition & 1 deletion minter
Submodule minter updated 4 files
+9 −0 .env.loopygen
+14 −4 minter.py
+24 −7 prepare.py
+1 −0 requirements.txt
54 changes: 0 additions & 54 deletions php/config/1.php

This file was deleted.

Loading