Info Security Memo
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org

Build Confidence

Focusing on Information Security 

Info Security Notes

Create a Tiktok style Web App Using Heroku or Self Hosted Cloud Docker Server or Free Virtual Hosting Service

11/2/2022

0 Comments

 
Create a Tiktok style Web App Using Heroku or Self Hosted Cloud Docker Server or Free Virtual Hosting Service
Create a Tiktok style Web App Using Heroku or Self Hosted Cloud Docker Server or some cloud free virtual hosting serviec. 




XJJ   

Github: https://github.com/51sec/xjj
Demo: http://xjj.51sec.org/

XJJ is a project forked from JMWpower/xiaojiejie. Most code keeps same, but the interface has been translated into English. It supports both PC and mobile devices using two different html files.  The main purpose is to give you an Tiktok feeling example to show videos online in your browser. 

It is writen by html and php language. As long as your web server supports php, you can dump all files into a folder to run it. 

You also can use docker to deploy it from scratch. 

php-nginx docker

Lets use this php-nginx docker as our base docker image to deploy XJJ project. 
Docker: https://hub.docker.com/r/trafex/php-nginx

Usage Examples:
docker run -p 80:8080 trafex/php-nginx
docker run -p 80:8080 -v ~/my-codebase:/var/www/html trafex/php-nginx

Make Your Own XJJ Image

We are going to use this php-nginx docker to deploy XJJ github code and save it as our own image to use it later. 

Here is a command to expose port 8080, and run it in background 

docker run -d -p 8080:8080 trafex/php-nginx2


Log into docker:

docker exec -it <container name> sh3

You might need root user to log in to be able to modify files in the docker.

docker exec -it --user root xjj sh

Outputs for our deployment of XJJ Github code. 


node1] (local) [email protected] ~
$
docker exec -it --user=root epic_nobel /bin/sh
/var/www/html # 
/var/www/html # 
/var/www/html # apk update
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
v3.16.2-210-g84cfb9e03b [https://dl-cdn.alpinelinux.org/alpine/v3.16/main]
v3.16.2-212-g313c9fb349 [https://dl-cdn.alpinelinux.org/alpine/v3.16/community]
OK: 17033 distinct packages available
/var/www/html # apk add git
(1/1) Installing git (2.36.2-r0)
Executing busybox-1.35.0-r17.trigger
OK: 128 MiB in 84 packages
/var/www/html # git clone https://github.com/51sec/xjj/
Cloning into 'xjj'...
remote: Enumerating objects: 364, done.
remote: Counting objects: 100% (63/63), done.
remote: Compressing objects: 100% (49/49), done.
remote: Total 364 (delta 38), reused 14 (delta 14), pack-reused 301
Receiving objects: 100% (364/364), 6.34 MiB | 24.80 MiB/s, done.
Resolving deltas: 100% (178/178), done.
/var/www/html # ls
index.php  test.html  xjj



Copy all files from sub folder to up level folder and remove xjj sub folder:

cp -r /var/www/html/xjj/* /var/www/html

rm -f -r xjj

Change default index.php name to something else:

mv index.php info.php4

Once you got your XJJ up and running as the way you want, you can tag the image then save it to your docker hub account:

$ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: johnyan2
Password: 
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
[node1] (local) [email protected] ~
$ docker ps
CONTAINER ID   IMAGE              COMMAND                  CREATED         STATUS                   PORTS                    NAMES
0709187f6de8   trafex/php-nginx   "/usr/bin/supervisor…"   7 minutes ago   Up 7 minutes (healthy)   0.0.0.0:8080->8080/tcp   beautiful_kapitsa
[node1] (local) [email protected] ~
$ docker commit beautiful_kapitsa xjj
sha256:bfe9df406ac46e4e810ef5564a34f50be8b9589b4d4c054fc558ef79e27ba999
[node1] (local) [email protected] ~
$ docker image list
REPOSITORY         TAG       IMAGE ID       CREATED         SIZE
xjj                latest    bfe9df406ac4   5 seconds ago   135MB
trafex/php-nginx   latest    3c715d61cf62   2 weeks ago     112MB
[node1] (local) [email protected] ~
$ docker tag xjj johnyan2/xjj:latest
[node1] (local) [email protected] ~
$ docker push johnyan2/xjj:latest
The push refers to repository [docker.io/johnyan2/xjj]
39fb7fab2513: Pushed 
4214a3c20885: Mounted from trafex/php-nginx 
dd2d315098b6: Mounted from trafex/php-nginx 
b6a2073595e4: Mounted from trafex/php-nginx 
69aaabf84209: Mounted from trafex/php-nginx 
30a01461c06d: Mounted from trafex/php-nginx 
7676824158d7: Mounted from trafex/php-nginx 
563d480ebb0d: Mounted from trafex/php-nginx 
c5da130154cc: Mounted from trafex/php-nginx 
0c7d93256a9b: Mounted from trafex/php-nginx 
994393dc58e7: Mounted from trafex/php-nginx 
latest: digest: sha256:f52267b7f90e059203bd352d455aa18337f201d4649f96149cc46e7ea7e4b65c size: 2610
[node1] (local) [email protected] ~
$


Check the docker image from : https://hub.docker.com/repository/docker/johnyan2/xjj



Docker image: johnyan2/xjj
Docker image site: https://hub.docker.com/repository/docker/johnyan2/xjj


Steps to Deploy to Virtual Hosting Service


TBD



Deploy Github Project 51sec/XJJ to Heroku

Github page: https://github.com/51sec/xjj

TBD

Collecting Video URLS


curl https://pf129.com/xjj/get/get1.php -w "\n" >> get1.txt

crontab -e
* * * * * curl https://pf129.com/xjj/get/get1.php -w "\n" >> get1.txt

Note: every minute.

Videos

 







References

  • Docker image site: https://hub.docker.com/repository/docker/johnyan2/xjj
  • Github: https://github.com/51sec/xjj
  • Demo: http://xjj.51sec.org/


via Blogger http://blog.51sec.org/2022/11/create-tiktok-style-web-app-using.html
November 02, 2022 at 08:56AM Software
0 Comments



Leave a Reply.

    Categories

    All
    Architecture
    Blog
    Checkpoint
    Cisco
    Cloud
    CyberArk
    F5
    Fortigate
    Guardium
    Juniper
    Linux
    Network
    Others
    Palo Alto
    Qualys
    Raspberry Pi
    Security
    SIEM
    Software
    Vmware
    VPN
    Wireless

    Archives

    March 2024
    February 2024
    January 2024
    December 2023
    November 2023
    October 2023
    September 2023
    August 2023
    July 2023
    June 2023
    May 2023
    April 2023
    March 2023
    February 2023
    January 2023
    December 2022
    November 2022
    October 2022
    September 2022
    August 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    October 2019
    September 2019
    June 2019
    July 2018
    May 2018
    December 2017
    August 2017
    April 2017
    March 2017
    January 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015
    April 2015
    March 2015

    Print Page:

    RSS Feed

    Email Subscribe
Powered by Create your own unique website with customizable templates.
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org