• Stars
    star
    104
  • Rank 319,040 (Top 7 %)
  • Language
    PHP
  • Created about 5 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Building highly customizable e-commerce websites selling shadowsocks services, using Wordpress and WooCommerce

Shadow Shop

A website selling shadowsocks services, using Wordpress and WooCommerce.

Environment

Mainstream Linux distributions are supported. Mac OS and Windows are not supported yet.

Initialization

  1. Download:

    cd ~
    git clone https://github.com/shadowsocks/shadow-shop.git
    
  2. Initialize:

    cd ~/shadow-shop
    sudo sh init.sh
    

    During this step, you have to specify the state and doamin name of your website. You may choose to run your website either in development or production state. Then you need input the domain name to be used by the your website.

    Before proceeding to this step, if you plan to choose production state, then you have to make sure that the domain name you are going to input indeed points to the IP address of the server that is running this software. Otherwise, the sofeware will NOT be able to get a valid digital certificate for you website later on.

Website Maintainence

  1. Create and run website:

    cd ~/shadow-shop
    docker-compose up -d
    
  2. Stop website:

    cd ~/shadow-shop
    docker-compose stop
    
  3. Start previously stopped website:

    cd ~/shadow-shop
    docker-compose start
    
  4. Restart website:

    cd ~/shadow-shop
    docker-compose restart
    
  5. Stop and remove website:

    cd ~/shadow-shop
    docker-compose down
    
  6. Show website running status:

    cd ~/shadow-shop
    docker-compose ps
    

Install Wordpress

Once you have brought up your website for the first time, you may install Wordpress by typing in a web browser the domain name that your provided during the Initialize step.

If you selected development state during the Initialize step, the website digital certificate is self-signed. Thus your website will show you a warning. You have to accept the digital certificate before proceeding.

Then the famous Wordpress 5-minute install process will guide you to customize the installation of Wordpress as you like.

  1. Select the language you want to use;
  2. Enter your site details: the site title, admin username, password and email address. If you want search engines, such as Google, to find your site, leave the Privacy box unchecked.

Setup WooCommerce

Now you can log in to your site by clicking the Log In button and entering the admin credentials you provided when you were installing WordPress. Then you may go to its admin panel by typing in the web browser the url:

https://your-domain-name/wp-admin

After that, you may perform any admin tasks, including setting up and configuring WooCommerce, in the admin panel. Official documentation for configuring WooCommerce settings can be found here.

Theme and Customization

By default, the theme StoreFront is installed and activiated as the active theme. You may choose a different theme as you wish. However it is highly recommanded to choose a WooCommerce-compatable theme.

Once you have chosen a theme, you may start to customize how your website looks as you wish.

Plugins

There are two compulsory plugins - WooCommerce and Shadow Shop - for this website to function properly. They are installed and activiated by default. Do not deactiviate or delete them, or the website will malfunction. If you are not familiar with WooCommerce before, then you might need a bit of googling.

You may install and activiate other plugins as you wish to customize your website functionality. In effect, WooCommerce may automatically install and activiate a few plugins for you during the previous configuration step, such as Jetpack, Mailchimp, and etc.

If you are familiar with Wordpress, then you should be comforatble with finding and using plugins that will help to meet your requierments.

If you are new to Wordpress, then there might be a learning curve. But in all honesty, they are fairly intuitive and easy to learn.

Products (IMPORTANT)

Once you have setup WooCommerce, you may start to create your products. It is IMPORTANT that for EVERY product, you have to choose one and only one value for each of following attributes: Life Span, Traffic, and Encryption Method. It is IMPORTANT that failure to comply will result in no creation of shadowsocks account for paid orders.

The Life Span attribute of a product specifies how long the shadowsocks accounts created for the product will last for. The options are: Monthly, Bimonthly, Quarterly, Semiannually, Annually. Once a shadowsocks account has reached its life span, it will be stopped and deleted.

The Traffic attribute of a product specifies the maximum number of bits that a user can consume by using the product. The traffic is calculated as the sum of the usages from all the shadowsocks acccounts created for the product for the user. The options are: 100M, 200M, 300M, 400M, 500M, 600M, 700M, 800M, 900M, 1G, 2G, 3G, 4G, 5G, 6G, 7G, 8G, 9G, 10G, 20G, 30G, 40G, 50G, 60G, 70G, 80G, 90G, 100G, 200G, 300G, 400G, 500G, 600G, 700G, 800G, 900G, 1T, 2T, 3T, 4T, 5T, 6T, 7T, 8T, 9T, 10T. Once a product has reached its life span, unused traffic will NOT be carried forward to the next product. It will simply be discarded.

The Encryption Method attribute of a product specifies the default encryption algorithm to be used by all the shadowsocks accounts created for this account. The options are: aes-128-gcm, aes-192-gcm, aes-256-gcm, aes-128-cfb, aes-192-cfb, aes-256-cfb, aes-128-ctr, aes-192-ctr, aes-256-ctr, camellia-128-cfb, camellia-192-cfb, camellia-256-cfb, bf-cfb, chacha20-ietf-poly1305, xchacha20-ietf-poly1305, salsa20, chacha20, chacha20-ietf.

Shadowsocks Management

Management of shadowsocks related resources can be done from the Shadow Shop menu of the admin panel.

  1. Servers

    A server is a remote machine acting as a shadowsocks exit point. A server may have more than one node (see below). Admin has to provide its IP address or domain name when adding a server. Admin may add, edit, and delete a server. Note that a server cannot be deleted if a node has been created using this server. Admin has to delete all its nodes before successfully deleting the server.

  2. Nodes

    A node is a virtual shadowsocks exit point. The difference between server and node is that a server is an indpendent machine where a node is a logical machine that relies on server. There can be multiple nodes residing on a single server. From users' perspective, nodes using the same server are different shadowsocks exit points. Before adding a node, the underlying server has to be added into the system first. When adding a new node, the admin has to select a server, give it a descriptive name, and provide its managing port, managing password, and a range of port numbers to be used in a form of lower and upper bound of port numbers. Admin may also edit and delete a node. Note that a node cannot be deleted if an account has been created using this node. Admin has to delete all its accounts before successfully deleting the node.

    Shadow Shop uses shadowsocks-restful-api to manage nodes. Install it on every server acting as a node. The managing port number and managing password chosen for shadowsocks-restful-api for a node have to be consistent with the managing port number and managing password fields for the node in Shadow Shop, so that Shadow Shop will be able to control the node. Otherwise, Shadow Shop will not be able to manage the node.

  3. Accounts

    An account is a shadowsocks account. The admin may manually add a new account by selecting a user, a node, the life span of this account, the ecryption method to be used by this account, and inputing the maximum traffic to be allocated to this account.

Orders

When a user has made a payment for a product, an order will be created. The system then will create a shadowsocks account from every existing node for the user for this order.

Note the system currently does not backtrack previous orders. When a new node is added into the system, no new shadowsocks account will be created from this new node for previously created orders.

Guest Users

In order to support guest user payment, go to WooCommerce > Settings > Accounts & Privacy, then configure the settings as the following screen shot:

account_configuration

Languages

Wordpress, WooCommerce, and Storefront support multi-language, and have been translated into many languages. Shadow Shop supports multi-language but has not been translated into other languages (due to my lack of language skills). So if you want to use other languages, you may contribute some translation as follows:

  1. Create a fork of this repository.

  2. Locate the language file in your forked repository. The file is located in website/wp-content/plugins/shadowsocks-hub/languages directory. This directory contains several .po files with each file corresponding to a language. The names of .po files have a pattern of shadowsocks-hub-{locale}.po where locale is the language code of the file. Find the .po file corresponding to the language of your interest. If your language file does not exist in the directory, please feel free to create an issue to let me know the language you want to translate. I will add the corresponding .po file.

  3. Translate the .po file. The file contains all the strings for translation. Each translatable string is formatted like this:

    #: admin/class-shadowsocks-hub-accounts-list-table.php:35
    msgid "No account found."
    msgstr ""
    

    The translated string should be put into msgstr section.

  4. Create a pull request and I will merge your translation into the project.

Update and Backup

The system will perform daily automatic update of code for Wordpress core files, the theme StoreFront, and the plugins WooCommerce and Shadow Shop. Ohter themes and plugins installed by users have to be updated by yourself from the Wordpress admin panel.

The system will perform daily local backup of all the code. In addition, when the website is up running, the system will perform daily local backup of the entire database.

Bug Report, Feature Request and Feedback

Please do not hesitate to raise an issue if you would like make a feature request, bug report or provide some feedback. Bugs have a high priority to get addressed while feedback and feature requests will be considered depending on their popularity and importance.

More Repositories

1

shadowsocks-windows

A C# port of shadowsocks
C#
57,941
star
2

shadowsocks-android

A shadowsocks client for Android
Kotlin
34,644
star
3

shadowsocks

Python
33,505
star
4

ShadowsocksX-NG

Next Generation of ShadowsocksX
Swift
32,168
star
5

shadowsocks-iOS

Removed according to regulations.
Objective-C
8,195
star
6

shadowsocks-qt5

A cross-platform shadowsocks GUI client
C++
7,952
star
7

shadowsocks-rust

A Rust port of shadowsocks
Rust
7,758
star
8

shadowsocks-go

go port of shadowsocks (Deprecated)
Go
6,620
star
9

shadowsocks-manager

A shadowsocks manager tool for multi user and traffic control.
JavaScript
4,106
star
10

ChinaDNS

Protect yourself against DNS poisoning in China.
C
3,565
star
11

openwrt-shadowsocks

Shadowsocks-libev for OpenWrt/LEDE
Makefile
3,227
star
12

v2ray-plugin

A SIP003 plugin based on v2ray
Go
2,611
star
13

simple-obfs

A simple obfuscating tool (Deprecated)
C
2,344
star
14

shadowsocks-gui

Shadowsocks GUI client
CoffeeScript
2,005
star
15

libQtShadowsocks

A lightweight and ultra-fast shadowsocks library written in C++14 with Qt framework
C++
1,492
star
16

shadowsocks-nodejs

CoffeeScript
1,244
star
17

luci-app-shadowsocks

OpenWrt/LEDE LuCI for Shadowsocks-libev
Lua
1,133
star
18

shadowsocks-org

www.shadowsocks.org
HTML
823
star
19

ChinaDNS-Python

Protect yourself against DNS poisoning in China.
Python
766
star
20

shadowsocks-chromeapp

Chrome client for shadowsocks
CoffeeScript
693
star
21

kcptun-android

kcptun for Android.
Shell
564
star
22

simple-obfs-android

A simple obfuscating tool for Android
C
433
star
23

v2ray-plugin-android

A SIP003 V2ray plugin on Android
Kotlin
425
star
24

crypto2

The fastest cryptographic library in the galaxy
Rust
344
star
25

ShadowDNS

A DNS forwarder using Shadowsocks as the server
Python
333
star
26

papers

List of papers related to shadowsocks
210
star
27

shadowsocks-dotcloud

a port of shadowsocks via websockets protocol, able to tunnel through HTTP proxy
CoffeeScript
200
star
28

shadowsocks-hub

A web app managing shadowsocks users, servers, nodes, products, accounts, and traffic. Suitable for internal use by companies, organizations, and friends.
JavaScript
130
star
29

qtun

Yet another SIP003 plugin based on IETF-QUIC
Rust
115
star
30

tun2socks-iOS

tun2socks as a library for iOS apps
94
star
31

Shadowsocks-Net

✈ A light-weight, cross-platform, extensible Shadowsocks developed in C# (.NET Core).
C#
89
star
32

shadowsocks-restful-api

Secure, reliable, standard restful api for managing shadowsocks-libev
JavaScript
79
star
33

stackscript

Shell
72
star
34

libsscrypto

Build libsscrypto.dll for shadowsocks-windows.
C
59
star
35

iptables

iptables is the userspace command line program used to configure the Linux 2.4.x and later packet filtering ruleset. It is targeted towards system administrators.
C
54
star
36

openwrt-feeds

OpenWrt/LEDE feeds
Makefile
52
star
37

shadowsocks-crypto

Shadowsocks Crypto
Rust
39
star
38

libev

A fork of libev
Shell
34
star
39

sysproxy

System Proxy Agent for Shadowsocks Windows
C
30
star
40

shadowsocks-hub-api

A set of open and standard restful APIs for managing shadowsocks users, servers, nodes, products, accounts, and traffic.
JavaScript
25
star
41

openssl-android

A fork of OpenSSL for shadowsocks-android
C
25
star
42

tun2socks

Rust
22
star
43

android-ndk-go

Circle CI Android image with NDK and golang + rust, for building golang and/or rust for NDK.
Dockerfile
18
star
44

libudns

A fork of libudns
C
11
star
45

overture-android

A wrapper of overture for shadowsocks-android
Shell
8
star
46

tls

TLS version 1.3
Rust
6
star
47

iana-ip-db

IANA IP Number Resources
Rust
3
star